]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xsk: add indirect call for xsk_destruct_skb
authorJason Xing <kernelxing@tencent.com>
Fri, 31 Oct 2025 10:33:28 +0000 (18:33 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 11 Nov 2025 09:21:08 +0000 (10:21 +0100)
commit8da7bea7db692e786165b71729fb68b7ff65ee56
tree86f436936e3aa1c281a7e80ce046e00bb97f86a2
parentb981e100c19dcd91ce8cca8562c3cdabd4fcf28c
xsk: add indirect call for xsk_destruct_skb

Since Eric proposed an idea about adding indirect call wrappers for
UDP and managed to see a huge improvement[1], the same situation can
also be applied in xsk scenario.

This patch adds an indirect call for xsk and helps current copy mode
improve the performance by around 1% stably which was observed with
IXGBE at 10Gb/sec loaded. If the throughput grows, the positive effect
will be magnified. I applied this patch on top of batch xmit series[2],
and was able to see <5% improvement from our internal application
which is a little bit unstable though.

Use INDIRECT wrappers to keep xsk_destruct_skb static as it used to
be when the mitigation config is off.

Be aware of the freeing path that can be very hot since the frequency
can reach around 2,000,000 times per second with the xdpsock test.

[1]: https://lore.kernel.org/netdev/20251006193103.2684156-2-edumazet@google.com/
[2]: https://lore.kernel.org/all/20251021131209.41491-1-kerneljasonxing@gmail.com/

Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Jason Xing <kernelxing@tencent.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://patch.msgid.link/20251031103328.95468-1-kerneljasonxing@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/xdp_sock.h
net/core/skbuff.c
net/xdp/xsk.c