]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Detect ATR HW Evict NVM issue and disable the feature
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Fri, 23 Jun 2017 08:24:48 +0000 (04:24 -0400)
committerJack Vogel <jack.vogel@oracle.com>
Tue, 10 Oct 2017 21:15:25 +0000 (14:15 -0700)
This patch fixes a problem with the HW ATR eviction feature where the
NVM setting was incorrect.  This patch detects the issue on X720
adapters and disables the feature if the NVM setting is incorrect.

Without this patch, HW ATR Evict feature does not work on broken NVMs
and is not detected either.  If the HW ATR Evict feature is disabled
the SW Eviction feature will take effect.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Alice Michael <alice.michael@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26785018
(cherry picked from commit 10a955ff62e56fe13dae1f29aabc04bc589eaf46)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 1c38ca1ce5cce48a0e92340e5e859cdf2034aa59..fe17bd1415f7c265e02e76600a0819076b691213 100644 (file)
@@ -8952,6 +8952,14 @@ static int i40e_sw_init(struct i40e_pf *pf)
                             | I40E_FLAG_GENEVE_OFFLOAD_CAPABLE
                             | I40E_FLAG_PTP_L4_CAPABLE
                             | I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE;
+
+#define I40E_FDEVICT_PCTYPE_DEFAULT 0xc03
+               if (rd32(&pf->hw, I40E_GLQF_FDEVICTENA(1)) !=
+                   I40E_FDEVICT_PCTYPE_DEFAULT) {
+                       dev_warn(&pf->pdev->dev,
+                                "FD EVICT PCTYPES are not right, disable FD HW EVICT\n");
+                       pf->flags &= ~I40E_FLAG_HW_ATR_EVICT_CAPABLE;
+               }
        } else if ((pf->hw.aq.api_maj_ver > 1) ||
                   ((pf->hw.aq.api_maj_ver == 1) &&
                    (pf->hw.aq.api_min_ver > 4))) {