Commit 9929f4ad authored by Chuck Lever's avatar Chuck Lever Committed by Anna Schumaker

xprtrdma: Remove FMR support in rpcrdma_convert_iovs()

Support for FMR was removed by commit ba69cd12 ("xprtrdma:
Remove support for FMR memory registration") [Dec 2018]. That means
the buffer-splitting behavior of rpcrdma_convert_kvec(), added by
commit 821c791a ("xprtrdma: Segment head and tail XDR buffers
on page boundaries") [Mar 2016], is no longer necessary. FRWR
memory registration handles this case with aplomb.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 1e83b173
...@@ -204,9 +204,7 @@ rpcrdma_alloc_sparse_pages(struct xdr_buf *buf) ...@@ -204,9 +204,7 @@ rpcrdma_alloc_sparse_pages(struct xdr_buf *buf)
return 0; return 0;
} }
/* Split @vec on page boundaries into SGEs. FMR registers pages, not /* Convert @vec to a single SGL element.
* a byte range. Other modes coalesce these SGEs into a single MR
* when they can.
* *
* Returns pointer to next available SGE, and bumps the total number * Returns pointer to next available SGE, and bumps the total number
* of SGEs consumed. * of SGEs consumed.
...@@ -215,22 +213,11 @@ static struct rpcrdma_mr_seg * ...@@ -215,22 +213,11 @@ static struct rpcrdma_mr_seg *
rpcrdma_convert_kvec(struct kvec *vec, struct rpcrdma_mr_seg *seg, rpcrdma_convert_kvec(struct kvec *vec, struct rpcrdma_mr_seg *seg,
unsigned int *n) unsigned int *n)
{ {
u32 remaining, page_offset; seg->mr_page = NULL;
char *base; seg->mr_offset = vec->iov_base;
seg->mr_len = vec->iov_len;
base = vec->iov_base; ++seg;
page_offset = offset_in_page(base); ++(*n);
remaining = vec->iov_len;
while (remaining) {
seg->mr_page = NULL;
seg->mr_offset = base;
seg->mr_len = min_t(u32, PAGE_SIZE - page_offset, remaining);
remaining -= seg->mr_len;
base += seg->mr_len;
++seg;
++(*n);
page_offset = 0;
}
return seg; return seg;
} }
...@@ -283,7 +270,7 @@ rpcrdma_convert_iovs(struct rpcrdma_xprt *r_xprt, struct xdr_buf *xdrbuf, ...@@ -283,7 +270,7 @@ rpcrdma_convert_iovs(struct rpcrdma_xprt *r_xprt, struct xdr_buf *xdrbuf,
goto out; goto out;
if (xdrbuf->tail[0].iov_len) if (xdrbuf->tail[0].iov_len)
seg = rpcrdma_convert_kvec(&xdrbuf->tail[0], seg, &n); rpcrdma_convert_kvec(&xdrbuf->tail[0], seg, &n);
out: out:
if (unlikely(n > RPCRDMA_MAX_SEGS)) if (unlikely(n > RPCRDMA_MAX_SEGS))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment