net-device: move gso_partial_features to net_device_read_tx
authorEric Dumazet <edumazet@google.com>
Thu, 21 Dec 2023 14:07:47 +0000 (14:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Jan 2024 12:35:42 +0000 (12:35 +0000)
dev->gso_partial_features is read from tx fast path for GSO packets.

Move it to appropriate section to avoid a cache line miss.

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: David Ahern <dsahern@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/net_cachelines/net_device.rst
include/linux/netdevice.h
net/core/dev.c

index 6cab1b797739f57f15962dc0daccc2bd6aafeb97..2dd8d8f20da2558fddcc341f3a8a27da3c4a1796 100644 (file)
@@ -38,7 +38,7 @@ netdev_features_t                   wanted_features
 netdev_features_t                   vlan_features                                                   
 netdev_features_t                   hw_enc_features         -                   -                   netif_skb_features
 netdev_features_t                   mpls_features                                                   
-netdev_features_t                   gso_partial_features                                            
+netdev_features_t                   gso_partial_features    read_mostly                             gso_features_check
 unsigned_int                        min_mtu                                                         
 unsigned_int                        max_mtu                                                         
 unsigned_short                      type                                                            
index 5baa5517f5330e115fb735d05f99e92bc116b210..d59db9adcc96e72272d4e981253fd4ee6e4e356a 100644 (file)
@@ -2115,6 +2115,7 @@ struct net_device {
        const struct net_device_ops *netdev_ops;
        const struct header_ops *header_ops;
        struct netdev_queue     *_tx;
+       netdev_features_t       gso_partial_features;
        unsigned int            real_num_tx_queues;
        unsigned int            gso_max_size;
        unsigned int            gso_ipv4_max_size;
@@ -2211,7 +2212,6 @@ struct net_device {
        netdev_features_t       vlan_features;
        netdev_features_t       hw_enc_features;
        netdev_features_t       mpls_features;
-       netdev_features_t       gso_partial_features;
 
        unsigned int            min_mtu;
        unsigned int            max_mtu;
index df04cbf77551f3b43601c115e5ba9cb584b13dbc..31588a50b7573c7f71ddf64b7b25ea5033bb5c97 100644 (file)
@@ -11629,6 +11629,7 @@ static void __init net_dev_struct_check(void)
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_max_size);
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_ipv4_max_size);
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_max_segs);
+       CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_partial_features);
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, num_tc);
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, mtu);
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, needed_headroom);
@@ -11642,7 +11643,7 @@ static void __init net_dev_struct_check(void)
 #ifdef CONFIG_NET_XGRESS
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, tcx_egress);
 #endif
-       CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_tx, 152);
+       CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_tx, 160);
 
        /* TXRX read-mostly hotpath */
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, flags);