aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTushar Dave <tushar.n.dave@intel.com>2012-09-15 06:16:57 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-18 16:32:21 -0400
commit59d86c760fbb855d9a26b9b280d4ff59303f2fc5 (patch)
tree738d612af6e59bc57e61134a0551fb6a052e5a9b /drivers
parent433a19548061bb5457b6ab77ed7ea58ca6e43ddb (diff)
e1000: Small packets may get corrupted during padding by HW
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 3bfbb8df8989..bde337ee1a34 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,
3149 return NETDEV_TX_OK; 3149 return NETDEV_TX_OK;
3150 } 3150 }
3151 3151
3152 /* On PCI/PCI-X HW, if packet size is less than ETH_ZLEN,
3153 * packets may get corrupted during padding by HW.
3154 * To WA this issue, pad all small packets manually.
3155 */
3156 if (skb->len < ETH_ZLEN) {
3157 if (skb_pad(skb, ETH_ZLEN - skb->len))
3158 return NETDEV_TX_OK;
3159 skb->len = ETH_ZLEN;
3160 skb_set_tail_pointer(skb, ETH_ZLEN);
3161 }
3162
3152 mss = skb_shinfo(skb)->gso_size; 3163 mss = skb_shinfo(skb)->gso_size;
3153 /* The controller does a simple calculation to 3164 /* The controller does a simple calculation to
3154 * make sure there is enough room in the FIFO before 3165 * make sure there is enough room in the FIFO before