diff options
author | Michael Chan <mchan@broadcom.com> | 2006-07-03 22:42:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-03 22:42:14 -0400 |
commit | b0026624f1aa3e38a887cb483de61f104d600b97 (patch) | |
tree | 16ab702d08c7235456f3d2f926932307aa90b0ad /drivers/net | |
parent | 6703931c546e6dec0431776fa616d5accd3e7162 (diff) |
[TG3]: Add ipv6 TSO feature
Enable ipv6 TSO feature on chips that support it.
Update version to 3.61.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/tg3.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e5e1b2962936..f645921aff8b 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -68,8 +68,8 @@ | |||
68 | 68 | ||
69 | #define DRV_MODULE_NAME "tg3" | 69 | #define DRV_MODULE_NAME "tg3" |
70 | #define PFX DRV_MODULE_NAME ": " | 70 | #define PFX DRV_MODULE_NAME ": " |
71 | #define DRV_MODULE_VERSION "3.61" | 71 | #define DRV_MODULE_VERSION "3.62" |
72 | #define DRV_MODULE_RELDATE "June 29, 2006" | 72 | #define DRV_MODULE_RELDATE "June 30, 2006" |
73 | 73 | ||
74 | #define TG3_DEF_MAC_MODE 0 | 74 | #define TG3_DEF_MAC_MODE 0 |
75 | #define TG3_DEF_RX_MODE 0 | 75 | #define TG3_DEF_RX_MODE 0 |
@@ -3798,18 +3798,24 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3798 | goto out_unlock; | 3798 | goto out_unlock; |
3799 | } | 3799 | } |
3800 | 3800 | ||
3801 | tcp_opt_len = ((skb->h.th->doff - 5) * 4); | 3801 | if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) |
3802 | ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr); | 3802 | mss |= (skb_headlen(skb) - ETH_HLEN) << 9; |
3803 | else { | ||
3804 | tcp_opt_len = ((skb->h.th->doff - 5) * 4); | ||
3805 | ip_tcp_len = (skb->nh.iph->ihl * 4) + | ||
3806 | sizeof(struct tcphdr); | ||
3807 | |||
3808 | skb->nh.iph->check = 0; | ||
3809 | skb->nh.iph->tot_len = htons(mss + ip_tcp_len + | ||
3810 | tcp_opt_len); | ||
3811 | mss |= (ip_tcp_len + tcp_opt_len) << 9; | ||
3812 | } | ||
3803 | 3813 | ||
3804 | base_flags |= (TXD_FLAG_CPU_PRE_DMA | | 3814 | base_flags |= (TXD_FLAG_CPU_PRE_DMA | |
3805 | TXD_FLAG_CPU_POST_DMA); | 3815 | TXD_FLAG_CPU_POST_DMA); |
3806 | 3816 | ||
3807 | skb->nh.iph->check = 0; | ||
3808 | skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); | ||
3809 | |||
3810 | skb->h.th->check = 0; | 3817 | skb->h.th->check = 0; |
3811 | 3818 | ||
3812 | mss |= (ip_tcp_len + tcp_opt_len) << 9; | ||
3813 | } | 3819 | } |
3814 | else if (skb->ip_summed == CHECKSUM_HW) | 3820 | else if (skb->ip_summed == CHECKSUM_HW) |
3815 | base_flags |= TXD_FLAG_TCPUDP_CSUM; | 3821 | base_flags |= TXD_FLAG_TCPUDP_CSUM; |
@@ -7887,6 +7893,12 @@ static int tg3_set_tso(struct net_device *dev, u32 value) | |||
7887 | return -EINVAL; | 7893 | return -EINVAL; |
7888 | return 0; | 7894 | return 0; |
7889 | } | 7895 | } |
7896 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) { | ||
7897 | if (value) | ||
7898 | dev->features |= NETIF_F_TSO6; | ||
7899 | else | ||
7900 | dev->features &= ~NETIF_F_TSO6; | ||
7901 | } | ||
7890 | return ethtool_op_set_tso(dev, value); | 7902 | return ethtool_op_set_tso(dev, value); |
7891 | } | 7903 | } |
7892 | #endif | 7904 | #endif |
@@ -11507,8 +11519,11 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
11507 | * Firmware TSO on older chips gives lower performance, so it | 11519 | * Firmware TSO on older chips gives lower performance, so it |
11508 | * is off by default, but can be enabled using ethtool. | 11520 | * is off by default, but can be enabled using ethtool. |
11509 | */ | 11521 | */ |
11510 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) | 11522 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { |
11511 | dev->features |= NETIF_F_TSO; | 11523 | dev->features |= NETIF_F_TSO; |
11524 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) | ||
11525 | dev->features |= NETIF_F_TSO6; | ||
11526 | } | ||
11512 | 11527 | ||
11513 | #endif | 11528 | #endif |
11514 | 11529 | ||