Skip to content

Commit

Permalink
nvme-rdma: assign completion vector correctly
Browse files Browse the repository at this point in the history
The completion vector index that is given during CQ creation can't
exceed the number of support vectors by the underlying RDMA device. This
violation currently can accure, for example, in case one will try to
connect with N regular read/write queues and M poll queues and the sum
of N + M > num_supported_vectors. This will lead to failure in establish
a connection to remote target. Instead, in that case, share a completion
vector between queues.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Max Gurtovoy authored and Christoph Hellwig committed Jun 24, 2020
1 parent 1b4ad7a commit 032a996
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/host/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue)
* Spread I/O queues completion vectors according their queue index.
* Admin queues can always go on completion vector 0.
*/
comp_vector = idx == 0 ? idx : idx - 1;
comp_vector = (idx == 0 ? idx : idx - 1) % ibdev->num_comp_vectors;

/* Polling queues need direct cq polling context */
if (nvme_rdma_poll_queue(queue))
Expand Down

0 comments on commit 032a996

Please sign in to comment.