net/mlx5: Don't request more than supported EQs
authorDaniel Jurgens <danielj@mellanox.com>
Thu, 5 Dec 2019 22:58:10 +0000 (16:58 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:42:09 +0000 (08:42 +0200)
commit05bbe9d85a4c2cbf79aea1023fa8ee8330bfe547
tree4f31b0905a3cf886fb691c8cc1fa10235d7da76b
parent86530effd18fbc43cf1c27046b48e64a5613a2d7
net/mlx5: Don't request more than supported EQs

[ Upstream commit a7b76002ae78cd230ee652ccdfedf21aa94fcecc ]

Calculating the number of compeltion EQs based on the number of
available IRQ vectors doesn't work now that all async EQs share one IRQ.
Thus the max number of EQs can be exceeded on systems with more than
approximately 256 CPUs. Take this into account when calculating the
number of available completion EQs.

Fixes: 81bfa206032a ("net/mlx5: Use a single IRQ for all async EQs")
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eq.c