diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-07-08 02:14:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-09 02:12:28 -0400 |
commit | 7fe876af921d1d2bc8353e0062c10ff35e902653 (patch) | |
tree | e819777abb27bc45692a88a08f1d9b4593f74d27 /drivers/net/tg3.c | |
parent | 511d22247be767bbf275ee7a5a388c4f009aa0c1 (diff) |
tg3: allow TSO on vlan devices
Similar to commit 72dccb01e8632aa (bnx2: Update vlan_features)
In order to enable TSO on vlan devices, tg3 needs to update
dev->vlan_features.
Tested on HP NC326m (aka BCM5715S (rev a3))
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 7c75f1e33996..aa2d64f58ed3 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -12789,6 +12789,13 @@ done: | |||
12789 | 12789 | ||
12790 | static struct pci_dev * __devinit tg3_find_peer(struct tg3 *); | 12790 | static struct pci_dev * __devinit tg3_find_peer(struct tg3 *); |
12791 | 12791 | ||
12792 | static void inline vlan_features_add(struct net_device *dev, unsigned long flags) | ||
12793 | { | ||
12794 | #if TG3_VLAN_TAG_USED | ||
12795 | dev->vlan_features |= flags; | ||
12796 | #endif | ||
12797 | } | ||
12798 | |||
12792 | static int __devinit tg3_get_invariants(struct tg3 *tp) | 12799 | static int __devinit tg3_get_invariants(struct tg3 *tp) |
12793 | { | 12800 | { |
12794 | static struct pci_device_id write_reorder_chipsets[] = { | 12801 | static struct pci_device_id write_reorder_chipsets[] = { |
@@ -13021,11 +13028,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13021 | if (tp->pci_chip_rev_id == CHIPREV_ID_5700_B0) | 13028 | if (tp->pci_chip_rev_id == CHIPREV_ID_5700_B0) |
13022 | tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS; | 13029 | tp->tg3_flags |= TG3_FLAG_BROKEN_CHECKSUMS; |
13023 | else { | 13030 | else { |
13031 | unsigned long features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_GRO; | ||
13032 | |||
13024 | tp->tg3_flags |= TG3_FLAG_RX_CHECKSUMS; | 13033 | tp->tg3_flags |= TG3_FLAG_RX_CHECKSUMS; |
13025 | tp->dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; | ||
13026 | if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS) | 13034 | if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS) |
13027 | tp->dev->features |= NETIF_F_IPV6_CSUM; | 13035 | features |= NETIF_F_IPV6_CSUM; |
13028 | tp->dev->features |= NETIF_F_GRO; | 13036 | tp->dev->features |= features; |
13037 | vlan_features_add(tp->dev, features); | ||
13029 | } | 13038 | } |
13030 | 13039 | ||
13031 | /* Determine TSO capabilities */ | 13040 | /* Determine TSO capabilities */ |
@@ -14514,20 +14523,25 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
14514 | * is off by default, but can be enabled using ethtool. | 14523 | * is off by default, but can be enabled using ethtool. |
14515 | */ | 14524 | */ |
14516 | if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) && | 14525 | if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) && |
14517 | (dev->features & NETIF_F_IP_CSUM)) | 14526 | (dev->features & NETIF_F_IP_CSUM)) { |
14518 | dev->features |= NETIF_F_TSO; | 14527 | dev->features |= NETIF_F_TSO; |
14519 | 14528 | vlan_features_add(dev, NETIF_F_TSO); | |
14529 | } | ||
14520 | if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) || | 14530 | if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) || |
14521 | (tp->tg3_flags2 & TG3_FLG2_HW_TSO_3)) { | 14531 | (tp->tg3_flags2 & TG3_FLG2_HW_TSO_3)) { |
14522 | if (dev->features & NETIF_F_IPV6_CSUM) | 14532 | if (dev->features & NETIF_F_IPV6_CSUM) { |
14523 | dev->features |= NETIF_F_TSO6; | 14533 | dev->features |= NETIF_F_TSO6; |
14534 | vlan_features_add(dev, NETIF_F_TSO6); | ||
14535 | } | ||
14524 | if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_3) || | 14536 | if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_3) || |
14525 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | 14537 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || |
14526 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && | 14538 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && |
14527 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || | 14539 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || |
14528 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | 14540 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || |
14529 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) | 14541 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) { |
14530 | dev->features |= NETIF_F_TSO_ECN; | 14542 | dev->features |= NETIF_F_TSO_ECN; |
14543 | vlan_features_add(dev, NETIF_F_TSO_ECN); | ||
14544 | } | ||
14531 | } | 14545 | } |
14532 | 14546 | ||
14533 | if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 && | 14547 | if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 && |