aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-09 11:33:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-09 11:33:31 -0400
commit26d2177e977c912863ac04f6c1a967e793ca3a56 (patch)
tree48da04fb0b947cfa404747690d7081b657e33221 /net/sunrpc
parenta794b4f3292160bb3fd0f1f90ec8df454e3b17b3 (diff)
parentd1178cbcdcf91900ccf10a177350d7945703c151 (diff)
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Pull inifiniband/rdma updates from Doug Ledford: "This is a fairly sizeable set of changes. I've put them through a decent amount of testing prior to sending the pull request due to that. There are still a few fixups that I know are coming, but I wanted to go ahead and get the big, sizable chunk into your hands sooner rather than waiting for those last few fixups. Of note is the fact that this creates what is intended to be a temporary area in the drivers/staging tree specifically for some cleanups and additions that are coming for the RDMA stack. We deprecated two drivers (ipath and amso1100) and are waiting to hear back if we can deprecate another one (ehca). We also put Intel's new hfi1 driver into this area because it needs to be refactored and a transfer library created out of the factored out code, and then it and the qib driver and the soft-roce driver should all be modified to use that library. I expect drivers/staging/rdma to be around for three or four kernel releases and then to go away as all of the work is completed and final deletions of deprecated drivers are done. Summary of changes for 4.3: - Create drivers/staging/rdma - Move amso1100 driver to staging/rdma and schedule for deletion - Move ipath driver to staging/rdma and schedule for deletion - Add hfi1 driver to staging/rdma and set TODO for move to regular tree - Initial support for namespaces to be used on RDMA devices - Add RoCE GID table handling to the RDMA core caching code - Infrastructure to support handling of devices with differing read and write scatter gather capabilities - Various iSER updates - Kill off unsafe usage of global mr registrations - Update SRP driver - Misc mlx4 driver updates - Support for the mr_alloc verb - Support for a netlink interface between kernel and user space cache daemon to speed path record queries and route resolution - Ininitial support for safe hot removal of verbs devices" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (136 commits) IB/ipoib: Suppress warning for send only join failures IB/ipoib: Clean up send-only multicast joins IB/srp: Fix possible protection fault IB/core: Move SM class defines from ib_mad.h to ib_smi.h IB/core: Remove unnecessary defines from ib_mad.h IB/hfi1: Add PSM2 user space header to header_install IB/hfi1: Add CSRs for CONFIG_SDMA_VERBOSITY mlx5: Fix incorrect wc pkey_index assignment for GSI messages IB/mlx5: avoid destroying a NULL mr in reg_user_mr error flow IB/uverbs: reject invalid or unknown opcodes IB/cxgb4: Fix if statement in pick_local_ip6adddrs IB/sa: Fix rdma netlink message flags IB/ucma: HW Device hot-removal support IB/mlx4_ib: Disassociate support IB/uverbs: Enable device removal when there are active user space applications IB/uverbs: Explicitly pass ib_dev to uverbs commands IB/uverbs: Fix race between ib_uverbs_open and remove_one IB/uverbs: Fix reference counting usage of event files IB/core: Make ib_dealloc_pd return void IB/srp: Create an insecure all physical rkey only if needed ...
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtrdma/frwr_ops.c6
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_recvfrom.c12
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_transport.c10
-rw-r--r--net/sunrpc/xprtrdma/verbs.c2
4 files changed, 13 insertions, 17 deletions
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
index 63f282e770b8..d6653f5d0830 100644
--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -117,7 +117,7 @@ __frwr_recovery_worker(struct work_struct *work)
117 if (ib_dereg_mr(r->r.frmr.fr_mr)) 117 if (ib_dereg_mr(r->r.frmr.fr_mr))
118 goto out_fail; 118 goto out_fail;
119 119
120 r->r.frmr.fr_mr = ib_alloc_fast_reg_mr(pd, depth); 120 r->r.frmr.fr_mr = ib_alloc_mr(pd, IB_MR_TYPE_MEM_REG, depth);
121 if (IS_ERR(r->r.frmr.fr_mr)) 121 if (IS_ERR(r->r.frmr.fr_mr))
122 goto out_fail; 122 goto out_fail;
123 123
@@ -148,7 +148,7 @@ __frwr_init(struct rpcrdma_mw *r, struct ib_pd *pd, struct ib_device *device,
148 struct rpcrdma_frmr *f = &r->r.frmr; 148 struct rpcrdma_frmr *f = &r->r.frmr;
149 int rc; 149 int rc;
150 150
151 f->fr_mr = ib_alloc_fast_reg_mr(pd, depth); 151 f->fr_mr = ib_alloc_mr(pd, IB_MR_TYPE_MEM_REG, depth);
152 if (IS_ERR(f->fr_mr)) 152 if (IS_ERR(f->fr_mr))
153 goto out_mr_err; 153 goto out_mr_err;
154 f->fr_pgl = ib_alloc_fast_reg_page_list(device, depth); 154 f->fr_pgl = ib_alloc_fast_reg_page_list(device, depth);
@@ -158,7 +158,7 @@ __frwr_init(struct rpcrdma_mw *r, struct ib_pd *pd, struct ib_device *device,
158 158
159out_mr_err: 159out_mr_err:
160 rc = PTR_ERR(f->fr_mr); 160 rc = PTR_ERR(f->fr_mr);
161 dprintk("RPC: %s: ib_alloc_fast_reg_mr status %i\n", 161 dprintk("RPC: %s: ib_alloc_mr status %i\n",
162 __func__, rc); 162 __func__, rc);
163 return rc; 163 return rc;
164 164
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
index 2e1348bde325..cb5174284074 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
@@ -115,15 +115,6 @@ static void rdma_build_arg_xdr(struct svc_rqst *rqstp,
115 rqstp->rq_arg.tail[0].iov_len = 0; 115 rqstp->rq_arg.tail[0].iov_len = 0;
116} 116}
117 117
118static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
119{
120 if (!rdma_cap_read_multi_sge(xprt->sc_cm_id->device,
121 xprt->sc_cm_id->port_num))
122 return 1;
123 else
124 return min_t(int, sge_count, xprt->sc_max_sge);
125}
126
127/* Issue an RDMA_READ using the local lkey to map the data sink */ 118/* Issue an RDMA_READ using the local lkey to map the data sink */
128int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt, 119int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt,
129 struct svc_rqst *rqstp, 120 struct svc_rqst *rqstp,
@@ -144,8 +135,7 @@ int rdma_read_chunk_lcl(struct svcxprt_rdma *xprt,
144 135
145 ctxt->direction = DMA_FROM_DEVICE; 136 ctxt->direction = DMA_FROM_DEVICE;
146 ctxt->read_hdr = head; 137 ctxt->read_hdr = head;
147 pages_needed = 138 pages_needed = min_t(int, pages_needed, xprt->sc_max_sge_rd);
148 min_t(int, pages_needed, rdma_read_max_sge(xprt, pages_needed));
149 read = min_t(int, pages_needed << PAGE_SHIFT, rs_length); 139 read = min_t(int, pages_needed << PAGE_SHIFT, rs_length);
150 140
151 for (pno = 0; pno < pages_needed; pno++) { 141 for (pno = 0; pno < pages_needed; pno++) {
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 21e40365042c..fcc3eb80c265 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -734,17 +734,19 @@ static struct svc_rdma_fastreg_mr *rdma_alloc_frmr(struct svcxprt_rdma *xprt)
734 struct ib_mr *mr; 734 struct ib_mr *mr;
735 struct ib_fast_reg_page_list *pl; 735 struct ib_fast_reg_page_list *pl;
736 struct svc_rdma_fastreg_mr *frmr; 736 struct svc_rdma_fastreg_mr *frmr;
737 u32 num_sg;
737 738
738 frmr = kmalloc(sizeof(*frmr), GFP_KERNEL); 739 frmr = kmalloc(sizeof(*frmr), GFP_KERNEL);
739 if (!frmr) 740 if (!frmr)
740 goto err; 741 goto err;
741 742
742 mr = ib_alloc_fast_reg_mr(xprt->sc_pd, RPCSVC_MAXPAGES); 743 num_sg = min_t(u32, RPCSVC_MAXPAGES, xprt->sc_frmr_pg_list_len);
744 mr = ib_alloc_mr(xprt->sc_pd, IB_MR_TYPE_MEM_REG, num_sg);
743 if (IS_ERR(mr)) 745 if (IS_ERR(mr))
744 goto err_free_frmr; 746 goto err_free_frmr;
745 747
746 pl = ib_alloc_fast_reg_page_list(xprt->sc_cm_id->device, 748 pl = ib_alloc_fast_reg_page_list(xprt->sc_cm_id->device,
747 RPCSVC_MAXPAGES); 749 num_sg);
748 if (IS_ERR(pl)) 750 if (IS_ERR(pl))
749 goto err_free_mr; 751 goto err_free_mr;
750 752
@@ -873,6 +875,8 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
873 * capabilities of this particular device */ 875 * capabilities of this particular device */
874 newxprt->sc_max_sge = min((size_t)devattr.max_sge, 876 newxprt->sc_max_sge = min((size_t)devattr.max_sge,
875 (size_t)RPCSVC_MAXPAGES); 877 (size_t)RPCSVC_MAXPAGES);
878 newxprt->sc_max_sge_rd = min_t(size_t, devattr.max_sge_rd,
879 RPCSVC_MAXPAGES);
876 newxprt->sc_max_requests = min((size_t)devattr.max_qp_wr, 880 newxprt->sc_max_requests = min((size_t)devattr.max_qp_wr,
877 (size_t)svcrdma_max_requests); 881 (size_t)svcrdma_max_requests);
878 newxprt->sc_sq_depth = RPCRDMA_SQ_DEPTH_MULT * newxprt->sc_max_requests; 882 newxprt->sc_sq_depth = RPCRDMA_SQ_DEPTH_MULT * newxprt->sc_max_requests;
@@ -1047,6 +1051,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
1047 " remote_ip : %pI4\n" 1051 " remote_ip : %pI4\n"
1048 " remote_port : %d\n" 1052 " remote_port : %d\n"
1049 " max_sge : %d\n" 1053 " max_sge : %d\n"
1054 " max_sge_rd : %d\n"
1050 " sq_depth : %d\n" 1055 " sq_depth : %d\n"
1051 " max_requests : %d\n" 1056 " max_requests : %d\n"
1052 " ord : %d\n", 1057 " ord : %d\n",
@@ -1060,6 +1065,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
1060 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> 1065 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id->
1061 route.addr.dst_addr)->sin_port), 1066 route.addr.dst_addr)->sin_port),
1062 newxprt->sc_max_sge, 1067 newxprt->sc_max_sge,
1068 newxprt->sc_max_sge_rd,
1063 newxprt->sc_sq_depth, 1069 newxprt->sc_sq_depth,
1064 newxprt->sc_max_requests, 1070 newxprt->sc_max_requests,
1065 newxprt->sc_ord); 1071 newxprt->sc_ord);
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index f73d7a71035c..682996779970 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -611,7 +611,7 @@ rpcrdma_ia_close(struct rpcrdma_ia *ia)
611 611
612 /* If the pd is still busy, xprtrdma missed freeing a resource */ 612 /* If the pd is still busy, xprtrdma missed freeing a resource */
613 if (ia->ri_pd && !IS_ERR(ia->ri_pd)) 613 if (ia->ri_pd && !IS_ERR(ia->ri_pd))
614 WARN_ON(ib_dealloc_pd(ia->ri_pd)); 614 ib_dealloc_pd(ia->ri_pd);
615} 615}
616 616
617/* 617/*