Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net-device: move xdp_prog to net_device_read_rx

xdp_prog is used in receive path, both from XDP enabled drivers
and from netif_elide_gro().

This patch also removes two 4-bytes holes.

Fixes: 43a71cd66b9c ("net-device: reorganize net_device fast path variables")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Coco Li <lixiaoyan@google.com>
Cc: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240102162220.750823-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
d3d344a1 a562a027

+3 -3
+1 -1
Documentation/networking/net_cachelines/net_device.rst
··· 96 96 struct_netdev_queue* _rx read_mostly - netdev_get_rx_queue(rx) 97 97 unsigned_int num_rx_queues 98 98 unsigned_int real_num_rx_queues - read_mostly get_rps_cpu 99 - struct_bpf_prog* xdp_prog 99 + struct_bpf_prog* xdp_prog - read_mostly netif_elide_gro() 100 100 unsigned_long gro_flush_timeout - read_mostly napi_complete_done 101 101 int napi_defer_hard_irqs - read_mostly napi_complete_done 102 102 unsigned_int gro_max_size - read_mostly skb_gro_receive
+1 -1
include/linux/netdevice.h
··· 2150 2150 2151 2151 /* RX read-mostly hotpath */ 2152 2152 __cacheline_group_begin(net_device_read_rx); 2153 + struct bpf_prog __rcu *xdp_prog; 2153 2154 struct list_head ptype_specific; 2154 2155 int ifindex; 2155 2156 unsigned int real_num_rx_queues; ··· 2326 2325 const unsigned char *dev_addr; 2327 2326 2328 2327 unsigned int num_rx_queues; 2329 - struct bpf_prog __rcu *xdp_prog; 2330 2328 #define GRO_LEGACY_MAX_SIZE 65536u 2331 2329 /* TCP minimal MSS is 8 (TCP_MIN_GSO_SIZE), 2332 2330 * and shinfo->gso_segs is a 16bit field.
+1 -1
net/core/dev.c
··· 11670 11670 #ifdef CONFIG_NET_XGRESS 11671 11671 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_rx, tcx_ingress); 11672 11672 #endif 11673 - CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_rx, 96); 11673 + CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_rx, 104); 11674 11674 } 11675 11675 11676 11676 /*