diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2008-12-22 10:15:03 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-12-22 10:15:03 -0500 |
commit | b8dd786f9417e5885929bfe33a235c76a9c1c569 (patch) | |
tree | 16b38c672980d142ffa0ac0ccdeb4af19c20cc31 /drivers/net/mlx4/en_cq.c | |
parent | 061e41fdb5047b1fb161e89664057835935ca1d2 (diff) |
mlx4_core: Add support for multiple completion event vectors
When using MSI-X mode, create a completion event queue for each CPU.
Report the number of completion EQs in a new struct mlx4_caps member,
num_comp_vectors, and extend the mlx4_cq_alloc() interface with a
vector parameter so that consumers can specify which completion EQ
should be used to report events for the CQ being created.
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4/en_cq.c')
-rw-r--r-- | drivers/net/mlx4/en_cq.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/mlx4/en_cq.c b/drivers/net/mlx4/en_cq.c index 1368a8010af4..674f836e225b 100644 --- a/drivers/net/mlx4/en_cq.c +++ b/drivers/net/mlx4/en_cq.c | |||
@@ -51,10 +51,13 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, | |||
51 | int err; | 51 | int err; |
52 | 52 | ||
53 | cq->size = entries; | 53 | cq->size = entries; |
54 | if (mode == RX) | 54 | if (mode == RX) { |
55 | cq->buf_size = cq->size * sizeof(struct mlx4_cqe); | 55 | cq->buf_size = cq->size * sizeof(struct mlx4_cqe); |
56 | else | 56 | cq->vector = ring % mdev->dev->caps.num_comp_vectors; |
57 | } else { | ||
57 | cq->buf_size = sizeof(struct mlx4_cqe); | 58 | cq->buf_size = sizeof(struct mlx4_cqe); |
59 | cq->vector = 0; | ||
60 | } | ||
58 | 61 | ||
59 | cq->ring = ring; | 62 | cq->ring = ring; |
60 | cq->is_tx = mode; | 63 | cq->is_tx = mode; |
@@ -86,7 +89,7 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) | |||
86 | memset(cq->buf, 0, cq->buf_size); | 89 | memset(cq->buf, 0, cq->buf_size); |
87 | 90 | ||
88 | err = mlx4_cq_alloc(mdev->dev, cq->size, &cq->wqres.mtt, &mdev->priv_uar, | 91 | err = mlx4_cq_alloc(mdev->dev, cq->size, &cq->wqres.mtt, &mdev->priv_uar, |
89 | cq->wqres.db.dma, &cq->mcq, cq->is_tx); | 92 | cq->wqres.db.dma, &cq->mcq, cq->vector, cq->is_tx); |
90 | if (err) | 93 | if (err) |
91 | return err; | 94 | return err; |
92 | 95 | ||