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/e1000 | |
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/e1000')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 78cf417cf236..4572fbba50f9 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -2887,7 +2887,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2887 | return err; | 2887 | return err; |
2888 | } | 2888 | } |
2889 | 2889 | ||
2890 | hdr_len = (skb_transport_offset(skb) + (skb->h.th->doff << 2)); | 2890 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
2891 | mss = skb_shinfo(skb)->gso_size; | 2891 | mss = skb_shinfo(skb)->gso_size; |
2892 | if (skb->protocol == htons(ETH_P_IP)) { | 2892 | if (skb->protocol == htons(ETH_P_IP)) { |
2893 | struct iphdr *iph = ip_hdr(skb); | 2893 | struct iphdr *iph = ip_hdr(skb); |
@@ -3292,7 +3292,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
3292 | /* TSO Workaround for 82571/2/3 Controllers -- if skb->data | 3292 | /* TSO Workaround for 82571/2/3 Controllers -- if skb->data |
3293 | * points to just header, pull a few bytes of payload from | 3293 | * points to just header, pull a few bytes of payload from |
3294 | * frags into skb->data */ | 3294 | * frags into skb->data */ |
3295 | hdr_len = (skb_transport_offset(skb) + (skb->h.th->doff << 2)); | 3295 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
3296 | if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) { | 3296 | if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) { |
3297 | switch (adapter->hw.mac_type) { | 3297 | switch (adapter->hw.mac_type) { |
3298 | unsigned int pull_size; | 3298 | unsigned int pull_size; |