From: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: [PATCH v1 16/17] svcrdma: Clean up after converting svc_rdma_recvfrom to rdma_rw API Date: Tue, 30 May 2017 14:16:10 -0400 [thread overview] Message-ID: <20170530181610.2992.59462.stgit@klimt.1015granger.net> (raw) In-Reply-To: <20170530175808.2992.60365.stgit-Hs+gFlyCn65vLzlybtyyYzGyq/o6K9yX@public.gmane.org> Clean up: Registration mode details are now handled by the rdma_rw API, and thus can be removed from svcrdma. Signed-off-by: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> --- include/linux/sunrpc/svc_rdma.h | 4 --- net/sunrpc/xprtrdma/svc_rdma_transport.c | 39 +++--------------------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index fd7775f..995c6fe 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h @@ -90,9 +90,6 @@ struct svc_rdma_op_ctxt { struct page *pages[RPCSVC_MAXPAGES]; }; -#define SVCRDMA_DEVCAP_FAST_REG 1 /* fast mr registration */ -#define SVCRDMA_DEVCAP_READ_W_INV 2 /* read w/ invalidate */ - struct svcxprt_rdma { struct svc_xprt sc_xprt; /* SVC transport structure */ struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ @@ -123,7 +120,6 @@ struct svcxprt_rdma { struct ib_qp *sc_qp; struct ib_cq *sc_rq_cq; struct ib_cq *sc_sq_cq; - u32 sc_dev_caps; /* distilled device caps */ spinlock_t sc_lock; /* transport lock */ diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 75bd11f..e660d49 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -783,7 +783,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) memset(&qp_attr, 0, sizeof qp_attr); qp_attr.event_handler = qp_event_handler; qp_attr.qp_context = &newxprt->sc_xprt; - qp_attr.port_num = newxprt->sc_cm_id->port_num; + qp_attr.port_num = newxprt->sc_port_num; qp_attr.cap.max_rdma_ctxs = newxprt->sc_max_requests; qp_attr.cap.max_send_wr = newxprt->sc_sq_depth; qp_attr.cap.max_recv_wr = newxprt->sc_rq_depth; @@ -807,43 +807,12 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) } newxprt->sc_qp = newxprt->sc_cm_id->qp; - /* - * Use the most secure set of MR resources based on the - * transport type and available memory management features in - * the device. Here's the table implemented below: - * - * Fast Global DMA Remote WR - * Reg LKEY MR Access - * Sup'd Sup'd Needed Needed - * - * IWARP N N Y Y - * N Y Y Y - * Y N Y N - * Y Y N - - * - * IB N N Y N - * N Y N - - * Y N Y N - * Y Y N - - * - * NB: iWARP requires remote write access for the data sink - * of an RDMA_READ. IB does not. - */ - if (dev->attrs.device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) { - newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_FAST_REG; - } else + if (!(dev->attrs.device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS)) newxprt->sc_snd_w_inv = false; - - /* - * Determine if a DMA MR is required and if so, what privs are required - */ - if (!rdma_protocol_iwarp(dev, newxprt->sc_cm_id->port_num) && - !rdma_ib_or_roce(dev, newxprt->sc_cm_id->port_num)) + if (!rdma_protocol_iwarp(dev, newxprt->sc_port_num) && + !rdma_ib_or_roce(dev, newxprt->sc_port_num)) goto errout; - if (rdma_protocol_iwarp(dev, newxprt->sc_cm_id->port_num)) - newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_READ_W_INV; - /* Post receive buffers */ for (i = 0; i < newxprt->sc_max_requests; i++) { ret = svc_rdma_post_recv(newxprt, GFP_KERNEL); -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Chuck Lever <chuck.lever@oracle.com> To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH v1 16/17] svcrdma: Clean up after converting svc_rdma_recvfrom to rdma_rw API Date: Tue, 30 May 2017 14:16:10 -0400 [thread overview] Message-ID: <20170530181610.2992.59462.stgit@klimt.1015granger.net> (raw) In-Reply-To: <20170530175808.2992.60365.stgit@klimt.1015granger.net> Clean up: Registration mode details are now handled by the rdma_rw API, and thus can be removed from svcrdma. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- include/linux/sunrpc/svc_rdma.h | 4 --- net/sunrpc/xprtrdma/svc_rdma_transport.c | 39 +++--------------------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index fd7775f..995c6fe 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h @@ -90,9 +90,6 @@ struct svc_rdma_op_ctxt { struct page *pages[RPCSVC_MAXPAGES]; }; -#define SVCRDMA_DEVCAP_FAST_REG 1 /* fast mr registration */ -#define SVCRDMA_DEVCAP_READ_W_INV 2 /* read w/ invalidate */ - struct svcxprt_rdma { struct svc_xprt sc_xprt; /* SVC transport structure */ struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ @@ -123,7 +120,6 @@ struct svcxprt_rdma { struct ib_qp *sc_qp; struct ib_cq *sc_rq_cq; struct ib_cq *sc_sq_cq; - u32 sc_dev_caps; /* distilled device caps */ spinlock_t sc_lock; /* transport lock */ diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 75bd11f..e660d49 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -783,7 +783,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) memset(&qp_attr, 0, sizeof qp_attr); qp_attr.event_handler = qp_event_handler; qp_attr.qp_context = &newxprt->sc_xprt; - qp_attr.port_num = newxprt->sc_cm_id->port_num; + qp_attr.port_num = newxprt->sc_port_num; qp_attr.cap.max_rdma_ctxs = newxprt->sc_max_requests; qp_attr.cap.max_send_wr = newxprt->sc_sq_depth; qp_attr.cap.max_recv_wr = newxprt->sc_rq_depth; @@ -807,43 +807,12 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) } newxprt->sc_qp = newxprt->sc_cm_id->qp; - /* - * Use the most secure set of MR resources based on the - * transport type and available memory management features in - * the device. Here's the table implemented below: - * - * Fast Global DMA Remote WR - * Reg LKEY MR Access - * Sup'd Sup'd Needed Needed - * - * IWARP N N Y Y - * N Y Y Y - * Y N Y N - * Y Y N - - * - * IB N N Y N - * N Y N - - * Y N Y N - * Y Y N - - * - * NB: iWARP requires remote write access for the data sink - * of an RDMA_READ. IB does not. - */ - if (dev->attrs.device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) { - newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_FAST_REG; - } else + if (!(dev->attrs.device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS)) newxprt->sc_snd_w_inv = false; - - /* - * Determine if a DMA MR is required and if so, what privs are required - */ - if (!rdma_protocol_iwarp(dev, newxprt->sc_cm_id->port_num) && - !rdma_ib_or_roce(dev, newxprt->sc_cm_id->port_num)) + if (!rdma_protocol_iwarp(dev, newxprt->sc_port_num) && + !rdma_ib_or_roce(dev, newxprt->sc_port_num)) goto errout; - if (rdma_protocol_iwarp(dev, newxprt->sc_cm_id->port_num)) - newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_READ_W_INV; - /* Post receive buffers */ for (i = 0; i < newxprt->sc_max_requests; i++) { ret = svc_rdma_post_recv(newxprt, GFP_KERNEL);
next prev parent reply other threads:[~2017-05-30 18:16 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-05-30 18:14 [PATCH v1 00/17] Server-side NFS/RDMA changes proposed for v4.13 Chuck Lever 2017-05-30 18:14 ` Chuck Lever [not found] ` <20170530175808.2992.60365.stgit-Hs+gFlyCn65vLzlybtyyYzGyq/o6K9yX@public.gmane.org> 2017-05-30 18:14 ` [PATCH v1 01/17] ib_core: Enable and expose force_mr module parameter Chuck Lever 2017-05-30 18:14 ` Chuck Lever [not found] ` <20170530181410.2992.90842.stgit-Hs+gFlyCn65vLzlybtyyYzGyq/o6K9yX@public.gmane.org> 2017-05-31 4:36 ` Leon Romanovsky 2017-05-31 4:36 ` Leon Romanovsky 2017-05-30 18:14 ` [PATCH v1 02/17] svcrdma: Squelch disconnection messages Chuck Lever 2017-05-30 18:14 ` Chuck Lever 2017-05-30 18:14 ` [PATCH v1 03/17] svcrdma: Avoid Send Queue overflow Chuck Lever 2017-05-30 18:14 ` Chuck Lever 2017-05-30 18:14 ` [PATCH v1 04/17] svcrdma: Remove svc_rdma_marshal.c Chuck Lever 2017-05-30 18:14 ` Chuck Lever 2017-05-30 18:14 ` [PATCH v1 05/17] svcrdma: Improve Read chunk sanity checking Chuck Lever 2017-05-30 18:14 ` Chuck Lever 2017-05-30 18:14 ` [PATCH v1 06/17] svcrdma: Improve Write " Chuck Lever 2017-05-30 18:14 ` Chuck Lever 2017-05-30 18:14 ` [PATCH v1 07/17] svcrdma: Improve Reply " Chuck Lever 2017-05-30 18:14 ` Chuck Lever 2017-05-30 18:15 ` [PATCH v1 08/17] svcrdma: Don't account for Receive queue "starvation" Chuck Lever 2017-05-30 18:15 ` Chuck Lever 2017-05-30 18:15 ` [PATCH v1 09/17] sunrpc: Allocate one more page per svc_rqst Chuck Lever 2017-05-30 18:15 ` Chuck Lever 2017-05-30 18:15 ` [PATCH v1 10/17] svcrdma: Add recvfrom helpers to svc_rdma_rw.c Chuck Lever 2017-05-30 18:15 ` Chuck Lever 2017-05-30 18:15 ` [PATCH v1 11/17] svcrdma: Use generic RDMA R/W API in RPC Call path Chuck Lever 2017-05-30 18:15 ` Chuck Lever 2017-05-30 18:15 ` [PATCH v1 12/17] svcrdma: Properly compute .len and .buflen for received RPC Calls Chuck Lever 2017-05-30 18:15 ` Chuck Lever 2017-05-30 18:15 ` [PATCH v1 13/17] svcrdma: Remove unused Read completion handlers Chuck Lever 2017-05-30 18:15 ` Chuck Lever 2017-05-30 18:15 ` [PATCH v1 14/17] svcrdma: Remove frmr cache Chuck Lever 2017-05-30 18:15 ` Chuck Lever 2017-05-30 18:16 ` [PATCH v1 15/17] svcrdma: Clean-up svc_rdma_unmap_dma Chuck Lever 2017-05-30 18:16 ` Chuck Lever 2017-05-30 18:16 ` Chuck Lever [this message] 2017-05-30 18:16 ` [PATCH v1 16/17] svcrdma: Clean up after converting svc_rdma_recvfrom to rdma_rw API Chuck Lever 2017-05-30 18:16 ` [PATCH v1 17/17] svcrdma: use offset_in_page() macro Chuck Lever 2017-05-30 18:16 ` Chuck Lever
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=20170530181610.2992.59462.stgit@klimt.1015granger.net \ --to=chuck.lever-qhclzuegtsvqt0dzr+alfa@public.gmane.org \ --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ /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: linkBe 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.