Skip to content

Commit 993498e

Browse files
edumazetdavem330
authored andcommitted
net-device: move gso_partial_features to net_device_read_tx
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: 43a71cd ("net-device: reorganize net_device fast path variables") Signed-off-by: Eric Dumazet <[email protected]> Cc: Coco Li <[email protected]> Cc: David Ahern <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 07938d7 commit 993498e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Documentation/networking/net_cachelines/net_device.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ netdev_features_t wanted_features
3838
netdev_features_t vlan_features
3939
netdev_features_t hw_enc_features - - netif_skb_features
4040
netdev_features_t mpls_features
41-
netdev_features_t gso_partial_features
41+
netdev_features_t gso_partial_features read_mostly gso_features_check
4242
unsigned_int min_mtu
4343
unsigned_int max_mtu
4444
unsigned_short type

include/linux/netdevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2115,6 +2115,7 @@ struct net_device {
21152115
const struct net_device_ops *netdev_ops;
21162116
const struct header_ops *header_ops;
21172117
struct netdev_queue *_tx;
2118+
netdev_features_t gso_partial_features;
21182119
unsigned int real_num_tx_queues;
21192120
unsigned int gso_max_size;
21202121
unsigned int gso_ipv4_max_size;
@@ -2211,7 +2212,6 @@ struct net_device {
22112212
netdev_features_t vlan_features;
22122213
netdev_features_t hw_enc_features;
22132214
netdev_features_t mpls_features;
2214-
netdev_features_t gso_partial_features;
22152215

22162216
unsigned int min_mtu;
22172217
unsigned int max_mtu;

net/core/dev.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11629,6 +11629,7 @@ static void __init net_dev_struct_check(void)
1162911629
CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_max_size);
1163011630
CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_ipv4_max_size);
1163111631
CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_max_segs);
11632+
CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_partial_features);
1163211633
CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, num_tc);
1163311634
CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, mtu);
1163411635
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)
1164211643
#ifdef CONFIG_NET_XGRESS
1164311644
CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, tcx_egress);
1164411645
#endif
11645-
CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_tx, 152);
11646+
CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_tx, 160);
1164611647

1164711648
/* TXRX read-mostly hotpath */
1164811649
CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, flags);

0 commit comments

Comments
 (0)