summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtrdma/verbs.c
diff options
context:
space:
mode:
authorChuck Lever2015-01-21 17:04:16 +0100
committerAnna Schumaker2015-01-30 16:47:49 +0100
commit85275c874eaeb92fb2a78a1d4ebb1ff4b0f7b732 (patch)
treea9816da15586ef6b23196992dd777e3656fb9f6b /net/sunrpc/xprtrdma/verbs.c
parentxprtrdma: Allocate RPC send buffer separately from struct rpcrdma_req (diff)
downloadkernel-qcow2-linux-85275c874eaeb92fb2a78a1d4ebb1ff4b0f7b732.tar.gz
kernel-qcow2-linux-85275c874eaeb92fb2a78a1d4ebb1ff4b0f7b732.tar.xz
kernel-qcow2-linux-85275c874eaeb92fb2a78a1d4ebb1ff4b0f7b732.zip
xprtrdma: Allocate RPC/RDMA send buffer separately from struct rpcrdma_req
The rl_base field is currently the buffer where each RPC/RDMA call header is built. The inline threshold is an agreed-on size limit to for RDMA SEND operations that pass between client and server. The sum of the RPC/RDMA header size and the RPC header size must be less than or equal to this threshold. Increasing the r/wsize maximum will require MAX_SEGS to grow significantly, but the inline threshold size won't change (both sides agree on it). The server's inline threshold doesn't change. Since an RPC/RDMA header can never be larger than the inline threshold, make all RPC/RDMA header buffers the size of the inline threshold. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma/verbs.c')
-rw-r--r--net/sunrpc/xprtrdma/verbs.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 40894403db81..c81749b9a0de 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1078,30 +1078,14 @@ rpcrdma_ep_disconnect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)
static struct rpcrdma_req *
rpcrdma_create_req(struct rpcrdma_xprt *r_xprt)
{
- struct rpcrdma_create_data_internal *cdata = &r_xprt->rx_data;
- size_t wlen = cdata->inline_wsize;
- struct rpcrdma_ia *ia = &r_xprt->rx_ia;
struct rpcrdma_req *req;
- int rc;
- rc = -ENOMEM;
- req = kmalloc(sizeof(*req) + wlen, GFP_KERNEL);
+ req = kzalloc(sizeof(*req), GFP_KERNEL);
if (req == NULL)
- goto out;
- memset(req, 0, sizeof(*req));
-
- rc = rpcrdma_register_internal(ia, req->rl_base, wlen,
- &req->rl_handle, &req->rl_iov);
- if (rc)
- goto out_free;
+ return ERR_PTR(-ENOMEM);
req->rl_buffer = &r_xprt->rx_buf;
return req;
-
-out_free:
- kfree(req);
-out:
- return ERR_PTR(rc);
}
static struct rpcrdma_rep *
@@ -1333,7 +1317,7 @@ rpcrdma_destroy_req(struct rpcrdma_ia *ia, struct rpcrdma_req *req)
return;
rpcrdma_free_regbuf(ia, req->rl_sendbuf);
- rpcrdma_deregister_internal(ia, req->rl_handle, &req->rl_iov);
+ rpcrdma_free_regbuf(ia, req->rl_rdmabuf);
kfree(req);
}