Skip to content

Commit 555cb3d

Browse files
committed
netdev_features: convert NETIF_F_LLTX to dev->lltx
JIRA: https://issues.redhat.com/browse/RHEL-59091 commit 00d066a Author: Alexander Lobakin <aleksander.lobakin@intel.com> Date: Thu Aug 29 14:33:37 2024 +0200 netdev_features: convert NETIF_F_LLTX to dev->lltx NETIF_F_LLTX can't be changed via Ethtool and is not a feature, rather an attribute, very similar to IFF_NO_QUEUE (and hot). Free one netdev_features_t bit and make it a "hot" private flag. Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Conflicts: drivers/net/macsec.c drivers/net/veth.c net/ipv6/ip6_tunnel.c - Context. drivers/net/amt.c drivers/net/netkit.c - Non-existent in RHEL 9. drivers/net/ethernet/chelsio/cxgb/cxgb2.c drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c - Drivers disabled in RHEL 9. Skipped. net/dsa/user.c - This is slave.c in RHEL 9, but CONFIG_NET_DSA is disabled, so skipped the hunk. net/core/net-sysfs.c - Code not present because of missing commit 74293ea ("net: sysfs: Do not create sysfs for non BQL device") Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
1 parent 12a9896 commit 555cb3d

File tree

51 files changed

+83
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+83
-77
lines changed

Documentation/networking/net_cachelines/net_device.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ net_device struct fast path usage breakdown
88
Type Name fastpath_tx_access fastpath_rx_access Comments
99
..struct ..net_device
1010
unsigned_long:32 priv_flags read_mostly - __dev_queue_xmit(tx)
11+
unsigned_long:1 lltx read_mostly - HARD_TX_LOCK,HARD_TX_TRYLOCK,HARD_TX_UNLOCK(tx)
1112
char name[16] - -
1213
struct_netdev_name_node* name_node
1314
struct_dev_ifalias* ifalias

Documentation/networking/netdev-features.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,6 @@ chained skbs (skb->next/prev list).
139139
Features contained in NETIF_F_SOFT_FEATURES are features of networking
140140
stack. Driver should not change behaviour based on them.
141141

142-
* LLTX driver (deprecated for hardware drivers)
143-
144-
NETIF_F_LLTX is meant to be used by drivers that don't need locking at all,
145-
e.g. software tunnels.
146-
147-
This is also used in a few legacy drivers that implement their
148-
own locking, don't use it for new (hardware) drivers.
149-
150142
* netns-local device
151143

152144
NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between

Documentation/networking/netdevices.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ ndo_get_stats:
258258
ndo_start_xmit:
259259
Synchronization: __netif_tx_lock spinlock.
260260

261-
When the driver sets NETIF_F_LLTX in dev->features this will be
261+
When the driver sets dev->lltx this will be
262262
called without holding netif_tx_lock. In this case the driver
263263
has to lock by itself when needed.
264264
The locking there should also properly protect against
265-
set_rx_mode. WARNING: use of NETIF_F_LLTX is deprecated.
265+
set_rx_mode. WARNING: use of dev->lltx is deprecated.
266266
Don't use it for new drivers.
267267

268268
Context: Process with BHs disabled or BH (timer),

drivers/net/bareudp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ static void bareudp_setup(struct net_device *dev)
557557
SET_NETDEV_DEVTYPE(dev, &bareudp_type);
558558
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
559559
dev->features |= NETIF_F_RXCSUM;
560-
dev->features |= NETIF_F_LLTX;
561560
dev->features |= NETIF_F_GSO_SOFTWARE;
562561
dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
563562
dev->hw_features |= NETIF_F_RXCSUM;
@@ -570,6 +569,7 @@ static void bareudp_setup(struct net_device *dev)
570569
dev->type = ARPHRD_NONE;
571570
netif_keep_dst(dev);
572571
dev->priv_flags |= IFF_NO_QUEUE;
572+
dev->lltx = true;
573573
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
574574
}
575575

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5895,7 +5895,7 @@ void bond_setup(struct net_device *bond_dev)
58955895
#endif /* CONFIG_XFRM_OFFLOAD */
58965896

58975897
/* don't acquire bond device's netif_tx_lock when transmitting */
5898-
bond_dev->features |= NETIF_F_LLTX;
5898+
bond_dev->lltx = true;
58995899

59005900
/* By default, we declare the bond to be fully
59015901
* VLAN hardware accelerated capable. Special

drivers/net/dummy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ static void dummy_setup(struct net_device *dev)
117117
dev->flags |= IFF_NOARP;
118118
dev->flags &= ~IFF_MULTICAST;
119119
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
120+
dev->lltx = true;
120121
dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST;
121122
dev->features |= NETIF_F_GSO_SOFTWARE;
122-
dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
123+
dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
123124
dev->features |= NETIF_F_GSO_ENCAP_ALL;
124125
dev->hw_features |= dev->features;
125126
dev->hw_enc_features |= dev->features;

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
250250
net_dev->max_mtu = dpaa_get_max_mtu();
251251

252252
net_dev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
253-
NETIF_F_LLTX | NETIF_F_RXHASH);
253+
NETIF_F_RXHASH);
254254

255255
net_dev->hw_features |= NETIF_F_SG | NETIF_F_HIGHDMA;
256256
/* The kernels enables GSO automatically, if we declare NETIF_F_SG.
@@ -260,6 +260,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
260260
net_dev->features |= NETIF_F_RXCSUM;
261261

262262
net_dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
263+
net_dev->lltx = true;
263264
/* we do not want shared skbs on TX */
264265
net_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
265266

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,9 +1691,10 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u16 local_port,
16911691

16921692
netif_carrier_off(dev);
16931693

1694-
dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_LLTX | NETIF_F_SG |
1694+
dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG |
16951695
NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_TC;
16961696
dev->hw_features |= NETIF_F_HW_TC | NETIF_F_LOOPBACK;
1697+
dev->lltx = true;
16971698

16981699
dev->min_mtu = 0;
16991700
dev->max_mtu = ETH_MAX_MTU;

drivers/net/ethernet/netronome/nfp/nfp_net_repr.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ nfp_repr_fix_features(struct net_device *netdev, netdev_features_t features)
248248

249249
features = netdev_intersect_features(features, lower_features);
250250
features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_HW_TC);
251-
features |= NETIF_F_LLTX;
252251

253252
return features;
254253
}
@@ -382,7 +381,7 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev,
382381
netif_set_tso_max_segs(netdev, NFP_NET_LSO_MAX_SEGS);
383382

384383
netdev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL;
385-
netdev->features |= NETIF_F_LLTX;
384+
netdev->lltx = true;
386385

387386
if (nfp_app_has_tc(app)) {
388387
netdev->features |= NETIF_F_HW_TC;

drivers/net/ethernet/pasemi/pasemi_mac.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,8 +1699,9 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
16991699

17001700
netif_napi_add(dev, &mac->napi, pasemi_mac_poll);
17011701

1702-
dev->features = NETIF_F_IP_CSUM | NETIF_F_LLTX | NETIF_F_SG |
1703-
NETIF_F_HIGHDMA | NETIF_F_GSO;
1702+
dev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_HIGHDMA |
1703+
NETIF_F_GSO;
1704+
dev->lltx = true;
17041705

17051706
mac->dma_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa007, NULL);
17061707
if (!mac->dma_pdev) {

0 commit comments

Comments
 (0)