History

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.

Eric Dumazet committed 2 years ago

Commit 993498e1 parent 07938d73 files · +4 −3Browse files

Unified · Split

3 files
  1. Documentation/networking/net_cachelines/net_device.rst +1 −1
  2. include/linux/netdevice.h +1 −1
  3. net/core/dev.c +2 −1
Documentation/networking/net_cachelines/net_device.rst+1−1
@@ -38,7 +38,7 @@ netdev_features_t wanted_features · 37 unmodified lines
38netdev_features_t vlan_features 38netdev_features_t vlan_features
39netdev_features_t hw_enc_features - - netif_skb_features39netdev_features_t hw_enc_features - - netif_skb_features
40netdev_features_t mpls_features 40netdev_features_t mpls_features
41netdev_features_t gso_partial_features 41netdev_features_t gso_partial_features read_mostly gso_features_check
42unsigned_int min_mtu 42unsigned_int min_mtu
43unsigned_int max_mtu 43unsigned_int max_mtu
44unsigned_short type 44unsigned_short type
include/linux/netdevice.h+1−1
@@ -2115,6 +2115,7 @@ struct net_device { · 2114 unmodified lines
2115 const struct net_device_ops *netdev_ops;2115 const struct net_device_ops *netdev_ops;
2116 const struct header_ops *header_ops;2116 const struct header_ops *header_ops;
2117 struct netdev_queue *_tx;2117 struct netdev_queue *_tx;
2118 netdev_features_t gso_partial_features;
2118 unsigned int real_num_tx_queues;2119 unsigned int real_num_tx_queues;
2119 unsigned int gso_max_size;2120 unsigned int gso_max_size;
2120 unsigned int gso_ipv4_max_size;2121 unsigned int gso_ipv4_max_size;
@@ -2211,7 +2212,6 @@ struct net_device { · 90 unmodified lines
2211 netdev_features_t vlan_features;2212 netdev_features_t vlan_features;
2212 netdev_features_t hw_enc_features;2213 netdev_features_t hw_enc_features;
2213 netdev_features_t mpls_features;2214 netdev_features_t mpls_features;
2214 netdev_features_t gso_partial_features;
2215 2215
2216 unsigned int min_mtu;2216 unsigned int min_mtu;
2217 unsigned int max_mtu;2217 unsigned int max_mtu;
net/core/dev.c+2−1
@@ -11629,6 +11629,7 @@ static void __init net_dev_struct_check(void) · 11628 unmodified lines
11629 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_max_size);11629 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_max_size);
11630 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_ipv4_max_size);11630 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_ipv4_max_size);
11631 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, gso_max_segs);11631 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);
11632 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, num_tc);11633 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, num_tc);
11633 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, mtu);11634 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, mtu);
11634 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, needed_headroom);11635 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) · 7 unmodified lines
11642#ifdef CONFIG_NET_XGRESS11643#ifdef CONFIG_NET_XGRESS
11643 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, tcx_egress);11644 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, tcx_egress);
11644#endif11645#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);
11646 11647
11647 /* TXRX read-mostly hotpath */11648 /* TXRX read-mostly hotpath */
11648 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, flags);11649 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, flags);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t