Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2b559ed authored by Yevgeny Petrilin's avatar Yevgeny Petrilin Committed by David S. Miller
Browse files

mlx4_en: Verify number of RX rings doesn't exceed MAX_RX_RINGS



Required in cases were dev->caps.num_comp_vectors > MAX_RX_RINGS.
For current values this would happen on machines that have more
then 16 cores.

Signed-off-by: default avatarYevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68888d10
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -170,7 +170,8 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
		mlx4_info(mdev, "Using %d tx rings for port:%d\n",
			  mdev->profile.prof[i].tx_ring_num, i);
		if (!mdev->profile.prof[i].rx_ring_num) {
			mdev->profile.prof[i].rx_ring_num = dev->caps.num_comp_vectors;
			mdev->profile.prof[i].rx_ring_num =
				min_t(int, dev->caps.num_comp_vectors, MAX_RX_RINGS);
			mlx4_info(mdev, "Defaulting to %d rx rings for port:%d\n",
				  mdev->profile.prof[i].rx_ring_num, i);
		} else