Skip to content

Commit

Permalink
mlx4_en: Verify number of RX rings doesn't exceed MAX_RX_RINGS
Browse files Browse the repository at this point in the history
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: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yevgeny Petrilin authored and David S. Miller committed Dec 30, 2008
1 parent 68888d1 commit c2b559e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/mlx4/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2b559e

Please sign in to comment.