public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger-ZtmgI6mnKB3QT0dZR+AlfA@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	Jarek Poplawski <jarkao2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 11/11] ipoib: fix DMA sync_single length error
Date: Wed, 20 Jan 2010 12:45:10 -0800	[thread overview]
Message-ID: <20100120204559.518399582@vyatta.com> (raw)
In-Reply-To: 20100120204459.820265084@vyatta.com

[-- 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

           reply	other threads:[~2010-01-20 20:45 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20100120204459.820265084@vyatta.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100120204559.518399582@vyatta.com \
    --to=shemminger-ztmgi6mnkb3qt0dzr+alfa@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=jarkao2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox