diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2012-03-21 02:58:03 -0400 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2012-04-05 11:17:33 -0400 |
commit | f3be4274f9b99b959f5c8d362536b4b0a2e6b689 (patch) | |
tree | 108d5231ed7b4d3ce3aa9638f0dc37700e597e65 /net/core | |
parent | 9582ec1d274c1908690d4a93be15a32f2eebf463 (diff) |
net: fix napi_reuse_skb() skb reserve
BugLink: http://bugs.launchpad.net/bugs/971808
[ Upstream commit 2a2a459eeeff48640dc557548ce576d666ab06ed ]
napi->skb is allocated in napi_get_frags() using
netdev_alloc_skb_ip_align(), with a reserve of NET_SKB_PAD +
NET_IP_ALIGN bytes.
However, when such skb is recycled in napi_reuse_skb(), it ends with a
reserve of NET_IP_ALIGN which is suboptimal.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core')
-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 17fdbf8d478..f134f88606e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -3504,7 +3504,8 @@ EXPORT_SYMBOL(napi_gro_receive); | |||
3504 | static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) | 3504 | static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) |
3505 | { | 3505 | { |
3506 | __skb_pull(skb, skb_headlen(skb)); | 3506 | __skb_pull(skb, skb_headlen(skb)); |
3507 | skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); | 3507 | /* restore the reserve we had after netdev_alloc_skb_ip_align() */ |
3508 | skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb)); | ||
3508 | skb->vlan_tci = 0; | 3509 | skb->vlan_tci = 0; |
3509 | skb->dev = napi->dev; | 3510 | skb->dev = napi->dev; |
3510 | skb->skb_iif = 0; | 3511 | skb->skb_iif = 0; |