diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-01-29 09:19:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-29 19:33:04 -0500 |
commit | 81705ad1b2f926d2ef15ed95074a9c1fa9fb4dc4 (patch) | |
tree | 9a88eb7cc46e5f1bd2aa7296e77bdb90f5533795 /net/core | |
parent | 86911732d3996a9da07914b280621450111bb6da (diff) |
gro: Do not merge paged packets into frag_list
gro: Do not merge paged packets into frag_list
Bigger is not always better :)
It was easy to continue to merged packets into frag_list after the
page array is full. However, this turns out to be worse than LRO
because frag_list is a much less efficient form of storage than the
page array. So we're better off stopping the merge and starting
a new entry with an empty page array.
In future we can optimise this further by doing frag_list merging
but making sure that we continue to fill in the page array.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/skbuff.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index f9f4065a7e9b..d386f1082ebd 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2591,9 +2591,11 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2591 | 2591 | ||
2592 | if (skb_shinfo(p)->frag_list) | 2592 | if (skb_shinfo(p)->frag_list) |
2593 | goto merge; | 2593 | goto merge; |
2594 | else if (skb_headlen(skb) <= skb_gro_offset(skb) && | 2594 | else if (skb_headlen(skb) <= skb_gro_offset(skb)) { |
2595 | skb_shinfo(p)->nr_frags + skb_shinfo(skb)->nr_frags <= | 2595 | if (skb_shinfo(p)->nr_frags + skb_shinfo(skb)->nr_frags > |
2596 | MAX_SKB_FRAGS) { | 2596 | MAX_SKB_FRAGS) |
2597 | return -E2BIG; | ||
2598 | |||
2597 | skb_shinfo(skb)->frags[0].page_offset += | 2599 | skb_shinfo(skb)->frags[0].page_offset += |
2598 | skb_gro_offset(skb) - skb_headlen(skb); | 2600 | skb_gro_offset(skb) - skb_headlen(skb); |
2599 | skb_shinfo(skb)->frags[0].size -= | 2601 | skb_shinfo(skb)->frags[0].size -= |