diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-01-04 19:13:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-04 19:13:19 -0500 |
commit | b530256d2e0f1a75fab31f9821129fff1bb49faa (patch) | |
tree | e3e615d405921fc157169180d53c91d09b9a7186 /net | |
parent | cfc3a44c3c32abe48898398d9a92e8524c976803 (diff) |
gro: Use gso_size to store MSS
In order to allow GRO packets without frag_list at all, we need to
store the MSS in the packet itself. The obvious place is gso_size.
The only thing to watch out for is if the packet ends up not being
GRO then we need to clear gso_size before pushing the packet into
the stack.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 2 | ||||
-rw-r--r-- | net/core/skbuff.c | 1 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 5 |
3 files changed, 4 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 09c66a449da6..1e1a68066457 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2365,6 +2365,7 @@ static int napi_gro_complete(struct sk_buff *skb) | |||
2365 | } | 2365 | } |
2366 | 2366 | ||
2367 | out: | 2367 | out: |
2368 | skb_shinfo(skb)->gso_size = 0; | ||
2368 | __skb_push(skb, -skb_network_offset(skb)); | 2369 | __skb_push(skb, -skb_network_offset(skb)); |
2369 | return netif_receive_skb(skb); | 2370 | return netif_receive_skb(skb); |
2370 | } | 2371 | } |
@@ -2446,6 +2447,7 @@ int napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) | |||
2446 | } | 2447 | } |
2447 | 2448 | ||
2448 | NAPI_GRO_CB(skb)->count = 1; | 2449 | NAPI_GRO_CB(skb)->count = 1; |
2450 | skb_shinfo(skb)->gso_size = skb->len; | ||
2449 | skb->next = napi->gro_list; | 2451 | skb->next = napi->gro_list; |
2450 | napi->gro_list = skb; | 2452 | napi->gro_list = skb; |
2451 | 2453 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index b8d0abb26433..3aafb10325b8 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2613,6 +2613,7 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2613 | 2613 | ||
2614 | *NAPI_GRO_CB(nskb) = *NAPI_GRO_CB(p); | 2614 | *NAPI_GRO_CB(nskb) = *NAPI_GRO_CB(p); |
2615 | skb_shinfo(nskb)->frag_list = p; | 2615 | skb_shinfo(nskb)->frag_list = p; |
2616 | skb_shinfo(nskb)->gso_size = skb_shinfo(p)->gso_size; | ||
2616 | skb_header_release(p); | 2617 | skb_header_release(p); |
2617 | nskb->prev = p; | 2618 | nskb->prev = p; |
2618 | 2619 | ||
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index f28acf11fc67..4d655e945413 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2519,9 +2519,7 @@ found: | |||
2519 | flush |= memcmp(th + 1, th2 + 1, thlen - sizeof(*th)); | 2519 | flush |= memcmp(th + 1, th2 + 1, thlen - sizeof(*th)); |
2520 | 2520 | ||
2521 | total = p->len; | 2521 | total = p->len; |
2522 | mss = total; | 2522 | mss = skb_shinfo(p)->gso_size; |
2523 | if (skb_shinfo(p)->frag_list) | ||
2524 | mss = skb_shinfo(p)->frag_list->len; | ||
2525 | 2523 | ||
2526 | flush |= skb->len > mss || skb->len <= 0; | 2524 | flush |= skb->len > mss || skb->len <= 0; |
2527 | flush |= ntohl(th2->seq) + total != ntohl(th->seq); | 2525 | flush |= ntohl(th2->seq) + total != ntohl(th->seq); |
@@ -2557,7 +2555,6 @@ int tcp_gro_complete(struct sk_buff *skb) | |||
2557 | skb->csum_offset = offsetof(struct tcphdr, check); | 2555 | skb->csum_offset = offsetof(struct tcphdr, check); |
2558 | skb->ip_summed = CHECKSUM_PARTIAL; | 2556 | skb->ip_summed = CHECKSUM_PARTIAL; |
2559 | 2557 | ||
2560 | skb_shinfo(skb)->gso_size = skb_shinfo(skb)->frag_list->len; | ||
2561 | skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count; | 2558 | skb_shinfo(skb)->gso_segs = NAPI_GRO_CB(skb)->count; |
2562 | 2559 | ||
2563 | if (th->cwr) | 2560 | if (th->cwr) |