diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-05-26 14:50:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-27 06:25:57 -0400 |
commit | 78d3fd0b7de844a6dad56e9620fc9d2271b32ab9 (patch) | |
tree | e79c910646deccc50f5a108782f66cebffafa4d8 /net/core/dev.c | |
parent | 67147ba99aeb48f2863e03b68e090088a34c1b5d (diff) |
gro: Only use skb_gro_header for completely non-linear packets
Currently skb_gro_header is used for packets which put the hardware
header in skb->data with the rest in frags. Since the drivers that
need this optimisation all provide completely non-linear packets,
we can gain extra optimisations by only performing the frag0
optimisation for completely non-linear packets.
In particular, we can simply test frag0 (instead of skb_headlen)
to see whether the optimisation is in force.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index bdb1a738193d..f9d90c56b6f0 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2510,7 +2510,8 @@ void skb_gro_reset_offset(struct sk_buff *skb) | |||
2510 | NAPI_GRO_CB(skb)->data_offset = 0; | 2510 | NAPI_GRO_CB(skb)->data_offset = 0; |
2511 | NAPI_GRO_CB(skb)->frag0 = NULL; | 2511 | NAPI_GRO_CB(skb)->frag0 = NULL; |
2512 | 2512 | ||
2513 | if (!skb_headlen(skb) && !PageHighMem(skb_shinfo(skb)->frags[0].page)) | 2513 | if (skb->mac_header == skb->tail && |
2514 | !PageHighMem(skb_shinfo(skb)->frags[0].page)) | ||
2514 | NAPI_GRO_CB(skb)->frag0 = | 2515 | NAPI_GRO_CB(skb)->frag0 = |
2515 | page_address(skb_shinfo(skb)->frags[0].page) + | 2516 | page_address(skb_shinfo(skb)->frags[0].page) + |
2516 | skb_shinfo(skb)->frags[0].page_offset; | 2517 | skb_shinfo(skb)->frags[0].page_offset; |