linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] NFS/RDMA server patches for 3.17
@ 2014-07-22 20:00 Chuck Lever
  2014-07-22 20:00 ` [PATCH 1/2] svcrdma: Increase credit limit to 32 Chuck Lever
  2014-07-22 20:00 ` [PATCH 2/2] svcrdma: Add zero padding if the client doesn't send it Chuck Lever
  0 siblings, 2 replies; 5+ messages in thread
From: Chuck Lever @ 2014-07-22 20:00 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

Hi Bruce-

Would you take these server patches for 3.17? Thank you!

---

Chuck Lever (2):
      svcrdma: Add zero padding if the client doesn't send it
      svcrdma: Increase credit limit to 32


 include/linux/sunrpc/svc_rdma.h         |    3 +--
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |   28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 2 deletions(-)

-- 
Chuck Lever

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

* [PATCH 1/2] svcrdma: Increase credit limit to 32
  2014-07-22 20:00 [PATCH 0/2] NFS/RDMA server patches for 3.17 Chuck Lever
@ 2014-07-22 20:00 ` Chuck Lever
  2014-07-22 20:35   ` J. Bruce Fields
  2014-07-22 20:00 ` [PATCH 2/2] svcrdma: Add zero padding if the client doesn't send it Chuck Lever
  1 sibling, 1 reply; 5+ messages in thread
From: Chuck Lever @ 2014-07-22 20:00 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 include/linux/sunrpc/svc_rdma.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index 5cf99a0..975da75 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -174,8 +174,7 @@ struct svcxprt_rdma {
  * page size of 4k, or 32k * 2 ops / 4k = 16 outstanding RDMA_READ.  */
 #define RPCRDMA_ORD             (64/4)
 #define RPCRDMA_SQ_DEPTH_MULT   8
-#define RPCRDMA_MAX_THREADS     16
-#define RPCRDMA_MAX_REQUESTS    16
+#define RPCRDMA_MAX_REQUESTS    32
 #define RPCRDMA_MAX_REQ_SIZE    4096
 
 /* svc_rdma_marshal.c */


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

* [PATCH 2/2] svcrdma: Add zero padding if the client doesn't send it
  2014-07-22 20:00 [PATCH 0/2] NFS/RDMA server patches for 3.17 Chuck Lever
  2014-07-22 20:00 ` [PATCH 1/2] svcrdma: Increase credit limit to 32 Chuck Lever
@ 2014-07-22 20:00 ` Chuck Lever
  1 sibling, 0 replies; 5+ messages in thread
From: Chuck Lever @ 2014-07-22 20:00 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

See RFC 5666 section 3.7: clients don't have to send zero XDR
padding.

BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=246
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
index 8f92a61..e011027 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
@@ -43,6 +43,7 @@
 #include <linux/sunrpc/debug.h>
 #include <linux/sunrpc/rpc_rdma.h>
 #include <linux/spinlock.h>
+#include <linux/highmem.h>
 #include <asm/unaligned.h>
 #include <rdma/ib_verbs.h>
 #include <rdma/rdma_cm.h>
@@ -435,6 +436,32 @@ static int rdma_read_chunks(struct svcxprt_rdma *xprt,
 	return ret;
 }
 
+/*
+ * To avoid a separate RDMA READ just for a handful of zero bytes,
+ * RFC 5666 section 3.7 allows the client to omit the XDR zero pad
+ * in chunk lists.
+ */
+static void
+rdma_fix_xdr_pad(struct xdr_buf *buf)
+{
+	unsigned int page_len = buf->page_len;
+	unsigned int size = (XDR_QUADLEN(page_len) << 2) - page_len;
+	unsigned int offset, pg_no;
+	char *p;
+
+	if (size == 0)
+		return;
+
+	pg_no = page_len >> PAGE_SHIFT;
+	offset = page_len & ~PAGE_MASK;
+	p = page_address(buf->pages[pg_no]);
+	memset(p + offset, 0, size);
+
+	buf->page_len += size;
+	buf->buflen += size;
+	buf->len += size;
+}
+
 static int rdma_read_complete(struct svc_rqst *rqstp,
 			      struct svc_rdma_op_ctxt *head)
 {
@@ -449,6 +476,7 @@ static int rdma_read_complete(struct svc_rqst *rqstp,
 		rqstp->rq_pages[page_no] = head->pages[page_no];
 	}
 	/* Point rq_arg.pages past header */
+	rdma_fix_xdr_pad(&head->arg);
 	rqstp->rq_arg.pages = &rqstp->rq_pages[head->hdr_count];
 	rqstp->rq_arg.page_len = head->arg.page_len;
 	rqstp->rq_arg.page_base = head->arg.page_base;


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

* Re: [PATCH 1/2] svcrdma: Increase credit limit to 32
  2014-07-22 20:00 ` [PATCH 1/2] svcrdma: Increase credit limit to 32 Chuck Lever
@ 2014-07-22 20:35   ` J. Bruce Fields
  2014-07-22 21:27     ` Chuck Lever
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2014-07-22 20:35 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs

Could I just get a little more of a changelog?  Why (in one sentence)
are we doing this?

--b.

On Tue, Jul 22, 2014 at 04:00:31PM -0400, Chuck Lever wrote:
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> 
>  include/linux/sunrpc/svc_rdma.h |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
> index 5cf99a0..975da75 100644
> --- a/include/linux/sunrpc/svc_rdma.h
> +++ b/include/linux/sunrpc/svc_rdma.h
> @@ -174,8 +174,7 @@ struct svcxprt_rdma {
>   * page size of 4k, or 32k * 2 ops / 4k = 16 outstanding RDMA_READ.  */
>  #define RPCRDMA_ORD             (64/4)
>  #define RPCRDMA_SQ_DEPTH_MULT   8
> -#define RPCRDMA_MAX_THREADS     16
> -#define RPCRDMA_MAX_REQUESTS    16
> +#define RPCRDMA_MAX_REQUESTS    32
>  #define RPCRDMA_MAX_REQ_SIZE    4096
>  
>  /* svc_rdma_marshal.c */
> 

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

* Re: [PATCH 1/2] svcrdma: Increase credit limit to 32
  2014-07-22 20:35   ` J. Bruce Fields
@ 2014-07-22 21:27     ` Chuck Lever
  0 siblings, 0 replies; 5+ messages in thread
From: Chuck Lever @ 2014-07-22 21:27 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing List


On Jul 22, 2014, at 4:35 PM, J. Bruce Fields <bfields@fieldses.org> wrote:

> Could I just get a little more of a changelog?  Why (in one sentence)
> are we doing this?

Apologies, yes, I will resend with an adequate patch description.

> 
> --b.
> 
> On Tue, Jul 22, 2014 at 04:00:31PM -0400, Chuck Lever wrote:
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>> 
>> include/linux/sunrpc/svc_rdma.h |    3 +--
>> 1 files changed, 1 insertions(+), 2 deletions(-)
>> 
>> diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
>> index 5cf99a0..975da75 100644
>> --- a/include/linux/sunrpc/svc_rdma.h
>> +++ b/include/linux/sunrpc/svc_rdma.h
>> @@ -174,8 +174,7 @@ struct svcxprt_rdma {
>>  * page size of 4k, or 32k * 2 ops / 4k = 16 outstanding RDMA_READ.  */
>> #define RPCRDMA_ORD             (64/4)
>> #define RPCRDMA_SQ_DEPTH_MULT   8
>> -#define RPCRDMA_MAX_THREADS     16
>> -#define RPCRDMA_MAX_REQUESTS    16
>> +#define RPCRDMA_MAX_REQUESTS    32
>> #define RPCRDMA_MAX_REQ_SIZE    4096
>> 
>> /* svc_rdma_marshal.c */
>> 

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




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

end of thread, other threads:[~2014-07-22 21:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-22 20:00 [PATCH 0/2] NFS/RDMA server patches for 3.17 Chuck Lever
2014-07-22 20:00 ` [PATCH 1/2] svcrdma: Increase credit limit to 32 Chuck Lever
2014-07-22 20:35   ` J. Bruce Fields
2014-07-22 21:27     ` Chuck Lever
2014-07-22 20:00 ` [PATCH 2/2] svcrdma: Add zero padding if the client doesn't send it Chuck Lever

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).