Skip to content

Commit 3d25046

Browse files
jjagielskanguy11
authored andcommitted
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: fa38e30 ("i40e: Fix for Tx timeouts when interface is brought up if DCB is enabled") Suggested-by: Alexander Lobakin <[email protected]> # Flatten the condition Signed-off-by: Sylwester Dziedziuch <[email protected]> Signed-off-by: Jedrzej Jagielski <[email protected]> Reviewed-by: Alexander Lobakin <[email protected]> Tested-by: Imam Hassan Reza Biswas <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 341adee commit 3d25046

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5372,14 +5372,24 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
53725372
/* There is no need to reset BW when mqprio mode is on. */
53735373
if (pf->flags & I40E_FLAG_TC_MQPRIO)
53745374
return 0;
5375-
if (!vsi->mqprio_qopt.qopt.hw && !(pf->flags & I40E_FLAG_DCB_ENABLED)) {
5375+
5376+
if (!vsi->mqprio_qopt.qopt.hw) {
5377+
if (pf->flags & I40E_FLAG_DCB_ENABLED)
5378+
goto skip_reset;
5379+
5380+
if (IS_ENABLED(CONFIG_I40E_DCB) &&
5381+
i40e_dcb_hw_get_num_tc(&pf->hw) == 1)
5382+
goto skip_reset;
5383+
53765384
ret = i40e_set_bw_limit(vsi, vsi->seid, 0);
53775385
if (ret)
53785386
dev_info(&pf->pdev->dev,
53795387
"Failed to reset tx rate for vsi->seid %u\n",
53805388
vsi->seid);
53815389
return ret;
53825390
}
5391+
5392+
skip_reset:
53835393
memset(&bw_data, 0, sizeof(bw_data));
53845394
bw_data.tc_valid_bits = enabled_tc;
53855395
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)

0 commit comments

Comments
 (0)