diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2010-07-11 05:31:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-11 20:07:41 -0400 |
commit | 34195c3dce84fd0ee47f4131584ff1f6f283b93c (patch) | |
tree | 7a0ee11aed71564cc4eccc870294dd194ee4e57e /drivers/net/tg3.c | |
parent | 20d7375c1fdf054ca8ab9e5b9fe7fe62b39fa218 (diff) |
tg3: Fix IPv6 TSO code in tg3_start_xmit_dma_bug()
The tg3_start_xmit_dma_bug() function was missing code to process IPv6
TSO packets. This patch adds the missing support.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 57dba794d31e..efac448ded15 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -5779,7 +5779,7 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb, | |||
5779 | 5779 | ||
5780 | if ((mss = skb_shinfo(skb)->gso_size) != 0) { | 5780 | if ((mss = skb_shinfo(skb)->gso_size) != 0) { |
5781 | struct iphdr *iph; | 5781 | struct iphdr *iph; |
5782 | u32 tcp_opt_len, ip_tcp_len, hdr_len; | 5782 | u32 tcp_opt_len, hdr_len; |
5783 | 5783 | ||
5784 | if (skb_header_cloned(skb) && | 5784 | if (skb_header_cloned(skb) && |
5785 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { | 5785 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { |
@@ -5787,10 +5787,21 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb, | |||
5787 | goto out_unlock; | 5787 | goto out_unlock; |
5788 | } | 5788 | } |
5789 | 5789 | ||
5790 | iph = ip_hdr(skb); | ||
5790 | tcp_opt_len = tcp_optlen(skb); | 5791 | tcp_opt_len = tcp_optlen(skb); |
5791 | ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr); | ||
5792 | 5792 | ||
5793 | hdr_len = ip_tcp_len + tcp_opt_len; | 5793 | if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) { |
5794 | hdr_len = skb_headlen(skb) - ETH_HLEN; | ||
5795 | } else { | ||
5796 | u32 ip_tcp_len; | ||
5797 | |||
5798 | ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr); | ||
5799 | hdr_len = ip_tcp_len + tcp_opt_len; | ||
5800 | |||
5801 | iph->check = 0; | ||
5802 | iph->tot_len = htons(mss + hdr_len); | ||
5803 | } | ||
5804 | |||
5794 | if (unlikely((ETH_HLEN + hdr_len) > 80) && | 5805 | if (unlikely((ETH_HLEN + hdr_len) > 80) && |
5795 | (tp->tg3_flags2 & TG3_FLG2_TSO_BUG)) | 5806 | (tp->tg3_flags2 & TG3_FLG2_TSO_BUG)) |
5796 | return tg3_tso_bug(tp, skb); | 5807 | return tg3_tso_bug(tp, skb); |
@@ -5798,9 +5809,6 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb, | |||
5798 | base_flags |= (TXD_FLAG_CPU_PRE_DMA | | 5809 | base_flags |= (TXD_FLAG_CPU_PRE_DMA | |
5799 | TXD_FLAG_CPU_POST_DMA); | 5810 | TXD_FLAG_CPU_POST_DMA); |
5800 | 5811 | ||
5801 | iph = ip_hdr(skb); | ||
5802 | iph->check = 0; | ||
5803 | iph->tot_len = htons(mss + hdr_len); | ||
5804 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { | 5812 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { |
5805 | tcp_hdr(skb)->check = 0; | 5813 | tcp_hdr(skb)->check = 0; |
5806 | base_flags &= ~TXD_FLAG_TCPUDP_CSUM; | 5814 | base_flags &= ~TXD_FLAG_TCPUDP_CSUM; |