[openib-general] [PATCH 5/7] IB/rds - Use the new verbs DMA mapping functions

Ralph Campbell ralph.campbell at qlogic.com
Thu Nov 2 14:35:03 PST 2006


IB/rds - Use the new verbs DMA mapping functions

This patch converts RDS to use the new DMA mapping functions
for kernel verbs consumers.

From: Ralph Campbell <ralph.campbell at qlogic.com>

Index: src/linux-kernel/infiniband/ulp/rds/rds_buf.c
===================================================================
--- src/linux-kernel/infiniband/ulp/rds/rds_buf.c	(revision 9441)
+++ src/linux-kernel/infiniband/ulp/rds/rds_buf.c	(working copy)
@@ -67,10 +67,10 @@ struct rds_buf*	rds_alloc_send_buffer(st
 	buf->loopback =	FALSE;
 	buf->optype = OP_SEND;
 	buf->sge.length	= ep->buffer_size;
-	buf->sge.addr =	dma_map_single(ep->cma_id->device->dma_device,
-					buf->data,
-					buf->sge.length,
-					DMA_TO_DEVICE);
+	buf->sge.addr =	ib_dma_map_single(ep->cma_id->device,
+					  buf->data,
+					  buf->sge.length,
+					  DMA_TO_DEVICE);
 
 	pci_unmap_addr_set(buf, mapping, buf->sge.addr);
 
@@ -101,7 +101,7 @@ struct rds_buf*	rds_alloc_recv_buffer(st
 	buf->loopback =	FALSE;
 	buf->optype = OP_RECV;
 	buf->sge.length	= ep->buffer_size;
-	buf->sge.addr =	dma_map_single(ep->cma_id->device->dma_device,
+	buf->sge.addr =	ib_dma_map_single(ep->cma_id->device,
 		buf->data,
 		buf->sge.length,
 		DMA_FROM_DEVICE);
@@ -126,8 +126,8 @@ void rds_free_buffer(struct rds_buf *buf
 				printk("rds: free buffer, bad ep or ep->kmem_cache!!\n");
 				return;
 		}
-		dma_unmap_single(
-			((struct rds_ep*)buf->parent_ep)->cma_id->device->dma_device,
+		ib_dma_unmap_single(
+			((struct rds_ep*)buf->parent_ep)->cma_id->device,
 			pci_unmap_addr(buf,mapping),
 			buf->sge.length,
 			DMA_TO_DEVICE);






More information about the general mailing list