From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anna Schumaker Subject: Re: [PATCH v1 05/12] xprtrdma: Account for RPC/RDMA header size when deciding to inline Date: Fri, 10 Jul 2015 16:08:48 -0400 Message-ID: <55A02650.1050809@Netapp.com> References: <20150709203242.26247.4848.stgit@manet.1015granger.net> <20150709204227.26247.51111.stgit@manet.1015granger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20150709204227.26247.51111.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Chuck Lever , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rdma@vger.kernel.org Hi Chuck, On 07/09/2015 04:42 PM, Chuck Lever wrote: > When marshaling RPC/RDMA requests, ensure the combined size of > RPC/RDMA header and RPC header do not exceed the inline threshold. > Endpoints typically reject RPC/RDMA messages that exceed the size > of their receive buffers. >=20 > Signed-off-by: Chuck Lever > --- > net/sunrpc/xprtrdma/rpc_rdma.c | 29 +++++++++++++++++++++++++++-- > 1 file changed, 27 insertions(+), 2 deletions(-) >=20 > diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc= _rdma.c > index 84ea37d..8cf9402 100644 > --- a/net/sunrpc/xprtrdma/rpc_rdma.c > +++ b/net/sunrpc/xprtrdma/rpc_rdma.c > @@ -71,6 +71,31 @@ static const char transfertypes[][12] =3D { > }; > #endif > =20 > +/* The client can send a request inline as long as the RPCRDMA heade= r > + * plus the RPC call fit under the transport's inline limit. If the > + * combined call message size exceeds that limit, the client must us= e > + * the read chunk list for this operation. > + */ > +static bool rpcrdma_args_inline(struct rpc_rqst *rqst) > +{ > + unsigned int callsize =3D RPCRDMA_HDRLEN_MIN + rqst->rq_snd_buf.len= ; > + > + return callsize <=3D RPCRDMA_INLINE_WRITE_THRESHOLD(rqst); > +} > + > +/* The client can=E2=80=99t know how large the actual reply will be.= Thus it ^^^^^ This is showing up as "can<80><99>t" in git-show, leading me to think t= hat the apostrophe was replaced with a unicode-apostrophe. Google migh= t have made the switch, but can you double check the patch on your side= just in case? Thanks, Anna > + * plans for the largest possible reply for that particular ULP > + * operation. If the maximum combined reply message size exceeds tha= t > + * limit, the client must provide a write list or a reply chunk for > + * this request. > + */ > +static bool rpcrdma_results_inline(struct rpc_rqst *rqst) > +{ > + unsigned int repsize =3D RPCRDMA_HDRLEN_MIN + rqst->rq_rcv_buf.bufl= en; > + > + return repsize <=3D RPCRDMA_INLINE_READ_THRESHOLD(rqst); > +} > + > /* > * Chunk assembly from upper layer xdr_buf. > * > @@ -418,7 +443,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst) > * a READ, then use write chunks to separate the file data > * into pages; otherwise use reply chunks. > */ > - if (rqst->rq_rcv_buf.buflen <=3D RPCRDMA_INLINE_READ_THRESHOLD(rqst= )) > + if (rpcrdma_results_inline(rqst)) > wtype =3D rpcrdma_noch; > else if (rqst->rq_rcv_buf.page_len =3D=3D 0) > wtype =3D rpcrdma_replych; > @@ -441,7 +466,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst) > * implies the op is a write. > * TBD check NFSv4 setacl > */ > - if (rqst->rq_snd_buf.len <=3D RPCRDMA_INLINE_WRITE_THRESHOLD(rqst)) > + if (rpcrdma_args_inline(rqst)) > rtype =3D rpcrdma_noch; > else if (rqst->rq_snd_buf.page_len =3D=3D 0) > rtype =3D rpcrdma_areadch; >=20 > -- > 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 >=20 -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx143.netapp.com ([216.240.21.24]:4589 "EHLO mx143.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932641AbbGJUIy (ORCPT ); Fri, 10 Jul 2015 16:08:54 -0400 Subject: Re: [PATCH v1 05/12] xprtrdma: Account for RPC/RDMA header size when deciding to inline To: Chuck Lever , , References: <20150709203242.26247.4848.stgit@manet.1015granger.net> <20150709204227.26247.51111.stgit@manet.1015granger.net> From: Anna Schumaker Message-ID: <55A02650.1050809@Netapp.com> Date: Fri, 10 Jul 2015 16:08:48 -0400 MIME-Version: 1.0 In-Reply-To: <20150709204227.26247.51111.stgit@manet.1015granger.net> Content-Type: text/plain; charset="utf-8" Sender: linux-nfs-owner@vger.kernel.org List-ID: Hi Chuck, On 07/09/2015 04:42 PM, Chuck Lever wrote: > When marshaling RPC/RDMA requests, ensure the combined size of > RPC/RDMA header and RPC header do not exceed the inline threshold. > Endpoints typically reject RPC/RDMA messages that exceed the size > of their receive buffers. > > Signed-off-by: Chuck Lever > --- > net/sunrpc/xprtrdma/rpc_rdma.c | 29 +++++++++++++++++++++++++++-- > 1 file changed, 27 insertions(+), 2 deletions(-) > > diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c > index 84ea37d..8cf9402 100644 > --- a/net/sunrpc/xprtrdma/rpc_rdma.c > +++ b/net/sunrpc/xprtrdma/rpc_rdma.c > @@ -71,6 +71,31 @@ static const char transfertypes[][12] = { > }; > #endif > > +/* The client can send a request inline as long as the RPCRDMA header > + * plus the RPC call fit under the transport's inline limit. If the > + * combined call message size exceeds that limit, the client must use > + * the read chunk list for this operation. > + */ > +static bool rpcrdma_args_inline(struct rpc_rqst *rqst) > +{ > + unsigned int callsize = RPCRDMA_HDRLEN_MIN + rqst->rq_snd_buf.len; > + > + return callsize <= RPCRDMA_INLINE_WRITE_THRESHOLD(rqst); > +} > + > +/* The client can’t know how large the actual reply will be. Thus it ^^^^^ This is showing up as "can<80><99>t" in git-show, leading me to think that the apostrophe was replaced with a unicode-apostrophe. Google might have made the switch, but can you double check the patch on your side just in case? Thanks, Anna > + * plans for the largest possible reply for that particular ULP > + * operation. If the maximum combined reply message size exceeds that > + * limit, the client must provide a write list or a reply chunk for > + * this request. > + */ > +static bool rpcrdma_results_inline(struct rpc_rqst *rqst) > +{ > + unsigned int repsize = RPCRDMA_HDRLEN_MIN + rqst->rq_rcv_buf.buflen; > + > + return repsize <= RPCRDMA_INLINE_READ_THRESHOLD(rqst); > +} > + > /* > * Chunk assembly from upper layer xdr_buf. > * > @@ -418,7 +443,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst) > * a READ, then use write chunks to separate the file data > * into pages; otherwise use reply chunks. > */ > - if (rqst->rq_rcv_buf.buflen <= RPCRDMA_INLINE_READ_THRESHOLD(rqst)) > + if (rpcrdma_results_inline(rqst)) > wtype = rpcrdma_noch; > else if (rqst->rq_rcv_buf.page_len == 0) > wtype = rpcrdma_replych; > @@ -441,7 +466,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst) > * implies the op is a write. > * TBD check NFSv4 setacl > */ > - if (rqst->rq_snd_buf.len <= RPCRDMA_INLINE_WRITE_THRESHOLD(rqst)) > + if (rpcrdma_args_inline(rqst)) > rtype = rpcrdma_noch; > else if (rqst->rq_snd_buf.page_len == 0) > rtype = rpcrdma_areadch; > > -- > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >