|
@@ -186,9 +186,9 @@ rpcrdma_convert_kvec(struct kvec *vec, struct rpcrdma_mr_seg *seg, int n)
|
|
|
*/
|
|
|
|
|
|
static int
|
|
|
-rpcrdma_convert_iovs(struct xdr_buf *xdrbuf, unsigned int pos,
|
|
|
- enum rpcrdma_chunktype type, struct rpcrdma_mr_seg *seg,
|
|
|
- bool reminv_expected)
|
|
|
+rpcrdma_convert_iovs(struct rpcrdma_xprt *r_xprt, struct xdr_buf *xdrbuf,
|
|
|
+ unsigned int pos, enum rpcrdma_chunktype type,
|
|
|
+ struct rpcrdma_mr_seg *seg)
|
|
|
{
|
|
|
int len, n, p, page_base;
|
|
|
struct page **ppages;
|
|
@@ -229,14 +229,15 @@ rpcrdma_convert_iovs(struct xdr_buf *xdrbuf, unsigned int pos,
|
|
|
/* When encoding a Read chunk, the tail iovec contains an
|
|
|
* XDR pad and may be omitted.
|
|
|
*/
|
|
|
- if (type == rpcrdma_readch && xprt_rdma_pad_optimize)
|
|
|
+ if (type == rpcrdma_readch && r_xprt->rx_ia.ri_implicit_roundup)
|
|
|
return n;
|
|
|
|
|
|
- /* When encoding the Write list, some servers need to see an extra
|
|
|
- * segment for odd-length Write chunks. The upper layer provides
|
|
|
- * space in the tail iovec for this purpose.
|
|
|
+ /* When encoding a Write chunk, some servers need to see an
|
|
|
+ * extra segment for non-XDR-aligned Write chunks. The upper
|
|
|
+ * layer provides space in the tail iovec that may be used
|
|
|
+ * for this purpose.
|
|
|
*/
|
|
|
- if (type == rpcrdma_writech && reminv_expected)
|
|
|
+ if (type == rpcrdma_writech && r_xprt->rx_ia.ri_implicit_roundup)
|
|
|
return n;
|
|
|
|
|
|
if (xdrbuf->tail[0].iov_len) {
|
|
@@ -291,7 +292,8 @@ rpcrdma_encode_read_list(struct rpcrdma_xprt *r_xprt,
|
|
|
if (rtype == rpcrdma_areadch)
|
|
|
pos = 0;
|
|
|
seg = req->rl_segments;
|
|
|
- nsegs = rpcrdma_convert_iovs(&rqst->rq_snd_buf, pos, rtype, seg, false);
|
|
|
+ nsegs = rpcrdma_convert_iovs(r_xprt, &rqst->rq_snd_buf, pos,
|
|
|
+ rtype, seg);
|
|
|
if (nsegs < 0)
|
|
|
return ERR_PTR(nsegs);
|
|
|
|
|
@@ -353,10 +355,9 @@ rpcrdma_encode_write_list(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req,
|
|
|
}
|
|
|
|
|
|
seg = req->rl_segments;
|
|
|
- nsegs = rpcrdma_convert_iovs(&rqst->rq_rcv_buf,
|
|
|
+ nsegs = rpcrdma_convert_iovs(r_xprt, &rqst->rq_rcv_buf,
|
|
|
rqst->rq_rcv_buf.head[0].iov_len,
|
|
|
- wtype, seg,
|
|
|
- r_xprt->rx_ia.ri_reminv_expected);
|
|
|
+ wtype, seg);
|
|
|
if (nsegs < 0)
|
|
|
return ERR_PTR(nsegs);
|
|
|
|
|
@@ -421,8 +422,7 @@ rpcrdma_encode_reply_chunk(struct rpcrdma_xprt *r_xprt,
|
|
|
}
|
|
|
|
|
|
seg = req->rl_segments;
|
|
|
- nsegs = rpcrdma_convert_iovs(&rqst->rq_rcv_buf, 0, wtype, seg,
|
|
|
- r_xprt->rx_ia.ri_reminv_expected);
|
|
|
+ nsegs = rpcrdma_convert_iovs(r_xprt, &rqst->rq_rcv_buf, 0, wtype, seg);
|
|
|
if (nsegs < 0)
|
|
|
return ERR_PTR(nsegs);
|
|
|
|