Skip to content

Commit

Permalink
gro: Do not merge paged packets into frag_list
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 30, 2009
1 parent 8691173 commit 81705ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -2591,9 +2591,11 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)

if (skb_shinfo(p)->frag_list)
goto merge;
else if (skb_headlen(skb) <= skb_gro_offset(skb) &&
skb_shinfo(p)->nr_frags + skb_shinfo(skb)->nr_frags <=
MAX_SKB_FRAGS) {
else if (skb_headlen(skb) <= skb_gro_offset(skb)) {
if (skb_shinfo(p)->nr_frags + skb_shinfo(skb)->nr_frags >
MAX_SKB_FRAGS)
return -E2BIG;

skb_shinfo(skb)->frags[0].page_offset +=
skb_gro_offset(skb) - skb_headlen(skb);
skb_shinfo(skb)->frags[0].size -=
Expand Down

0 comments on commit 81705ad

Please sign in to comment.