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/myri10ge | |
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/myri10ge')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 7c04179c7b13..e04228c7b14f 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -2029,7 +2029,7 @@ again: | |||
2029 | odd_flag = 0; | 2029 | odd_flag = 0; |
2030 | flags = (MXGEFW_FLAGS_NO_TSO | MXGEFW_FLAGS_FIRST); | 2030 | flags = (MXGEFW_FLAGS_NO_TSO | MXGEFW_FLAGS_FIRST); |
2031 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { | 2031 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { |
2032 | cksum_offset = (skb->h.raw - skb->data); | 2032 | cksum_offset = skb_transport_offset(skb); |
2033 | pseudo_hdr_offset = cksum_offset + skb->csum_offset; | 2033 | pseudo_hdr_offset = cksum_offset + skb->csum_offset; |
2034 | /* If the headers are excessively large, then we must | 2034 | /* If the headers are excessively large, then we must |
2035 | * fall back to a software checksum */ | 2035 | * fall back to a software checksum */ |
@@ -2054,7 +2054,8 @@ again: | |||
2054 | * send loop that we are still in the | 2054 | * send loop that we are still in the |
2055 | * header portion of the TSO packet. | 2055 | * header portion of the TSO packet. |
2056 | * TSO header must be at most 134 bytes long */ | 2056 | * TSO header must be at most 134 bytes long */ |
2057 | cum_len = -((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); | 2057 | cum_len = -(skb_transport_offset(skb) + |
2058 | (skb->h.th->doff << 2)); | ||
2058 | 2059 | ||
2059 | /* for TSO, pseudo_hdr_offset holds mss. | 2060 | /* for TSO, pseudo_hdr_offset holds mss. |
2060 | * The firmware figures out where to put | 2061 | * The firmware figures out where to put |