net: ethernet: enetc: do not always access skb_shared_info in the XDP path
authorLorenzo Bianconi <lorenzo@kernel.org>
Wed, 4 Jan 2023 13:57:12 +0000 (14:57 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 Jan 2023 05:38:29 +0000 (21:38 -0800)
commitc7030d14c78e634b94616a08f4961d767f645834
treecc44f4e48cf1c4a8bf90250a19fc8f184420ae66
parent59cc773a352c0c7c7aa96fbd645fe36ffc193e55
net: ethernet: enetc: do not always access skb_shared_info in the XDP path

Move XDP skb_shared_info structure initialization in from
enetc_map_rx_buff_to_xdp() to enetc_add_rx_buff_to_xdp() and do not always
access skb_shared_info in the xdp_buff/xdp_frame since it is located in a
different cacheline with respect to hard_start and data xdp pointers.
Rely on XDP_FLAGS_HAS_FRAGS flag to check if it really necessary to access
non-linear part of the xdp_buff/xdp_frame.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc.c