]> Gentwo Git Trees - linux/.git/commit
net: use NAPI_SKB_CACHE_FREE to keep 32 as default to do bulk free
authorJason Xing <kernelxing@tencent.com>
Tue, 18 Nov 2025 07:06:45 +0000 (15:06 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 20 Nov 2025 04:29:24 +0000 (20:29 -0800)
commit2d67b5c5c67f934c54a55e00ee291a8587c5b4fe
tree8afb369c0d379acde657f06112a39d3450f3c9e7
parent01d7385618992a9017198534870aec62f54f963a
net: use NAPI_SKB_CACHE_FREE to keep 32 as default to do bulk free

- Replace NAPI_SKB_CACHE_HALF with NAPI_SKB_CACHE_FREE
- Only free 32 skbs in napi_skb_cache_put()

Since the first patch adjusting NAPI_SKB_CACHE_SIZE to 128, the number
of packets to be freed in the softirq was increased from 32 to 64.
Considering a subsequent net_rx_action() calling napi_poll() a few
times can easily consume the 64 available slots and we can afford
keeping a higher value of sk_buffs in per-cpu storage, decrease
NAPI_SKB_CACHE_FREE to 32 like before. So now the logic is 1) keeping
96 skbs, 2) freeing 32 skbs at one time.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Xing <kernelxing@tencent.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://patch.msgid.link/20251118070646.61344-4-kerneljasonxing@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/skbuff.c