diff options
author | Vlad Yasevich <vyasevich@gmail.com> | 2014-09-18 10:31:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-22 14:20:23 -0400 |
commit | 476c18850c6cbaa3f2bb661ae9710645081563b9 (patch) | |
tree | cd83fc62f9b3fa92f22e7f856ba66d20106905ed | |
parent | 07d92d5cc977a7fe1e683e1d4a6f723f7f2778cb (diff) |
tg3: Work around HW/FW limitations with vlan encapsulated frames
TG3 appears to have an issue performing TSO and checksum offloading
correclty when the frame has been vlan encapsulated (non-accelrated).
In these cases, tcp checksum is not correctly updated.
This patch attempts to work around this issue. After the patch,
802.1ad vlans start working correctly over tg3 devices.
CC: Prashant Sreedharan <prashant@broadcom.com>
CC: Michael Chan <mchan@broadcom.com>
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index cb77ae93d89a..e7d3a620d96a 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -7914,8 +7914,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
7914 | 7914 | ||
7915 | entry = tnapi->tx_prod; | 7915 | entry = tnapi->tx_prod; |
7916 | base_flags = 0; | 7916 | base_flags = 0; |
7917 | if (skb->ip_summed == CHECKSUM_PARTIAL) | ||
7918 | base_flags |= TXD_FLAG_TCPUDP_CSUM; | ||
7919 | 7917 | ||
7920 | mss = skb_shinfo(skb)->gso_size; | 7918 | mss = skb_shinfo(skb)->gso_size; |
7921 | if (mss) { | 7919 | if (mss) { |
@@ -7929,6 +7927,13 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
7929 | 7927 | ||
7930 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb) - ETH_HLEN; | 7928 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb) - ETH_HLEN; |
7931 | 7929 | ||
7930 | /* HW/FW can not correctly segment packets that have been | ||
7931 | * vlan encapsulated. | ||
7932 | */ | ||
7933 | if (skb->protocol == htons(ETH_P_8021Q) || | ||
7934 | skb->protocol == htons(ETH_P_8021AD)) | ||
7935 | return tg3_tso_bug(tp, tnapi, txq, skb); | ||
7936 | |||
7932 | if (!skb_is_gso_v6(skb)) { | 7937 | if (!skb_is_gso_v6(skb)) { |
7933 | if (unlikely((ETH_HLEN + hdr_len) > 80) && | 7938 | if (unlikely((ETH_HLEN + hdr_len) > 80) && |
7934 | tg3_flag(tp, TSO_BUG)) | 7939 | tg3_flag(tp, TSO_BUG)) |
@@ -7979,6 +7984,17 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
7979 | base_flags |= tsflags << 12; | 7984 | base_flags |= tsflags << 12; |
7980 | } | 7985 | } |
7981 | } | 7986 | } |
7987 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { | ||
7988 | /* HW/FW can not correctly checksum packets that have been | ||
7989 | * vlan encapsulated. | ||
7990 | */ | ||
7991 | if (skb->protocol == htons(ETH_P_8021Q) || | ||
7992 | skb->protocol == htons(ETH_P_8021AD)) { | ||
7993 | if (skb_checksum_help(skb)) | ||
7994 | goto drop; | ||
7995 | } else { | ||
7996 | base_flags |= TXD_FLAG_TCPUDP_CSUM; | ||
7997 | } | ||
7982 | } | 7998 | } |
7983 | 7999 | ||
7984 | if (tg3_flag(tp, USE_JUMBO_BDFLAG) && | 8000 | if (tg3_flag(tp, USE_JUMBO_BDFLAG) && |