Commit 025b4a54 authored by Anjali Singhai Jain's avatar Anjali Singhai Jain Committed by Jeff Kirsher

i40e: Add FW check to disable DCB and wrap autoneg workaround with FW check

For FW < 4.33 DCB should be disabled.
Also Autoneg workaround to avoid Rx stall is still needed for FW < 4.33.

Change-ID: Iff36ad86be2f597e7701096014d6d094332a9a21
Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 9a3bd2f1
...@@ -4551,6 +4551,11 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf) ...@@ -4551,6 +4551,11 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf)
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
int err = 0; int err = 0;
/* Do not enable DCB for SW1 and SW2 images even if the FW is capable */
if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) ||
(pf->hw.aq.fw_maj_ver < 4))
goto out;
/* Get the initial DCB configuration */ /* Get the initial DCB configuration */
err = i40e_init_dcb(hw); err = i40e_init_dcb(hw);
if (!err) { if (!err) {
...@@ -6311,13 +6316,14 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit) ...@@ -6311,13 +6316,14 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
} }
} }
msleep(75); if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) ||
ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); (pf->hw.aq.fw_maj_ver < 4)) {
if (ret) { msleep(75);
dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n", ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
pf->hw.aq.asq_last_status); if (ret)
dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n",
pf->hw.aq.asq_last_status);
} }
/* reinit the misc interrupt */ /* reinit the misc interrupt */
if (pf->flags & I40E_FLAG_MSIX_ENABLED) if (pf->flags & I40E_FLAG_MSIX_ENABLED)
ret = i40e_setup_misc_vector(pf); ret = i40e_setup_misc_vector(pf);
...@@ -9677,13 +9683,14 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -9677,13 +9683,14 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err) if (err)
dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", err); dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", err);
msleep(75); if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) ||
err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); (pf->hw.aq.fw_maj_ver < 4)) {
if (err) { msleep(75);
dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n", err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
pf->hw.aq.asq_last_status); if (err)
dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n",
pf->hw.aq.asq_last_status);
} }
/* The main driver is (mostly) up and happy. We need to set this state /* 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 * before setting up the misc vector or we get a race and the vector
* ends up disabled forever. * ends up disabled forever.
......
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