From: maxg@mellanox.com (Max Gurtovoy)
Subject: [PATCH 1/3] nvmet-rdma: use srq pointer in rdma_cmd
Date: Tue, 5 Sep 2017 13:59:15 +0300 [thread overview]
Message-ID: <1504609157-3004-2-git-send-email-maxg@mellanox.com> (raw)
In-Reply-To: <1504609157-3004-1-git-send-email-maxg@mellanox.com>
This is a preparetion patch that creates an infrastructure in post
recv mechanism for the SRQ per completion vector feature.
Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
---
drivers/nvme/target/rdma.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 56a4cba..fb322b3 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -45,6 +45,7 @@ struct nvmet_rdma_cmd {
struct page *inline_page;
struct nvme_command *nvme_cmd;
struct nvmet_rdma_queue *queue;
+ struct ib_srq *srq;
};
enum {
@@ -442,8 +443,8 @@ static int nvmet_rdma_post_recv(struct nvmet_rdma_device *ndev,
cmd->sge[0].addr, cmd->sge[0].length,
DMA_FROM_DEVICE);
- if (ndev->srq)
- return ib_post_srq_recv(ndev->srq, &cmd->wr, &bad_wr);
+ if (cmd->srq)
+ return ib_post_srq_recv(cmd->srq, &cmd->wr, &bad_wr);
return ib_post_recv(cmd->queue->cm_id->qp, &cmd->wr, &bad_wr);
}
@@ -819,8 +820,10 @@ static int nvmet_rdma_init_srq(struct nvmet_rdma_device *ndev)
ndev->srq = srq;
ndev->srq_size = srq_size;
- for (i = 0; i < srq_size; i++)
+ for (i = 0; i < srq_size; i++) {
+ ndev->srq_cmds[i].srq = srq;
nvmet_rdma_post_recv(ndev, &ndev->srq_cmds[i]);
+ }
return 0;
--
1.7.1
next prev parent reply other threads:[~2017-09-05 10:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 10:59 [PATCH 0/3] nvmet-rdma: SRQ per completion vector Max Gurtovoy
2017-09-05 10:59 ` Max Gurtovoy [this message]
2017-09-06 10:30 ` [PATCH 1/3] nvmet-rdma: use srq pointer in rdma_cmd Christoph Hellwig
2017-09-05 10:59 ` [PATCH 2/3] nvmet-rdma: use SRQ per completion vector Max Gurtovoy
2017-09-06 10:38 ` Christoph Hellwig
2017-09-06 14:57 ` Sagi Grimberg
2017-09-07 12:03 ` Christoph Hellwig
2017-09-06 14:50 ` Sagi Grimberg
2017-09-07 10:47 ` Max Gurtovoy
2017-09-05 10:59 ` [PATCH 3/3] nvmet-rdma: add module parameter for SRQ size Max Gurtovoy
2017-09-06 10:39 ` Christoph Hellwig
2017-09-06 15:02 ` Sagi Grimberg
2017-09-06 14:40 ` [PATCH 0/3] nvmet-rdma: SRQ per completion vector Sagi Grimberg
2017-11-07 14:40 ` Max Gurtovoy
2017-11-08 10:07 ` Sagi Grimberg
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=1504609157-3004-2-git-send-email-maxg@mellanox.com \
--to=maxg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox