diff options
author | Jay Cliburn <jacliburn@bellsouth.net> | 2008-02-02 20:50:05 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-17 07:49:23 -0400 |
commit | 9d90fb1ac9d97da86e24d9ea947bf2a2f333829a (patch) | |
tree | 6d131717366e60ec0b8d1c8adbc133d99ff5f736 /drivers/net | |
parent | 305282ba19f81e571bd6d2dcc10ebb02e59a06ef (diff) |
atl1: fix broken TSO
The L1 tx packet descriptor expects TCP Header Length to be expressed as a
number of 32-bit dwords. The atl1 driver uses tcp_hdrlen() to populate the
field, but tcp_hdrlen() returns the header length in bytes, not in dwords.
Add a shift to convert tcp_hdrlen() to dwords when we write it to the tpd.
Also, some of our bit assignments are made to the wrong tpd words. Change
those to the correct words.
Finally, since all this fixes TSO, enable TSO by default.
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Acked-by: Chris Snook <csnook@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/atlx/atl1.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index a84c97c75c75..8a26dad96acb 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -36,7 +36,6 @@ | |||
36 | * A very incomplete list of things that need to be dealt with: | 36 | * A very incomplete list of things that need to be dealt with: |
37 | * | 37 | * |
38 | * TODO: | 38 | * TODO: |
39 | * Fix TSO; tx performance is horrible with TSO enabled. | ||
40 | * Wake on LAN. | 39 | * Wake on LAN. |
41 | * Add more ethtool functions. | 40 | * Add more ethtool functions. |
42 | * Fix abstruse irq enable/disable condition described here: | 41 | * Fix abstruse irq enable/disable condition described here: |
@@ -1308,8 +1307,8 @@ static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb, | |||
1308 | tso->tsopl |= 1 << TSO_PARAM_ETHTYPE_SHIFT; | 1307 | tso->tsopl |= 1 << TSO_PARAM_ETHTYPE_SHIFT; |
1309 | 1308 | ||
1310 | tso->tsopl |= (iph->ihl & | 1309 | tso->tsopl |= (iph->ihl & |
1311 | CSUM_PARAM_IPHL_MASK) << CSUM_PARAM_IPHL_SHIFT; | 1310 | TSO_PARAM_IPHL_MASK) << TSO_PARAM_IPHL_SHIFT; |
1312 | tso->tsopl |= (tcp_hdrlen(skb) & | 1311 | tso->tsopl |= ((tcp_hdrlen(skb) >> 2) & |
1313 | TSO_PARAM_TCPHDRLEN_MASK) << | 1312 | TSO_PARAM_TCPHDRLEN_MASK) << |
1314 | TSO_PARAM_TCPHDRLEN_SHIFT; | 1313 | TSO_PARAM_TCPHDRLEN_SHIFT; |
1315 | tso->tsopl |= (skb_shinfo(skb)->gso_size & | 1314 | tso->tsopl |= (skb_shinfo(skb)->gso_size & |
@@ -1472,8 +1471,8 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, int count, | |||
1472 | tpd->desc.tso.tsopl = descr->tso.tsopl; | 1471 | tpd->desc.tso.tsopl = descr->tso.tsopl; |
1473 | tpd->buffer_addr = cpu_to_le64(buffer_info->dma); | 1472 | tpd->buffer_addr = cpu_to_le64(buffer_info->dma); |
1474 | tpd->desc.data = descr->data; | 1473 | tpd->desc.data = descr->data; |
1475 | tpd->desc.csum.csumpu |= (cpu_to_le16(buffer_info->length) & | 1474 | tpd->desc.tso.tsopu |= (cpu_to_le16(buffer_info->length) & |
1476 | CSUM_PARAM_BUFLEN_MASK) << CSUM_PARAM_BUFLEN_SHIFT; | 1475 | TSO_PARAM_BUFLEN_MASK) << TSO_PARAM_BUFLEN_SHIFT; |
1477 | 1476 | ||
1478 | val = (descr->tso.tsopl >> TSO_PARAM_SEGMENT_SHIFT) & | 1477 | val = (descr->tso.tsopl >> TSO_PARAM_SEGMENT_SHIFT) & |
1479 | TSO_PARAM_SEGMENT_MASK; | 1478 | TSO_PARAM_SEGMENT_MASK; |
@@ -1481,7 +1480,7 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, int count, | |||
1481 | tpd->desc.tso.tsopl |= 1 << TSO_PARAM_HDRFLAG_SHIFT; | 1480 | tpd->desc.tso.tsopl |= 1 << TSO_PARAM_HDRFLAG_SHIFT; |
1482 | 1481 | ||
1483 | if (j == (count - 1)) | 1482 | if (j == (count - 1)) |
1484 | tpd->desc.csum.csumpl |= 1 << CSUM_PARAM_EOP_SHIFT; | 1483 | tpd->desc.tso.tsopl |= 1 << TSO_PARAM_EOP_SHIFT; |
1485 | 1484 | ||
1486 | if (++tpd_next_to_use == tpd_ring->count) | 1485 | if (++tpd_next_to_use == tpd_ring->count) |
1487 | tpd_next_to_use = 0; | 1486 | tpd_next_to_use = 0; |
@@ -1574,9 +1573,9 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1574 | vlan_tag = vlan_tx_tag_get(skb); | 1573 | vlan_tag = vlan_tx_tag_get(skb); |
1575 | vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) | | 1574 | vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) | |
1576 | ((vlan_tag >> 9) & 0x8); | 1575 | ((vlan_tag >> 9) & 0x8); |
1577 | param.csum.csumpl |= 1 << CSUM_PARAM_INSVLAG_SHIFT; | 1576 | param.tso.tsopl |= 1 << TSO_PARAM_INSVLAG_SHIFT; |
1578 | param.csum.csumpu |= (vlan_tag & CSUM_PARAM_VALANTAG_MASK) << | 1577 | param.tso.tsopu |= (vlan_tag & TSO_PARAM_VLANTAG_MASK) << |
1579 | CSUM_PARAM_VALAN_SHIFT; | 1578 | TSO_PARAM_VLAN_SHIFT; |
1580 | } | 1579 | } |
1581 | 1580 | ||
1582 | tso = atl1_tso(adapter, skb, ¶m.tso); | 1581 | tso = atl1_tso(adapter, skb, ¶m.tso); |
@@ -1595,8 +1594,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1595 | } | 1594 | } |
1596 | } | 1595 | } |
1597 | 1596 | ||
1598 | val = (param.csum.csumpl >> CSUM_PARAM_SEGMENT_SHIFT) & | 1597 | val = (param.tso.tsopl >> TSO_PARAM_SEGMENT_SHIFT) & |
1599 | CSUM_PARAM_SEGMENT_MASK; | 1598 | TSO_PARAM_SEGMENT_MASK; |
1600 | atl1_tx_map(adapter, skb, 1 == val); | 1599 | atl1_tx_map(adapter, skb, 1 == val); |
1601 | atl1_tx_queue(adapter, count, ¶m); | 1600 | atl1_tx_queue(adapter, count, ¶m); |
1602 | netdev->trans_start = jiffies; | 1601 | netdev->trans_start = jiffies; |
@@ -2091,13 +2090,7 @@ static int __devinit atl1_probe(struct pci_dev *pdev, | |||
2091 | netdev->features = NETIF_F_HW_CSUM; | 2090 | netdev->features = NETIF_F_HW_CSUM; |
2092 | netdev->features |= NETIF_F_SG; | 2091 | netdev->features |= NETIF_F_SG; |
2093 | netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); | 2092 | netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); |
2094 | 2093 | netdev->features |= NETIF_F_TSO; | |
2095 | /* | ||
2096 | * FIXME - Until tso performance gets fixed, disable the feature. | ||
2097 | * Enable it with ethtool -K if desired. | ||
2098 | */ | ||
2099 | /* netdev->features |= NETIF_F_TSO; */ | ||
2100 | |||
2101 | netdev->features |= NETIF_F_LLTX; | 2094 | netdev->features |= NETIF_F_LLTX; |
2102 | 2095 | ||
2103 | /* | 2096 | /* |