Skip to content

Commit 032a996

Browse files
Max GurtovoyChristoph Hellwig
authored andcommitted
nvme-rdma: assign completion vector correctly
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 <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 1b4ad7a commit 032a996

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/rdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue)
470470
* Spread I/O queues completion vectors according their queue index.
471471
* Admin queues can always go on completion vector 0.
472472
*/
473-
comp_vector = idx == 0 ? idx : idx - 1;
473+
comp_vector = (idx == 0 ? idx : idx - 1) % ibdev->num_comp_vectors;
474474

475475
/* Polling queues need direct cq polling context */
476476
if (nvme_rdma_poll_queue(queue))

0 commit comments

Comments
 (0)