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>
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 4089440..c81749b 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1078,30 +1078,14 @@
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 @@
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);
}