i40e: Fix for allowing too many MDD events on VF
authorCarolyn Wyborny <carolyn.wyborny@intel.com>
Thu, 28 Feb 2019 17:52:47 +0000 (09:52 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 3 May 2019 21:31:05 +0000 (14:31 -0700)
This patch changes the driver behavior when detecting a VF MDD event.
It now disables the VF after one event, which indicates a hw detected
problem in the VF.  Before this change, the PF would allow a couple of
events before doing the reset.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 65c2b9d2652b215de260f1e2d5502bebe73ea957..b52a9d5644b84781cdb6b7b2c26b3c29d30ee010 100644 (file)
@@ -9767,6 +9767,9 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
                        vf->num_mdd_events++;
                        dev_info(&pf->pdev->dev, "TX driver issue detected on VF %d\n",
                                 i);
+                       dev_info(&pf->pdev->dev,
+                                "Use PF Control I/F to re-enable the VF\n");
+                       set_bit(I40E_VF_STATE_DISABLED, &vf->vf_states);
                }
 
                reg = rd32(hw, I40E_VP_MDET_RX(i));
@@ -9775,11 +9778,6 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
                        vf->num_mdd_events++;
                        dev_info(&pf->pdev->dev, "RX driver issue detected on VF %d\n",
                                 i);
-               }
-
-               if (vf->num_mdd_events > I40E_DEFAULT_NUM_MDD_EVENTS_ALLOWED) {
-                       dev_info(&pf->pdev->dev,
-                                "Too many MDD events on VF %d, disabled\n", i);
                        dev_info(&pf->pdev->dev,
                                 "Use PF Control I/F to re-enable the VF\n");
                        set_bit(I40E_VF_STATE_DISABLED, &vf->vf_states);