Skip to contentSkip to conversation

net-device: move xdp_prog to net_device_read_rx

PATCH Applied Eric Dumazet 2 participants 2 messages Jan 2, 2024 – Jan 4, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
Cc Coco Li <[email protected]>
Cc Simon Horman <[email protected]>
---
 Documentation/networking/net_cachelines/net_device.rst | 2 +-
 include/linux/netdevice.h                              | 2 +-
 net/core/dev.c                                         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Documentation/networking/net_cachelines/net_device.rst +1 -1
index 2dd8d8f20da2558fddcc341f3a8a27da3c4a1796..e75a53593bb9606f1c0595d8f7227881ec932b9c 100644
@@ -96,7 +96,7 @@ unsigned_char*                      dev_addr
 struct_netdev_queue*                _rx                     read_mostly         -                   netdev_get_rx_queue(rx)
 unsigned_int                        num_rx_queues                                                   
 unsigned_int                        real_num_rx_queues      -                   read_mostly         get_rps_cpu
-struct_bpf_prog*                    xdp_prog                                                        
+struct_bpf_prog*                    xdp_prog                -                   read_mostly         netif_elide_gro()
 unsigned_long                       gro_flush_timeout       -                   read_mostly         napi_complete_done
 int                                 napi_defer_hard_irqs    -                   read_mostly         napi_complete_done
 unsigned_int                        gro_max_size            -                   read_mostly         skb_gro_receive
include/linux/netdevice.h +1 -1
index d59db9adcc96e72272d4e981253fd4ee6e4e356a..e265aa1f21699ad567fe3af8e748be51cb7be7d6 100644
@@ -2150,6 +2150,7 @@ struct net_device {
 
 	/* RX read-mostly hotpath */
 	__cacheline_group_begin(net_device_read_rx);
+	struct bpf_prog __rcu	*xdp_prog;
 	struct list_head	ptype_specific;
 	int			ifindex;
 	unsigned int		real_num_rx_queues;
@@ -2325,7 +2326,6 @@ struct net_device {
 	const unsigned char	*dev_addr;
 
 	unsigned int		num_rx_queues;
-	struct bpf_prog __rcu	*xdp_prog;
 #define GRO_LEGACY_MAX_SIZE	65536u
 /* TCP minimal MSS is 8 (TCP_MIN_GSO_SIZE),
  * and shinfo->gso_segs is a 16bit field.
net/core/dev.c +1 -1
index 31588a50b7573c7f71ddf64b7b25ea5033bb5c97..bc4ac49d4643a557d034ec7cad7194e152a4b9c5 100644
@@ -11670,7 +11670,7 @@ static void __init net_dev_struct_check(void)
 #ifdef CONFIG_NET_XGRESS
 	CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_rx, tcx_ingress);
 #endif
-	CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_rx, 96);
+	CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_rx, 104);
 }
 
 /*
Signature · 1 line
2.43.0.472.g3155946c3a-goog
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Tue, 2 Jan 2024 16:22:20 +0000 you wrote:

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")
Cc Coco Li <[email protected]>
Cc Simon Horman <[email protected]>

[...]

Here is the summary with links:
- [net-next] net-device: move xdp_prog to net_device_read_rx

    https://git.kernel.org/netdev/net-next/c/d3d344a1ca69

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html