Skip to content

Commit 7438a3b

Browse files
pgreenwaJeff Kirsher
authored andcommitted
ice: print Rx MDD auto reset message before VF reset
Rx MDD auto reset message was not being logged because logging occurred after the VF reset and the VF MDD data was reinitialized. Log the Rx MDD auto reset message before triggering the VF reset. Signed-off-by: Paul Greenwalt <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 4244910 commit 7438a3b

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,13 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
13221322
* PF can be configured to reset the VF through ethtool
13231323
* private flag mdd-auto-reset-vf.
13241324
*/
1325-
if (test_bit(ICE_FLAG_MDD_AUTO_RESET_VF, pf->flags))
1325+
if (test_bit(ICE_FLAG_MDD_AUTO_RESET_VF, pf->flags)) {
1326+
/* VF MDD event counters will be cleared by
1327+
* reset, so print the event prior to reset.
1328+
*/
1329+
ice_print_vf_rx_mdd_event(vf);
13261330
ice_reset_vf(&pf->vf[i], false);
1331+
}
13271332
}
13281333
}
13291334

drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3756,6 +3756,24 @@ int ice_get_vf_stats(struct net_device *netdev, int vf_id,
37563756
return 0;
37573757
}
37583758

3759+
/**
3760+
* ice_print_vf_rx_mdd_event - print VF Rx malicious driver detect event
3761+
* @vf: pointer to the VF structure
3762+
*/
3763+
void ice_print_vf_rx_mdd_event(struct ice_vf *vf)
3764+
{
3765+
struct ice_pf *pf = vf->pf;
3766+
struct device *dev;
3767+
3768+
dev = ice_pf_to_dev(pf);
3769+
3770+
dev_info(dev, "%d Rx Malicious Driver Detection events detected on PF %d VF %d MAC %pM. mdd-auto-reset-vfs=%s\n",
3771+
vf->mdd_rx_events.count, pf->hw.pf_id, vf->vf_id,
3772+
vf->dflt_lan_addr.addr,
3773+
test_bit(ICE_FLAG_MDD_AUTO_RESET_VF, pf->flags)
3774+
? "on" : "off");
3775+
}
3776+
37593777
/**
37603778
* ice_print_vfs_mdd_event - print VFs malicious driver detect event
37613779
* @pf: pointer to the PF structure
@@ -3785,12 +3803,7 @@ void ice_print_vfs_mdd_events(struct ice_pf *pf)
37853803
if (vf->mdd_rx_events.count != vf->mdd_rx_events.last_printed) {
37863804
vf->mdd_rx_events.last_printed =
37873805
vf->mdd_rx_events.count;
3788-
3789-
dev_info(dev, "%d Rx Malicious Driver Detection events detected on PF %d VF %d MAC %pM. mdd-auto-reset-vfs=%s\n",
3790-
vf->mdd_rx_events.count, hw->pf_id, i,
3791-
vf->dflt_lan_addr.addr,
3792-
test_bit(ICE_FLAG_MDD_AUTO_RESET_VF, pf->flags)
3793-
? "on" : "off");
3806+
ice_print_vf_rx_mdd_event(vf);
37943807
}
37953808

37963809
/* only print Tx MDD event message if there are new events */

drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ bool ice_is_any_vf_in_promisc(struct ice_pf *pf);
132132
void
133133
ice_vf_lan_overflow_event(struct ice_pf *pf, struct ice_rq_event_info *event);
134134
void ice_print_vfs_mdd_events(struct ice_pf *pf);
135+
void ice_print_vf_rx_mdd_event(struct ice_vf *vf);
135136
#else /* CONFIG_PCI_IOV */
136137
#define ice_process_vflr_event(pf) do {} while (0)
137138
#define ice_free_vfs(pf) do {} while (0)
@@ -141,6 +142,7 @@ void ice_print_vfs_mdd_events(struct ice_pf *pf);
141142
#define ice_set_vf_state_qs_dis(vf) do {} while (0)
142143
#define ice_vf_lan_overflow_event(pf, event) do {} while (0)
143144
#define ice_print_vfs_mdd_events(pf) do {} while (0)
145+
#define ice_print_vf_rx_mdd_event(vf) do {} while (0)
144146

145147
static inline bool
146148
ice_reset_all_vfs(struct ice_pf __always_unused *pf,

0 commit comments

Comments
 (0)