]> git.openfabrics.org - ~emulex/for-vlad/old/compat-rdma.git/commitdiff
NFSRDMA: Add RHEL6.5 backport Signed-off-by: Jeff Becker <Jeffrey.C.Becker@nasa.gov>
authorJeffrey C. Becker <Jeffrey.C.Becker@nasa.gov>
Tue, 4 Feb 2014 00:17:34 +0000 (16:17 -0800)
committerVladimir Sokolovsky <vlad@mellanox.com>
Tue, 4 Feb 2014 14:41:08 +0000 (16:41 +0200)
patches/0023-nfsrdma-backport-for-RHEL6.5 [new file with mode: 0644]

diff --git a/patches/0023-nfsrdma-backport-for-RHEL6.5 b/patches/0023-nfsrdma-backport-for-RHEL6.5
new file mode 100644 (file)
index 0000000..17bf6f4
--- /dev/null
@@ -0,0 +1,138 @@
+diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c
+index e03725b..410b551 100644
+--- a/net/sunrpc/xprtrdma/rpc_rdma.c
++++ b/net/sunrpc/xprtrdma/rpc_rdma.c
+@@ -338,9 +338,17 @@ rpcrdma_inline_pullup(struct rpc_rqst *rqst, int pad)
+                       curlen = copy_len;
+               dprintk("RPC:       %s: page %d destp 0x%p len %d curlen %d\n",
+                       __func__, i, destp, copy_len, curlen);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
++                srcp = kmap_atomic(ppages[i], KM_SKB_SUNRPC_DATA);
++#else
+               srcp = kmap_atomic(ppages[i]);
++#endif
+               memcpy(destp, srcp+page_base, curlen);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
++                kunmap_atomic(srcp, KM_SKB_SUNRPC_DATA);
++#else
+               kunmap_atomic(srcp);
++#endif
+               rqst->rq_svec[0].iov_len += curlen;
+               destp += curlen;
+               copy_len -= curlen;
+@@ -639,10 +647,18 @@ rpcrdma_inline_fixup(struct rpc_rqst *rqst, char *srcp, int copy_len, int pad)
+                       dprintk("RPC:       %s: page %d"
+                               " srcp 0x%p len %d curlen %d\n",
+                               __func__, i, srcp, copy_len, curlen);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
++                        destp = kmap_atomic(ppages[i], KM_SKB_SUNRPC_DATA);
++#else
+                       destp = kmap_atomic(ppages[i]);
++#endif
+                       memcpy(destp + page_base, srcp, curlen);
+                       flush_dcache_page(ppages[i]);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
++                        kunmap_atomic(destp, KM_SKB_SUNRPC_DATA);
++#else
+                       kunmap_atomic(destp);
++#endif
+                       srcp += curlen;
+                       copy_len -= curlen;
+                       if (copy_len == 0)
+diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+index 0ce7552..afd46ee 100644
+--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
++++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+@@ -524,8 +524,13 @@ next_sge:
+        * Detach res pages. If svc_release sees any it will attempt to
+        * put them.
+        */
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
++        while (rqstp->rq_resused)
++                rqstp->rq_respages[--rqstp->rq_resused] = NULL;
++#else
+       while (rqstp->rq_next_page != rqstp->rq_respages)
+               *(--rqstp->rq_next_page) = NULL;
++#endif
+       return err;
+ }
+@@ -550,7 +555,11 @@ static int rdma_read_complete(struct svc_rqst *rqstp,
+       /* rq_respages starts after the last arg page */
+       rqstp->rq_respages = &rqstp->rq_arg.pages[page_no];
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
++        rqstp->rq_resused = 0;
++#else
+       rqstp->rq_next_page = &rqstp->rq_arg.pages[page_no];
++#endif
+       /* Rebuild rq_arg head and tail. */
+       rqstp->rq_arg.head[0] = head->arg.head[0];
+diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+index c1d124d..59d462d 100644
+--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
++++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+@@ -548,7 +548,9 @@ static int send_reply(struct svcxprt_rdma *rdma,
+       int sge_no;
+       int sge_bytes;
+       int page_no;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+       int pages;
++#endif
+       int ret;
+       /* Post a recv buffer to handle another request. */
+@@ -612,8 +614,12 @@ static int send_reply(struct svcxprt_rdma *rdma,
+        * respages array. They are our pages until the I/O
+        * completes.
+        */
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
++        for (page_no = 0; page_no < rqstp->rq_resused; page_no++) {
++#else
+       pages = rqstp->rq_next_page - rqstp->rq_respages;
+       for (page_no = 0; page_no < pages; page_no++) {
++#endif
+               ctxt->pages[page_no+1] = rqstp->rq_respages[page_no];
+               ctxt->count++;
+               rqstp->rq_respages[page_no] = NULL;
+diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
+index 62e4f9b..f4d65b1 100644
+--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
++++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
+@@ -445,7 +445,11 @@ static struct svcxprt_rdma *rdma_create_xprt(struct svc_serv *serv,
+       if (!cma_xprt)
+               return NULL;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
++      svc_xprt_init(&svc_rdma_class, &cma_xprt->sc_xprt, serv);
++#else
+       svc_xprt_init(&init_net, &svc_rdma_class, &cma_xprt->sc_xprt, serv);
++#endif
+       INIT_LIST_HEAD(&cma_xprt->sc_accept_q);
+       INIT_LIST_HEAD(&cma_xprt->sc_dto_q);
+       INIT_LIST_HEAD(&cma_xprt->sc_rq_dto_q);
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index 285dc08..b53d9f3 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -51,7 +51,9 @@
+ #include <linux/init.h>
+ #include <linux/slab.h>
+ #include <linux/seq_file.h>
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(3,8,0))
+ #include <linux/sunrpc/addr.h>
++#endif
+ #include "xprt_rdma.h"
+@@ -707,7 +709,9 @@ static void xprt_rdma_print_stats(struct rpc_xprt *xprt, struct seq_file *seq)
+ static struct rpc_xprt_ops xprt_rdma_procs = {
+       .reserve_xprt           = xprt_rdma_reserve_xprt,
+       .release_xprt           = xprt_release_xprt_cong, /* sunrpc/xprt.c */
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(3,7,0))
+       .alloc_slot             = xprt_alloc_slot,
++#endif
+       .release_request        = xprt_release_rqst_cong,       /* ditto */
+       .set_retrans_timeout    = xprt_set_retrans_timeout_def, /* ditto */
+       .rpcbind                = rpcb_getport_async,   /* sunrpc/rpcb_clnt.c */