diff options
| author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-07-22 15:09:08 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-07-25 00:05:57 -0400 |
| commit | fed66381d65a35198639f564365e61a7f256bf79 (patch) | |
| tree | e4d4c83f135f58c32a85454e28e33407711f7718 /include/linux | |
| parent | c1f79426e2df5ef96fe3e76de6c7606d15bf390b (diff) | |
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 'include/linux')
| -rw-r--r-- | include/linux/skbuff.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f5aa87e1e0c8..d89876b806a0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -202,10 +202,11 @@ struct skb_shared_info { | |||
| 202 | */ | 202 | */ |
| 203 | atomic_t dataref; | 203 | atomic_t dataref; |
| 204 | 204 | ||
| 205 | skb_frag_t frags[MAX_SKB_FRAGS]; | ||
| 206 | /* Intermediate layers must ensure that destructor_arg | 205 | /* Intermediate layers must ensure that destructor_arg |
| 207 | * remains valid until skb destructor */ | 206 | * remains valid until skb destructor */ |
| 208 | void * destructor_arg; | 207 | void * destructor_arg; |
| 208 | /* must be last field, see pskb_expand_head() */ | ||
| 209 | skb_frag_t frags[MAX_SKB_FRAGS]; | ||
| 209 | }; | 210 | }; |
| 210 | 211 | ||
| 211 | /* We divide dataref into two halves. The higher 16 bits hold references | 212 | /* We divide dataref into two halves. The higher 16 bits hold references |
