summaryrefslogtreecommitdiff
path: root/lib/mpi/mpih-mul.c
diff options
context:
space:
mode:
authorMaxim Mikityanskiy <maximmi@mellanox.com>2021-03-01 20:59:59 +0200
committerSaeed Mahameed <saeedm@nvidia.com>2021-03-22 13:16:41 -0700
commit846d6da1fcdb14105f86b46b4345233550a79d55 (patch)
treefe64c3d0889cee715ca949cfd188bfd6671a2478 /lib/mpi/mpih-mul.c
parent4eacfe72e3e037e3fc019113df32c39a705148c2 (diff)
net/mlx5e: Fix division by 0 in mlx5e_select_queue
mlx5e_select_queue compares num_tc_x_num_ch to real_num_tx_queues to determine if HTB and/or PTP offloads are active. If they are, it calculates netdev_pick_tx() % num_tc_x_num_ch to prevent it from selecting HTB and PTP queues for regular traffic. However, before the channels are first activated, num_tc_x_num_ch is zero. If ndo_select_queue gets called at this point, the HTB/PTP check will pass, and mlx5e_select_queue will attempt to take a modulo by num_tc_x_num_ch, which equals to zero. This commit fixes the bug by assigning num_tc_x_num_ch to a non-zero value before registering the netdev. Fixes: 214baf22870c ("net/mlx5e: Support HTB offload") Reported-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'lib/mpi/mpih-mul.c')
0 files changed, 0 insertions, 0 deletions