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

Ralph Campbell ralph.campbell at qlogic.com
Thu Nov 30 10:26:58 PST 2006


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

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

Index: rds_buf.c
===================================================================
--- rds_buf.c	(revision 9441)
+++ rds_buf.c	(working copy)
@@ -67,12 +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);
-
-	pci_unmap_addr_set(buf, mapping, buf->sge.addr);
+	buf->sge.addr =	ib_dma_map_single(ep->cma_id->device,
+					  buf->data,
+					  buf->sge.length,
+					  DMA_TO_DEVICE);
 
 	buf->sge.lkey =	ep->mr->lkey;
 
@@ -101,7 +99,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,9 +124,9 @@ 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,
-			pci_unmap_addr(buf,mapping),
+		ib_dma_unmap_single(
+			((struct rds_ep*)buf->parent_ep)->cma_id->device,
+			buf->sge.addr,
 			buf->sge.length,
 			DMA_TO_DEVICE);
 
Index: rds_buf.h
===================================================================
--- rds_buf.h	(revision 9441)
+++ rds_buf.h	(working copy)
@@ -66,7 +66,6 @@ struct rds_buf {
 	u32 recv_len;
 	u32 pkts;
 	u32 copied;
-	DECLARE_PCI_UNMAP_ADDR(mapping)
 };
 
 struct rds_buf_pool {






More information about the general mailing list