ice: Check all VFs for MDD activity, don't disable
authorMitch Williams <mitch.a.williams@intel.com>
Tue, 16 Apr 2019 17:30:45 +0000 (10:30 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 29 May 2019 09:50:46 +0000 (02:50 -0700)
Don't use the mdd_detected variable as an exit condition for this loop;
the first VF to NOT have an MDD event will cause the loop to terminate.

Instead just look at all of the VFs, but don't disable them. This
prevents proper release of resources if the VFs are rebooted or the VF
driver reloaded. Instead, just log a message and call out repeat
offenders.

To make it clear what we are doing, use a differently-named variable in
the loop.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c

index 6fc4d8176d146beee37c708bcb62d454a82e5ea5..59971f6224f1e3d8a2ecf081bf7fe1205e10412d 100644 (file)
@@ -1161,16 +1161,16 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
                }
        }
 
-       /* see if one of the VFs needs to be reset */
-       for (i = 0; i < pf->num_alloc_vfs && mdd_detected; i++) {
+       /* check to see if one of the VFs caused the MDD */
+       for (i = 0; i < pf->num_alloc_vfs; i++) {
                struct ice_vf *vf = &pf->vf[i];
 
-               mdd_detected = false;
+               bool vf_mdd_detected = false;
 
                reg = rd32(hw, VP_MDET_TX_PQM(i));
                if (reg & VP_MDET_TX_PQM_VALID_M) {
                        wr32(hw, VP_MDET_TX_PQM(i), 0xFFFF);
-                       mdd_detected = true;
+                       vf_mdd_detected = true;
                        dev_info(&pf->pdev->dev, "TX driver issue detected on VF %d\n",
                                 i);
                }
@@ -1178,7 +1178,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
                reg = rd32(hw, VP_MDET_TX_TCLAN(i));
                if (reg & VP_MDET_TX_TCLAN_VALID_M) {
                        wr32(hw, VP_MDET_TX_TCLAN(i), 0xFFFF);
-                       mdd_detected = true;
+                       vf_mdd_detected = true;
                        dev_info(&pf->pdev->dev, "TX driver issue detected on VF %d\n",
                                 i);
                }
@@ -1186,7 +1186,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
                reg = rd32(hw, VP_MDET_TX_TDPU(i));
                if (reg & VP_MDET_TX_TDPU_VALID_M) {
                        wr32(hw, VP_MDET_TX_TDPU(i), 0xFFFF);
-                       mdd_detected = true;
+                       vf_mdd_detected = true;
                        dev_info(&pf->pdev->dev, "TX driver issue detected on VF %d\n",
                                 i);
                }
@@ -1194,19 +1194,18 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
                reg = rd32(hw, VP_MDET_RX(i));
                if (reg & VP_MDET_RX_VALID_M) {
                        wr32(hw, VP_MDET_RX(i), 0xFFFF);
-                       mdd_detected = true;
+                       vf_mdd_detected = true;
                        dev_info(&pf->pdev->dev, "RX driver issue detected on VF %d\n",
                                 i);
                }
 
-               if (mdd_detected) {
+               if (vf_mdd_detected) {
                        vf->num_mdd_events++;
-                       dev_info(&pf->pdev->dev,
-                                "Use PF Control I/F to re-enable the VF\n");
-                       set_bit(ICE_VF_STATE_DIS, vf->vf_states);
+                       if (vf->num_mdd_events > 1)
+                               dev_info(&pf->pdev->dev, "VF %d has had %llu MDD events since last boot\n",
+                                        i, vf->num_mdd_events);
                }
        }
-
 }
 
 /**