From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Jens Axboe <axboe@kernel.dk>, Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@mellanox.com>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Yamin Friedman <yaminf@mellanox.com>,
Max Gurtovoy <maxg@mellanox.com>, Christoph Hellwig <hch@lst.de>
Subject: linux-next: manual merge of the block tree with the rdma tree
Date: Tue, 2 Jun 2020 12:48:24 +1000 [thread overview]
Message-ID: <20200602124824.4293d0dc@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 3079 bytes --]
Hi all,
Today's linux-next merge of the block tree got a conflict in:
drivers/nvme/host/rdma.c
between commit:
583f69304b91 ("nvme-rdma: use new shared CQ mechanism")
from the rdma tree and commit:
5ec5d3bddc6b ("nvme-rdma: add metadata/T10-PI support")
from the block tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/nvme/host/rdma.c
index 83d5f292c937,f8f856dc0c67..000000000000
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@@ -85,7 -95,7 +95,8 @@@ struct nvme_rdma_queue
struct rdma_cm_id *cm_id;
int cm_error;
struct completion cm_done;
+ int cq_size;
+ bool pi_support;
};
struct nvme_rdma_ctrl {
@@@ -262,7 -272,8 +273,9 @@@ static int nvme_rdma_create_qp(struct n
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;
+ if (queue->pi_support)
+ init_attr.create_flags |= IB_QP_CREATE_INTEGRITY_EN;
ret = rdma_create_qp(queue->cm_id, dev->pd, &init_attr);
@@@ -426,43 -437,18 +447,49 @@@ static void nvme_rdma_destroy_queue_ib(
nvme_rdma_dev_put(dev);
}
- static int nvme_rdma_get_max_fr_pages(struct ib_device *ibdev)
+ static int nvme_rdma_get_max_fr_pages(struct ib_device *ibdev, bool pi_support)
{
- return min_t(u32, NVME_RDMA_MAX_SEGMENTS,
- ibdev->attrs.max_fast_reg_page_list_len - 1);
+ u32 max_page_list_len;
+
+ if (pi_support)
+ max_page_list_len = ibdev->attrs.max_pi_fast_reg_page_list_len;
+ else
+ max_page_list_len = ibdev->attrs.max_fast_reg_page_list_len;
+
+ return min_t(u32, NVME_RDMA_MAX_SEGMENTS, max_page_list_len - 1);
}
+static int nvme_rdma_create_cq(struct ib_device *ibdev,
+ struct nvme_rdma_queue *queue)
+{
+ int ret, comp_vector, idx = nvme_rdma_queue_idx(queue);
+ enum ib_poll_context poll_ctx;
+
+ /*
+ * 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;
+
+ /* Polling queues need direct cq polling context */
+ if (nvme_rdma_poll_queue(queue)) {
+ poll_ctx = IB_POLL_DIRECT;
+ queue->ib_cq = ib_alloc_cq(ibdev, queue, queue->cq_size,
+ comp_vector, poll_ctx);
+ } else {
+ poll_ctx = IB_POLL_SOFTIRQ;
+ queue->ib_cq = ib_cq_pool_get(ibdev, queue->cq_size,
+ comp_vector, poll_ctx);
+ }
+
+ if (IS_ERR(queue->ib_cq)) {
+ ret = PTR_ERR(queue->ib_cq);
+ return ret;
+ }
+
+ return 0;
+}
+
static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue)
{
struct ib_device *ibdev;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2020-06-02 2:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-02 2:48 Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-02 2:56 linux-next: manual merge of the block tree with the rdma tree Stephen Rothwell
2020-06-02 8:37 ` Max Gurtovoy
2020-06-02 10:43 ` Stephen Rothwell
2020-06-02 19:01 ` Jason Gunthorpe
2020-06-02 19:02 ` Jens Axboe
2020-06-02 19:09 ` Jason Gunthorpe
2020-06-02 21:37 ` Jens Axboe
2020-06-02 22:40 ` Max Gurtovoy
2020-06-02 23:32 ` Jason Gunthorpe
2020-06-03 10:56 ` Max Gurtovoy
2018-07-26 3:58 Stephen Rothwell
2018-08-15 1:45 ` Stephen Rothwell
2018-08-15 19:26 ` Jason Gunthorpe
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=20200602124824.4293d0dc@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=axboe@kernel.dk \
--cc=dledford@redhat.com \
--cc=hch@lst.de \
--cc=jgg@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=maxg@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 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).