Commit 8eed76fa authored by Anjali Singhai Jain's avatar Anjali Singhai Jain Committed by Jeff Kirsher

i40e: Cleanup the code with respect to restarting autoneg

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: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
Change-ID: I942c3ff40cccd1e56f424b1da776b020fe3c9d2a
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 10311540
...@@ -340,6 +340,7 @@ struct i40e_pf { ...@@ -340,6 +340,7 @@ struct i40e_pf {
#define I40E_FLAG_GENEVE_OFFLOAD_CAPABLE BIT_ULL(41) #define I40E_FLAG_GENEVE_OFFLOAD_CAPABLE BIT_ULL(41)
#define I40E_FLAG_NO_PCI_LINK_CHECK BIT_ULL(42) #define I40E_FLAG_NO_PCI_LINK_CHECK BIT_ULL(42)
#define I40E_FLAG_100M_SGMII_CAPABLE BIT_ULL(43) #define I40E_FLAG_100M_SGMII_CAPABLE BIT_ULL(43)
#define I40E_FLAG_RESTART_AUTONEG BIT_ULL(44)
#define I40E_FLAG_PF_MAC BIT_ULL(50) #define I40E_FLAG_PF_MAC BIT_ULL(50)
/* tracks features that get auto disabled by errors */ /* tracks features that get auto disabled by errors */
......
...@@ -6889,8 +6889,7 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit) ...@@ -6889,8 +6889,7 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
wr32(hw, I40E_REG_MSS, val); wr32(hw, I40E_REG_MSS, val);
} }
if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) || if (pf->flags & I40E_FLAG_RESTART_AUTONEG) {
(pf->hw.aq.fw_maj_ver < 4)) {
msleep(75); msleep(75);
ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
if (ret) if (ret)
...@@ -8367,6 +8366,12 @@ static int i40e_sw_init(struct i40e_pf *pf) ...@@ -8367,6 +8366,12 @@ static int i40e_sw_init(struct i40e_pf *pf)
pf->hw.func_caps.fd_filters_best_effort; 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) { if (pf->hw.func_caps.vmdq) {
pf->num_vmdq_vsis = I40E_DEFAULT_NUM_VMDQ_VSI; pf->num_vmdq_vsis = I40E_DEFAULT_NUM_VMDQ_VSI;
pf->flags |= I40E_FLAG_VMDQ_ENABLED; pf->flags |= I40E_FLAG_VMDQ_ENABLED;
...@@ -10904,8 +10909,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -10904,8 +10909,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
wr32(hw, I40E_REG_MSS, val); wr32(hw, I40E_REG_MSS, val);
} }
if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) || if (pf->flags & I40E_FLAG_RESTART_AUTONEG) {
(pf->hw.aq.fw_maj_ver < 4)) {
msleep(75); msleep(75);
err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment