Hi,

we got an oops on using Lustre over infiniband with ipath cards. With the help 
of Robert Walsh 
(http://lists.openfabrics.org/pipermail/general/2007-April/034776.html) I 
created the attached patch.


Cheers
Bernd


-- 
Bernd Schubert
Q-Leap Networks GmbH
Index: lustre-1.4.9/lnet/klnds/o2iblnd/o2iblnd.c
===================================================================
--- lustre-1.4.9.orig/lnet/klnds/o2iblnd/o2iblnd.c	2007-04-03 10:07:27.000000000 +0200
+++ lustre-1.4.9/lnet/klnds/o2iblnd/o2iblnd.c	2007-04-03 10:13:20.000000000 +0200
@@ -669,7 +669,7 @@
                 rx->rx_conn = conn;
                 rx->rx_msg = (kib_msg_t *)(((char *)page_address(page)) +
                                            page_offset);
-                rx->rx_msgaddr = dma_map_single(cmid->device->dma_device,
+                rx->rx_msgaddr = ib_dma_map_single(cmid->device,
                                                 rx->rx_msg,
                                                 IBLND_MSG_SIZE,
                                                 DMA_FROM_DEVICE);
@@ -854,7 +854,7 @@
 
                         LASSERT (rx->rx_nob >= 0); /* not posted */
 
-                        dma_unmap_single(conn->ibc_cmid->device->dma_device,
+                        ib_dma_unmap_single(conn->ibc_cmid->device,
                                          pci_unmap_addr(rx, rx_msgunmap),
                                          IBLND_MSG_SIZE, DMA_FROM_DEVICE);
                 }
@@ -1173,7 +1173,7 @@
         for (i = 0; i < IBLND_TX_MSGS(); i++) {
                 tx = &kiblnd_data.kib_tx_descs[i];
 
-                dma_unmap_single(kiblnd_data.kib_cmid->device->dma_device,
+                ib_dma_unmap_single(kiblnd_data.kib_cmid->device,
                                  pci_unmap_addr(tx, tx_msgunmap),
                                  IBLND_MSG_SIZE, DMA_TO_DEVICE);
         }
@@ -1201,8 +1201,8 @@
                 tx->tx_msg = (kib_msg_t *)(((char *)page_address(page)) +
                                            page_offset);
 
-                tx->tx_msgaddr = dma_map_single(
-                        kiblnd_data.kib_cmid->device->dma_device,
+                tx->tx_msgaddr = ib_dma_map_single(
+                        kiblnd_data.kib_cmid->device,
                         tx->tx_msg, IBLND_MSG_SIZE, DMA_TO_DEVICE);
                 pci_unmap_addr_set(tx, tx_msgunmap, tx->tx_msgaddr);
 
Index: lustre-1.4.9/lnet/klnds/o2iblnd/o2iblnd_cb.c
===================================================================
--- lustre-1.4.9.orig/lnet/klnds/o2iblnd/o2iblnd_cb.c	2007-04-03 10:21:39.000000000 +0200
+++ lustre-1.4.9/lnet/klnds/o2iblnd/o2iblnd_cb.c	2007-04-03 10:38:00.000000000 +0200
@@ -88,7 +88,7 @@
         }
 #else
         if (tx->tx_nfrags != 0) {
-                dma_unmap_sg(kiblnd_data.kib_cmid->device->dma_device,
+                ib_dma_unmap_sg(kiblnd_data.kib_cmid->device,
                              tx->tx_frags, tx->tx_nfrags, tx->tx_dmadir);
                 tx->tx_nfrags = 0;
         }
@@ -623,14 +623,16 @@
         tx->tx_nfrags = sg - tx->tx_frags;
         tx->tx_dmadir = (rd != tx->tx_rd) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
 
-        rd->rd_nfrags = dma_map_sg(kiblnd_data.kib_cmid->device->dma_device,
+        rd->rd_nfrags = ib_dma_map_sg(kiblnd_data.kib_cmid->device,
                                    tx->tx_frags, tx->tx_nfrags, tx->tx_dmadir);
         rd->rd_key    = (rd != tx->tx_rd) ? 
                         kiblnd_data.kib_mr->rkey : kiblnd_data.kib_mr->lkey;
 
         for (i = 0; i < rd->rd_nfrags; i++) {
-                rd->rd_frags[i].rf_nob  = sg_dma_len(&tx->tx_frags[i]);
-                rd->rd_frags[i].rf_addr = sg_dma_address(&tx->tx_frags[i]);
+                rd->rd_frags[i].rf_nob  = ib_sg_dma_len(kiblnd_data.kib_cmid->device,
+                                                        &tx->tx_frags[i]);
+                rd->rd_frags[i].rf_addr = ib_sg_dma_address(kiblnd_data.kib_cmid->device,
+                                                         &tx->tx_frags[i]);
         }
         
         return 0;
@@ -679,14 +681,16 @@
         tx->tx_nfrags = sg - tx->tx_frags;
         tx->tx_dmadir = (rd != tx->tx_rd) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
 
-        rd->rd_nfrags = dma_map_sg(kiblnd_data.kib_cmid->device->dma_device,
+        rd->rd_nfrags = ib_dma_map_sg(kiblnd_data.kib_cmid->device,
                                    tx->tx_frags, tx->tx_nfrags, tx->tx_dmadir);
         rd->rd_key    = (rd != tx->tx_rd) ? 
                         kiblnd_data.kib_mr->rkey : kiblnd_data.kib_mr->lkey;
 
         for (i = 0; i < tx->tx_nfrags; i++) {
-                rd->rd_frags[i].rf_nob  = sg_dma_len(&tx->tx_frags[i]);
-                rd->rd_frags[i].rf_addr = sg_dma_address(&tx->tx_frags[i]);
+                rd->rd_frags[i].rf_nob  = ib_sg_dma_len(kiblnd_data.kib_cmid->device,
+                                                        &tx->tx_frags[i]);
+                rd->rd_frags[i].rf_addr = ib_sg_dma_address(kiblnd_data.kib_cmid->device,
+                                                            &tx->tx_frags[i]);
 #if 0
                 CDEBUG(D_WARNING,"frag[%d]: "LPX64" for %d\n",
                        i, rd->rd_frags[i].rf_addr, rd->rd_frags[i].rf_nob);
_______________________________________________
Lustre-devel mailing list
Lustre-devel@clusterfs.com
https://mail.clusterfs.com/mailman/listinfo/lustre-devel

Reply via email to