Skip to content

Commit

Permalink
ice: Don't clog kernel debug log with VF MDD events errors
Browse files Browse the repository at this point in the history
In case of MDD events on VF, don't clog kernel log with unlimited VF MDD
events message "VF 0 has had 1018 MDD events since last boot" - limit
events log message to 30, based on the observation in some experimentation
with sending malicious packet once, and number of events reported before
device stopped observing MDD events.

Also removed defunct macro "ICE_DFLT_NUM_MDD_EVENTS_ALLOWED" for tracking
number of MDD events allowed before disabling the interface...

Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Akeem G Abodunrin authored and Jeff Kirsher committed Aug 27, 2019
1 parent 4425e05 commit e63a1db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/intel/ice/ice_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,8 +1315,10 @@ static void ice_handle_mdd_event(struct ice_pf *pf)

if (vf_mdd_detected) {
vf->num_mdd_events++;
if (vf->num_mdd_events > 1)
dev_info(&pf->pdev->dev, "VF %d has had %llu MDD events since last boot\n",
if (vf->num_mdd_events &&
vf->num_mdd_events <= ICE_MDD_EVENTS_THRESHOLD)
dev_info(&pf->pdev->dev,
"VF %d has had %llu MDD events since last boot, Admin might need to reload AVF driver with this number of events\n",
i, vf->num_mdd_events);
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#define ICE_MAX_MACADDR_PER_VF 12

/* Malicious Driver Detection */
#define ICE_DFLT_NUM_MDD_EVENTS_ALLOWED 3
#define ICE_DFLT_NUM_INVAL_MSGS_ALLOWED 10
#define ICE_MDD_EVENTS_THRESHOLD 30

/* Static VF transaction/status register def */
#define VF_DEVICE_STATUS 0xAA
Expand Down

0 comments on commit e63a1db

Please sign in to comment.