diff mbox

[2/4,v2] netdev: bfin_mac: fix malformed UDP packet transmission when polling with KGDB

Message ID 1243604443-27204-1-git-send-email-vapier@gentoo.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Mike Frysinger May 29, 2009, 1:40 p.m. UTC
From: Sonic Zhang <sonic.zhang@analog.com>

Writes to the DMA descriptors may sit in the internal Blackfin data buffers
and not actually be available when the DMA engine goes to fetch them.  This
does not typically happen, but when dealing with short/fast packets such as
UDP and polling KGDB, this occurs much more frequently.  Same goes for
heavy loads as seen by netperf tests or large scp transfers.  So force the
buffers to drain with SSYNC otherwise we get random malformed packets.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
v2
	- make comment/changelog reflect what is actually going on

 drivers/net/bfin_mac.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Comments

David Miller May 29, 2009, 10:49 p.m. UTC | #1
From: Mike Frysinger <vapier@gentoo.org>
Date: Fri, 29 May 2009 09:40:43 -0400

> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> Writes to the DMA descriptors may sit in the internal Blackfin data buffers
> and not actually be available when the DMA engine goes to fetch them.  This
> does not typically happen, but when dealing with short/fast packets such as
> UDP and polling KGDB, this occurs much more frequently.  Same goes for
> heavy loads as seen by netperf tests or large scp transfers.  So force the
> buffers to drain with SSYNC otherwise we get random malformed packets.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> Signed-off-by: Bryan Wu <cooloney@kernel.org>

Applied to net-next-2.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 1905532..38d34ce 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -688,6 +688,12 @@  static int bfin_mac_hard_start_xmit(struct sk_buff *skb,
 		}
 	}
 
+	/* make sure the internal data buffers in the core are drained
+	 * so that the DMA descriptors are completely written when the
+	 * DMA engine goes to fetch them below
+	 */
+	SSYNC();
+
 	/* enable this packet's dma */
 	current_tx_ptr->desc_a.config |= DMAEN;