diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-12-15 20:04:33 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-26 16:28:20 -0500 |
commit | 683a2aa339f607c8a422835161ceab68b2a5a18a (patch) | |
tree | 02dc57eac192826585de7650ef20616dca5abe3c | |
parent | 1a63e846a4099e6fbff86a3b112064378515f254 (diff) |
e1000: Do not truncate TSO TCP header with 82544 workaround
The e1000 driver has a workaround for 82544 on PCI-X where if the
terminating byte of a buffer is at addresses 0-3 mod 8, then 4 bytes
are shaved off it and defered to a new segment. This is due to an
erratum that could otherwise cause TX hangs.
Unfortunately this breaks TSO because it may cause the TCP header to
be split over two segments which itself causes TX hangs. The solution
is to pull 4 bytes of data up from the next segment rather than pushing
4 bytes off. This ensures the TCP header remains in one piece and
works around the PCI-X hang.
This patch is based on one from Jesse Brandeburg.
This bug has been trigered by both CONFIG_DEBUG_SLAB as well as Xen.
Note that the only reason we don't see this normally is because the
TCP stack starts writing from the end, i.e., it writes the TCP header
first then slaps on the IP header, etc. So the end of the TCP header
(skb->tail - 1 here) is always aligned correctly.
Had we made the start of the IP header (e.g., IPv6) 8-byte aligned
instead, this would happen for normal TCP traffic as well.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 8c4924f1f7ed..4c1ff752048c 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3318,6 +3318,16 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
3318 | if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) { | 3318 | if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) { |
3319 | switch (adapter->hw.mac_type) { | 3319 | switch (adapter->hw.mac_type) { |
3320 | unsigned int pull_size; | 3320 | unsigned int pull_size; |
3321 | case e1000_82544: | ||
3322 | /* Make sure we have room to chop off 4 bytes, | ||
3323 | * and that the end alignment will work out to | ||
3324 | * this hardware's requirements | ||
3325 | * NOTE: this is a TSO only workaround | ||
3326 | * if end byte alignment not correct move us | ||
3327 | * into the next dword */ | ||
3328 | if ((unsigned long)(skb->tail - 1) & 4) | ||
3329 | break; | ||
3330 | /* fall through */ | ||
3321 | case e1000_82571: | 3331 | case e1000_82571: |
3322 | case e1000_82572: | 3332 | case e1000_82572: |
3323 | case e1000_82573: | 3333 | case e1000_82573: |