Commit 87ca4e5b authored by Auke Kok's avatar Auke Kok Committed by Jeff Garzik

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: default avatarAuke Kok <auke-jan.h.kok@intel.com>
parent b00dae7c
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
#include <linux/capability.h> #include <linux/capability.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/ip.h> #include <linux/ip.h>
#ifdef NETIF_F_TSO6
#include <linux/ipv6.h>
#endif
#include <linux/tcp.h> #include <linux/tcp.h>
#include <linux/udp.h> #include <linux/udp.h>
#include <net/pkt_sched.h> #include <net/pkt_sched.h>
......
...@@ -348,6 +348,13 @@ e1000_set_tso(struct net_device *netdev, uint32_t data) ...@@ -348,6 +348,13 @@ e1000_set_tso(struct net_device *netdev, uint32_t data)
else else
netdev->features &= ~NETIF_F_TSO; netdev->features &= ~NETIF_F_TSO;
#ifdef NETIF_F_TSO6
if (data)
netdev->features |= NETIF_F_TSO6;
else
netdev->features &= ~NETIF_F_TSO6;
#endif
DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled");
adapter->tso_force = TRUE; adapter->tso_force = TRUE;
return 0; return 0;
......
...@@ -844,9 +844,9 @@ e1000_probe(struct pci_dev *pdev, ...@@ -844,9 +844,9 @@ e1000_probe(struct pci_dev *pdev,
(adapter->hw.mac_type != e1000_82547)) (adapter->hw.mac_type != e1000_82547))
netdev->features |= NETIF_F_TSO; netdev->features |= NETIF_F_TSO;
#ifdef NETIF_F_TSO_IPV6 #ifdef NETIF_F_TSO6
if (adapter->hw.mac_type > e1000_82547_rev_2) if (adapter->hw.mac_type > e1000_82547_rev_2)
netdev->features |= NETIF_F_TSO_IPV6; netdev->features |= NETIF_F_TSO6;
#endif #endif
#endif #endif
if (pci_using_dac) if (pci_using_dac)
...@@ -1814,8 +1814,11 @@ e1000_setup_rctl(struct e1000_adapter *adapter) ...@@ -1814,8 +1814,11 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
/* Configure extra packet-split registers */ /* Configure extra packet-split registers */
rfctl = E1000_READ_REG(&adapter->hw, RFCTL); rfctl = E1000_READ_REG(&adapter->hw, RFCTL);
rfctl |= E1000_RFCTL_EXTEN; rfctl |= E1000_RFCTL_EXTEN;
/* disable IPv6 packet split support */ /* disable packet split support for IPv6 extension headers,
rfctl |= E1000_RFCTL_IPV6_DIS; * because some malformed IPv6 headers can hang the RX */
rfctl |= (E1000_RFCTL_IPV6_EX_DIS |
E1000_RFCTL_NEW_IPV6_EXT_DIS);
E1000_WRITE_REG(&adapter->hw, RFCTL, rfctl); E1000_WRITE_REG(&adapter->hw, RFCTL, rfctl);
rctl |= E1000_RCTL_DTYP_PS; rctl |= E1000_RCTL_DTYP_PS;
...@@ -2473,9 +2476,15 @@ e1000_watchdog(unsigned long data) ...@@ -2473,9 +2476,15 @@ e1000_watchdog(unsigned long data)
DPRINTK(PROBE,INFO, DPRINTK(PROBE,INFO,
"10/100 speed: disabling TSO\n"); "10/100 speed: disabling TSO\n");
netdev->features &= ~NETIF_F_TSO; netdev->features &= ~NETIF_F_TSO;
#ifdef NETIF_F_TSO6
netdev->features &= ~NETIF_F_TSO6;
#endif
break; break;
case SPEED_1000: case SPEED_1000:
netdev->features |= NETIF_F_TSO; netdev->features |= NETIF_F_TSO;
#ifdef NETIF_F_TSO6
netdev->features |= NETIF_F_TSO6;
#endif
break; break;
default: default:
/* oops */ /* oops */
...@@ -2610,7 +2619,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, ...@@ -2610,7 +2619,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
0); 0);
cmd_length = E1000_TXD_CMD_IP; cmd_length = E1000_TXD_CMD_IP;
ipcse = skb->h.raw - skb->data - 1; ipcse = skb->h.raw - skb->data - 1;
#ifdef NETIF_F_TSO_IPV6 #ifdef NETIF_F_TSO6
} else if (skb->protocol == htons(ETH_P_IPV6)) { } else if (skb->protocol == htons(ETH_P_IPV6)) {
skb->nh.ipv6h->payload_len = 0; skb->nh.ipv6h->payload_len = 0;
skb->h.th->check = skb->h.th->check =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment