netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net] e1000: Small packets may get corrupted during padding by HW
@ 2012-09-15 20:16 Jeff Kirsher
  2012-09-15 20:44 ` Michał Mirosław
  2012-09-18 20:33 ` David Miller
  0 siblings, 2 replies; 18+ messages in thread
From: Jeff Kirsher @ 2012-09-15 20:16 UTC (permalink / raw)
  To: davem; +Cc: Tushar Dave, netdev, gospo, sassmann, Jeff Kirsher

From: Tushar Dave <tushar.n.dave@intel.com>

On PCI/PCI-X HW, if packet size is less than ETH_ZLEN,
packets may get corrupted during padding by HW.
To WA this issue, pad all small packets manually.

Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000/e1000_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 3bfbb8d..bde337e 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -3149,6 +3149,17 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 		return NETDEV_TX_OK;
 	}
 
+	/* On PCI/PCI-X HW, if packet size is less than ETH_ZLEN,
+	 * packets may get corrupted during padding by HW.
+	 * To WA this issue, pad all small packets manually.
+	 */
+	if (skb->len < ETH_ZLEN) {
+		if (skb_pad(skb, ETH_ZLEN - skb->len))
+			return NETDEV_TX_OK;
+		skb->len = ETH_ZLEN;
+		skb_set_tail_pointer(skb, ETH_ZLEN);
+	}
+
 	mss = skb_shinfo(skb)->gso_size;
 	/* The controller does a simple calculation to
 	 * make sure there is enough room in the FIFO before
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-09-18 20:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-15 20:16 [net] e1000: Small packets may get corrupted during padding by HW Jeff Kirsher
2012-09-15 20:44 ` Michał Mirosław
2012-09-16  1:25   ` Dave, Tushar N
2012-09-16  1:48     ` John Fastabend
2012-09-16  2:30       ` John Fastabend
2012-09-17  7:33       ` Dave, Tushar N
2012-09-17  7:58         ` Eric Dumazet
2012-09-17 20:53           ` Alexander Duyck
2012-09-17 21:02             ` Eric Dumazet
2012-09-18  3:01               ` Alexander Duyck
2012-09-18  3:03                 ` David Miller
2012-09-18  3:27                   ` Alexander Duyck
2012-09-18  5:45                     ` Eric Dumazet
2012-09-18  5:55                       ` Alexander Duyck
2012-09-17 16:31         ` David Miller
2012-09-17 16:39           ` Dave, Tushar N
2012-09-17 19:40   ` Alexander Duyck
2012-09-18 20:33 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).