Skip to content

Commit bbd00c4

Browse files
ayalevingregkh
authored andcommitted
net/mlx5e: Fix error path of updating netdev queues
commit 5e7923a upstream. 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 <ayal@nvidia.com> Reviewed-by: Maxim Mikityanskiy <maximmi@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 02a8da4 commit bbd00c4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

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

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

29222922
old_num_txqs = netdev->real_num_tx_queues;
2923-
old_ntc = netdev->num_tc;
2923+
old_ntc = netdev->num_tc ? : 1;
29242924

29252925
nch = priv->channels.params.num_channels;
29262926
ntc = priv->channels.params.num_tc;

0 commit comments

Comments
 (0)