All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Gurtovoy <maxg@mellanox.com>
To: sagi@grimberg.me, linux-nvme@lists.infradead.org,
	kbusch@kernel.org, hch@lst.de
Cc: yaminf@mellanox.com, idanb@mellanox.com, israelr@mellanox.com,
	shlomin@mellanox.com, jgg@nvidia.com,
	Max Gurtovoy <maxg@mellanox.com>,
	ogerlitz@mellanox.com
Subject: [PATCH 3/3] nvme-rdma: assign completion vector correctly
Date: Tue, 23 Jun 2020 17:55:25 +0300	[thread overview]
Message-ID: <20200623145525.1586-4-maxg@mellanox.com> (raw)
In-Reply-To: <20200623145525.1586-1-maxg@mellanox.com>

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>
---
 drivers/nvme/host/rdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index f5d6a57..981adbd 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -469,7 +469,7 @@ static int nvme_rdma_create_cq(struct ib_device *ibdev,
 	 * 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)) {
-- 
1.8.3.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2020-06-23 14:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 14:55 [PATCH 0/3] NVMe/RDMA patches for 5.8 Max Gurtovoy
2020-06-23 14:55 ` [PATCH 1/3] nvme-rdma: use new shared CQ mechanism Max Gurtovoy
2020-06-23 14:55 ` [PATCH 2/3] nvmet-rdma: " Max Gurtovoy
2020-06-23 14:55 ` Max Gurtovoy [this message]
2020-06-23 15:22   ` [PATCH 3/3] nvme-rdma: assign completion vector correctly Jason Gunthorpe
2020-06-23 17:34     ` Sagi Grimberg
2020-06-24  8:34       ` Max Gurtovoy
2020-06-24  8:37         ` Christoph Hellwig
2020-06-24  8:44           ` Max Gurtovoy
2020-06-24  8:46             ` Christoph Hellwig
2020-06-24 14:22             ` Jason Gunthorpe
2020-06-24 15:14               ` Max Gurtovoy
2020-06-24 16:41   ` Christoph Hellwig
2020-06-25  8:11     ` Max Gurtovoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200623145525.1586-4-maxg@mellanox.com \
    --to=maxg@mellanox.com \
    --cc=hch@lst.de \
    --cc=idanb@mellanox.com \
    --cc=israelr@mellanox.com \
    --cc=jgg@nvidia.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=ogerlitz@mellanox.com \
    --cc=sagi@grimberg.me \
    --cc=shlomin@mellanox.com \
    --cc=yaminf@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.