Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexander Lobakin and committed by
Paolo Abeni
00d066a4 beb5a9be

+93 -84
+1
Documentation/networking/net_cachelines/net_device.rst
··· 8 8 Type Name fastpath_tx_access fastpath_rx_access Comments 9 9 ..struct ..net_device 10 10 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) 11 12 char name[16] - - 12 13 struct_netdev_name_node* name_node 13 14 struct_dev_ifalias* ifalias
-8
Documentation/networking/netdev-features.rst
··· 139 139 Features contained in NETIF_F_SOFT_FEATURES are features of networking 140 140 stack. Driver should not change behaviour based on them. 141 141 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 - 150 142 * netns-local device 151 143 152 144 NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between
+2 -2
Documentation/networking/netdevices.rst
··· 258 258 ndo_start_xmit: 259 259 Synchronization: __netif_tx_lock spinlock. 260 260 261 - When the driver sets NETIF_F_LLTX in dev->features this will be 261 + When the driver sets dev->lltx this will be 262 262 called without holding netif_tx_lock. In this case the driver 263 263 has to lock by itself when needed. 264 264 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. 266 266 Don't use it for new drivers. 267 267 268 268 Context: Process with BHs disabled or BH (timer),
+1 -1
drivers/net/amt.c
··· 3098 3098 dev->hard_header_len = 0; 3099 3099 dev->addr_len = 0; 3100 3100 dev->priv_flags |= IFF_NO_QUEUE; 3101 - dev->features |= NETIF_F_LLTX; 3101 + dev->lltx = true; 3102 3102 dev->features |= NETIF_F_GSO_SOFTWARE; 3103 3103 dev->features |= NETIF_F_NETNS_LOCAL; 3104 3104 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM;
+1 -1
drivers/net/bareudp.c
··· 553 553 SET_NETDEV_DEVTYPE(dev, &bareudp_type); 554 554 dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST; 555 555 dev->features |= NETIF_F_RXCSUM; 556 - dev->features |= NETIF_F_LLTX; 557 556 dev->features |= NETIF_F_GSO_SOFTWARE; 558 557 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST; 559 558 dev->hw_features |= NETIF_F_RXCSUM; ··· 565 566 dev->type = ARPHRD_NONE; 566 567 netif_keep_dst(dev); 567 568 dev->priv_flags |= IFF_NO_QUEUE; 569 + dev->lltx = true; 568 570 dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; 569 571 dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS; 570 572 }
+1 -1
drivers/net/bonding/bond_main.c
··· 5928 5928 #endif /* CONFIG_XFRM_OFFLOAD */ 5929 5929 5930 5930 /* don't acquire bond device's netif_tx_lock when transmitting */ 5931 - bond_dev->features |= NETIF_F_LLTX; 5931 + bond_dev->lltx = true; 5932 5932 5933 5933 /* By default, we declare the bond to be fully 5934 5934 * VLAN hardware accelerated capable. Special
+2 -1
drivers/net/dummy.c
··· 109 109 dev->flags |= IFF_NOARP; 110 110 dev->flags &= ~IFF_MULTICAST; 111 111 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE; 112 + dev->lltx = true; 112 113 dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST; 113 114 dev->features |= NETIF_F_GSO_SOFTWARE; 114 - dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX; 115 + dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA; 115 116 dev->features |= NETIF_F_GSO_ENCAP_ALL; 116 117 dev->hw_features |= dev->features; 117 118 dev->hw_enc_features |= dev->features;
+2 -1
drivers/net/ethernet/chelsio/cxgb/cxgb2.c
··· 1034 1034 netdev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM | 1035 1035 NETIF_F_RXCSUM; 1036 1036 netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | 1037 - NETIF_F_RXCSUM | NETIF_F_LLTX | NETIF_F_HIGHDMA; 1037 + NETIF_F_RXCSUM | NETIF_F_HIGHDMA; 1038 + netdev->lltx = true; 1038 1039 1039 1040 if (vlan_tso_capable(adapter)) { 1040 1041 netdev->features |=
+2 -1
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
··· 229 229 net_dev->max_mtu = dpaa_get_max_mtu(); 230 230 231 231 net_dev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 232 - NETIF_F_LLTX | NETIF_F_RXHASH); 232 + NETIF_F_RXHASH); 233 233 234 234 net_dev->hw_features |= NETIF_F_SG | NETIF_F_HIGHDMA; 235 235 /* The kernels enables GSO automatically, if we declare NETIF_F_SG. ··· 239 239 net_dev->features |= NETIF_F_RXCSUM; 240 240 241 241 net_dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; 242 + net_dev->lltx = true; 242 243 /* we do not want shared skbs on TX */ 243 244 net_dev->priv_flags &= ~IFF_TX_SKB_SHARING; 244 245
+2 -1
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
··· 4594 4594 4595 4595 net_dev->priv_flags |= supported; 4596 4596 net_dev->priv_flags &= ~not_supported; 4597 + net_dev->lltx = true; 4597 4598 4598 4599 /* Features */ 4599 4600 net_dev->features = NETIF_F_RXCSUM | 4600 4601 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 4601 4602 NETIF_F_SG | NETIF_F_HIGHDMA | 4602 - NETIF_F_LLTX | NETIF_F_HW_TC | NETIF_F_TSO; 4603 + NETIF_F_HW_TC | NETIF_F_TSO; 4603 4604 net_dev->gso_max_segs = DPAA2_ETH_ENQUEUE_MAX_FDS; 4604 4605 net_dev->hw_features = net_dev->features; 4605 4606 net_dev->xdp_features = NETDEV_XDP_ACT_BASIC |
+2 -1
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
··· 1676 1676 1677 1677 netif_carrier_off(dev); 1678 1678 1679 - dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_LLTX | NETIF_F_SG | 1679 + dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG | 1680 1680 NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_TC; 1681 1681 dev->hw_features |= NETIF_F_HW_TC | NETIF_F_LOOPBACK; 1682 + dev->lltx = true; 1682 1683 1683 1684 dev->min_mtu = ETH_MIN_MTU; 1684 1685 dev->max_mtu = MLXSW_PORT_MAX_MTU - MLXSW_PORT_ETH_FRAME_HDR;
+1 -2
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
··· 248 248 249 249 features = netdev_intersect_features(features, lower_features); 250 250 features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_HW_TC); 251 - features |= NETIF_F_LLTX; 252 251 253 252 return features; 254 253 } ··· 385 386 netif_set_tso_max_segs(netdev, NFP_NET_LSO_MAX_SEGS); 386 387 387 388 netdev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL; 388 - netdev->features |= NETIF_F_LLTX; 389 + netdev->lltx = true; 389 390 390 391 if (nfp_app_has_tc(app)) { 391 392 netdev->features |= NETIF_F_HW_TC;
+3 -2
drivers/net/ethernet/pasemi/pasemi_mac.c
··· 1699 1699 1700 1700 netif_napi_add(dev, &mac->napi, pasemi_mac_poll); 1701 1701 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; 1704 1705 1705 1706 mac->dma_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa007, NULL); 1706 1707 if (!mac->dma_pdev) {
+1 -1
drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
··· 286 286 rmnet_dev->needs_free_netdev = true; 287 287 rmnet_dev->ethtool_ops = &rmnet_ethtool_ops; 288 288 289 - rmnet_dev->features |= NETIF_F_LLTX; 289 + rmnet_dev->lltx = true; 290 290 291 291 /* This perm addr will be used as interface identifier by IPv6 */ 292 292 rmnet_dev->addr_assign_type = NET_ADDR_RANDOM;
+2 -2
drivers/net/ethernet/sfc/ef100_rep.c
··· 233 233 net_dev->ethtool_ops = &efx_ef100_rep_ethtool_ops; 234 234 net_dev->min_mtu = EFX_MIN_MTU; 235 235 net_dev->max_mtu = EFX_MAX_MTU; 236 - net_dev->features |= NETIF_F_LLTX; 237 - net_dev->hw_features |= NETIF_F_LLTX; 236 + net_dev->lltx = true; 237 + 238 238 return efv; 239 239 fail1: 240 240 free_netdev(net_dev);
+2 -2
drivers/net/ethernet/tehuti/tehuti.c
··· 1671 1671 1672 1672 #endif 1673 1673 #ifdef BDX_LLTX 1674 - netif_trans_update(ndev); /* NETIF_F_LLTX driver :( */ 1674 + netif_trans_update(ndev); /* dev->lltx driver :( */ 1675 1675 #endif 1676 1676 ndev->stats.tx_packets++; 1677 1677 ndev->stats.tx_bytes += skb->len; ··· 2019 2019 * set multicast list callback has to use priv->tx_lock. 2020 2020 */ 2021 2021 #ifdef BDX_LLTX 2022 - ndev->features |= NETIF_F_LLTX; 2022 + ndev->lltx = true; 2023 2023 #endif 2024 2024 /* MTU range: 60 - 16384 */ 2025 2025 ndev->min_mtu = ETH_ZLEN;
+1 -1
drivers/net/ethernet/tehuti/tehuti.h
··· 260 260 int tx_update_mark; 261 261 int tx_noupd; 262 262 #endif 263 - spinlock_t tx_lock; /* NETIF_F_LLTX mode */ 263 + spinlock_t tx_lock; /* dev->lltx mode */ 264 264 265 265 /* rarely used */ 266 266 u8 port;
+2 -1
drivers/net/ethernet/toshiba/spider_net.c
··· 2277 2277 netdev->hw_features = NETIF_F_RXCSUM | NETIF_F_IP_CSUM; 2278 2278 if (SPIDER_NET_RX_CSUM_DEFAULT) 2279 2279 netdev->features |= NETIF_F_RXCSUM; 2280 - netdev->features |= NETIF_F_IP_CSUM | NETIF_F_LLTX; 2280 + netdev->features |= NETIF_F_IP_CSUM; 2281 2281 /* some time: NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | 2282 2282 * NETIF_F_HW_VLAN_CTAG_FILTER 2283 2283 */ 2284 + netdev->lltx = true; 2284 2285 2285 2286 /* MTU range: 64 - 2294 */ 2286 2287 netdev->min_mtu = SPIDER_NET_MIN_MTU;
+1 -1
drivers/net/geneve.c
··· 1194 1194 1195 1195 SET_NETDEV_DEVTYPE(dev, &geneve_type); 1196 1196 1197 - dev->features |= NETIF_F_LLTX; 1198 1197 dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST; 1199 1198 dev->features |= NETIF_F_RXCSUM; 1200 1199 dev->features |= NETIF_F_GSO_SOFTWARE; ··· 1214 1215 netif_keep_dst(dev); 1215 1216 dev->priv_flags &= ~IFF_TX_SKB_SHARING; 1216 1217 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE; 1218 + dev->lltx = true; 1217 1219 eth_hw_addr_random(dev); 1218 1220 } 1219 1221
+1 -1
drivers/net/gtp.c
··· 1356 1356 1357 1357 dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS; 1358 1358 dev->priv_flags |= IFF_NO_QUEUE; 1359 - dev->features |= NETIF_F_LLTX; 1359 + dev->lltx = true; 1360 1360 netif_keep_dst(dev); 1361 1361 1362 1362 dev->needed_headroom = LL_MAX_HEADER + GTP_IPV4_MAXLEN;
+1 -1
drivers/net/hamradio/bpqether.c
··· 458 458 dev->needs_free_netdev = true; 459 459 460 460 dev->flags = 0; 461 - dev->features = NETIF_F_LLTX; /* Allow recursion */ 461 + dev->lltx = true; /* Allow recursion */ 462 462 463 463 #if IS_ENABLED(CONFIG_AX25) 464 464 dev->header_ops = &ax25_header_ops;
+2 -1
drivers/net/ipvlan/ipvlan_main.c
··· 114 114 NETIF_F_GSO_ROBUST | NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL) 115 115 116 116 #define IPVLAN_ALWAYS_ON \ 117 - (IPVLAN_ALWAYS_ON_OFLOADS | NETIF_F_LLTX | NETIF_F_VLAN_CHALLENGED) 117 + (IPVLAN_ALWAYS_ON_OFLOADS | NETIF_F_VLAN_CHALLENGED) 118 118 119 119 #define IPVLAN_FEATURES \ 120 120 (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ ··· 141 141 dev->vlan_features = phy_dev->vlan_features & IPVLAN_FEATURES; 142 142 dev->vlan_features |= IPVLAN_ALWAYS_ON_OFLOADS; 143 143 dev->hw_enc_features |= dev->features; 144 + dev->lltx = true; 144 145 netif_inherit_tso_max(dev, phy_dev); 145 146 dev->hard_header_len = phy_dev->hard_header_len; 146 147
+1 -1
drivers/net/loopback.c
··· 171 171 dev->type = ARPHRD_LOOPBACK; /* 0x0001*/ 172 172 dev->flags = IFF_LOOPBACK; 173 173 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE; 174 + dev->lltx = true; 174 175 netif_keep_dst(dev); 175 176 dev->hw_features = NETIF_F_GSO_SOFTWARE; 176 177 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST ··· 180 179 | NETIF_F_RXCSUM 181 180 | NETIF_F_SCTP_CRC 182 181 | NETIF_F_HIGHDMA 183 - | NETIF_F_LLTX 184 182 | NETIF_F_NETNS_LOCAL 185 183 | NETIF_F_VLAN_CHALLENGED 186 184 | NETIF_F_LOOPBACK;
+2 -2
drivers/net/macsec.c
··· 3550 3550 return err; 3551 3551 3552 3552 dev->features = real_dev->features & MACSEC_FEATURES; 3553 - dev->features |= NETIF_F_LLTX | NETIF_F_GSO_SOFTWARE; 3553 + dev->features |= NETIF_F_GSO_SOFTWARE; 3554 + dev->lltx = true; 3554 3555 dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS; 3555 3556 3556 3557 macsec_set_head_tail_room(dev); ··· 3582 3581 3583 3582 features &= (real_dev->features & MACSEC_FEATURES) | 3584 3583 NETIF_F_GSO_SOFTWARE | NETIF_F_SOFT_FEATURES; 3585 - features |= NETIF_F_LLTX; 3586 3584 3587 3585 return features; 3588 3586 }
+2 -1
drivers/net/macvlan.c
··· 900 900 (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE | \ 901 901 NETIF_F_GSO_ROBUST | NETIF_F_GSO_ENCAP_ALL) 902 902 903 - #define ALWAYS_ON_FEATURES (ALWAYS_ON_OFFLOADS | NETIF_F_LLTX) 903 + #define ALWAYS_ON_FEATURES ALWAYS_ON_OFFLOADS 904 904 905 905 #define MACVLAN_FEATURES \ 906 906 (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ ··· 932 932 dev->vlan_features = lowerdev->vlan_features & MACVLAN_FEATURES; 933 933 dev->vlan_features |= ALWAYS_ON_OFFLOADS; 934 934 dev->hw_enc_features |= dev->features; 935 + dev->lltx = true; 935 936 netif_inherit_tso_max(dev, lowerdev); 936 937 dev->hard_header_len = lowerdev->hard_header_len; 937 938 macvlan_set_lockdep_class(dev);
+1 -1
drivers/net/net_failover.c
··· 731 731 IFF_TX_SKB_SHARING); 732 732 733 733 /* don't acquire failover netdev's netif_tx_lock when transmitting */ 734 - failover_dev->features |= NETIF_F_LLTX; 734 + failover_dev->lltx = true; 735 735 736 736 /* Don't allow failover devices to change network namespaces. */ 737 737 failover_dev->features |= NETIF_F_NETNS_LOCAL;
+2 -1
drivers/net/netkit.c
··· 255 255 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; 256 256 dev->priv_flags |= IFF_PHONY_HEADROOM; 257 257 dev->priv_flags |= IFF_NO_QUEUE; 258 + dev->lltx = true; 258 259 259 260 dev->ethtool_ops = &netkit_ethtool_ops; 260 261 dev->netdev_ops = &netkit_netdev_ops; 261 262 262 - dev->features |= netkit_features | NETIF_F_LLTX; 263 + dev->features |= netkit_features; 263 264 dev->hw_features = netkit_features; 264 265 dev->hw_enc_features = netkit_features; 265 266 dev->mpls_features = NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE;
+2 -2
drivers/net/nlmon.c
··· 63 63 { 64 64 dev->type = ARPHRD_NETLINK; 65 65 dev->priv_flags |= IFF_NO_QUEUE; 66 + dev->lltx = true; 66 67 67 68 dev->netdev_ops = &nlmon_ops; 68 69 dev->ethtool_ops = &nlmon_ethtool_ops; 69 70 dev->needs_free_netdev = true; 70 71 71 - dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | 72 - NETIF_F_HIGHDMA | NETIF_F_LLTX; 72 + dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA; 73 73 dev->flags = IFF_NOARP; 74 74 dev->pcpu_stat_type = NETDEV_PCPU_STAT_LSTATS; 75 75
+1 -1
drivers/net/ppp/ppp_generic.c
··· 1631 1631 dev->netdev_ops = &ppp_netdev_ops; 1632 1632 SET_NETDEV_DEVTYPE(dev, &ppp_type); 1633 1633 1634 - dev->features |= NETIF_F_LLTX; 1634 + dev->lltx = true; 1635 1635 1636 1636 dev->hard_header_len = PPP_HDRLEN; 1637 1637 dev->mtu = PPP_MRU;
+1 -1
drivers/net/rionet.c
··· 515 515 /* MTU range: 68 - 4082 */ 516 516 ndev->min_mtu = ETH_MIN_MTU; 517 517 ndev->max_mtu = RIONET_MAX_MTU; 518 - ndev->features = NETIF_F_LLTX; 518 + ndev->lltx = true; 519 519 SET_NETDEV_DEV(ndev, &mport->dev); 520 520 ndev->ethtool_ops = &rionet_ethtool_ops; 521 521
+1 -1
drivers/net/team/team_core.c
··· 2189 2189 * Let this up to underlay drivers. 2190 2190 */ 2191 2191 dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE; 2192 + dev->lltx = true; 2192 2193 2193 - dev->features |= NETIF_F_LLTX; 2194 2194 dev->features |= NETIF_F_GRO; 2195 2195 2196 2196 /* Don't allow team devices to change network namespaces. */
+3 -2
drivers/net/tun.c
··· 990 990 dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | 991 991 TUN_USER_FEATURES | NETIF_F_HW_VLAN_CTAG_TX | 992 992 NETIF_F_HW_VLAN_STAG_TX; 993 - dev->features = dev->hw_features | NETIF_F_LLTX; 993 + dev->features = dev->hw_features; 994 994 dev->vlan_features = dev->features & 995 995 ~(NETIF_F_HW_VLAN_CTAG_TX | 996 996 NETIF_F_HW_VLAN_STAG_TX); 997 + dev->lltx = true; 997 998 998 999 tun->flags = (tun->flags & ~TUN_FEATURES) | 999 1000 (ifr->ifr_flags & TUN_FEATURES); ··· 1130 1129 goto drop; 1131 1130 } 1132 1131 1133 - /* NETIF_F_LLTX requires to do our own update of trans_start */ 1132 + /* dev->lltx requires to do our own update of trans_start */ 1134 1133 queue = netdev_get_tx_queue(dev, txq); 1135 1134 txq_trans_cond_update(queue); 1136 1135
+1 -1
drivers/net/veth.c
··· 1697 1697 dev->priv_flags |= IFF_NO_QUEUE; 1698 1698 dev->priv_flags |= IFF_PHONY_HEADROOM; 1699 1699 dev->priv_flags |= IFF_DISABLE_NETPOLL; 1700 + dev->lltx = true; 1700 1701 1701 1702 dev->netdev_ops = &veth_netdev_ops; 1702 1703 dev->xdp_metadata_ops = &veth_xdp_metadata_ops; 1703 1704 dev->ethtool_ops = &veth_ethtool_ops; 1704 - dev->features |= NETIF_F_LLTX; 1705 1705 dev->features |= VETH_FEATURES; 1706 1706 dev->vlan_features = dev->features & 1707 1707 ~(NETIF_F_HW_VLAN_CTAG_TX |
+1 -1
drivers/net/vrf.c
··· 1635 1635 eth_hw_addr_random(dev); 1636 1636 1637 1637 /* don't acquire vrf device's netif_tx_lock when transmitting */ 1638 - dev->features |= NETIF_F_LLTX; 1638 + dev->lltx = true; 1639 1639 1640 1640 /* don't allow vrf devices to change network namespaces. */ 1641 1641 dev->features |= NETIF_F_NETNS_LOCAL;
+2 -2
drivers/net/vsockmon.c
··· 83 83 { 84 84 dev->type = ARPHRD_VSOCKMON; 85 85 dev->priv_flags |= IFF_NO_QUEUE; 86 + dev->lltx = true; 86 87 87 88 dev->netdev_ops = &vsockmon_ops; 88 89 dev->ethtool_ops = &vsockmon_ethtool_ops; 89 90 dev->needs_free_netdev = true; 90 91 91 - dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | 92 - NETIF_F_HIGHDMA | NETIF_F_LLTX; 92 + dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA; 93 93 94 94 dev->flags = IFF_NOARP; 95 95
+1 -1
drivers/net/vxlan/vxlan_core.c
··· 3321 3321 dev->needs_free_netdev = true; 3322 3322 SET_NETDEV_DEVTYPE(dev, &vxlan_type); 3323 3323 3324 - dev->features |= NETIF_F_LLTX; 3325 3324 dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST; 3326 3325 dev->features |= NETIF_F_RXCSUM; 3327 3326 dev->features |= NETIF_F_GSO_SOFTWARE; ··· 3332 3333 netif_keep_dst(dev); 3333 3334 dev->priv_flags |= IFF_NO_QUEUE; 3334 3335 dev->change_proto_down = true; 3336 + dev->lltx = true; 3335 3337 3336 3338 /* MTU range: 68 - 65535 */ 3337 3339 dev->min_mtu = ETH_MIN_MTU;
+1 -1
drivers/net/wireguard/device.c
··· 289 289 dev->type = ARPHRD_NONE; 290 290 dev->flags = IFF_POINTOPOINT | IFF_NOARP; 291 291 dev->priv_flags |= IFF_NO_QUEUE; 292 - dev->features |= NETIF_F_LLTX; 292 + dev->lltx = true; 293 293 dev->features |= WG_NETDEV_FEATURES; 294 294 dev->hw_features |= WG_NETDEV_FEATURES; 295 295 dev->hw_enc_features |= WG_NETDEV_FEATURES;
+1 -1
drivers/staging/octeon/ethernet.c
··· 425 425 dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; 426 426 427 427 /* We do our own locking, Linux doesn't need to */ 428 - dev->features |= NETIF_F_LLTX; 428 + dev->lltx = true; 429 429 dev->ethtool_ops = &cvm_oct_ethtool_ops; 430 430 431 431 cvm_oct_set_mac_filter(dev);
+2 -4
include/linux/netdev_features.h
··· 24 24 NETIF_F_HW_VLAN_CTAG_FILTER_BIT,/* Receive filtering on VLAN CTAGs */ 25 25 NETIF_F_VLAN_CHALLENGED_BIT, /* Device cannot handle VLAN packets */ 26 26 NETIF_F_GSO_BIT, /* Enable software GSO. */ 27 - NETIF_F_LLTX_BIT, /* LockLess TX - deprecated. Please */ 28 - /* do not use LLTX in new drivers */ 27 + __UNUSED_NETIF_F_12, 29 28 NETIF_F_NETNS_LOCAL_BIT, /* Does not change network namespaces */ 30 29 NETIF_F_GRO_BIT, /* Generic receive offload */ 31 30 NETIF_F_LRO_BIT, /* large receive offload */ ··· 119 120 #define NETIF_F_HW_VLAN_CTAG_TX __NETIF_F(HW_VLAN_CTAG_TX) 120 121 #define NETIF_F_IP_CSUM __NETIF_F(IP_CSUM) 121 122 #define NETIF_F_IPV6_CSUM __NETIF_F(IPV6_CSUM) 122 - #define NETIF_F_LLTX __NETIF_F(LLTX) 123 123 #define NETIF_F_LOOPBACK __NETIF_F(LOOPBACK) 124 124 #define NETIF_F_LRO __NETIF_F(LRO) 125 125 #define NETIF_F_NETNS_LOCAL __NETIF_F(NETNS_LOCAL) ··· 191 193 /* Features valid for ethtool to change */ 192 194 /* = all defined minus driver/device-class-related */ 193 195 #define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \ 194 - NETIF_F_LLTX | NETIF_F_NETNS_LOCAL) 196 + NETIF_F_NETNS_LOCAL) 195 197 196 198 /* remember that ((t)1 << t_BITS) is undefined in C99 */ 197 199 #define NETIF_F_ETHTOOL_BITS ((__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) | \
+7 -3
include/linux/netdevice.h
··· 1720 1720 * 1721 1721 * @priv_flags: flags invisible to userspace defined as bits, see 1722 1722 * enum netdev_priv_flags for the definitions 1723 + * @lltx: device supports lockless Tx. Deprecated for real HW 1724 + * drivers. Mainly used by logical interfaces, such as 1725 + * bonding and tunnels 1723 1726 * 1724 1727 * @name: This is the first field of the "visible" part of this structure 1725 1728 * (i.e. as seen by users in the "Space.c" file). It is the name ··· 2021 2018 __cacheline_group_begin(net_device_read_tx); 2022 2019 struct_group(priv_flags_fast, 2023 2020 unsigned long priv_flags:32; 2021 + unsigned long lltx:1; 2024 2022 ); 2025 2023 const struct net_device_ops *netdev_ops; 2026 2024 const struct header_ops *header_ops; ··· 4437 4433 } 4438 4434 4439 4435 #define HARD_TX_LOCK(dev, txq, cpu) { \ 4440 - if ((dev->features & NETIF_F_LLTX) == 0) { \ 4436 + if (!(dev)->lltx) { \ 4441 4437 __netif_tx_lock(txq, cpu); \ 4442 4438 } else { \ 4443 4439 __netif_tx_acquire(txq); \ ··· 4445 4441 } 4446 4442 4447 4443 #define HARD_TX_TRYLOCK(dev, txq) \ 4448 - (((dev->features & NETIF_F_LLTX) == 0) ? \ 4444 + (!(dev)->lltx ? \ 4449 4445 __netif_tx_trylock(txq) : \ 4450 4446 __netif_tx_acquire(txq)) 4451 4447 4452 4448 #define HARD_TX_UNLOCK(dev, txq) { \ 4453 - if ((dev->features & NETIF_F_LLTX) == 0) { \ 4449 + if (!(dev)->lltx) { \ 4454 4450 __netif_tx_unlock(txq); \ 4455 4451 } else { \ 4456 4452 __netif_tx_release(txq); \
+1 -2
lib/test_bpf.c
··· 15077 15077 .build_skb = build_test_skb_linear_no_head_frag, 15078 15078 .features = NETIF_F_SG | NETIF_F_FRAGLIST | 15079 15079 NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_GSO | 15080 - NETIF_F_LLTX | NETIF_F_GRO | 15081 - NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM | 15080 + NETIF_F_GRO | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM | 15082 15081 NETIF_F_HW_VLAN_STAG_TX 15083 15082 } 15084 15083 };
+2 -2
net/8021q/vlan_dev.c
··· 569 569 if (real_dev->vlan_features & NETIF_F_HW_MACSEC) 570 570 dev->hw_features |= NETIF_F_HW_MACSEC; 571 571 572 - dev->features |= dev->hw_features | NETIF_F_LLTX; 572 + dev->features |= dev->hw_features; 573 + dev->lltx = true; 573 574 netif_inherit_tso_max(dev, real_dev); 574 575 if (dev->features & NETIF_F_VLAN_FEATURES) 575 576 netdev_warn(real_dev, "VLAN features are set incorrectly. Q-in-Q configurations may not work correctly.\n"); ··· 656 655 lower_features |= NETIF_F_HW_CSUM; 657 656 features = netdev_intersect_features(features, lower_features); 658 657 features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE); 659 - features |= NETIF_F_LLTX; 660 658 661 659 return features; 662 660 }
+1 -1
net/batman-adv/soft-interface.c
··· 1021 1021 dev->needs_free_netdev = true; 1022 1022 dev->priv_destructor = batadv_softif_free; 1023 1023 dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_NETNS_LOCAL; 1024 - dev->features |= NETIF_F_LLTX; 1025 1024 dev->priv_flags |= IFF_NO_QUEUE; 1025 + dev->lltx = true; 1026 1026 1027 1027 /* can't call min_mtu, because the needed variables 1028 1028 * have not been initialized yet
+2 -1
net/bridge/br_device.c
··· 487 487 dev->ethtool_ops = &br_ethtool_ops; 488 488 SET_NETDEV_DEVTYPE(dev, &br_type); 489 489 dev->priv_flags = IFF_EBRIDGE | IFF_NO_QUEUE; 490 + dev->lltx = true; 490 491 491 - dev->features = COMMON_FEATURES | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL | 492 + dev->features = COMMON_FEATURES | NETIF_F_NETNS_LOCAL | 492 493 NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX; 493 494 dev->hw_features = COMMON_FEATURES | NETIF_F_HW_VLAN_CTAG_TX | 494 495 NETIF_F_HW_VLAN_STAG_TX;
+1 -2
net/core/net-sysfs.c
··· 1764 1764 1765 1765 static bool netdev_uses_bql(const struct net_device *dev) 1766 1766 { 1767 - if (dev->features & NETIF_F_LLTX || 1768 - dev->priv_flags & IFF_NO_QUEUE) 1767 + if (dev->lltx || (dev->priv_flags & IFF_NO_QUEUE)) 1769 1768 return false; 1770 1769 1771 1770 return IS_ENABLED(CONFIG_BQL);
+2 -1
net/dsa/user.c
··· 2642 2642 2643 2643 user->features = conduit->vlan_features | NETIF_F_HW_TC; 2644 2644 user->hw_features |= NETIF_F_HW_TC; 2645 - user->features |= NETIF_F_LLTX; 2646 2645 if (user->needed_tailroom) 2647 2646 user->features &= ~(NETIF_F_SG | NETIF_F_FRAGLIST); 2648 2647 if (ds->needs_standalone_vlan_filtering) 2649 2648 user->features |= NETIF_F_HW_VLAN_CTAG_FILTER; 2649 + 2650 + user->lltx = true; 2650 2651 } 2651 2652 2652 2653 int dsa_user_suspend(struct net_device *user_dev)
-1
net/ethtool/common.c
··· 25 25 [NETIF_F_HW_VLAN_STAG_FILTER_BIT] = "rx-vlan-stag-filter", 26 26 [NETIF_F_VLAN_CHALLENGED_BIT] = "vlan-challenged", 27 27 [NETIF_F_GSO_BIT] = "tx-generic-segmentation", 28 - [NETIF_F_LLTX_BIT] = "tx-lockless", 29 28 [NETIF_F_NETNS_LOCAL_BIT] = "netns-local", 30 29 [NETIF_F_GRO_BIT] = "rx-gro", 31 30 [NETIF_F_GRO_HW_BIT] = "rx-gro-hw",
+2 -2
net/hsr/hsr_device.c
··· 554 554 dev->netdev_ops = &hsr_device_ops; 555 555 SET_NETDEV_DEVTYPE(dev, &hsr_type); 556 556 dev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL; 557 + /* Prevent recursive tx locking */ 558 + dev->lltx = true; 557 559 558 560 dev->needs_free_netdev = true; 559 561 ··· 565 563 566 564 dev->features = dev->hw_features; 567 565 568 - /* Prevent recursive tx locking */ 569 - dev->features |= NETIF_F_LLTX; 570 566 /* VLAN on top of HSR needs testing and probably some work on 571 567 * hsr_header_create() etc. 572 568 */
+3 -1
net/ipv4/ip_gre.c
··· 996 996 tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen; 997 997 dev->needed_headroom = tunnel->hlen + sizeof(tunnel->parms.iph); 998 998 999 - dev->features |= GRE_FEATURES | NETIF_F_LLTX; 999 + dev->features |= GRE_FEATURES; 1000 1000 dev->hw_features |= GRE_FEATURES; 1001 1001 1002 1002 /* TCP offload with GRE SEQ is not supported, nor can we support 2 ··· 1010 1010 1011 1011 dev->features |= NETIF_F_GSO_SOFTWARE; 1012 1012 dev->hw_features |= NETIF_F_GSO_SOFTWARE; 1013 + 1014 + dev->lltx = true; 1013 1015 } 1014 1016 1015 1017 static int ipgre_tunnel_init(struct net_device *dev)
+1 -1
net/ipv4/ip_vti.c
··· 443 443 444 444 dev->flags = IFF_NOARP; 445 445 dev->addr_len = 4; 446 - dev->features |= NETIF_F_LLTX; 446 + dev->lltx = true; 447 447 netif_keep_dst(dev); 448 448 449 449 return ip_tunnel_init(dev);
+1 -1
net/ipv4/ipip.c
··· 378 378 dev->type = ARPHRD_TUNNEL; 379 379 dev->flags = IFF_NOARP; 380 380 dev->addr_len = 4; 381 - dev->features |= NETIF_F_LLTX; 381 + dev->lltx = true; 382 382 netif_keep_dst(dev); 383 383 384 384 dev->features |= IPIP_FEATURES;
+3 -1
net/ipv6/ip6_gre.c
··· 1471 1471 { 1472 1472 struct ip6_tnl *nt = netdev_priv(dev); 1473 1473 1474 - dev->features |= GRE6_FEATURES | NETIF_F_LLTX; 1474 + dev->features |= GRE6_FEATURES; 1475 1475 dev->hw_features |= GRE6_FEATURES; 1476 1476 1477 1477 /* TCP offload with GRE SEQ is not supported, nor can we support 2 ··· 1485 1485 1486 1486 dev->features |= NETIF_F_GSO_SOFTWARE; 1487 1487 dev->hw_features |= NETIF_F_GSO_SOFTWARE; 1488 + 1489 + dev->lltx = true; 1488 1490 } 1489 1491 1490 1492 static int ip6gre_tunnel_init_common(struct net_device *dev)
+1 -1
net/ipv6/ip6_tunnel.c
··· 1849 1849 dev->type = ARPHRD_TUNNEL6; 1850 1850 dev->flags |= IFF_NOARP; 1851 1851 dev->addr_len = sizeof(struct in6_addr); 1852 - dev->features |= NETIF_F_LLTX; 1852 + dev->lltx = true; 1853 1853 dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS; 1854 1854 netif_keep_dst(dev); 1855 1855
+1 -1
net/ipv6/sit.c
··· 1436 1436 dev->flags = IFF_NOARP; 1437 1437 netif_keep_dst(dev); 1438 1438 dev->addr_len = 4; 1439 - dev->features |= NETIF_F_LLTX; 1439 + dev->lltx = true; 1440 1440 dev->features |= SIT_FEATURES; 1441 1441 dev->hw_features |= SIT_FEATURES; 1442 1442 dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
+1 -1
net/l2tp/l2tp_eth.c
··· 97 97 SET_NETDEV_DEVTYPE(dev, &l2tpeth_type); 98 98 ether_setup(dev); 99 99 dev->priv_flags &= ~IFF_TX_SKB_SHARING; 100 - dev->features |= NETIF_F_LLTX; 100 + dev->lltx = true; 101 101 dev->netdev_ops = &l2tp_eth_netdev_ops; 102 102 dev->needs_free_netdev = true; 103 103 dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
+5 -4
net/openvswitch/vport-internal_dev.c
··· 102 102 netdev->priv_flags &= ~IFF_TX_SKB_SHARING; 103 103 netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_OPENVSWITCH | 104 104 IFF_NO_QUEUE; 105 + netdev->lltx = true; 105 106 netdev->needs_free_netdev = true; 106 107 netdev->priv_destructor = NULL; 107 108 netdev->ethtool_ops = &internal_dev_ethtool_ops; 108 109 netdev->rtnl_link_ops = &internal_dev_link_ops; 109 110 110 - netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST | 111 - NETIF_F_HIGHDMA | NETIF_F_HW_CSUM | 112 - NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL; 111 + netdev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | 112 + NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE | 113 + NETIF_F_GSO_ENCAP_ALL; 113 114 114 115 netdev->vlan_features = netdev->features; 115 116 netdev->hw_enc_features = netdev->features; 116 117 netdev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX; 117 - netdev->hw_features = netdev->features & ~NETIF_F_LLTX; 118 + netdev->hw_features = netdev->features; 118 119 119 120 eth_hw_addr_random(netdev); 120 121 }
+1 -1
net/xfrm/xfrm_interface_core.c
··· 769 769 if (err) 770 770 return err; 771 771 772 - dev->features |= NETIF_F_LLTX; 772 + dev->lltx = true; 773 773 dev->features |= XFRMI_FEATURES; 774 774 dev->hw_features |= XFRMI_FEATURES; 775 775