svcrdma: fix offset calculation for non-page aligned sge entries
Subsystems (3)
PATCH v2 1/1 svcrdma: fix offset calculation for non-page aligned sge entries
The xdr_off value in dma_map_xdr gets passed to ib_dma_map_page as the offset into the page to be mapped. This calculation does not correctly take into account the case where the data starts at some offset into the page. Increment the xdr_off by the page_base to ensure that it is respected.
Cc Tom Tucker <[email protected]>
Signed-off-by Jeff Layton <[email protected]>
--- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 1 + 1 file changed, 1 insertion(+)
net/sunrpc/xprtrdma/svc_rdma_sendto.c +1 -0
@@ -265,6 +265,7 @@ static dma_addr_t dma_map_xdr(struct svcxprt_rdma *xprt, xdr_off -= xdr->head[0 ].iov_len;if (xdr_off < xdr->page_len) {/* This offset is in the page list */ + xdr_off += xdr->page_base; page = xdr->pages[xdr_off >>PAGE_SHIFT ]; xdr_off &= ~PAGE_MASK ; }else {
Signature · 1 line
1.8.5.3
Quoted 5 lines · Jeff Layton
The
xdr_offvalue indma_map_xdrgets passed toib_dma_map_pageas the offset into the page to be mapped. This calculation does not correctly take into account the case where the data starts at some offset into the page. Increment thexdr_offby thepage_baseto ensure that it is respected.
Thanks, applying.--b.
Quoted 22 lines
Cc Tom Tucker <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 1 + 1 file changed, 1 insertion(+)net/sunrpc/xprtrdma/svc_rdma_sendto.c +1
-0@@ -265,6 +265,7 @@ static dma_addr_t dma_map_xdr(struct svcxprt_rdma *xprt, xdr_off -= xdr->head[0 ].iov_len;if (xdr_off < xdr->page_len) {/* This offset is in the page list */ + xdr_off += xdr->page_base; page = xdr->pages[xdr_off >>PAGE_SHIFT ]; xdr_off &= ~PAGE_MASK ; }else {Signature · 1 line
1.8.5.3