Skip to contentSkip to conversation

svcrdma: Fix dma map direction for rdma read targets

PATCH In review Steve Wise 3 participants 4 messages Apr 3, 2009 – Apr 9, 2009 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Steve Wise

author
#0 lore raw

PATCH 1/1 svcrdma: Fix dma map direction for rdma read targets

The nfs server rdma transport was mapping rdma read target pages for TO_DEVICE instead of FROM_DEVICE. This causes data corruption on non cache-coherent systems if frmrs are used.

---

 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +1 -1
index 629a287..42a6f9f 100644
@@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,
 		frmr->page_list->page_list[page_no] =
 			ib_dma_map_single(xprt->sc_cm_id->device,
 					  page_address(rqstp->rq_arg.pages[page_no]),
-					  PAGE_SIZE, DMA_TO_DEVICE);
+					  PAGE_SIZE, DMA_FROM_DEVICE);
 		if (ib_dma_mapping_error(xprt->sc_cm_id->device,
 					 frmr->page_list->page_list[page_no]))
 			goto fatal_err;

A message that is not in the archive (sent off-list or not yet received): 20090403201824.18102.62915.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org

#2 lore raw
Quoted 15 lines · Steve Wise

The nfs server rdma transport was mapping rdma read target pages for TO_DEVICE instead of FROM_DEVICE. This causes data corruption on non cache-coherent systems if frmrs are used.

---

 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +0 -0
index 629a287..42a6f9f 100644

net/sunrpc/xprtrdma/svc_rdma_recvfrom.c static int fast_reg_read_chunks(struct svcxprt_rdma *xprt, · line 268

Quoted 5 lines
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +1 -1
@@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,
 		frmr->page_list->page_list[page_no] =
 			ib_dma_map_single(xprt->sc_cm_id->device,
 					  page_address(rqstp->rq_arg.pages[page_no]),
-					  PAGE_SIZE, DMA_TO_DEVICE);
+					  PAGE_SIZE, DMA_FROM_DEVICE);

FWIW, this looks good to me.

Quoted 8 lines
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +0 -1
 		if (ib_dma_mapping_error(xprt->sc_cm_id->device,
 					 frmr->page_list->page_list[page_no]))
 			goto fatal_err;
 
--

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 11 lines · Tom Tucker
Quoted 10 lines · Steve Wise

The nfs server rdma transport was mapping rdma read target pages for TO_DEVICE instead of FROM_DEVICE. This causes data corruption on non cache-coherent systems if frmrs are used.

---

 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 12 lines

net/sunrpc/xprtrdma/svc_rdma_recvfrom.c static int fast_reg_read_chunks(struct svcxprt_rdma *xprt, · line 268

Quoted 10 lines
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +1 -1
index 629a287..42a6f9f 100644
@@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,
 		frmr->page_list->page_list[page_no] =
 			ib_dma_map_single(xprt->sc_cm_id->device,
 					  page_address(rqstp->rq_arg.pages[page_no]),
-					  PAGE_SIZE, DMA_TO_DEVICE);
+					  PAGE_SIZE, DMA_FROM_DEVICE);

FWIW, this looks good to me.

Thanks; I'll add an acked-by if you don't object. Should this go to stable as well?

--b.

Quoted 10 lines
Quoted 9 lines
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +0 -1
 		if (ib_dma_mapping_error(xprt->sc_cm_id->device,
 					 frmr->page_list->page_list[page_no]))
 			goto fatal_err;
 
--

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 24 lines · J. Bruce Fields
Quoted 11 lines · Tom Tucker
Quoted 10 lines · Steve Wise

The nfs server rdma transport was mapping rdma read target pages for TO_DEVICE instead of FROM_DEVICE. This causes data corruption on non cache-coherent systems if frmrs are used.

---

 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 11 lines

net/sunrpc/xprtrdma/svc_rdma_recvfrom.c static int fast_reg_read_chunks(struct svcxprt_rdma *xprt, · line 268

Quoted 10 lines
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +1 -1
index 629a287..42a6f9f 100644
@@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,
 		frmr->page_list->page_list[page_no] =
 			ib_dma_map_single(xprt->sc_cm_id->device,
 					  page_address(rqstp->rq_arg.pages[page_no]),
-					  PAGE_SIZE, DMA_TO_DEVICE);
+					  PAGE_SIZE, DMA_FROM_DEVICE);

FWIW, this looks good to me.

Quoted 1 line

Thanks; I'll add an acked-by if you don't object.

Sure...

Quoted 3 lines

... Should this go to
stable as well?

I think so because it's a bug and we've verified it fixes the data corruption issue and doesn't regress existing platforms.

Quoted 14 lines

--b.

Quoted 8 lines
Quoted 8 lines
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +0 -1
 		if (ib_dma_mapping_error(xprt->sc_cm_id->device,
 					 frmr->page_list->page_list[page_no]))
 			goto fatal_err;
 
--

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html