Skip to content

Commit

Permalink
netdev: bfin_mac: fix malformed UDP packet transmission when polling …
Browse files Browse the repository at this point in the history
…with KGDB

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sonic Zhang authored and David S. Miller committed May 29, 2009
1 parent 91a455f commit 805a8ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 805a8ab

Please sign in to comment.