* [PATCH 11/11] ipoib: fix DMA sync_single length error
[not found] <20100120204459.820265084@vyatta.com>
@ 2010-01-20 20:45 ` Stephen Hemminger
0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2010-01-20 20:45 UTC (permalink / raw)
To: David Miller, Jarek Poplawski, Roland Dreier
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: ipoib.patch --]
[-- Type: text/plain, Size: 1356 bytes --]
The DMA api requires that the full mapping be sync'd when
copying frame. First found by Jarek on sky2.
Signed-off-by: Stephen Hemminger <shemminger-ZtmgI6mnKB3QT0dZR+AlfA@public.gmane.org>
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c 2010-01-20 12:02:29.269388203 -0800
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c 2010-01-20 12:24:37.828137536 -0800
@@ -624,11 +624,15 @@ void ipoib_cm_handle_rx_wc(struct net_de
small_skb = dev_alloc_skb(dlen + 12);
if (small_skb) {
skb_reserve(small_skb, 12);
- ib_dma_sync_single_for_cpu(priv->ca, rx_ring[wr_id].mapping[0],
- dlen, DMA_FROM_DEVICE);
+ ib_dma_sync_single_for_cpu(priv->ca,
+ rx_ring[wr_id].mapping[0],
+ IPOIB_CM_HEAD_SIZE,
+ DMA_FROM_DEVICE);
skb_copy_from_linear_data(skb, small_skb->data, dlen);
- ib_dma_sync_single_for_device(priv->ca, rx_ring[wr_id].mapping[0],
- dlen, DMA_FROM_DEVICE);
+ ib_dma_sync_single_for_device(priv->ca,
+ rx_ring[wr_id].mapping[0],
+ IPOIB_CM_HEAD_SIZE,
+ DMA_FROM_DEVICE);
skb_put(small_skb, dlen);
skb = small_skb;
goto copied;
--
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-01-20 20:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20100120204459.820265084@vyatta.com>
2010-01-20 20:45 ` [PATCH 11/11] ipoib: fix DMA sync_single length error Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox