diff options
author | Rana Shahout <ranas@mellanox.com> | 2016-06-30 17:34:48 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-01 13:12:04 +0300 |
commit | 7ccdd0841b305323e10e779c476d3fbae2165756 (patch) | |
tree | 3ea5b15101ac29674352097a210d49d3352bc5e5 /lib/mpi/mpiutil.c | |
parent | e3a19b53cbb0e6738b7a547f262179065b72e3fa (diff) | |
download | linux-7ccdd0841b305323e10e779c476d3fbae2165756.tar.xz |
net/mlx5e: Fix select queue callback
The default fallback function used by mlx5e select queue can return
any TX queues in range [0..dev->num_real_tx_queues).
The current implementation assumes that the fallback function returns
a number in the range [0.. number of channels). Actually
dev->num_real_tx_queues = (number of channels) * dev->num_tc;
which is more than the expected range if num_tc is configured and could
lead to crashes.
To fix this we test if num_tc is not configured we can safely return the
fallback suggestion, if not we will reciprocal_scale the fallback
result and normalize it to the desired range.
Fixes: 08fb1dacdd76 ('net/mlx5e: Support DCBNL IEEE ETS')
Signed-off-by: Rana Shahout <ranas@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reported-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions