]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Cleanup the code with respect to restarting autoneg
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Wed, 9 Dec 2015 23:50:31 +0000 (15:50 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:36:50 +0000 (08:36 -0800)
Orabug: 22342532

The restart-autoneg work around does not apply to X722.
Added a flag to set it only for the right MAC and right FW version
where the work around should be applied.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Change-ID: I942c3ff40cccd1e56f424b1da776b020fe3c9d2a
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 8eed76fa4885f1ed9f19f4d3a16dd24cebf09c19)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_main.c

drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_main.c

index 9c12aa89b5f268b4711ea559fa006e072e31216c..5a580992cc162955589674f2d519543e7815a768 100644 (file)
@@ -340,6 +340,7 @@ struct i40e_pf {
 #define I40E_FLAG_GENEVE_OFFLOAD_CAPABLE       BIT_ULL(41)
 #define I40E_FLAG_NO_PCI_LINK_CHECK            BIT_ULL(42)
 #define I40E_FLAG_100M_SGMII_CAPABLE           BIT_ULL(43)
+#define I40E_FLAG_RESTART_AUTONEG              BIT_ULL(44)
 
        /* tracks features that get auto disabled by errors */
        u64 auto_disable_flags;
index a934973799c8f2819a6ebb018f09a1754e293fd3..f10ac51f0ce965dbbab828cb1e559f562c0298ad 100644 (file)
@@ -6836,15 +6836,15 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
                }
        }
 
-       msleep(75);
-       ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
-       if (ret) {
-                        dev_info(&pf->pdev->dev, "link restart failed, err %s aq_err %s\n",
-                                 i40e_stat_str(&pf->hw, ret),
-                                 i40e_aq_str(&pf->hw,
-                                             pf->hw.aq.asq_last_status));
+       if (pf->flags & I40E_FLAG_RESTART_AUTONEG) {
+               msleep(75);
+               ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
+               if (ret)
+                       dev_info(&pf->pdev->dev, "link restart failed, err %s aq_err %s\n",
+                                i40e_stat_str(&pf->hw, ret),
+                                i40e_aq_str(&pf->hw,
+                                            pf->hw.aq.asq_last_status));
        }
-
        /* reinit the misc interrupt */
        if (pf->flags & I40E_FLAG_MSIX_ENABLED)
                ret = i40e_setup_misc_vector(pf);
@@ -8313,6 +8313,12 @@ static int i40e_sw_init(struct i40e_pf *pf)
                                 pf->hw.func_caps.fd_filters_best_effort;
        }
 
+       if (((pf->hw.mac.type == I40E_MAC_X710) ||
+            (pf->hw.mac.type == I40E_MAC_XL710)) &&
+           (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) ||
+           (pf->hw.aq.fw_maj_ver < 4)))
+               pf->flags |= I40E_FLAG_RESTART_AUTONEG;
+
        if (pf->hw.func_caps.vmdq) {
                pf->num_vmdq_vsis = I40E_DEFAULT_NUM_VMDQ_VSI;
                pf->flags |= I40E_FLAG_VMDQ_ENABLED;
@@ -10750,15 +10756,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                         i40e_stat_str(&pf->hw, err),
                         i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
 
-       msleep(75);
-       err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
-       if (err) {
-               dev_info(&pf->pdev->dev, "link restart failed, err %s aq_err %s\n",
-                                 i40e_stat_str(&pf->hw, err),
-                                 i40e_aq_str(&pf->hw,
-                                             pf->hw.aq.asq_last_status));
+       if (pf->flags & I40E_FLAG_RESTART_AUTONEG) {
+               msleep(75);
+               err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
+               if (err)
+                       dev_info(&pf->pdev->dev, "link restart failed, err %s aq_err %s\n",
+                                i40e_stat_str(&pf->hw, err),
+                                i40e_aq_str(&pf->hw,
+                                            pf->hw.aq.asq_last_status));
        }
-
        /* The main driver is (mostly) up and happy. We need to set this state
         * before setting up the misc vector or we get a race and the vector
         * ends up disabled forever.