diff options
author | Max Gurtovoy <maxg@mellanox.com> | 2020-06-23 17:55:25 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-06-24 19:41:19 +0300 |
commit | 032a9966a22a3596addf81dacf0c1736dfedc32a (patch) | |
tree | 9eb5d953a75f620045ec84b092ec45eef09826c4 /drivers/nvme/host/rdma.c | |
parent | 1b4ad7a50ab06573aa8841217d6a472dc1db2d85 (diff) | |
download | linux-032a9966a22a3596addf81dacf0c1736dfedc32a.tar.xz |
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 <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/rdma.c')
-rw-r--r-- | drivers/nvme/host/rdma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index f8f856dc0c67..13506a87a444 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -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)) |