diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-18 20:43:48 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:24 -0400 |
commit | ab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (patch) | |
tree | 54cfa7d4fe00d0c28a60022b075afc0856d6fc2b /drivers/net/atl1/atl1_main.c | |
parent | 88c7664f13bd1a36acb8566b93892a4c58759ac6 (diff) |
[TCP]: Introduce tcp_hdrlen() and tcp_optlen()
The ip_hdrlen() buddy, created to reduce the number of skb->h.th-> uses and to
avoid the longer, open coded equivalent.
Ditched a no-op in bnx2 in the process.
I wonder if we should have a BUG_ON(skb->h.th->doff < 5) in tcp_optlen()...
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/atl1/atl1_main.c')
-rw-r--r-- | drivers/net/atl1/atl1_main.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index c26f8ce320e6..8d5994751e2e 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -1307,7 +1307,7 @@ static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb, | |||
1307 | 1307 | ||
1308 | tso->tsopl |= (iph->ihl & | 1308 | tso->tsopl |= (iph->ihl & |
1309 | CSUM_PARAM_IPHL_MASK) << CSUM_PARAM_IPHL_SHIFT; | 1309 | CSUM_PARAM_IPHL_MASK) << CSUM_PARAM_IPHL_SHIFT; |
1310 | tso->tsopl |= ((skb->h.th->doff << 2) & | 1310 | tso->tsopl |= (tcp_hdrlen(skb) & |
1311 | TSO_PARAM_TCPHDRLEN_MASK) << TSO_PARAM_TCPHDRLEN_SHIFT; | 1311 | TSO_PARAM_TCPHDRLEN_MASK) << TSO_PARAM_TCPHDRLEN_SHIFT; |
1312 | tso->tsopl |= (skb_shinfo(skb)->gso_size & | 1312 | tso->tsopl |= (skb_shinfo(skb)->gso_size & |
1313 | TSO_PARAM_MSS_MASK) << TSO_PARAM_MSS_SHIFT; | 1313 | TSO_PARAM_MSS_MASK) << TSO_PARAM_MSS_SHIFT; |
@@ -1369,8 +1369,7 @@ static void atl1_tx_map(struct atl1_adapter *adapter, | |||
1369 | 1369 | ||
1370 | if (tcp_seg) { | 1370 | if (tcp_seg) { |
1371 | /* TSO/GSO */ | 1371 | /* TSO/GSO */ |
1372 | proto_hdr_len = (skb_transport_offset(skb) + | 1372 | proto_hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
1373 | (skb->h.th->doff << 2)); | ||
1374 | buffer_info->length = proto_hdr_len; | 1373 | buffer_info->length = proto_hdr_len; |
1375 | page = virt_to_page(skb->data); | 1374 | page = virt_to_page(skb->data); |
1376 | offset = (unsigned long)skb->data & ~PAGE_MASK; | 1375 | offset = (unsigned long)skb->data & ~PAGE_MASK; |
@@ -1563,7 +1562,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1563 | if (mss) { | 1562 | if (mss) { |
1564 | if (skb->protocol == htons(ETH_P_IP)) { | 1563 | if (skb->protocol == htons(ETH_P_IP)) { |
1565 | proto_hdr_len = (skb_transport_offset(skb) + | 1564 | proto_hdr_len = (skb_transport_offset(skb) + |
1566 | (skb->h.th->doff << 2)); | 1565 | tcp_hdrlen(skb)); |
1567 | if (unlikely(proto_hdr_len > len)) { | 1566 | if (unlikely(proto_hdr_len > len)) { |
1568 | dev_kfree_skb_any(skb); | 1567 | dev_kfree_skb_any(skb); |
1569 | return NETDEV_TX_OK; | 1568 | return NETDEV_TX_OK; |