All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net v1] i40e: Fix reset bw limit when DCB enabled with 1 TC
@ 2021-12-14 10:08 Jedrzej Jagielski
  2022-01-20 13:31 ` Hassan
  0 siblings, 1 reply; 2+ messages in thread
From: Jedrzej Jagielski @ 2021-12-14 10:08 UTC (permalink / raw)
  To: intel-wired-lan

There was an AQ error I40E_AQ_RC_EINVAL when trying
to reset bw limit as part of bw allocation setup.
This was caused by trying to reset bw limit with
DCB enabled. Bw limit should not be reset when
DCB is enabled. The code was relying on the pf->flags
to check if DCB is enabled but if only 1 TC is available
this flag will not be set even though DCB is enabled.
Add a check for number of TC and if it is 1
don't try to reset bw limit even if pf->flags shows
DCB as disabled.

Fixes: fa38e30ac73f ("i40e: Fix for Tx timeouts when interface is brought up if DCB is enabled")
Suggested-by: Alexander Lobakin <alexandr.lobakin@intel.com> # Flatten
the condition
Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 4a6e7822b4ab..817513a744e1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5404,7 +5404,15 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
 	/* There is no need to reset BW when mqprio mode is on.  */
 	if (pf->flags & I40E_FLAG_TC_MQPRIO)
 		return 0;
-	if (!vsi->mqprio_qopt.qopt.hw && !(pf->flags & I40E_FLAG_DCB_ENABLED)) {
+
+	if (!vsi->mqprio_qopt.qopt.hw) {
+		if (pf->flags & I40E_FLAG_DCB_ENABLED)
+			goto skip_reset;
+
+		if (IS_ENABLED(CONFIG_I40E_DCB) &&
+		    i40e_dcb_hw_get_num_tc(&pf->hw) == 1)
+			goto skip_reset;
+
 		ret = i40e_set_bw_limit(vsi, vsi->seid, 0);
 		if (ret)
 			dev_info(&pf->pdev->dev,
@@ -5412,6 +5420,8 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
 				 vsi->seid);
 		return ret;
 	}
+
+skip_reset:
 	memset(&bw_data, 0, sizeof(bw_data));
 	bw_data.tc_valid_bits = enabled_tc;
 	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Intel-wired-lan] [PATCH net v1] i40e: Fix reset bw limit when DCB enabled with 1 TC
  2021-12-14 10:08 [Intel-wired-lan] [PATCH net v1] i40e: Fix reset bw limit when DCB enabled with 1 TC Jedrzej Jagielski
@ 2022-01-20 13:31 ` Hassan
  0 siblings, 0 replies; 2+ messages in thread
From: Hassan @ 2022-01-20 13:31 UTC (permalink / raw)
  To: intel-wired-lan

> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Jagielski, Jedrzej
> Sent: Tuesday, December 14, 2021 3:38 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Dziedziuch, SylwesterX <sylwesterx.dziedziuch@intel.com>; Jagielski,
> Jedrzej <jedrzej.jagielski@intel.com>
> Subject: [Intel-wired-lan] [PATCH net v1] i40e: Fix reset bw limit when DCB
> enabled with 1 TC
> 
> There was an AQ error I40E_AQ_RC_EINVAL when trying to reset bw limit as
> part of bw allocation setup.
> This was caused by trying to reset bw limit with DCB enabled. Bw limit should
> not be reset when DCB is enabled. The code was relying on the pf->flags to
> check if DCB is enabled but if only 1 TC is available this flag will not be set
> even though DCB is enabled.
> Add a check for number of TC and if it is 1 don't try to reset bw limit even if
> pf->flags shows DCB as disabled.
> 
> Fixes: fa38e30ac73f ("i40e: Fix for Tx timeouts when interface is brought up if
> DCB is enabled")
> Suggested-by: Alexander Lobakin <alexandr.lobakin@intel.com> # Flatten
> the condition
> Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
> Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
Tested-by: Imam Hassan Reza Biswas (imam.hassan.reza.biswas at intel.com)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-20 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 10:08 [Intel-wired-lan] [PATCH net v1] i40e: Fix reset bw limit when DCB enabled with 1 TC Jedrzej Jagielski
2022-01-20 13:31 ` Hassan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.