summaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-07-22 19:09:08 +0000
committerDavid S. Miller <davem@davemloft.net>2010-07-24 21:05:57 -0700
commitfed66381d65a35198639f564365e61a7f256bf79 (patch)
treee4d4c83f135f58c32a85454e28e33407711f7718 /net/core/skbuff.c
parentc1f79426e2df5ef96fe3e76de6c7606d15bf390b (diff)
downloadop-kernel-dev-fed66381d65a35198639f564365e61a7f256bf79.zip
op-kernel-dev-fed66381d65a35198639f564365e61a7f256bf79.tar.gz
net: pskb_expand_head() optimization
Move frags[] at the end of struct skb_shared_info, and make pskb_expand_head() copy only the used part of it instead of whole array. This should avoid kmemcheck warnings and speedup pskb_expand_head() as well, avoiding a lot of cache misses. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 76d33ca..7da58a2 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -817,7 +817,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
memcpy(data + nhead, skb->head, skb->tail - skb->head);
#endif
memcpy(data + size, skb_end_pointer(skb),
- sizeof(struct skb_shared_info));
+ offsetof(struct skb_shared_info, frags[skb_shinfo(skb)->nr_frags]));
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
get_page(skb_shinfo(skb)->frags[i].page);
OpenPOWER on IntegriCloud