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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'netdev_features-start-cleaning-netdev_features_t-up'

Alexander Lobakin says:

====================
netdev_features: start cleaning netdev_features_t up

NETDEV_FEATURE_COUNT is currently 64, which means we can't add any new
features as netdev_features_t is u64.
As per several discussions, instead of converting netdev_features_t to
a bitmap, which would mean A LOT of changes, we can try cleaning up
netdev feature bits.
There's a bunch of bits which don't really mean features, rather device
attributes/properties that can't be changed via Ethtool in any of the
drivers. Such attributes can be moved to netdev private flags without
losing any functionality.

Start converting some read-only netdev features to private flags from
the ones that are most obvious, like lockless Tx, inability to change
network namespace etc. I was able to reduce NETDEV_FEATURE_COUNT from
64 to 60, which mean 4 free slots for new features. There are obviously
more read-only features to convert, such as highDMA, "challenged VLAN",
HSR (4 bits) - this will be done in subsequent series.

Please note that currently netdev features are not uAPI/ABI by any means.
Ethtool passes their names and bits to the userspace separately and there
are no hardcoded names/bits in the userspace, so that new Ethtool could
work on older kernels and vice versa.
This, however, isn't true for Ethtools < 3.4. I haven't changed the bit
positions of the already existing features and instead replaced the freed
bits with stubs. But it's anyway theoretically possible that Ethtools
older than 2011 will break. I hope no currently supported distros supply
such an ancient version.
Shell scripts also most likely won't break since the removed bits were
always read-only, meaning nobody would try touching them from a script.
====================

Link: https://patch.msgid.link/20240829123340.789395-1-aleksander.lobakin@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+208 -194
+6 -1
Documentation/networking/net_cachelines/net_device.rst
··· 7 7 8 8 Type Name fastpath_tx_access fastpath_rx_access Comments 9 9 ..struct ..net_device 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) 10 12 char name[16] - - 11 13 struct_netdev_name_node* name_node 12 14 struct_dev_ifalias* ifalias ··· 25 23 struct adj_list 26 24 unsigned_int flags read_mostly read_mostly __dev_queue_xmit,__dev_xmit_skb,ip6_output,__ip6_finish_output(tx);ip6_rcv_core(rx) 27 25 xdp_features_t xdp_features 28 - unsigned_long_long priv_flags read_mostly - __dev_queue_xmit(tx) 29 26 struct_net_device_ops* netdev_ops read_mostly - netdev_core_pick_tx,netdev_start_xmit(tx) 30 27 struct_xdp_metadata_ops* xdp_metadata_ops 31 28 int ifindex - read_mostly ip6_rcv_core ··· 164 163 bool proto_down 165 164 unsigned:1 wol_enabled 166 165 unsigned:1 threaded - - napi_poll(napi_enable,dev_set_threaded) 166 + unsigned_long:1 see_all_hwtstamp_requests 167 + unsigned_long:1 change_proto_down 168 + unsigned_long:1 netns_local 169 + unsigned_long:1 fcoe_mtu 167 170 struct_list_head net_notifier_list 168 171 struct_macsec_ops* macsec_ops 169 172 struct_udp_tunnel_nic_info* udp_tunnel_nic_info
-15
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 - * netns-local device 151 - 152 - NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between 153 - network namespaces (e.g. loopback). 154 - 155 - Don't use it in drivers. 156 - 157 142 * VLAN challenged 158 143 159 144 NETIF_F_VLAN_CHALLENGED should be set for devices which can't cope with VLAN
+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),
+2 -2
Documentation/networking/switchdev.rst
··· 137 137 Port Features 138 138 ^^^^^^^^^^^^^ 139 139 140 - NETIF_F_NETNS_LOCAL 140 + dev->netns_local 141 141 142 142 If the switchdev driver (and device) only supports offloading of the default 143 - network namespace (netns), the driver should set this feature flag to prevent 143 + network namespace (netns), the driver should set this private flag to prevent 144 144 the port netdev from being moved out of the default netns. A netns-aware 145 145 driver/device would not set this flag and be responsible for partitioning 146 146 hardware to preserve netns containment. This means hardware cannot forward
+2 -2
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 + dev->netns_local = true; 3102 3103 dev->features |= NETIF_F_GSO_SOFTWARE; 3103 - dev->features |= NETIF_F_NETNS_LOCAL; 3104 3104 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM; 3105 3105 dev->hw_features |= NETIF_F_FRAGLIST | NETIF_F_RXCSUM; 3106 3106 dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+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 }
+4 -4
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 + 5933 + /* Don't allow bond devices to change network namespaces. */ 5934 + bond_dev->netns_local = true; 5932 5935 5933 5936 /* By default, we declare the bond to be fully 5934 5937 * VLAN hardware accelerated capable. Special ··· 5939 5936 * when there are slaves that are not hw accel 5940 5937 * capable 5941 5938 */ 5942 - 5943 - /* Don't allow bond devices to change network namespaces. */ 5944 - bond_dev->features |= NETIF_F_NETNS_LOCAL; 5945 5939 5946 5940 bond_dev->hw_features = BOND_VLAN_FEATURES | 5947 5941 NETIF_F_HW_VLAN_CTAG_RX |
+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;
+1 -1
drivers/net/ethernet/adi/adin1110.c
··· 1599 1599 netdev->netdev_ops = &adin1110_netdev_ops; 1600 1600 netdev->ethtool_ops = &adin1110_ethtool_ops; 1601 1601 netdev->priv_flags |= IFF_UNICAST_FLT; 1602 - netdev->features |= NETIF_F_NETNS_LOCAL; 1602 + netdev->netns_local = true; 1603 1603 1604 1604 port_priv->phydev = get_phy_device(priv->mii_bus, i + 1, false); 1605 1605 if (IS_ERR(port_priv->phydev)) {
+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 -4
drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c
··· 81 81 82 82 netdev->features |= NETIF_F_FCOE_CRC; 83 83 netdev->vlan_features |= NETIF_F_FCOE_CRC; 84 - netdev->features |= NETIF_F_FCOE_MTU; 85 - netdev->vlan_features |= NETIF_F_FCOE_MTU; 84 + netdev->fcoe_mtu = true; 86 85 87 86 netdev_features_change(netdev); 88 87 ··· 111 112 112 113 netdev->features &= ~NETIF_F_FCOE_CRC; 113 114 netdev->vlan_features &= ~NETIF_F_FCOE_CRC; 114 - netdev->features &= ~NETIF_F_FCOE_MTU; 115 - netdev->vlan_features &= ~NETIF_F_FCOE_MTU; 115 + netdev->fcoe_mtu = false; 116 116 117 117 netdev_features_change(netdev); 118 118
+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 |
+1 -1
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
··· 317 317 int max_frame = adapter->netdev->mtu + ETH_HLEN + ETH_FCS_LEN; 318 318 319 319 #ifdef IXGBE_FCOE 320 - if (adapter->netdev->features & NETIF_F_FCOE_MTU) 320 + if (adapter->netdev->fcoe_mtu) 321 321 max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE); 322 322 #endif 323 323
+2 -2
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
··· 858 858 859 859 /* enable FCoE and notify stack */ 860 860 adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; 861 - netdev->features |= NETIF_F_FCOE_MTU; 861 + netdev->fcoe_mtu = true; 862 862 netdev_features_change(netdev); 863 863 864 864 /* release existing queues and reallocate them */ ··· 898 898 899 899 /* disable FCoE and notify stack */ 900 900 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; 901 - netdev->features &= ~NETIF_F_FCOE_MTU; 901 + netdev->fcoe_mtu = false; 902 902 903 903 netdev_features_change(netdev); 904 904
+1 -1
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
··· 981 981 set_bit(__IXGBE_RX_CSUM_UDP_ZERO_ERR, &ring->state); 982 982 983 983 #ifdef IXGBE_FCOE 984 - if (adapter->netdev->features & NETIF_F_FCOE_MTU) { 984 + if (adapter->netdev->fcoe_mtu) { 985 985 struct ixgbe_ring_feature *f; 986 986 f = &adapter->ring_feature[RING_F_FCOE]; 987 987 if ((rxr_idx >= f->offset) &&
+4 -7
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 5079 5079 netif_set_tso_max_size(adapter->netdev, 32768); 5080 5080 5081 5081 #ifdef IXGBE_FCOE 5082 - if (adapter->netdev->features & NETIF_F_FCOE_MTU) 5082 + if (adapter->netdev->fcoe_mtu) 5083 5083 max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE); 5084 5084 #endif 5085 5085 ··· 5136 5136 5137 5137 #ifdef IXGBE_FCOE 5138 5138 /* FCoE traffic class uses FCOE jumbo frames */ 5139 - if ((dev->features & NETIF_F_FCOE_MTU) && 5140 - (tc < IXGBE_FCOE_JUMBO_FRAME_SIZE) && 5139 + if (dev->fcoe_mtu && tc < IXGBE_FCOE_JUMBO_FRAME_SIZE && 5141 5140 (pb == ixgbe_fcoe_get_tc(adapter))) 5142 5141 tc = IXGBE_FCOE_JUMBO_FRAME_SIZE; 5143 5142 #endif ··· 5196 5197 5197 5198 #ifdef IXGBE_FCOE 5198 5199 /* FCoE traffic class uses FCOE jumbo frames */ 5199 - if ((dev->features & NETIF_F_FCOE_MTU) && 5200 - (tc < IXGBE_FCOE_JUMBO_FRAME_SIZE) && 5200 + if (dev->fcoe_mtu && tc < IXGBE_FCOE_JUMBO_FRAME_SIZE && 5201 5201 (pb == netdev_get_prio_tc_map(dev, adapter->fcoe.up))) 5202 5202 tc = IXGBE_FCOE_JUMBO_FRAME_SIZE; 5203 5203 #endif ··· 11094 11096 NETIF_F_FCOE_CRC; 11095 11097 11096 11098 netdev->vlan_features |= NETIF_F_FSO | 11097 - NETIF_F_FCOE_CRC | 11098 - NETIF_F_FCOE_MTU; 11099 + NETIF_F_FCOE_CRC; 11099 11100 } 11100 11101 #endif /* IXGBE_FCOE */ 11101 11102 if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)
+2 -2
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
··· 495 495 int err = 0; 496 496 497 497 #ifdef CONFIG_FCOE 498 - if (dev->features & NETIF_F_FCOE_MTU) 498 + if (dev->fcoe_mtu) 499 499 pf_max_frame = max_t(int, pf_max_frame, 500 500 IXGBE_FCOE_JUMBO_FRAME_SIZE); 501 501 ··· 857 857 int pf_max_frame = dev->mtu + ETH_HLEN; 858 858 859 859 #if IS_ENABLED(CONFIG_FCOE) 860 - if (dev->features & NETIF_F_FCOE_MTU) 860 + if (dev->fcoe_mtu) 861 861 pf_max_frame = max_t(int, pf_max_frame, 862 862 IXGBE_FCOE_JUMBO_FRAME_SIZE); 863 863 #endif /* CONFIG_FCOE */
+2 -1
drivers/net/ethernet/marvell/prestera/prestera_main.c
··· 633 633 if (err) 634 634 goto err_dl_port_register; 635 635 636 - dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_HW_TC; 636 + dev->features |= NETIF_F_HW_TC; 637 + dev->netns_local = true; 637 638 dev->netdev_ops = &prestera_netdev_ops; 638 639 dev->ethtool_ops = &prestera_ethtool_ops; 639 640 SET_NETDEV_DEV(dev, sw->dev->dev);
+2 -2
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 4414 4414 4415 4415 if (mlx5e_is_uplink_rep(priv)) { 4416 4416 features = mlx5e_fix_uplink_rep_features(netdev, features); 4417 - features |= NETIF_F_NETNS_LOCAL; 4417 + netdev->netns_local = true; 4418 4418 } else { 4419 - features &= ~NETIF_F_NETNS_LOCAL; 4419 + netdev->netns_local = false; 4420 4420 } 4421 4421 4422 4422 mutex_unlock(&priv->state_lock);
+2 -1
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
··· 898 898 netdev->hw_features |= NETIF_F_RXCSUM; 899 899 900 900 netdev->features |= netdev->hw_features; 901 - netdev->features |= NETIF_F_NETNS_LOCAL; 901 + 902 + netdev->netns_local = true; 902 903 } 903 904 904 905 static int mlx5e_init_rep(struct mlx5_core_dev *mdev,
+4 -2
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 | 1680 - NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_TC; 1679 + dev->features |= NETIF_F_SG | NETIF_F_HW_VLAN_CTAG_FILTER | 1680 + NETIF_F_HW_TC; 1681 1681 dev->hw_features |= NETIF_F_HW_TC | NETIF_F_LOOPBACK; 1682 + dev->lltx = true; 1683 + dev->netns_local = true; 1682 1684 1683 1685 dev->min_mtu = ETH_MIN_MTU; 1684 1686 dev->max_mtu = MLXSW_PORT_MAX_MTU - MLXSW_PORT_ETH_FRAME_HDR;
+1 -1
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
··· 816 816 NETIF_F_HW_VLAN_STAG_TX | 817 817 NETIF_F_HW_TC; 818 818 dev->hw_features |= NETIF_F_HW_TC; 819 - dev->priv_flags |= IFF_SEE_ALL_HWTSTAMP_REQUESTS; 819 + dev->see_all_hwtstamp_requests = true; 820 820 dev->needed_headroom = IFH_LEN_BYTES; 821 821 822 822 eth_hw_addr_gen(dev, lan966x->base_mac, p + 1);
+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 -1
drivers/net/ethernet/rocker/rocker_main.c
··· 2575 2575 netif_napi_add(dev, &rocker_port->napi_rx, rocker_port_poll_rx); 2576 2576 rocker_carrier_init(rocker_port); 2577 2577 2578 - dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG; 2578 + dev->features |= NETIF_F_SG; 2579 + dev->netns_local = true; 2579 2580 2580 2581 /* MTU range: 68 - 9000 */ 2581 2582 dev->min_mtu = ROCKER_PORT_MIN_MTU;
+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/ti/cpsw_new.c
··· 1407 1407 cpsw->slaves[i].ndev = ndev; 1408 1408 1409 1409 ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | 1410 - NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_NETNS_LOCAL | NETIF_F_HW_TC; 1410 + NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_TC; 1411 + ndev->netns_local = true; 1411 1412 1412 1413 ndev->xdp_features = NETDEV_XDP_ACT_BASIC | 1413 1414 NETDEV_XDP_ACT_REDIRECT |
+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
+2 -2
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; 175 + dev->netns_local = true; 174 176 netif_keep_dst(dev); 175 177 dev->hw_features = NETIF_F_GSO_SOFTWARE; 176 178 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST ··· 181 179 | NETIF_F_RXCSUM 182 180 | NETIF_F_SCTP_CRC 183 181 | NETIF_F_HIGHDMA 184 - | NETIF_F_LLTX 185 - | NETIF_F_NETNS_LOCAL 186 182 | NETIF_F_VLAN_CHALLENGED 187 183 | NETIF_F_LOOPBACK; 188 184 dev->ethtool_ops = eth_ops;
+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 }
+4 -2
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); ··· 1214 1213 dev->max_mtu = ETH_MAX_MTU; 1215 1214 dev->priv_flags &= ~IFF_TX_SKB_SHARING; 1216 1215 netif_keep_dst(dev); 1217 - dev->priv_flags |= IFF_UNICAST_FLT | IFF_CHANGE_PROTO_DOWN; 1216 + dev->priv_flags |= IFF_UNICAST_FLT; 1217 + dev->change_proto_down = true; 1218 1218 dev->netdev_ops = &macvlan_netdev_ops; 1219 1219 dev->needs_free_netdev = true; 1220 1220 dev->priv_destructor = macvlan_dev_free;
+2 -2
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 - failover_dev->features |= NETIF_F_NETNS_LOCAL; 737 + failover_dev->netns_local = true; 738 738 739 739 failover_dev->hw_features = FAILOVER_VLAN_FEATURES | 740 740 NETIF_F_HW_VLAN_CTAG_TX |
+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
+4 -4
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 - 2193 - dev->features |= NETIF_F_LLTX; 2194 - dev->features |= NETIF_F_GRO; 2192 + dev->lltx = true; 2195 2193 2196 2194 /* Don't allow team devices to change network namespaces. */ 2197 - dev->features |= NETIF_F_NETNS_LOCAL; 2195 + dev->netns_local = true; 2196 + 2197 + dev->features |= NETIF_F_GRO; 2198 2198 2199 2199 dev->hw_features = TEAM_VLAN_FEATURES | 2200 2200 NETIF_F_HW_VLAN_CTAG_RX |
+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 |
+2 -2
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 - dev->features |= NETIF_F_NETNS_LOCAL; 1641 + dev->netns_local = true; 1642 1642 1643 1643 /* does not make sense for a VLAN to be added to a vrf device */ 1644 1644 dev->features |= NETIF_F_VLAN_CHALLENGED;
+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
+3 -2
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; ··· 3330 3331 dev->hw_features |= NETIF_F_RXCSUM; 3331 3332 dev->hw_features |= NETIF_F_GSO_SOFTWARE; 3332 3333 netif_keep_dst(dev); 3333 - dev->priv_flags |= IFF_NO_QUEUE | IFF_CHANGE_PROTO_DOWN; 3334 + dev->priv_flags |= IFF_NO_QUEUE; 3335 + dev->change_proto_down = true; 3336 + dev->lltx = true; 3334 3337 3335 3338 /* MTU range: 68 - 65535 */ 3336 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;
+2 -2
drivers/scsi/fcoe/fcoe.c
··· 722 722 * will return 0, so do this first. 723 723 */ 724 724 mfs = netdev->mtu; 725 - if (netdev->features & NETIF_F_FCOE_MTU) { 725 + if (netdev->fcoe_mtu) { 726 726 mfs = FCOE_MTU; 727 727 FCOE_NETDEV_DBG(netdev, "Supports FCOE_MTU of %d bytes\n", mfs); 728 728 } ··· 1863 1863 case NETDEV_CHANGE: 1864 1864 break; 1865 1865 case NETDEV_CHANGEMTU: 1866 - if (netdev->features & NETIF_F_FCOE_MTU) 1866 + if (netdev->fcoe_mtu) 1867 1867 break; 1868 1868 mfs = netdev->mtu - (sizeof(struct fcoe_hdr) + 1869 1869 sizeof(struct fcoe_crc_eof));
+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);
+4 -12
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 */ 29 - NETIF_F_NETNS_LOCAL_BIT, /* Does not change network namespaces */ 27 + __UNUSED_NETIF_F_12, 28 + __UNUSED_NETIF_F_13, 30 29 NETIF_F_GRO_BIT, /* Generic receive offload */ 31 30 NETIF_F_LRO_BIT, /* large receive offload */ 32 31 ··· 58 59 59 60 NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */ 60 61 NETIF_F_SCTP_CRC_BIT, /* SCTP checksum offload */ 61 - NETIF_F_FCOE_MTU_BIT, /* Supports max FCoE MTU, 2158 bytes*/ 62 + __UNUSED_NETIF_F_37, 62 63 NETIF_F_NTUPLE_BIT, /* N-tuple filters supported */ 63 64 NETIF_F_RXHASH_BIT, /* Receive hashing offload */ 64 65 NETIF_F_RXCSUM_BIT, /* Receive checksumming offload */ ··· 105 106 #define __NETIF_F(name) __NETIF_F_BIT(NETIF_F_##name##_BIT) 106 107 107 108 #define NETIF_F_FCOE_CRC __NETIF_F(FCOE_CRC) 108 - #define NETIF_F_FCOE_MTU __NETIF_F(FCOE_MTU) 109 109 #define NETIF_F_FRAGLIST __NETIF_F(FRAGLIST) 110 110 #define NETIF_F_FSO __NETIF_F(FSO) 111 111 #define NETIF_F_GRO __NETIF_F(GRO) ··· 118 120 #define NETIF_F_HW_VLAN_CTAG_TX __NETIF_F(HW_VLAN_CTAG_TX) 119 121 #define NETIF_F_IP_CSUM __NETIF_F(IP_CSUM) 120 122 #define NETIF_F_IPV6_CSUM __NETIF_F(IPV6_CSUM) 121 - #define NETIF_F_LLTX __NETIF_F(LLTX) 122 123 #define NETIF_F_LOOPBACK __NETIF_F(LOOPBACK) 123 124 #define NETIF_F_LRO __NETIF_F(LRO) 124 - #define NETIF_F_NETNS_LOCAL __NETIF_F(NETNS_LOCAL) 125 125 #define NETIF_F_NOCACHE_COPY __NETIF_F(NOCACHE_COPY) 126 126 #define NETIF_F_NTUPLE __NETIF_F(NTUPLE) 127 127 #define NETIF_F_RXCSUM __NETIF_F(RXCSUM) ··· 188 192 189 193 /* Features valid for ethtool to change */ 190 194 /* = all defined minus driver/device-class-related */ 191 - #define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \ 192 - NETIF_F_LLTX | NETIF_F_NETNS_LOCAL) 195 + #define NETIF_F_NEVER_CHANGE NETIF_F_VLAN_CHALLENGED 193 196 194 197 /* remember that ((t)1 << t_BITS) is undefined in C99 */ 195 198 #define NETIF_F_ETHTOOL_BITS ((__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) | \ ··· 208 213 209 214 #define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | \ 210 215 NETIF_F_TSO_ECN | NETIF_F_TSO_MANGLEID) 211 - 212 - #define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ 213 - NETIF_F_FSO) 214 216 215 217 /* List of features with software fallbacks. */ 216 218 #define NETIF_F_GSO_SOFTWARE (NETIF_F_ALL_TSO | NETIF_F_GSO_SCTP | \
+29 -13
include/linux/netdevice.h
··· 1613 1613 * userspace; this means that the order of these flags can change 1614 1614 * during any kernel release. 1615 1615 * 1616 - * You should have a pretty good reason to be extending these flags. 1616 + * You should add bitfield booleans after either net_device::priv_flags 1617 + * (hotpath) or ::threaded (slowpath) instead of extending these flags. 1617 1618 * 1618 1619 * @IFF_802_1Q_VLAN: 802.1Q VLAN device 1619 1620 * @IFF_EBRIDGE: Ethernet bridging device ··· 1653 1652 * @IFF_NO_ADDRCONF: prevent ipv6 addrconf 1654 1653 * @IFF_TX_SKB_NO_LINEAR: device/driver is capable of xmitting frames with 1655 1654 * skb_headlen(skb) == 0 (data starts from frag0) 1656 - * @IFF_CHANGE_PROTO_DOWN: device supports setting carrier via IFLA_PROTO_DOWN 1657 - * @IFF_SEE_ALL_HWTSTAMP_REQUESTS: device wants to see calls to 1658 - * ndo_hwtstamp_set() for all timestamp requests regardless of source, 1659 - * even if those aren't HWTSTAMP_SOURCE_NETDEV. 1660 1655 */ 1661 1656 enum netdev_priv_flags { 1662 1657 IFF_802_1Q_VLAN = 1<<0, ··· 1687 1690 IFF_L3MDEV_RX_HANDLER = 1<<29, 1688 1691 IFF_NO_ADDRCONF = BIT_ULL(30), 1689 1692 IFF_TX_SKB_NO_LINEAR = BIT_ULL(31), 1690 - IFF_CHANGE_PROTO_DOWN = BIT_ULL(32), 1691 - IFF_SEE_ALL_HWTSTAMP_REQUESTS = BIT_ULL(33), 1692 1693 }; 1693 1694 1694 1695 /* Specifies the type of the struct net_device::ml_priv pointer */ ··· 1717 1722 * Actually, this whole structure is a big mistake. It mixes I/O 1718 1723 * data with strictly "high-level" data, and it has to know about 1719 1724 * almost every data structure used in the INET module. 1725 + * 1726 + * @priv_flags: flags invisible to userspace defined as bits, see 1727 + * enum netdev_priv_flags for the definitions 1728 + * @lltx: device supports lockless Tx. Deprecated for real HW 1729 + * drivers. Mainly used by logical interfaces, such as 1730 + * bonding and tunnels 1720 1731 * 1721 1732 * @name: This is the first field of the "visible" part of this structure 1722 1733 * (i.e. as seen by users in the "Space.c" file). It is the name ··· 1790 1789 * 1791 1790 * @flags: Interface flags (a la BSD) 1792 1791 * @xdp_features: XDP capability supported by the device 1793 - * @priv_flags: Like 'flags' but invisible to userspace, 1794 - * see if.h for the definitions 1795 1792 * @gflags: Global flags ( kept as legacy ) 1796 1793 * @priv_len: Size of the ->priv flexible array 1797 1794 * @priv: Flexible array containing private data ··· 1963 1964 * 1964 1965 * @threaded: napi threaded mode is enabled 1965 1966 * 1967 + * @see_all_hwtstamp_requests: device wants to see calls to 1968 + * ndo_hwtstamp_set() for all timestamp requests 1969 + * regardless of source, even if those aren't 1970 + * HWTSTAMP_SOURCE_NETDEV 1971 + * @change_proto_down: device supports setting carrier via IFLA_PROTO_DOWN 1972 + * @netns_local: interface can't change network namespaces 1973 + * @fcoe_mtu: device supports maximum FCoE MTU, 2158 bytes 1974 + * 1966 1975 * @net_notifier_list: List of per-net netdev notifier block 1967 1976 * that follow this device when it is moved 1968 1977 * to another network namespace. ··· 2021 2014 2022 2015 /* TX read-mostly hotpath */ 2023 2016 __cacheline_group_begin(net_device_read_tx); 2024 - unsigned long long priv_flags; 2017 + struct_group(priv_flags_fast, 2018 + unsigned long priv_flags:32; 2019 + unsigned long lltx:1; 2020 + ); 2025 2021 const struct net_device_ops *netdev_ops; 2026 2022 const struct header_ops *header_ops; 2027 2023 struct netdev_queue *_tx; ··· 2359 2349 struct lock_class_key *qdisc_tx_busylock; 2360 2350 bool proto_down; 2361 2351 bool threaded; 2352 + 2353 + /* priv_flags_slow, ungrouped to save space */ 2354 + unsigned long see_all_hwtstamp_requests:1; 2355 + unsigned long change_proto_down:1; 2356 + unsigned long netns_local:1; 2357 + unsigned long fcoe_mtu:1; 2362 2358 2363 2359 struct list_head net_notifier_list; 2364 2360 ··· 4441 4425 } 4442 4426 4443 4427 #define HARD_TX_LOCK(dev, txq, cpu) { \ 4444 - if ((dev->features & NETIF_F_LLTX) == 0) { \ 4428 + if (!(dev)->lltx) { \ 4445 4429 __netif_tx_lock(txq, cpu); \ 4446 4430 } else { \ 4447 4431 __netif_tx_acquire(txq); \ ··· 4449 4433 } 4450 4434 4451 4435 #define HARD_TX_TRYLOCK(dev, txq) \ 4452 - (((dev->features & NETIF_F_LLTX) == 0) ? \ 4436 + (!(dev)->lltx ? \ 4453 4437 __netif_tx_trylock(txq) : \ 4454 4438 __netif_tx_acquire(txq)) 4455 4439 4456 4440 #define HARD_TX_UNLOCK(dev, txq) { \ 4457 - if ((dev->features & NETIF_F_LLTX) == 0) { \ 4441 + if (!(dev)->lltx) { \ 4458 4442 __netif_tx_unlock(txq); \ 4459 4443 } else { \ 4460 4444 __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 };
+6 -4
net/8021q/vlan_dev.c
··· 564 564 NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | 565 565 NETIF_F_GSO_ENCAP_ALL | 566 566 NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC | 567 - NETIF_F_ALL_FCOE; 567 + NETIF_F_FCOE_CRC | NETIF_F_FSO; 568 568 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; 574 + dev->fcoe_mtu = true; 573 575 netif_inherit_tso_max(dev, real_dev); 574 576 if (dev->features & NETIF_F_VLAN_FEATURES) 575 577 netdev_warn(real_dev, "VLAN features are set incorrectly. Q-in-Q configurations may not work correctly.\n"); 576 578 577 - dev->vlan_features = real_dev->vlan_features & ~NETIF_F_ALL_FCOE; 579 + dev->vlan_features = real_dev->vlan_features & 580 + ~(NETIF_F_FCOE_CRC | NETIF_F_FSO); 578 581 dev->hw_enc_features = vlan_tnl_features(real_dev); 579 582 dev->mpls_features = real_dev->mpls_features; 580 583 ··· 658 655 lower_features |= NETIF_F_HW_CSUM; 659 656 features = netdev_intersect_features(features, lower_features); 660 657 features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE); 661 - features |= NETIF_F_LLTX; 662 658 663 659 return features; 664 660 }
+2 -2
net/8021q/vlanproc.c
··· 238 238 239 239 stats = dev_get_stats(vlandev, &temp); 240 240 seq_printf(seq, 241 - "%s VID: %d REORDER_HDR: %i dev->priv_flags: %llx\n", 241 + "%s VID: %d REORDER_HDR: %i dev->priv_flags: %x\n", 242 242 vlandev->name, vlan->vlan_id, 243 - (int)(vlan->flags & 1), vlandev->priv_flags); 243 + (int)(vlan->flags & 1), (u32)vlandev->priv_flags); 244 244 245 245 seq_printf(seq, fmt64, "total frames received", stats->rx_packets); 246 246 seq_printf(seq, fmt64, "total bytes received", stats->rx_bytes);
+3 -2
net/batman-adv/soft-interface.c
··· 1020 1020 dev->netdev_ops = &batadv_netdev_ops; 1021 1021 dev->needs_free_netdev = true; 1022 1022 dev->priv_destructor = batadv_softif_free; 1023 - dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_NETNS_LOCAL; 1024 - dev->features |= NETIF_F_LLTX; 1023 + dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; 1025 1024 dev->priv_flags |= IFF_NO_QUEUE; 1025 + dev->lltx = true; 1026 + dev->netns_local = true; 1026 1027 1027 1028 /* can't call min_mtu, because the needed variables 1028 1029 * have not been initialized yet
+4 -2
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; 491 + dev->netns_local = true; 490 492 491 - dev->features = COMMON_FEATURES | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL | 492 - NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX; 493 + dev->features = COMMON_FEATURES | NETIF_F_HW_VLAN_CTAG_TX | 494 + NETIF_F_HW_VLAN_STAG_TX; 493 495 dev->hw_features = COMMON_FEATURES | NETIF_F_HW_VLAN_CTAG_TX | 494 496 NETIF_F_HW_VLAN_STAG_TX; 495 497 dev->vlan_features = COMMON_FEATURES;
+4 -4
net/core/dev.c
··· 9274 9274 */ 9275 9275 int dev_change_proto_down(struct net_device *dev, bool proto_down) 9276 9276 { 9277 - if (!(dev->priv_flags & IFF_CHANGE_PROTO_DOWN)) 9277 + if (!dev->change_proto_down) 9278 9278 return -EOPNOTSUPP; 9279 9279 if (!netif_device_present(dev)) 9280 9280 return -ENODEV; ··· 11487 11487 11488 11488 /* Don't allow namespace local devices to be moved. */ 11489 11489 err = -EINVAL; 11490 - if (dev->features & NETIF_F_NETNS_LOCAL) 11490 + if (dev->netns_local) 11491 11491 goto out; 11492 11492 11493 11493 /* Ensure the device has been registered */ ··· 11869 11869 char fb_name[IFNAMSIZ]; 11870 11870 11871 11871 /* Ignore unmoveable devices (i.e. loopback) */ 11872 - if (dev->features & NETIF_F_NETNS_LOCAL) 11872 + if (dev->netns_local) 11873 11873 continue; 11874 11874 11875 11875 /* Leave virtual devices for the generic cleanup */ ··· 11930 11930 static void __init net_dev_struct_check(void) 11931 11931 { 11932 11932 /* TX read-mostly hotpath */ 11933 - CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, priv_flags); 11933 + CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, priv_flags_fast); 11934 11934 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, netdev_ops); 11935 11935 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, header_ops); 11936 11936 CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, _tx);
+4 -5
net/core/dev_ioctl.c
··· 317 317 * should take precedence in front of hardware timestamping provided by the 318 318 * netdev. If the netdev driver needs to perform specific actions even for PHY 319 319 * timestamping to work properly (a switch port must trap the timestamped 320 - * frames and not forward them), it must set IFF_SEE_ALL_HWTSTAMP_REQUESTS in 321 - * dev->priv_flags. 320 + * frames and not forward them), it must set dev->see_all_hwtstamp_requests. 322 321 */ 323 322 int dev_set_hwtstamp_phylib(struct net_device *dev, 324 323 struct kernel_hwtstamp_config *cfg, ··· 331 332 332 333 cfg->source = phy_ts ? HWTSTAMP_SOURCE_PHYLIB : HWTSTAMP_SOURCE_NETDEV; 333 334 334 - if (phy_ts && (dev->priv_flags & IFF_SEE_ALL_HWTSTAMP_REQUESTS)) { 335 + if (phy_ts && dev->see_all_hwtstamp_requests) { 335 336 err = ops->ndo_hwtstamp_get(dev, &old_cfg); 336 337 if (err) 337 338 return err; 338 339 } 339 340 340 - if (!phy_ts || (dev->priv_flags & IFF_SEE_ALL_HWTSTAMP_REQUESTS)) { 341 + if (!phy_ts || dev->see_all_hwtstamp_requests) { 341 342 err = ops->ndo_hwtstamp_set(dev, cfg, extack); 342 343 if (err) { 343 344 if (extack->_msg) ··· 346 347 } 347 348 } 348 349 349 - if (phy_ts && (dev->priv_flags & IFF_SEE_ALL_HWTSTAMP_REQUESTS)) 350 + if (phy_ts && dev->see_all_hwtstamp_requests) 350 351 changed = kernel_hwtstamp_config_changed(&old_cfg, cfg); 351 352 352 353 if (phy_ts) {
+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);
+1 -1
net/core/rtnetlink.c
··· 2724 2724 bool proto_down; 2725 2725 int err; 2726 2726 2727 - if (!(dev->priv_flags & IFF_CHANGE_PROTO_DOWN)) { 2727 + if (!dev->change_proto_down) { 2728 2728 NL_SET_ERR_MSG(extack, "Protodown not supported by device"); 2729 2729 return -EOPNOTSUPP; 2730 2730 }
+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)
-3
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 - [NETIF_F_NETNS_LOCAL_BIT] = "netns-local", 30 28 [NETIF_F_GRO_BIT] = "rx-gro", 31 29 [NETIF_F_GRO_HW_BIT] = "rx-gro-hw", 32 30 [NETIF_F_LRO_BIT] = "rx-lro", ··· 50 52 51 53 [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc", 52 54 [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp", 53 - [NETIF_F_FCOE_MTU_BIT] = "fcoe-mtu", 54 55 [NETIF_F_NTUPLE_BIT] = "rx-ntuple-filter", 55 56 [NETIF_F_RXHASH_BIT] = "rx-hashing", 56 57 [NETIF_F_RXCSUM_BIT] = "rx-checksum",
+6 -6
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; 559 + /* Not sure about this. Taken from bridge code. netdevice.h says 560 + * it means "Does not change network namespaces". 561 + */ 562 + dev->netns_local = true; 557 563 558 564 dev->needs_free_netdev = true; 559 565 ··· 569 563 570 564 dev->features = dev->hw_features; 571 565 572 - /* Prevent recursive tx locking */ 573 - dev->features |= NETIF_F_LLTX; 574 566 /* VLAN on top of HSR needs testing and probably some work on 575 567 * hsr_header_create() etc. 576 568 */ 577 569 dev->features |= NETIF_F_VLAN_CHALLENGED; 578 - /* Not sure about this. Taken from bridge code. netdev_features.h says 579 - * it means "Does not change network namespaces". 580 - */ 581 - dev->features |= NETIF_F_NETNS_LOCAL; 582 570 } 583 571 584 572 /* Return true if dev is a HSR master; return false otherwise.
+1 -1
net/ieee802154/6lowpan/core.c
··· 116 116 ldev->netdev_ops = &lowpan_netdev_ops; 117 117 ldev->header_ops = &lowpan_header_ops; 118 118 ldev->needs_free_netdev = true; 119 - ldev->features |= NETIF_F_NETNS_LOCAL; 119 + ldev->netns_local = true; 120 120 } 121 121 122 122 static int lowpan_validate(struct nlattr *tb[], struct nlattr *data[],
+5 -5
net/ieee802154/core.c
··· 226 226 list_for_each_entry(wpan_dev, &rdev->wpan_dev_list, list) { 227 227 if (!wpan_dev->netdev) 228 228 continue; 229 - wpan_dev->netdev->features &= ~NETIF_F_NETNS_LOCAL; 229 + wpan_dev->netdev->netns_local = false; 230 230 err = dev_change_net_namespace(wpan_dev->netdev, net, "wpan%d"); 231 231 if (err) 232 232 break; 233 - wpan_dev->netdev->features |= NETIF_F_NETNS_LOCAL; 233 + wpan_dev->netdev->netns_local = true; 234 234 } 235 235 236 236 if (err) { ··· 242 242 list) { 243 243 if (!wpan_dev->netdev) 244 244 continue; 245 - wpan_dev->netdev->features &= ~NETIF_F_NETNS_LOCAL; 245 + wpan_dev->netdev->netns_local = false; 246 246 err = dev_change_net_namespace(wpan_dev->netdev, net, 247 247 "wpan%d"); 248 248 WARN_ON(err); 249 - wpan_dev->netdev->features |= NETIF_F_NETNS_LOCAL; 249 + wpan_dev->netdev->netns_local = true; 250 250 } 251 251 252 252 return err; ··· 291 291 switch (state) { 292 292 /* TODO NETDEV_DEVTYPE */ 293 293 case NETDEV_REGISTER: 294 - dev->features |= NETIF_F_NETNS_LOCAL; 294 + dev->netns_local = true; 295 295 wpan_dev->identifier = ++rdev->wpan_dev_id; 296 296 list_add_rcu(&wpan_dev->list, &rdev->wpan_dev_list); 297 297 rdev->devlist_generation++;
+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_tunnel.c
··· 1161 1161 * Allowing to move it to another netns is clearly unsafe. 1162 1162 */ 1163 1163 if (!IS_ERR(itn->fb_tunnel_dev)) { 1164 - itn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL; 1164 + itn->fb_tunnel_dev->netns_local = true; 1165 1165 itn->fb_tunnel_dev->mtu = ip_tunnel_bind_dev(itn->fb_tunnel_dev); 1166 1166 ip_tunnel_add(itn, netdev_priv(itn->fb_tunnel_dev)); 1167 1167 itn->type = itn->fb_tunnel_dev->type;
+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;
+1 -1
net/ipv4/ipmr.c
··· 537 537 dev->flags = IFF_NOARP; 538 538 dev->netdev_ops = &reg_vif_netdev_ops; 539 539 dev->needs_free_netdev = true; 540 - dev->features |= NETIF_F_NETNS_LOCAL; 540 + dev->netns_local = true; 541 541 } 542 542 543 543 static struct net_device *ipmr_reg_vif(struct net *net, struct mr_table *mrt)
+4 -3
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) ··· 1621 1619 /* FB netdevice is special: we have one, and only one per netns. 1622 1620 * Allowing to move it to another netns is clearly unsafe. 1623 1621 */ 1624 - ign->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL; 1625 - 1622 + ign->fb_tunnel_dev->netns_local = true; 1626 1623 1627 1624 ip6gre_fb_tunnel_init(ign->fb_tunnel_dev); 1628 1625 ign->fb_tunnel_dev->rtnl_link_ops = &ip6gre_link_ops;
+2 -2
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 ··· 2258 2258 /* FB netdevice is special: we have one, and only one per netns. 2259 2259 * Allowing to move it to another netns is clearly unsafe. 2260 2260 */ 2261 - ip6n->fb_tnl_dev->features |= NETIF_F_NETNS_LOCAL; 2261 + ip6n->fb_tnl_dev->netns_local = true; 2262 2262 2263 2263 err = ip6_fb_tnl_dev_init(ip6n->fb_tnl_dev); 2264 2264 if (err < 0)
+1 -1
net/ipv6/ip6mr.c
··· 640 640 dev->flags = IFF_NOARP; 641 641 dev->netdev_ops = &reg_vif_netdev_ops; 642 642 dev->needs_free_netdev = true; 643 - dev->features |= NETIF_F_NETNS_LOCAL; 643 + dev->netns_local = true; 644 644 } 645 645 646 646 static struct net_device *ip6mr_reg_vif(struct net *net, struct mr_table *mrt)
+2 -2
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; ··· 1856 1856 /* FB netdevice is special: we have one, and only one per netns. 1857 1857 * Allowing to move it to another netns is clearly unsafe. 1858 1858 */ 1859 - sitn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL; 1859 + sitn->fb_tunnel_dev->netns_local = true; 1860 1860 1861 1861 err = register_netdev(sitn->fb_tunnel_dev); 1862 1862 if (err)
+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;
+6 -5
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 } ··· 149 148 150 149 /* Restrict bridge port to current netns. */ 151 150 if (vport->port_no == OVSP_LOCAL) 152 - vport->dev->features |= NETIF_F_NETNS_LOCAL; 151 + vport->dev->netns_local = true; 153 152 154 153 rtnl_lock(); 155 154 err = register_netdevice(vport->dev);
+5 -5
net/wireless/core.c
··· 165 165 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { 166 166 if (!wdev->netdev) 167 167 continue; 168 - wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; 168 + wdev->netdev->netns_local = false; 169 169 err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); 170 170 if (err) 171 171 break; 172 - wdev->netdev->features |= NETIF_F_NETNS_LOCAL; 172 + wdev->netdev->netns_local = true; 173 173 } 174 174 175 175 if (err) { ··· 181 181 list) { 182 182 if (!wdev->netdev) 183 183 continue; 184 - wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; 184 + wdev->netdev->netns_local = false; 185 185 err = dev_change_net_namespace(wdev->netdev, net, 186 186 "wlan%d"); 187 187 WARN_ON(err); 188 - wdev->netdev->features |= NETIF_F_NETNS_LOCAL; 188 + wdev->netdev->netns_local = true; 189 189 } 190 190 191 191 return err; ··· 1473 1473 SET_NETDEV_DEVTYPE(dev, &wiphy_type); 1474 1474 wdev->netdev = dev; 1475 1475 /* can only change netns with wiphy */ 1476 - dev->features |= NETIF_F_NETNS_LOCAL; 1476 + dev->netns_local = true; 1477 1477 1478 1478 cfg80211_init_wdev(wdev); 1479 1479 break;
+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
+1 -1
tools/testing/selftests/net/forwarding/README
··· 6 6 7 7 Unfortunately, these namespaces can not be used with actual switching 8 8 ASICs, as their ports can not be migrated to other network namespaces 9 - (NETIF_F_NETNS_LOCAL) and most of them probably do not support the 9 + (dev->netns_local) and most of them probably do not support the 10 10 L1-separation provided by namespaces. 11 11 12 12 However, a similar kind of flexibility can be achieved by using VRFs and