diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2010-08-23 23:45:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-24 17:54:47 -0400 |
commit | 00d7d7bc6e886ef48af6ed766eb12b8cec241d35 (patch) | |
tree | 9fd96c64407a9e1f2abaf72fd03cd573192883a1 /drivers/net/mlx4 | |
parent | 69351a2933428515b31fe54100f90a669cbbd384 (diff) |
mlx4_en: Setting actual RX ring size
When configuring HW resources, the RX ring size that is passed should be the actual
size that depends on number of buffers that we succeeded to allocate.
The mask for ring size should also be configured accordingly
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r-- | drivers/net/mlx4/en_rx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c index 4335c58160d7..7a5123c4a366 100644 --- a/drivers/net/mlx4/en_rx.c +++ b/drivers/net/mlx4/en_rx.c | |||
@@ -251,7 +251,6 @@ reduce_rings: | |||
251 | ring->prod--; | 251 | ring->prod--; |
252 | mlx4_en_free_rx_desc(priv, ring, ring->actual_size); | 252 | mlx4_en_free_rx_desc(priv, ring, ring->actual_size); |
253 | } | 253 | } |
254 | ring->size_mask = ring->actual_size - 1; | ||
255 | } | 254 | } |
256 | 255 | ||
257 | return 0; | 256 | return 0; |
@@ -389,6 +388,7 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv) | |||
389 | for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) { | 388 | for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) { |
390 | ring = &priv->rx_ring[ring_ind]; | 389 | ring = &priv->rx_ring[ring_ind]; |
391 | 390 | ||
391 | ring->size_mask = ring->actual_size - 1; | ||
392 | mlx4_en_update_rx_prod_db(ring); | 392 | mlx4_en_update_rx_prod_db(ring); |
393 | } | 393 | } |
394 | 394 | ||
@@ -816,7 +816,7 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn, | |||
816 | qp->event = mlx4_en_sqp_event; | 816 | qp->event = mlx4_en_sqp_event; |
817 | 817 | ||
818 | memset(context, 0, sizeof *context); | 818 | memset(context, 0, sizeof *context); |
819 | mlx4_en_fill_qp_context(priv, ring->size, ring->stride, 0, 0, | 819 | mlx4_en_fill_qp_context(priv, ring->actual_size, ring->stride, 0, 0, |
820 | qpn, ring->cqn, context); | 820 | qpn, ring->cqn, context); |
821 | context->db_rec_addr = cpu_to_be64(ring->wqres.db.dma); | 821 | context->db_rec_addr = cpu_to_be64(ring->wqres.db.dma); |
822 | 822 | ||