[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251125085431.4039-2-kerneljasonxing@gmail.com>
Date: Tue, 25 Nov 2025 16:54:29 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
bjorn@...nel.org,
magnus.karlsson@...el.com,
maciej.fijalkowski@...el.com,
jonathan.lemon@...il.com,
sdf@...ichev.me,
ast@...nel.org,
daniel@...earbox.net,
hawk@...nel.org,
john.fastabend@...il.com
Cc: bpf@...r.kernel.org,
netdev@...r.kernel.org,
Jason Xing <kernelxing@...cent.com>
Subject: [PATCH net-next v2 1/3] xsk: add atomic cached_prod for copy mode
From: Jason Xing <kernelxing@...cent.com>
Add a union member for completion queue only in copy mode for now. The
purpose is to replace the cq_cached_prod_lock with atomic operation
to improve performance. Note that completion queue in zerocopy mode
doesn't need to be converted because the whole process is lockless.
Signed-off-by: Jason Xing <kernelxing@...cent.com>
---
net/xdp/xsk_queue.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h
index 1eb8d9f8b104..44cc01555c0b 100644
--- a/net/xdp/xsk_queue.h
+++ b/net/xdp/xsk_queue.h
@@ -40,7 +40,11 @@ struct xdp_umem_ring {
struct xsk_queue {
u32 ring_mask;
u32 nentries;
- u32 cached_prod;
+ union {
+ u32 cached_prod;
+ /* Used for cq in copy mode only */
+ atomic_t cached_prod_atomic;
+ };
u32 cached_cons;
struct xdp_ring *ring;
u64 invalid_descs;
--
2.41.3
Powered by blists - more mailing lists