The function build_skb() also have the responsibility to allocate and clear the SKB structure. Introduce a new function build_skb_around(), that moves the responsibility of allocation and clearing to the caller. This allows caller to use kmem_cache (slab/slub) bulk allocation API. Next patch use this function combined with kmem_cache_alloc_bulk.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -1042,6 +1042,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t priority, int flags, · 1041 unmodified lines | ||
| 1042 | 1042 | int node); |
| 1043 | 1043 | struct sk_buff *__build_skb(void *data, unsigned int frag_size); |
| 1044 | 1044 | struct sk_buff *build_skb(void *data, unsigned int frag_size); |
| 1045 | +struct sk_buff *build_skb_around(struct sk_buff *skb, | |
| 1046 | + void *data, unsigned int frag_size); | |
| 1045 | 1047 | |
| 1046 | 1048 | /** |
| 1047 | 1049 | * alloc_skb - allocate a network buffer |