Skip to content

Commit 5e7923a

Browse files
ayalevinSaeed Mahameed
authored andcommitted
net/mlx5e: Fix error path of updating netdev queues
Avoid division by zero in the error flow. In the driver TC number can be either 1 or 8. When TC count is set to 1, driver zero netdev->num_tc. Hence, need to convert it back from 0 to 1 in the error flow. Fixes: fa37487 ("net/mlx5e: Handle errors from netif_set_real_num_{tx,rx}_queues") Signed-off-by: Aya Levin <[email protected]> Reviewed-by: Maxim Mikityanskiy <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 7d1a3d0 commit 5e7923a

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,7 @@ static int mlx5e_update_netdev_queues(struct mlx5e_priv *priv)
26972697
int err;
26982698

26992699
old_num_txqs = netdev->real_num_tx_queues;
2700-
old_ntc = netdev->num_tc;
2700+
old_ntc = netdev->num_tc ? : 1;
27012701

27022702
nch = priv->channels.params.num_channels;
27032703
ntc = priv->channels.params.num_tc;

0 commit comments

Comments
 (0)