Skip to contentSkip to conversation

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

PATCH Applied Yevgeny Petrilin 2 participants 2 messages Dec 29, 2008 – Dec 30, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 4/9 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.

---
 drivers/net/mlx4/en_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/mlx4/en_main.c +2 -1
index c1c0585..34f3a19 100644
@@ -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
Signature · 1 line
1.5.4