diff options
author | Maciej Fijalkowski <maciej.fijalkowski@intel.com> | 2024-10-07 14:24:53 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2024-10-14 17:22:38 +0200 |
commit | b692bf9a7543af7ad11a59d182a3757578f0ba53 (patch) | |
tree | 5552d4412e8e07a324a94fcc358961f2ee8a3fbf /net/xdp | |
parent | a8057ed23a368abad2e8b8f53438b98170a82ebc (diff) | |
download | linux-stable-b692bf9a7543af7ad11a59d182a3757578f0ba53.tar.gz linux-stable-b692bf9a7543af7ad11a59d182a3757578f0ba53.tar.bz2 linux-stable-b692bf9a7543af7ad11a59d182a3757578f0ba53.zip |
xsk: Get rid of xdp_buff_xsk::xskb_list_node
Let's bring xdp_buff_xsk back to occupying 2 cachelines by removing
xskb_list_node - for the purpose of gathering the xskb frags
free_list_node can be used, head of the list (xsk_buff_pool::xskb_list)
stays as-is, just reuse the node ptr.
It is safe to do as a single xdp_buff_xsk can never reside in two
pool's lists simultaneously.
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20241007122458.282590-2-maciej.fijalkowski@intel.com
Diffstat (limited to 'net/xdp')
-rw-r--r-- | net/xdp/xsk.c | 4 | ||||
-rw-r--r-- | net/xdp/xsk_buff_pool.c | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 1140b2a120ca..9c93064349a8 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -171,14 +171,14 @@ static int xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len) return 0; xskb_list = &xskb->pool->xskb_list; - list_for_each_entry_safe(pos, tmp, xskb_list, xskb_list_node) { + list_for_each_entry_safe(pos, tmp, xskb_list, free_list_node) { if (list_is_singular(xskb_list)) contd = 0; len = pos->xdp.data_end - pos->xdp.data; err = __xsk_rcv_zc(xs, pos, len, contd); if (err) goto err; - list_del(&pos->xskb_list_node); + list_del(&pos->free_list_node); } return 0; diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c index 521a2938e50a..e5368db7d18e 100644 --- a/net/xdp/xsk_buff_pool.c +++ b/net/xdp/xsk_buff_pool.c @@ -102,7 +102,6 @@ struct xsk_buff_pool *xp_create_and_assign_umem(struct xdp_sock *xs, xskb->pool = pool; xskb->xdp.frame_sz = umem->chunk_size - umem->headroom; INIT_LIST_HEAD(&xskb->free_list_node); - INIT_LIST_HEAD(&xskb->xskb_list_node); if (pool->unaligned) pool->free_heads[i] = xskb; else |