]> Gentwo Git Trees - linux/.git/commit
xsk: remove @first_frag from xsk_build_skb()
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Thu, 25 Sep 2025 16:00:08 +0000 (18:00 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Sep 2025 20:51:45 +0000 (13:51 -0700)
commit6b9c129c2f93df545248e26434720928f249ff2e
tree5d12e5c983e3ba5fae4b02ffc212bea76cb88d81
parentc30d084960cf316c95fbf145d39974ce1ff7889c
xsk: remove @first_frag from xsk_build_skb()

Instead of using auxiliary boolean that tracks if we are at first frag
when gathering all elements of skb, same functionality can be achieved
with checking if skb_shared_info::nr_frags is 0.

Remove @first_frag but be careful around xsk_build_skb_zerocopy() and
NULL the skb pointer when it failed so that common error path does not
incorrectly interpret it during decision whether to call kfree_skb().

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250925160009.2474816-3-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/xdp/xsk.c