diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2008-12-29 21:38:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-29 21:38:21 -0500 |
commit | c2b559ed8683ffb5a7bdd9e71b3803b231623c86 (patch) | |
tree | 348b528a7b8718c05d07285197b056f35650b909 /drivers/net | |
parent | 68888d105365366c5e1e0424cc939c1fc757f9c4 (diff) |
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: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/mlx4/en_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mlx4/en_main.c b/drivers/net/mlx4/en_main.c index c1c05852a95e..34f3a191fbdf 100644 --- a/drivers/net/mlx4/en_main.c +++ b/drivers/net/mlx4/en_main.c | |||
@@ -170,7 +170,8 @@ static void *mlx4_en_add(struct mlx4_dev *dev) | |||
170 | mlx4_info(mdev, "Using %d tx rings for port:%d\n", | 170 | mlx4_info(mdev, "Using %d tx rings for port:%d\n", |
171 | mdev->profile.prof[i].tx_ring_num, i); | 171 | mdev->profile.prof[i].tx_ring_num, i); |
172 | if (!mdev->profile.prof[i].rx_ring_num) { | 172 | if (!mdev->profile.prof[i].rx_ring_num) { |
173 | mdev->profile.prof[i].rx_ring_num = dev->caps.num_comp_vectors; | 173 | mdev->profile.prof[i].rx_ring_num = |
174 | min_t(int, dev->caps.num_comp_vectors, MAX_RX_RINGS); | ||
174 | mlx4_info(mdev, "Defaulting to %d rx rings for port:%d\n", | 175 | mlx4_info(mdev, "Defaulting to %d rx rings for port:%d\n", |
175 | mdev->profile.prof[i].rx_ring_num, i); | 176 | mdev->profile.prof[i].rx_ring_num, i); |
176 | } else | 177 | } else |