diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-25 20:55:53 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:16 -0400 |
commit | ea2ae17d6443abddc79480dc9f7af8feacabddc4 (patch) | |
tree | 2d6f48a5e4a40f761b5b510af9aac1fca55004cb /drivers/net/e1000/e1000_main.c | |
parent | badff6d01a8589a1c828b0bf118903ca38627f4e (diff) |
[SK_BUFF]: Introduce skb_transport_offset()
For the quite common 'skb->h.raw - skb->data' sequence.
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/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index a3d9986b4170..78cf417cf236 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->h.raw - skb->data) + (skb->h.th->doff << 2)); | 2890 | hdr_len = (skb_transport_offset(skb) + (skb->h.th->doff << 2)); |
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); |
@@ -2897,7 +2897,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2897 | iph->daddr, 0, | 2897 | iph->daddr, 0, |
2898 | IPPROTO_TCP, 0); | 2898 | IPPROTO_TCP, 0); |
2899 | cmd_length = E1000_TXD_CMD_IP; | 2899 | cmd_length = E1000_TXD_CMD_IP; |
2900 | ipcse = skb->h.raw - skb->data - 1; | 2900 | ipcse = skb_transport_offset(skb) - 1; |
2901 | } else if (skb->protocol == htons(ETH_P_IPV6)) { | 2901 | } else if (skb->protocol == htons(ETH_P_IPV6)) { |
2902 | ipv6_hdr(skb)->payload_len = 0; | 2902 | ipv6_hdr(skb)->payload_len = 0; |
2903 | skb->h.th->check = | 2903 | skb->h.th->check = |
@@ -2908,7 +2908,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2908 | } | 2908 | } |
2909 | ipcss = skb_network_offset(skb); | 2909 | ipcss = skb_network_offset(skb); |
2910 | ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data; | 2910 | ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data; |
2911 | tucss = skb->h.raw - skb->data; | 2911 | tucss = skb_transport_offset(skb); |
2912 | tucso = (void *)&(skb->h.th->check) - (void *)skb->data; | 2912 | tucso = (void *)&(skb->h.th->check) - (void *)skb->data; |
2913 | tucse = 0; | 2913 | tucse = 0; |
2914 | 2914 | ||
@@ -2950,7 +2950,7 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2950 | uint8_t css; | 2950 | uint8_t css; |
2951 | 2951 | ||
2952 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { | 2952 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { |
2953 | css = skb->h.raw - skb->data; | 2953 | css = skb_transport_offset(skb); |
2954 | 2954 | ||
2955 | i = tx_ring->next_to_use; | 2955 | i = tx_ring->next_to_use; |
2956 | buffer_info = &tx_ring->buffer_info[i]; | 2956 | buffer_info = &tx_ring->buffer_info[i]; |
@@ -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->h.raw - skb->data) + (skb->h.th->doff << 2)); | 3295 | hdr_len = (skb_transport_offset(skb) + (skb->h.th->doff << 2)); |
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; |