diff options
| author | Anjali Singhai Jain <anjali.singhai@intel.com> | 2014-09-13 03:40:45 -0400 |
|---|---|---|
| committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-10-23 23:38:03 -0400 |
| commit | cafa2ee6fbb1bbc2fecdeef990858d56646fc1bd (patch) | |
| tree | c945add7a44976dd39d5ce6898a5e49798326b2c /drivers/net | |
| parent | f98a20068dfcc16d1292d3e4d0d690e123da1538 (diff) | |
i40e: Fix a bug where Rx would stop after some time
Move the setting of flow control because this should be done at a pf level not
a vsi level. Also add a sleep and restart an to fix a bug where Rx would stop
after some stress.
Change-ID: I9a93d8c2ff27c39339eb00bc4ec1225e43900be0
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net')
| -rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index f7464e87d521..ff6d94d4d1e0 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
| @@ -4479,12 +4479,8 @@ static void i40e_print_link_message(struct i40e_vsi *vsi, bool isup) | |||
| 4479 | static int i40e_up_complete(struct i40e_vsi *vsi) | 4479 | static int i40e_up_complete(struct i40e_vsi *vsi) |
| 4480 | { | 4480 | { |
| 4481 | struct i40e_pf *pf = vsi->back; | 4481 | struct i40e_pf *pf = vsi->back; |
| 4482 | u8 set_fc_aq_fail = 0; | ||
| 4483 | int err; | 4482 | int err; |
| 4484 | 4483 | ||
| 4485 | /* force flow control off */ | ||
| 4486 | i40e_set_fc(&pf->hw, &set_fc_aq_fail, true); | ||
| 4487 | |||
| 4488 | if (pf->flags & I40E_FLAG_MSIX_ENABLED) | 4484 | if (pf->flags & I40E_FLAG_MSIX_ENABLED) |
| 4489 | i40e_vsi_configure_msix(vsi); | 4485 | i40e_vsi_configure_msix(vsi); |
| 4490 | else | 4486 | else |
| @@ -5958,6 +5954,7 @@ static void i40e_send_version(struct i40e_pf *pf) | |||
| 5958 | static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit) | 5954 | static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit) |
| 5959 | { | 5955 | { |
| 5960 | struct i40e_hw *hw = &pf->hw; | 5956 | struct i40e_hw *hw = &pf->hw; |
| 5957 | u8 set_fc_aq_fail = 0; | ||
| 5961 | i40e_status ret; | 5958 | i40e_status ret; |
| 5962 | u32 v; | 5959 | u32 v; |
| 5963 | 5960 | ||
| @@ -6038,6 +6035,11 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit) | |||
| 6038 | if (ret) | 6035 | if (ret) |
| 6039 | dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", ret); | 6036 | dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", ret); |
| 6040 | 6037 | ||
| 6038 | /* make sure our flow control settings are restored */ | ||
| 6039 | ret = i40e_set_fc(&pf->hw, &set_fc_aq_fail, true); | ||
| 6040 | if (ret) | ||
| 6041 | dev_info(&pf->pdev->dev, "set fc fail, aq_err %d\n", ret); | ||
| 6042 | |||
| 6041 | /* Rebuild the VSIs and VEBs that existed before reset. | 6043 | /* Rebuild the VSIs and VEBs that existed before reset. |
| 6042 | * They are still in our local switch element arrays, so only | 6044 | * They are still in our local switch element arrays, so only |
| 6043 | * need to rebuild the switch model in the HW. | 6045 | * need to rebuild the switch model in the HW. |
| @@ -6092,6 +6094,13 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit) | |||
| 6092 | } | 6094 | } |
| 6093 | } | 6095 | } |
| 6094 | 6096 | ||
| 6097 | msleep(75); | ||
| 6098 | ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); | ||
| 6099 | if (ret) { | ||
| 6100 | dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n", | ||
| 6101 | pf->hw.aq.asq_last_status); | ||
| 6102 | } | ||
| 6103 | |||
| 6095 | /* reinit the misc interrupt */ | 6104 | /* reinit the misc interrupt */ |
| 6096 | if (pf->flags & I40E_FLAG_MSIX_ENABLED) | 6105 | if (pf->flags & I40E_FLAG_MSIX_ENABLED) |
| 6097 | ret = i40e_setup_misc_vector(pf); | 6106 | ret = i40e_setup_misc_vector(pf); |
| @@ -9169,6 +9178,13 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 9169 | if (err) | 9178 | if (err) |
| 9170 | dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", err); | 9179 | dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", err); |
| 9171 | 9180 | ||
| 9181 | msleep(75); | ||
| 9182 | err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); | ||
| 9183 | if (err) { | ||
| 9184 | dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n", | ||
| 9185 | pf->hw.aq.asq_last_status); | ||
| 9186 | } | ||
| 9187 | |||
| 9172 | /* The main driver is (mostly) up and happy. We need to set this state | 9188 | /* The main driver is (mostly) up and happy. We need to set this state |
| 9173 | * before setting up the misc vector or we get a race and the vector | 9189 | * before setting up the misc vector or we get a race and the vector |
| 9174 | * ends up disabled forever. | 9190 | * ends up disabled forever. |
