0008-i40e-Fix-for-Tx-timeouts-when-interface-is-brought-u.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Martyna Szapar <[email protected]>
  3. Date: Tue, 7 Aug 2018 17:11:23 -0700
  4. Subject: [PATCH] i40e: Fix for Tx timeouts when interface is brought up if DCB
  5. is enabled
  6. If interface is connected to switch port configured for DCB there are
  7. TX timeouts when bringing up interface. Problem started appearing after
  8. adding in i40e driver code mqprio hardware offload mode. In function
  9. i40e_vsi_configure_bw_alloc was added resetting BW rate which should
  10. be executing when mqprio qdisc is removed but was also when there was
  11. no mqprio qdisc added and DCB was enabled. In this patch was added
  12. additional check for DCB flag so now when DCB is enabled the correct
  13. DCB configs from before mqprio patch are restored.
  14. Signed-off-by: Martyna Szapar <[email protected]>
  15. Tested-by: Andrew Bowers <[email protected]>
  16. Signed-off-by: Jeff Kirsher <[email protected]>
  17. Signed-off-by: Thomas Lamprecht <[email protected]>
  18. ---
  19. drivers/net/ethernet/intel/i40e/i40e_main.c | 15 ++++++++-------
  20. 1 file changed, 8 insertions(+), 7 deletions(-)
  21. diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
  22. index 08f7bd9001bc..7895a0af37e6 100644
  23. --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
  24. +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
  25. @@ -5219,15 +5219,17 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
  26. u8 *bw_share)
  27. {
  28. struct i40e_aqc_configure_vsi_tc_bw_data bw_data;
  29. + struct i40e_pf *pf = vsi->back;
  30. i40e_status ret;
  31. int i;
  32. - if (vsi->back->flags & I40E_FLAG_TC_MQPRIO)
  33. + /* There is no need to reset BW when mqprio mode is on. */
  34. + if (pf->flags & I40E_FLAG_TC_MQPRIO)
  35. return 0;
  36. - if (!vsi->mqprio_qopt.qopt.hw) {
  37. + if (!vsi->mqprio_qopt.qopt.hw && !(pf->flags & I40E_FLAG_DCB_ENABLED)) {
  38. ret = i40e_set_bw_limit(vsi, vsi->seid, 0);
  39. if (ret)
  40. - dev_info(&vsi->back->pdev->dev,
  41. + dev_info(&pf->pdev->dev,
  42. "Failed to reset tx rate for vsi->seid %u\n",
  43. vsi->seid);
  44. return ret;
  45. @@ -5236,12 +5238,11 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
  46. for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
  47. bw_data.tc_bw_credits[i] = bw_share[i];
  48. - ret = i40e_aq_config_vsi_tc_bw(&vsi->back->hw, vsi->seid, &bw_data,
  49. - NULL);
  50. + ret = i40e_aq_config_vsi_tc_bw(&pf->hw, vsi->seid, &bw_data, NULL);
  51. if (ret) {
  52. - dev_info(&vsi->back->pdev->dev,
  53. + dev_info(&pf->pdev->dev,
  54. "AQ command Config VSI BW allocation per TC failed = %d\n",
  55. - vsi->back->hw.aq.asq_last_status);
  56. + pf->hw.aq.asq_last_status);
  57. return -EINVAL;
  58. }