diff options
author | Eric Dumazet <edumazet@google.com> | 2024-03-06 16:00:23 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-07 21:12:42 -0800 |
commit | aa70d2d16f280efe8aa52afc25a33b2ec8d346b6 (patch) | |
tree | 530fada42a45cff45804c4c16bde489af5f5a706 /net/core/xdp.c | |
parent | 71c0de9bac9c1dda503322c86be4924f055dc6c9 (diff) | |
download | linux-aa70d2d16f280efe8aa52afc25a33b2ec8d346b6.tar.gz linux-aa70d2d16f280efe8aa52afc25a33b2ec8d346b6.tar.bz2 linux-aa70d2d16f280efe8aa52afc25a33b2ec8d346b6.zip |
net: move skbuff_cache(s) to net_hotdata
skbuff_cache, skbuff_fclone_cache and skb_small_head_cache
are used in rx/tx fast paths.
Move them to net_hotdata for better cache locality.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240306160031.874438-11-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/xdp.c')
-rw-r--r-- | net/core/xdp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/xdp.c b/net/core/xdp.c index 0e3709a29175..41693154e426 100644 --- a/net/core/xdp.c +++ b/net/core/xdp.c @@ -16,6 +16,7 @@ #include <linux/bug.h> #include <net/page_pool/helpers.h> +#include <net/hotdata.h> #include <net/xdp.h> #include <net/xdp_priv.h> /* struct xdp_mem_allocator */ #include <trace/events/xdp.h> @@ -589,7 +590,7 @@ EXPORT_SYMBOL_GPL(xdp_warn); int xdp_alloc_skb_bulk(void **skbs, int n_skb, gfp_t gfp) { - n_skb = kmem_cache_alloc_bulk(skbuff_cache, gfp, n_skb, skbs); + n_skb = kmem_cache_alloc_bulk(net_hotdata.skbuff_cache, gfp, n_skb, skbs); if (unlikely(!n_skb)) return -ENOMEM; @@ -658,7 +659,7 @@ struct sk_buff *xdp_build_skb_from_frame(struct xdp_frame *xdpf, { struct sk_buff *skb; - skb = kmem_cache_alloc(skbuff_cache, GFP_ATOMIC); + skb = kmem_cache_alloc(net_hotdata.skbuff_cache, GFP_ATOMIC); if (unlikely(!skb)) return NULL; |