diff options
author | Arnaldo Carvalho de Melo | 2007-04-26 02:55:53 +0200 |
---|---|---|
committer | David S. Miller | 2007-04-26 07:25:16 +0200 |
commit | ea2ae17d6443abddc79480dc9f7af8feacabddc4 (patch) | |
tree | 2d6f48a5e4a40f761b5b510af9aac1fca55004cb /drivers/net/ixgb | |
parent | [SK_BUFF]: Introduce skb_reset_transport_header(skb) (diff) | |
download | kernel-qcow2-linux-ea2ae17d6443abddc79480dc9f7af8feacabddc4.tar.gz kernel-qcow2-linux-ea2ae17d6443abddc79480dc9f7af8feacabddc4.tar.xz kernel-qcow2-linux-ea2ae17d6443abddc79480dc9f7af8feacabddc4.zip |
[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/ixgb')
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index bba4dcaf92e9..ceea6e45792d 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c @@ -1190,7 +1190,7 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) return err; } - hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); + hdr_len = (skb_transport_offset(skb) + (skb->h.th->doff << 2)); mss = skb_shinfo(skb)->gso_size; iph = ip_hdr(skb); iph->tot_len = 0; @@ -1199,8 +1199,8 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) 0, IPPROTO_TCP, 0); ipcss = skb_network_offset(skb); ipcso = (void *)&(iph->check) - (void *)skb->data; - ipcse = skb->h.raw - skb->data - 1; - tucss = skb->h.raw - skb->data; + ipcse = skb_transport_offset(skb) - 1; + tucss = skb_transport_offset(skb); tucso = (void *)&(skb->h.th->check) - (void *)skb->data; tucse = 0; @@ -1245,7 +1245,7 @@ ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb) if(likely(skb->ip_summed == CHECKSUM_PARTIAL)) { struct ixgb_buffer *buffer_info; - css = skb->h.raw - skb->data; + css = skb_transport_offset(skb); cso = css + skb->csum_offset; i = adapter->tx_ring.next_to_use; |