diff options
author | Auke Kok <auke\-jan.h.kok@intel.com> | 2006-11-01 11:47:36 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:11:58 -0500 |
commit | 87ca4e5b8d729fc157a0a599d78ccab245fc0602 (patch) | |
tree | 69bec3c1d367d26253678e6fbd9eff184c68e7ee | |
parent | b00dae7cce465323850c3e1fd3ac8b2d9229735c (diff) |
e1000: FIX: enable hw TSO for IPV6
Enable TSO for IPV6. All e1000 hardware supports it. This reduces CPU
utilizations by 50% when transmitting IPv6 frames.
Fix symbol naming enabling ipv6 TSO. Turn off TSO6 for 10/100.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
-rw-r--r-- | drivers/net/e1000/e1000.h | 3 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 7 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 19 |
3 files changed, 24 insertions, 5 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 7ecce438d258..3f0be02e85e2 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h | |||
@@ -59,6 +59,9 @@ | |||
59 | #include <linux/capability.h> | 59 | #include <linux/capability.h> |
60 | #include <linux/in.h> | 60 | #include <linux/in.h> |
61 | #include <linux/ip.h> | 61 | #include <linux/ip.h> |
62 | #ifdef NETIF_F_TSO6 | ||
63 | #include <linux/ipv6.h> | ||
64 | #endif | ||
62 | #include <linux/tcp.h> | 65 | #include <linux/tcp.h> |
63 | #include <linux/udp.h> | 66 | #include <linux/udp.h> |
64 | #include <net/pkt_sched.h> | 67 | #include <net/pkt_sched.h> |
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index 82d2c78e1696..b9c0927d79b3 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
@@ -348,6 +348,13 @@ e1000_set_tso(struct net_device *netdev, uint32_t data) | |||
348 | else | 348 | else |
349 | netdev->features &= ~NETIF_F_TSO; | 349 | netdev->features &= ~NETIF_F_TSO; |
350 | 350 | ||
351 | #ifdef NETIF_F_TSO6 | ||
352 | if (data) | ||
353 | netdev->features |= NETIF_F_TSO6; | ||
354 | else | ||
355 | netdev->features &= ~NETIF_F_TSO6; | ||
356 | #endif | ||
357 | |||
351 | DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); | 358 | DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); |
352 | adapter->tso_force = TRUE; | 359 | adapter->tso_force = TRUE; |
353 | return 0; | 360 | return 0; |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 35d6d080522f..38ee39e570ea 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -844,9 +844,9 @@ e1000_probe(struct pci_dev *pdev, | |||
844 | (adapter->hw.mac_type != e1000_82547)) | 844 | (adapter->hw.mac_type != e1000_82547)) |
845 | netdev->features |= NETIF_F_TSO; | 845 | netdev->features |= NETIF_F_TSO; |
846 | 846 | ||
847 | #ifdef NETIF_F_TSO_IPV6 | 847 | #ifdef NETIF_F_TSO6 |
848 | if (adapter->hw.mac_type > e1000_82547_rev_2) | 848 | if (adapter->hw.mac_type > e1000_82547_rev_2) |
849 | netdev->features |= NETIF_F_TSO_IPV6; | 849 | netdev->features |= NETIF_F_TSO6; |
850 | #endif | 850 | #endif |
851 | #endif | 851 | #endif |
852 | if (pci_using_dac) | 852 | if (pci_using_dac) |
@@ -1814,8 +1814,11 @@ e1000_setup_rctl(struct e1000_adapter *adapter) | |||
1814 | /* Configure extra packet-split registers */ | 1814 | /* Configure extra packet-split registers */ |
1815 | rfctl = E1000_READ_REG(&adapter->hw, RFCTL); | 1815 | rfctl = E1000_READ_REG(&adapter->hw, RFCTL); |
1816 | rfctl |= E1000_RFCTL_EXTEN; | 1816 | rfctl |= E1000_RFCTL_EXTEN; |
1817 | /* disable IPv6 packet split support */ | 1817 | /* disable packet split support for IPv6 extension headers, |
1818 | rfctl |= E1000_RFCTL_IPV6_DIS; | 1818 | * because some malformed IPv6 headers can hang the RX */ |
1819 | rfctl |= (E1000_RFCTL_IPV6_EX_DIS | | ||
1820 | E1000_RFCTL_NEW_IPV6_EXT_DIS); | ||
1821 | |||
1819 | E1000_WRITE_REG(&adapter->hw, RFCTL, rfctl); | 1822 | E1000_WRITE_REG(&adapter->hw, RFCTL, rfctl); |
1820 | 1823 | ||
1821 | rctl |= E1000_RCTL_DTYP_PS; | 1824 | rctl |= E1000_RCTL_DTYP_PS; |
@@ -2473,9 +2476,15 @@ e1000_watchdog(unsigned long data) | |||
2473 | DPRINTK(PROBE,INFO, | 2476 | DPRINTK(PROBE,INFO, |
2474 | "10/100 speed: disabling TSO\n"); | 2477 | "10/100 speed: disabling TSO\n"); |
2475 | netdev->features &= ~NETIF_F_TSO; | 2478 | netdev->features &= ~NETIF_F_TSO; |
2479 | #ifdef NETIF_F_TSO6 | ||
2480 | netdev->features &= ~NETIF_F_TSO6; | ||
2481 | #endif | ||
2476 | break; | 2482 | break; |
2477 | case SPEED_1000: | 2483 | case SPEED_1000: |
2478 | netdev->features |= NETIF_F_TSO; | 2484 | netdev->features |= NETIF_F_TSO; |
2485 | #ifdef NETIF_F_TSO6 | ||
2486 | netdev->features |= NETIF_F_TSO6; | ||
2487 | #endif | ||
2479 | break; | 2488 | break; |
2480 | default: | 2489 | default: |
2481 | /* oops */ | 2490 | /* oops */ |
@@ -2610,7 +2619,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2610 | 0); | 2619 | 0); |
2611 | cmd_length = E1000_TXD_CMD_IP; | 2620 | cmd_length = E1000_TXD_CMD_IP; |
2612 | ipcse = skb->h.raw - skb->data - 1; | 2621 | ipcse = skb->h.raw - skb->data - 1; |
2613 | #ifdef NETIF_F_TSO_IPV6 | 2622 | #ifdef NETIF_F_TSO6 |
2614 | } else if (skb->protocol == htons(ETH_P_IPV6)) { | 2623 | } else if (skb->protocol == htons(ETH_P_IPV6)) { |
2615 | skb->nh.ipv6h->payload_len = 0; | 2624 | skb->nh.ipv6h->payload_len = 0; |
2616 | skb->h.th->check = | 2625 | skb->h.th->check = |