]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: advance skb_defer_disable_key check in napi_consume_skb
authorJason Xing <kernelxing@tencent.com>
Thu, 2 Apr 2026 03:41:14 +0000 (11:41 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 7 Apr 2026 01:32:04 +0000 (18:32 -0700)
commit8a4e3ab61d496c37595219e5122d91f204cb05de
tree4ea1e5ee9b1d8a4d71c609b321da705572605cbe
parent1ef05ed263a1ad857149407a79496dcacafe39eb
net: advance skb_defer_disable_key check in napi_consume_skb

When net.core.skb_defer_max is adjusted to zero, napi_consume_skb()
shouldn't go into that deeper in skb_attempt_defer_free() because it adds
an additional pair of local_bh_enable/disable() which is evidently not
needed. Advancing the check of the static key saves more cycles and
benefits non defer case.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
Link: https://patch.msgid.link/20260402034114.65766-1-kerneljasonxing@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/skbuff.c