]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: xdp: pass full flags to xdp_update_skb_shared_info()
authorJakub Kicinski <kuba@kernel.org>
Fri, 5 Sep 2025 22:15:38 +0000 (15:15 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 11 Sep 2025 10:00:20 +0000 (12:00 +0200)
commit1827f773e416842bb0a1be93f313e02591e0b0c2
tree5bedbc515262b2ea5fada04e88a01b7e2def05e1
parentdb1b6006668623b46a3f6b3fe6b5f030e4c60a42
net: xdp: pass full flags to xdp_update_skb_shared_info()

xdp_update_skb_shared_info() needs to update skb state which
was maintained in xdp_buff / frame. Pass full flags into it,
instead of breaking it out bit by bit. We will need to add
a bit for unreadable frags (even tho XDP doesn't support
those the driver paths may be common), at which point almost
all call sites would become:

    xdp_update_skb_shared_info(skb, num_frags,
                               sinfo->xdp_frags_size,
                               MY_PAGE_SIZE * num_frags,
                               xdp_buff_is_frag_pfmemalloc(xdp),
                               xdp_buff_is_frag_unreadable(xdp));

Keep a helper for accessing the flags, in case we need to
transform them somehow in the future (e.g. to cover up xdp_buff
vs xdp_frame differences).

While we are touching call callers - rename the helper to
xdp_update_skb_frags_info(), previous name may have implied that
it's shinfo that's updated. We are updating flags in struct sk_buff
based on frags that got attched.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Link: https://patch.msgid.link/20250905221539.2930285-2-kuba@kernel.org
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/ice/ice_txrx.c
drivers/net/ethernet/marvell/mvneta.c
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
drivers/net/virtio_net.c
include/net/xdp.h
net/core/xdp.c