linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC 1/2] nvme-rdma: Matching rdma WC to rdma queue according to WC QP
@ 2016-08-08 11:00 Roy Shterman
  2016-08-08 11:00 ` [RFC 2/2] nvmet-rdma: " Roy Shterman
  2016-08-08 11:32 ` [RFC 1/2] nvme-rdma: " Sagi Grimberg
  0 siblings, 2 replies; 5+ messages in thread
From: Roy Shterman @ 2016-08-08 11:00 UTC (permalink / raw)


Today when assiging rdma_nvme_queue to rdma work complition we use
cq_context which is passed as queue pointer when creating the CQ.
In case we will want to aggregate few QP to one CQ this method will
not work, hence it will be better if we will use QP context instead.

Signed-off-by: Roy Shterman <roysh at mellanox.com>
---
 drivers/nvme/host/rdma.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 278551b..98a0ab5 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -277,6 +277,7 @@ static int nvme_rdma_create_qp(struct nvme_rdma_queue *queue, const int factor)
 	init_attr.qp_type = IB_QPT_RC;
 	init_attr.send_cq = queue->ib_cq;
 	init_attr.recv_cq = queue->ib_cq;
+	init_attr.qp_context = queue;
 
 	ret = rdma_create_qp(queue->cm_id, dev->pd, &init_attr);
 
@@ -803,7 +804,7 @@ static void nvme_rdma_error_recovery(struct nvme_rdma_ctrl *ctrl)
 static void nvme_rdma_wr_error(struct ib_cq *cq, struct ib_wc *wc,
 		const char *op)
 {
-	struct nvme_rdma_queue *queue = cq->cq_context;
+	struct nvme_rdma_queue *queue = wc->qp->qp_context;
 	struct nvme_rdma_ctrl *ctrl = queue->ctrl;
 
 	if (ctrl->ctrl.state == NVME_CTRL_LIVE)
@@ -1163,7 +1164,7 @@ static int __nvme_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc, int tag)
 {
 	struct nvme_rdma_qe *qe =
 		container_of(wc->wr_cqe, struct nvme_rdma_qe, cqe);
-	struct nvme_rdma_queue *queue = cq->cq_context;
+	struct nvme_rdma_queue *queue = wc->qp->qp_context;
 	struct ib_device *ibdev = queue->device->dev;
 	struct nvme_completion *cqe = qe->data;
 	const size_t len = sizeof(struct nvme_completion);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-08 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-08 11:00 [RFC 1/2] nvme-rdma: Matching rdma WC to rdma queue according to WC QP Roy Shterman
2016-08-08 11:00 ` [RFC 2/2] nvmet-rdma: " Roy Shterman
2016-08-08 11:35   ` Sagi Grimberg
2016-08-08 13:24     ` Christoph Hellwig
2016-08-08 11:32 ` [RFC 1/2] nvme-rdma: " Sagi Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).