2024-04-05 13:39:28

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH RFC net-next 0/7] 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 58, which mean 6 free slots for new features. NETIF_F_NEVER_CHANGE
is gone, so ETHTOOL_A_FEATURES_NOCHANGE Netlink reply will always be 0.
I may've made some mistakes with feature inheriting and also some of
these are compile-tested only, so this is marked as RFC to discuss
the changes. There are obviously more read-only features to convert,
such as HSR (4 bits), this will be done in subsequent series.

Alexander Lobakin (7):
netdev_features: remove unused __UNUSED_NETIF_F_1
netdev_features: convert NETIF_F_LLTX to priv_flag IFF_LLTX
netdevice: introduce IFF_LOGICAL as (IFF_NO_QUEUE | IFF_LLTX)
netdev_features: convert NETIF_F_NETNS_LOCAL to IFF_NETNS_LOCAL
netdev_features: convert NETIF_F_HIGHDMA to priv_flag IFF_HIGHDMA
netdev_features: convert NETIF_F_VLAN_CHALLENGED to
IFF_VLAN_CHALLENGED
netdev_features: convert NETIF_F_FCOE_MTU to IFF_FCOE_MTU

Documentation/driver-api/usb/dma.rst | 2 +-
Documentation/networking/ethtool-netlink.rst | 2 +-
Documentation/networking/netdev-features.rst | 31 +-------------
Documentation/networking/netdevices.rst | 4 +-
Documentation/networking/switchdev.rst | 4 +-
drivers/net/ethernet/tehuti/tehuti.h | 2 +-
include/linux/if_vlan.h | 5 +--
include/linux/netdev_features.h | 26 ++----------
include/linux/netdevice.h | 31 ++++++++++++--
include/net/mac80211.h | 1 +
include/net/net_failover.h | 6 ++-
net/mac80211/ieee80211_i.h | 4 +-
drivers/firewire/net.c | 2 +-
drivers/infiniband/hw/hfi1/vnic_main.c | 3 +-
drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +-
drivers/net/amt.c | 4 +-
drivers/net/bareudp.c | 3 +-
drivers/net/bonding/bond_main.c | 42 +++++++++----------
drivers/net/dummy.c | 4 +-
drivers/net/ethernet/adaptec/starfire.c | 2 +-
drivers/net/ethernet/adi/adin1110.c | 3 +-
drivers/net/ethernet/aeroflex/greth.c | 3 +-
drivers/net/ethernet/alteon/acenic.c | 2 +-
drivers/net/ethernet/altera/altera_tse_main.c | 3 +-
drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++-
drivers/net/ethernet/broadcom/bcmsysport.c | 4 +-
drivers/net/ethernet/broadcom/bnx2.c | 2 +-
.../net/ethernet/broadcom/bnx2x/bnx2x_main.c | 5 +--
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +--
.../net/ethernet/broadcom/genet/bcmgenet.c | 4 +-
drivers/net/ethernet/broadcom/tg3.c | 2 +-
drivers/net/ethernet/brocade/bna/bnad.c | 9 ++--
drivers/net/ethernet/calxeda/xgmac.c | 4 +-
.../net/ethernet/cavium/liquidio/lio_main.c | 4 +-
.../ethernet/cavium/liquidio/lio_vf_main.c | 4 +-
drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 3 +-
.../net/ethernet/chelsio/cxgb3/cxgb3_main.c | 4 +-
.../net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c | 6 +--
.../net/ethernet/chelsio/cxgb4/cxgb4_main.c | 6 +--
.../ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 6 +--
drivers/net/ethernet/cisco/enic/enic_main.c | 2 +-
drivers/net/ethernet/emulex/benet/be_main.c | 5 +--
.../net/ethernet/freescale/dpaa/dpaa_eth.c | 6 +--
.../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 5 +--
.../net/ethernet/freescale/enetc/enetc_pf.c | 4 +-
.../net/ethernet/freescale/enetc/enetc_vf.c | 3 +-
drivers/net/ethernet/freescale/gianfar.c | 3 +-
.../ethernet/fungible/funeth/funeth_main.c | 5 ++-
drivers/net/ethernet/google/gve/gve_main.c | 2 +-
drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 4 +-
.../net/ethernet/huawei/hinic/hinic_main.c | 4 +-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 6 +--
drivers/net/ethernet/intel/e100.c | 2 +-
drivers/net/ethernet/intel/e1000/e1000_main.c | 6 +--
drivers/net/ethernet/intel/e1000e/netdev.c | 5 +--
drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 6 +--
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
drivers/net/ethernet/intel/iavf/iavf_main.c | 3 +-
drivers/net/ethernet/intel/ice/ice_main.c | 5 ++-
drivers/net/ethernet/intel/idpf/idpf_lib.c | 5 ++-
drivers/net/ethernet/intel/igb/igb_main.c | 4 +-
drivers/net/ethernet/intel/igbvf/netdev.c | 3 +-
drivers/net/ethernet/intel/igc/igc_main.c | 4 +-
.../net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 4 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | 3 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 +++---
.../net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 +-
.../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 +-
drivers/net/ethernet/jme.c | 6 +--
.../ethernet/marvell/prestera/prestera_main.c | 3 +-
drivers/net/ethernet/marvell/skge.c | 2 +-
drivers/net/ethernet/marvell/sky2.c | 2 +-
.../net/ethernet/mellanox/mlx4/en_netdev.c | 3 +-
.../net/ethernet/mellanox/mlx5/core/en_main.c | 7 ++--
.../net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +-
.../net/ethernet/mellanox/mlxsw/spectrum.c | 5 ++-
.../net/ethernet/myricom/myri10ge/myri10ge.c | 4 +-
drivers/net/ethernet/natsemi/ns83820.c | 4 +-
drivers/net/ethernet/neterion/s2io.c | 4 +-
.../ethernet/netronome/nfp/nfp_net_common.c | 2 +-
.../net/ethernet/netronome/nfp/nfp_net_repr.c | 5 +--
drivers/net/ethernet/nvidia/forcedeth.c | 4 +-
drivers/net/ethernet/pasemi/pasemi_mac.c | 4 +-
.../net/ethernet/pensando/ionic/ionic_lif.c | 4 +-
.../ethernet/qlogic/netxen/netxen_nic_main.c | 6 +--
drivers/net/ethernet/qlogic/qede/qede_main.c | 6 +--
drivers/net/ethernet/qlogic/qla3xxx.c | 2 +-
.../net/ethernet/qlogic/qlcnic/qlcnic_main.c | 6 +--
.../net/ethernet/qualcomm/rmnet/rmnet_vnd.c | 2 +-
drivers/net/ethernet/realtek/8139cp.c | 5 +--
drivers/net/ethernet/realtek/8139too.c | 3 +-
drivers/net/ethernet/realtek/r8169_main.c | 2 +-
drivers/net/ethernet/rocker/rocker_main.c | 3 +-
.../net/ethernet/samsung/sxgbe/sxgbe_main.c | 4 +-
drivers/net/ethernet/sfc/ef100_netdev.c | 3 +-
drivers/net/ethernet/sfc/ef100_nic.c | 2 +-
drivers/net/ethernet/sfc/ef100_rep.c | 3 +-
drivers/net/ethernet/sfc/efx.c | 4 +-
drivers/net/ethernet/sfc/falcon/efx.c | 3 +-
drivers/net/ethernet/sfc/siena/efx.c | 4 +-
drivers/net/ethernet/sgi/ioc3-eth.c | 3 +-
drivers/net/ethernet/silan/sc92031.c | 4 +-
drivers/net/ethernet/socionext/netsec.c | 3 +-
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +-
drivers/net/ethernet/sun/cassini.c | 2 +-
drivers/net/ethernet/sun/niu.c | 2 +-
drivers/net/ethernet/sun/sungem.c | 2 +-
drivers/net/ethernet/tehuti/tehuti.c | 9 ++--
drivers/net/ethernet/ti/cpsw_new.c | 3 +-
drivers/net/ethernet/toshiba/ps3_gelic_net.c | 3 +-
drivers/net/ethernet/toshiba/spider_net.c | 3 +-
drivers/net/ethernet/tundra/tsi108_eth.c | 2 +-
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 2 +-
.../net/ethernet/wangxun/txgbe/txgbe_main.c | 2 +-
drivers/net/ethernet/wiznet/w5100.c | 2 +-
drivers/net/ethernet/wiznet/w5300.c | 2 +-
drivers/net/ethernet/xilinx/ll_temac_main.c | 2 -
drivers/net/geneve.c | 3 +-
drivers/net/gtp.c | 3 +-
drivers/net/hamradio/bpqether.c | 2 +-
drivers/net/hyperv/netvsc_drv.c | 4 +-
drivers/net/ifb.c | 4 +-
drivers/net/ipvlan/ipvlan_main.c | 13 +++---
drivers/net/loopback.c | 8 ++--
drivers/net/macsec.c | 6 +--
drivers/net/macvlan.c | 12 +++---
drivers/net/net_failover.c | 36 ++++++++--------
drivers/net/netdevsim/netdev.c | 6 +--
drivers/net/netkit.c | 6 +--
drivers/net/nlmon.c | 5 +--
drivers/net/ntb_netdev.c | 3 +-
drivers/net/ppp/ppp_generic.c | 2 +-
drivers/net/rionet.c | 2 +-
drivers/net/tap.c | 3 +-
drivers/net/team/team_core.c | 27 ++++++------
drivers/net/thunderbolt/main.c | 3 +-
drivers/net/tun.c | 5 ++-
drivers/net/usb/r8152.c | 5 ++-
drivers/net/veth.c | 6 +--
drivers/net/virtio_net.c | 3 +-
drivers/net/vmxnet3/vmxnet3_drv.c | 3 +-
drivers/net/vrf.c | 17 +++-----
drivers/net/vsockmon.c | 5 +--
drivers/net/vxlan/vxlan_core.c | 3 +-
drivers/net/wireguard/device.c | 5 +--
.../net/wireless/intel/iwlwifi/dvm/mac80211.c | 6 ++-
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 6 ++-
drivers/net/wwan/t7xx/t7xx_netdev.c | 3 +-
drivers/s390/net/qeth_l2_main.c | 2 +-
drivers/scsi/fcoe/fcoe.c | 4 +-
drivers/staging/octeon/ethernet.c | 2 +-
drivers/usb/fotg210/fotg210-hcd.c | 2 +-
drivers/usb/host/ehci-hcd.c | 2 +-
drivers/usb/host/oxu210hp-hcd.c | 2 +-
lib/test_bpf.c | 3 +-
net/8021q/vlan.c | 2 +-
net/8021q/vlan_dev.c | 8 ++--
net/batman-adv/soft-interface.c | 5 +--
net/bridge/br_device.c | 9 ++--
net/core/dev.c | 34 +++++++++++----
net/core/net-sysfs.c | 3 +-
net/dsa/user.c | 3 +-
net/ethtool/common.c | 5 ---
net/ethtool/features.c | 2 +-
net/ethtool/ioctl.c | 3 +-
net/hsr/hsr_device.c | 19 +++------
net/ieee802154/6lowpan/core.c | 3 +-
net/ieee802154/core.c | 10 ++---
net/ipv4/ip_gre.c | 5 ++-
net/ipv4/ip_tunnel.c | 2 +-
net/ipv4/ip_vti.c | 2 +-
net/ipv4/ipip.c | 3 +-
net/ipv4/ipmr.c | 2 +-
net/ipv6/ip6_gre.c | 8 ++--
net/ipv6/ip6_tunnel.c | 5 +--
net/ipv6/ip6mr.c | 2 +-
net/ipv6/sit.c | 5 +--
net/l2tp/l2tp_eth.c | 2 +-
net/mac80211/iface.c | 2 +
net/openvswitch/vport-internal_dev.c | 12 +++---
net/wireless/core.c | 10 ++---
net/xfrm/xfrm_interface_core.c | 2 +-
tools/testing/selftests/net/forwarding/README | 2 +-
184 files changed, 462 insertions(+), 498 deletions(-)

--
2.44.0



2024-04-05 13:40:14

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH RFC net-next 2/7] netdev_features: convert NETIF_F_LLTX to priv_flag IFF_LLTX

NETIF_F_LLTX can't be changed via Ethtool and is not a feature, rather
an attribute, very similar to IFF_NO_QUEUE.
Free one netdev_features_t bit and make it a private flag.

Signed-off-by: Alexander Lobakin <[email protected]>
---
Documentation/networking/netdev-features.rst | 8 --------
Documentation/networking/netdevices.rst | 4 ++--
drivers/net/ethernet/tehuti/tehuti.h | 2 +-
include/linux/netdev_features.h | 5 +----
include/linux/netdevice.h | 9 ++++++---
drivers/net/amt.c | 3 +--
drivers/net/bareudp.c | 3 +--
drivers/net/bonding/bond_main.c | 5 ++---
drivers/net/dummy.c | 4 ++--
drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 3 ++-
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 4 ++--
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++--
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 3 ++-
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 4 +---
drivers/net/ethernet/pasemi/pasemi_mac.c | 5 +++--
drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c | 2 +-
drivers/net/ethernet/sfc/ef100_rep.c | 3 +--
drivers/net/ethernet/tehuti/tehuti.c | 4 ++--
drivers/net/ethernet/toshiba/spider_net.c | 3 ++-
drivers/net/geneve.c | 3 +--
drivers/net/gtp.c | 3 +--
drivers/net/hamradio/bpqether.c | 2 +-
drivers/net/ipvlan/ipvlan_main.c | 3 ++-
drivers/net/loopback.c | 2 +-
drivers/net/macsec.c | 4 ++--
drivers/net/macvlan.c | 3 ++-
drivers/net/net_failover.c | 5 +----
drivers/net/netkit.c | 3 ++-
drivers/net/nlmon.c | 5 ++---
drivers/net/ppp/ppp_generic.c | 2 +-
drivers/net/rionet.c | 2 +-
drivers/net/team/team_core.c | 3 +--
drivers/net/tun.c | 5 +++--
drivers/net/veth.c | 2 +-
drivers/net/vrf.c | 5 ++---
drivers/net/vsockmon.c | 5 ++---
drivers/net/vxlan/vxlan_core.c | 3 +--
drivers/net/wireguard/device.c | 3 +--
drivers/staging/octeon/ethernet.c | 2 +-
lib/test_bpf.c | 3 +--
net/8021q/vlan_dev.c | 4 ++--
net/batman-adv/soft-interface.c | 3 +--
net/bridge/br_device.c | 4 ++--
net/core/net-sysfs.c | 3 +--
net/dsa/user.c | 3 ++-
net/ethtool/common.c | 1 -
net/hsr/hsr_device.c | 4 +---
net/ipv4/ip_gre.c | 4 +++-
net/ipv4/ip_vti.c | 2 +-
net/ipv4/ipip.c | 2 +-
net/ipv6/ip6_gre.c | 4 +++-
net/ipv6/ip6_tunnel.c | 2 +-
net/ipv6/sit.c | 2 +-
net/l2tp/l2tp_eth.c | 2 +-
net/openvswitch/vport-internal_dev.c | 10 +++++-----
net/xfrm/xfrm_interface_core.c | 2 +-
56 files changed, 90 insertions(+), 108 deletions(-)

diff --git a/Documentation/networking/netdev-features.rst b/Documentation/networking/netdev-features.rst
index d7b15bb64deb..f29d982ebf5d 100644
--- a/Documentation/networking/netdev-features.rst
+++ b/Documentation/networking/netdev-features.rst
@@ -139,14 +139,6 @@ chained skbs (skb->next/prev list).
Features contained in NETIF_F_SOFT_FEATURES are features of networking
stack. Driver should not change behaviour based on them.

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

NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between
diff --git a/Documentation/networking/netdevices.rst b/Documentation/networking/netdevices.rst
index c2476917a6c3..6f9737fa594c 100644
--- a/Documentation/networking/netdevices.rst
+++ b/Documentation/networking/netdevices.rst
@@ -258,11 +258,11 @@ ndo_get_stats:
ndo_start_xmit:
Synchronization: __netif_tx_lock spinlock.

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

Context: Process with BHs disabled or BH (timer),
diff --git a/drivers/net/ethernet/tehuti/tehuti.h b/drivers/net/ethernet/tehuti/tehuti.h
index 909e7296cecf..b2b9f2a0a225 100644
--- a/drivers/net/ethernet/tehuti/tehuti.h
+++ b/drivers/net/ethernet/tehuti/tehuti.h
@@ -260,7 +260,7 @@ struct bdx_priv {
int tx_update_mark;
int tx_noupd;
#endif
- spinlock_t tx_lock; /* NETIF_F_LLTX mode */
+ spinlock_t tx_lock; /* IFF_LLTX mode */

/* rarely used */
u8 port;
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 44c428d62db4..54d1578f6642 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -23,8 +23,6 @@ enum {
NETIF_F_HW_VLAN_CTAG_FILTER_BIT,/* Receive filtering on VLAN CTAGs */
NETIF_F_VLAN_CHALLENGED_BIT, /* Device cannot handle VLAN packets */
NETIF_F_GSO_BIT, /* Enable software GSO. */
- NETIF_F_LLTX_BIT, /* LockLess TX - deprecated. Please */
- /* do not use LLTX in new drivers */
NETIF_F_NETNS_LOCAL_BIT, /* Does not change network namespaces */
NETIF_F_GRO_BIT, /* Generic receive offload */
NETIF_F_LRO_BIT, /* large receive offload */
@@ -119,7 +117,6 @@ enum {
#define NETIF_F_HW_VLAN_CTAG_TX __NETIF_F(HW_VLAN_CTAG_TX)
#define NETIF_F_IP_CSUM __NETIF_F(IP_CSUM)
#define NETIF_F_IPV6_CSUM __NETIF_F(IPV6_CSUM)
-#define NETIF_F_LLTX __NETIF_F(LLTX)
#define NETIF_F_LOOPBACK __NETIF_F(LOOPBACK)
#define NETIF_F_LRO __NETIF_F(LRO)
#define NETIF_F_NETNS_LOCAL __NETIF_F(NETNS_LOCAL)
@@ -192,7 +189,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)
/* Features valid for ethtool to change */
/* = all defined minus driver/device-class-related */
#define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \
- NETIF_F_LLTX | NETIF_F_NETNS_LOCAL)
+ NETIF_F_NETNS_LOCAL)

/* remember that ((t)1 << t_BITS) is undefined in C99 */
#define NETIF_F_ETHTOOL_BITS ((__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) | \
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0c198620ac93..065dd68fe97c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1649,6 +1649,8 @@ struct net_device_ops {
* @IFF_SEE_ALL_HWTSTAMP_REQUESTS: device wants to see calls to
* ndo_hwtstamp_set() for all timestamp requests regardless of source,
* even if those aren't HWTSTAMP_SOURCE_NETDEV.
+ @ @IFF_LLTX: device supports lockless Tx. Mainly used by logical interfaces,
+ * such as tunnels.
*/
enum netdev_priv_flags {
IFF_802_1Q_VLAN = 1<<0,
@@ -1685,6 +1687,7 @@ enum netdev_priv_flags {
IFF_TX_SKB_NO_LINEAR = BIT_ULL(31),
IFF_CHANGE_PROTO_DOWN = BIT_ULL(32),
IFF_SEE_ALL_HWTSTAMP_REQUESTS = BIT_ULL(33),
+ IFF_LLTX = BIT_ULL(34),
};

#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -4436,7 +4439,7 @@ static inline void netif_tx_unlock_bh(struct net_device *dev)
}

#define HARD_TX_LOCK(dev, txq, cpu) { \
- if ((dev->features & NETIF_F_LLTX) == 0) { \
+ if (!((dev)->priv_flags & IFF_LLTX)) { \
__netif_tx_lock(txq, cpu); \
} else { \
__netif_tx_acquire(txq); \
@@ -4444,12 +4447,12 @@ static inline void netif_tx_unlock_bh(struct net_device *dev)
}

#define HARD_TX_TRYLOCK(dev, txq) \
- (((dev->features & NETIF_F_LLTX) == 0) ? \
+ (!((dev)->priv_flags & IFF_LLTX) ? \
__netif_tx_trylock(txq) : \
__netif_tx_acquire(txq))

#define HARD_TX_UNLOCK(dev, txq) { \
- if ((dev->features & NETIF_F_LLTX) == 0) { \
+ if (!((dev)->priv_flags & IFF_LLTX)) { \
__netif_tx_unlock(txq); \
} else { \
__netif_tx_release(txq); \
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 6d15ab3bfbbc..9312274c330a 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -3097,8 +3097,7 @@ static void amt_link_setup(struct net_device *dev)
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
dev->hard_header_len = 0;
dev->addr_len = 0;
- dev->priv_flags |= IFF_NO_QUEUE;
- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
dev->features |= NETIF_F_GSO_SOFTWARE;
dev->features |= NETIF_F_NETNS_LOCAL;
dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM;
diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index d5c56ca91b77..958ee2c55c9e 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -553,7 +553,6 @@ static void bareudp_setup(struct net_device *dev)
SET_NETDEV_DEVTYPE(dev, &bareudp_type);
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
dev->features |= NETIF_F_RXCSUM;
- dev->features |= NETIF_F_LLTX;
dev->features |= NETIF_F_GSO_SOFTWARE;
dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
dev->hw_features |= NETIF_F_RXCSUM;
@@ -565,7 +564,7 @@ static void bareudp_setup(struct net_device *dev)
dev->max_mtu = IP_MAX_MTU - BAREUDP_BASE_HLEN;
dev->type = ARPHRD_NONE;
netif_keep_dst(dev);
- dev->priv_flags |= IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
}
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2c5ed0a7cb18..70bfe60e5868 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -5876,6 +5876,8 @@ void bond_setup(struct net_device *bond_dev)
/* Initialize the device options */
bond_dev->flags |= IFF_MASTER;
bond_dev->priv_flags |= IFF_BONDING | IFF_UNICAST_FLT | IFF_NO_QUEUE;
+ /* don't acquire bond device's netif_tx_lock when transmitting */
+ bond_dev->priv_flags |= IFF_LLTX;
bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);

#ifdef CONFIG_XFRM_OFFLOAD
@@ -5885,9 +5887,6 @@ void bond_setup(struct net_device *bond_dev)
spin_lock_init(&bond->ipsec_lock);
#endif /* CONFIG_XFRM_OFFLOAD */

- /* don't acquire bond device's netif_tx_lock when transmitting */
- bond_dev->features |= NETIF_F_LLTX;
-
/* By default, we declare the bond to be fully
* VLAN hardware accelerated capable. Special
* care is taken in the various xmit functions
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index d29b5d7af0d7..6cd38b646d5e 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -108,10 +108,10 @@ static void dummy_setup(struct net_device *dev)
/* Fill in device structure with ethernet-generic values. */
dev->flags |= IFF_NOARP;
dev->flags &= ~IFF_MULTICAST;
- dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE | IFF_LLTX;
dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST;
dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
+ dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
dev->features |= NETIF_F_GSO_ENCAP_ALL;
dev->hw_features |= dev->features;
dev->hw_enc_features |= dev->features;
diff --git a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
index d2286adf09fe..9d0e8fc35ff9 100644
--- a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
+++ b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
@@ -1031,10 +1031,11 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->mem_start = mmio_start;
netdev->mem_end = mmio_start + mmio_len - 1;
netdev->ml_priv = adapter;
+ netdev->priv_flags |= IFF_LLTX;
netdev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM |
NETIF_F_RXCSUM;
netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM |
- NETIF_F_RXCSUM | NETIF_F_LLTX | NETIF_F_HIGHDMA;
+ NETIF_F_RXCSUM | NETIF_F_HIGHDMA;

if (vlan_tso_capable(adapter)) {
netdev->features |=
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index dcbc598b11c6..4129344e1541 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -229,7 +229,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
net_dev->max_mtu = dpaa_get_max_mtu();

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

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

- net_dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ net_dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LLTX;
/* we do not want shared skbs on TX */
net_dev->priv_flags &= ~IFF_TX_SKB_SHARING;

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index 40e881829595..bbd846bf12b0 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -4585,7 +4585,7 @@ static int dpaa2_eth_netdev_init(struct net_device *net_dev)
dpaa2_eth_detect_features(priv);

/* Capabilities listing */
- supported |= IFF_LIVE_ADDR_CHANGE;
+ supported |= IFF_LIVE_ADDR_CHANGE | IFF_LLTX;

if (options & DPNI_OPT_NO_MAC_FILTER)
not_supported |= IFF_UNICAST_FLT;
@@ -4599,7 +4599,7 @@ static int dpaa2_eth_netdev_init(struct net_device *net_dev)
net_dev->features = NETIF_F_RXCSUM |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_SG | NETIF_F_HIGHDMA |
- NETIF_F_LLTX | NETIF_F_HW_TC | NETIF_F_TSO;
+ NETIF_F_HW_TC | NETIF_F_TSO;
net_dev->gso_max_segs = DPAA2_ETH_ENQUEUE_MAX_FDS;
net_dev->hw_features = net_dev->features;
net_dev->xdp_features = NETDEV_XDP_ACT_BASIC |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index bb642e9bb6cf..ba228f500539 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1693,9 +1693,10 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u16 local_port,

netif_carrier_off(dev);

- dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_LLTX | NETIF_F_SG |
+ dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG |
NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_TC;
dev->hw_features |= NETIF_F_HW_TC | NETIF_F_LOOPBACK;
+ dev->priv_flags |= IFF_LLTX;

dev->min_mtu = 0;
dev->max_mtu = ETH_MAX_MTU;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
index 3af1229a3f08..5c79f3e3ad58 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
@@ -248,7 +248,6 @@ nfp_repr_fix_features(struct net_device *netdev, netdev_features_t features)

features = netdev_intersect_features(features, lower_features);
features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_HW_TC);
- features |= NETIF_F_LLTX;

return features;
}
@@ -385,8 +384,7 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev,
netdev->features &= ~NETIF_F_HW_VLAN_STAG_RX;
netif_set_tso_max_segs(netdev, NFP_NET_LSO_MAX_SEGS);

- netdev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL;
- netdev->features |= NETIF_F_LLTX;
+ netdev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL | IFF_LLTX;

if (nfp_app_has_tc(app)) {
netdev->features |= NETIF_F_HW_TC;
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c
index ed7dd0a04235..2dcbfe24134c 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
@@ -1699,8 +1699,9 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

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

- dev->features = NETIF_F_IP_CSUM | NETIF_F_LLTX | NETIF_F_SG |
- NETIF_F_HIGHDMA | NETIF_F_GSO;
+ dev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_HIGHDMA |
+ NETIF_F_GSO;
+ dev->priv_flags |= IFF_LLTX;

mac->dma_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa007, NULL);
if (!mac->dma_pdev) {
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
index 9d2a9562c96f..b79426e6446a 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
@@ -286,7 +286,7 @@ void rmnet_vnd_setup(struct net_device *rmnet_dev)
rmnet_dev->needs_free_netdev = true;
rmnet_dev->ethtool_ops = &rmnet_ethtool_ops;

- rmnet_dev->features |= NETIF_F_LLTX;
+ rmnet_dev->priv_flags |= IFF_LLTX;

/* This perm addr will be used as interface identifier by IPv6 */
rmnet_dev->addr_assign_type = NET_ADDR_RANDOM;
diff --git a/drivers/net/ethernet/sfc/ef100_rep.c b/drivers/net/ethernet/sfc/ef100_rep.c
index 0b3083ef0ead..8819bbce8bf9 100644
--- a/drivers/net/ethernet/sfc/ef100_rep.c
+++ b/drivers/net/ethernet/sfc/ef100_rep.c
@@ -233,8 +233,7 @@ static struct efx_rep *efx_ef100_rep_create_netdev(struct efx_nic *efx,
net_dev->ethtool_ops = &efx_ef100_rep_ethtool_ops;
net_dev->min_mtu = EFX_MIN_MTU;
net_dev->max_mtu = EFX_MAX_MTU;
- net_dev->features |= NETIF_F_LLTX;
- net_dev->hw_features |= NETIF_F_LLTX;
+ net_dev->priv_flags |= IFF_LLTX;
return efv;
fail1:
free_netdev(net_dev);
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index ca409515ead5..5c44d27a9f48 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -1671,7 +1671,7 @@ static netdev_tx_t bdx_tx_transmit(struct sk_buff *skb,

#endif
#ifdef BDX_LLTX
- netif_trans_update(ndev); /* NETIF_F_LLTX driver :( */
+ netif_trans_update(ndev); /* IFF_LLTX driver :( */
#endif
ndev->stats.tx_packets++;
ndev->stats.tx_bytes += skb->len;
@@ -2019,7 +2019,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
* set multicast list callback has to use priv->tx_lock.
*/
#ifdef BDX_LLTX
- ndev->features |= NETIF_F_LLTX;
+ ndev->priv_flags |= IFF_LLTX;
#endif
/* MTU range: 60 - 16384 */
ndev->min_mtu = ETH_ZLEN;
diff --git a/drivers/net/ethernet/toshiba/spider_net.c b/drivers/net/ethernet/toshiba/spider_net.c
index 87e67121477c..b712540d81ec 100644
--- a/drivers/net/ethernet/toshiba/spider_net.c
+++ b/drivers/net/ethernet/toshiba/spider_net.c
@@ -2277,10 +2277,11 @@ spider_net_setup_netdev(struct spider_net_card *card)
netdev->hw_features = NETIF_F_RXCSUM | NETIF_F_IP_CSUM;
if (SPIDER_NET_RX_CSUM_DEFAULT)
netdev->features |= NETIF_F_RXCSUM;
- netdev->features |= NETIF_F_IP_CSUM | NETIF_F_LLTX;
+ netdev->features |= NETIF_F_IP_CSUM;
/* some time: NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
* NETIF_F_HW_VLAN_CTAG_FILTER
*/
+ netdev->priv_flags |= IFF_LLTX;

/* MTU range: 64 - 2294 */
netdev->min_mtu = SPIDER_NET_MIN_MTU;
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 163f94a5a58f..51ef6d8f1f46 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1192,7 +1192,6 @@ static void geneve_setup(struct net_device *dev)

SET_NETDEV_DEVTYPE(dev, &geneve_type);

- dev->features |= NETIF_F_LLTX;
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
dev->features |= NETIF_F_RXCSUM;
dev->features |= NETIF_F_GSO_SOFTWARE;
@@ -1212,7 +1211,7 @@ static void geneve_setup(struct net_device *dev)

netif_keep_dst(dev);
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
- dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE | IFF_LLTX;
eth_hw_addr_random(dev);
}

diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index ba4704c2c640..2933ef5f0d5b 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -956,8 +956,7 @@ static void gtp_link_setup(struct net_device *dev)
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;

dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
- dev->priv_flags |= IFF_NO_QUEUE;
- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
netif_keep_dst(dev);

dev->needed_headroom = LL_MAX_HEADER + max_gtp_header_len;
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 83a16d10eedb..090a4667931e 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -458,7 +458,7 @@ static void bpq_setup(struct net_device *dev)
dev->needs_free_netdev = true;

dev->flags = 0;
- dev->features = NETIF_F_LLTX; /* Allow recursion */
+ dev->priv_flags = IFF_LLTX; /* Allow recursion */

#if IS_ENABLED(CONFIG_AX25)
dev->header_ops = &ax25_header_ops;
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 5920f7e63352..5a2e7fc397e1 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -114,7 +114,7 @@ static void ipvlan_port_destroy(struct net_device *dev)
NETIF_F_GSO_ROBUST | NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL)

#define IPVLAN_ALWAYS_ON \
- (IPVLAN_ALWAYS_ON_OFLOADS | NETIF_F_LLTX | NETIF_F_VLAN_CHALLENGED)
+ (IPVLAN_ALWAYS_ON_OFLOADS | NETIF_F_VLAN_CHALLENGED)

#define IPVLAN_FEATURES \
(NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
@@ -141,6 +141,7 @@ static int ipvlan_init(struct net_device *dev)
dev->vlan_features = phy_dev->vlan_features & IPVLAN_FEATURES;
dev->vlan_features |= IPVLAN_ALWAYS_ON_OFLOADS;
dev->hw_enc_features |= dev->features;
+ dev->priv_flags |= IFF_LLTX;
netif_inherit_tso_max(dev, phy_dev);
dev->hard_header_len = phy_dev->hard_header_len;

diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index f6eab66c2660..f38f0017b70a 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -175,6 +175,7 @@ static void gen_lo_setup(struct net_device *dev,
dev->type = ARPHRD_LOOPBACK; /* 0x0001*/
dev->flags = IFF_LOOPBACK;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_LLTX;
netif_keep_dst(dev);
dev->hw_features = NETIF_F_GSO_SOFTWARE;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
@@ -183,7 +184,6 @@ static void gen_lo_setup(struct net_device *dev,
| NETIF_F_RXCSUM
| NETIF_F_SCTP_CRC
| NETIF_F_HIGHDMA
- | NETIF_F_LLTX
| NETIF_F_NETNS_LOCAL
| NETIF_F_VLAN_CHALLENGED
| NETIF_F_LOOPBACK;
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 0206b84284ab..5146feb52be7 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -3524,7 +3524,8 @@ static int macsec_dev_init(struct net_device *dev)
return err;

dev->features = real_dev->features & MACSEC_FEATURES;
- dev->features |= NETIF_F_LLTX | NETIF_F_GSO_SOFTWARE;
+ dev->features |= NETIF_F_GSO_SOFTWARE;
+ dev->priv_flags |= IFF_LLTX;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;

macsec_set_head_tail_room(dev);
@@ -3555,7 +3556,6 @@ static netdev_features_t macsec_fix_features(struct net_device *dev,

features &= (real_dev->features & MACSEC_FEATURES) |
NETIF_F_GSO_SOFTWARE | NETIF_F_SOFT_FEATURES;
- features |= NETIF_F_LLTX;

return features;
}
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 0cec2783a3e7..d8fca9e355cf 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -900,7 +900,7 @@ static struct lock_class_key macvlan_netdev_addr_lock_key;
(NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE | \
NETIF_F_GSO_ROBUST | NETIF_F_GSO_ENCAP_ALL)

-#define ALWAYS_ON_FEATURES (ALWAYS_ON_OFFLOADS | NETIF_F_LLTX)
+#define ALWAYS_ON_FEATURES ALWAYS_ON_OFFLOADS

#define MACVLAN_FEATURES \
(NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
@@ -932,6 +932,7 @@ static int macvlan_init(struct net_device *dev)
dev->vlan_features = lowerdev->vlan_features & MACVLAN_FEATURES;
dev->vlan_features |= ALWAYS_ON_OFFLOADS;
dev->hw_enc_features |= dev->features;
+ dev->priv_flags |= IFF_LLTX;
netif_inherit_tso_max(dev, lowerdev);
dev->hard_header_len = lowerdev->hard_header_len;
macvlan_set_lockdep_class(dev);
diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index d0c916a53d7c..5ce1df4a6e3d 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -726,13 +726,10 @@ struct failover *net_failover_create(struct net_device *standby_dev)
failover_dev->ethtool_ops = &failover_ethtool_ops;

/* Initialize the device options */
- failover_dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE;
+ failover_dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE | IFF_LLTX;
failover_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE |
IFF_TX_SKB_SHARING);

- /* don't acquire failover netdev's netif_tx_lock when transmitting */
- failover_dev->features |= NETIF_F_LLTX;
-
/* Don't allow failover devices to change network namespaces. */
failover_dev->features |= NETIF_F_NETNS_LOCAL;

diff --git a/drivers/net/netkit.c b/drivers/net/netkit.c
index a4d2e76a8d58..65247de21761 100644
--- a/drivers/net/netkit.c
+++ b/drivers/net/netkit.c
@@ -242,11 +242,12 @@ static void netkit_setup(struct net_device *dev)
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
dev->priv_flags |= IFF_PHONY_HEADROOM;
dev->priv_flags |= IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_LLTX;

dev->ethtool_ops = &netkit_ethtool_ops;
dev->netdev_ops = &netkit_netdev_ops;

- dev->features |= netkit_features | NETIF_F_LLTX;
+ dev->features |= netkit_features;
dev->hw_features = netkit_features;
dev->hw_enc_features = netkit_features;
dev->mpls_features = NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE;
diff --git a/drivers/net/nlmon.c b/drivers/net/nlmon.c
index e5a0987a263e..e08eec154227 100644
--- a/drivers/net/nlmon.c
+++ b/drivers/net/nlmon.c
@@ -62,14 +62,13 @@ static const struct net_device_ops nlmon_ops = {
static void nlmon_setup(struct net_device *dev)
{
dev->type = ARPHRD_NETLINK;
- dev->priv_flags |= IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;

dev->netdev_ops = &nlmon_ops;
dev->ethtool_ops = &nlmon_ethtool_ops;
dev->needs_free_netdev = true;

- dev->features = NETIF_F_SG | NETIF_F_FRAGLIST |
- NETIF_F_HIGHDMA | NETIF_F_LLTX;
+ dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
dev->flags = IFF_NOARP;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_LSTATS;

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index fe380fe196e7..4d0d97645fa9 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -1616,7 +1616,7 @@ static void ppp_setup(struct net_device *dev)
dev->netdev_ops = &ppp_netdev_ops;
SET_NETDEV_DEVTYPE(dev, &ppp_type);

- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_LLTX;

dev->hard_header_len = PPP_HDRLEN;
dev->mtu = PPP_MRU;
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index 4eececc94513..5ca6d236b8d7 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -515,7 +515,7 @@ static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
/* MTU range: 68 - 4082 */
ndev->min_mtu = ETH_MIN_MTU;
ndev->max_mtu = RIONET_MAX_MTU;
- ndev->features = NETIF_F_LLTX;
+ ndev->priv_flags |= IFF_LLTX;
SET_NETDEV_DEV(ndev, &mport->dev);
ndev->ethtool_ops = &rionet_ethtool_ops;

diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index 4e3c8d404957..396c1f7cae09 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -2188,9 +2188,8 @@ static void team_setup(struct net_device *dev)
* bring us to promisc mode in case a unicast addr is added.
* Let this up to underlay drivers.
*/
- dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
+ dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE | IFF_LLTX;

- dev->features |= NETIF_F_LLTX;
dev->features |= NETIF_F_GRO;

/* Don't allow team devices to change network namespaces. */
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 0b3f21cba552..d3d2cc392f59 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -990,10 +990,11 @@ static int tun_net_init(struct net_device *dev)
dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST |
TUN_USER_FEATURES | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX;
- dev->features = dev->hw_features | NETIF_F_LLTX;
+ dev->features = dev->hw_features;
dev->vlan_features = dev->features &
~(NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX);
+ dev->priv_flags |= IFF_LLTX;

tun->flags = (tun->flags & ~TUN_FEATURES) |
(ifr->ifr_flags & TUN_FEATURES);
@@ -1129,7 +1130,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
goto drop;
}

- /* NETIF_F_LLTX requires to do our own update of trans_start */
+ /* IFF_LLTX requires to do our own update of trans_start */
queue = netdev_get_tx_queue(dev, txq);
txq_trans_cond_update(queue);

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index bcdfbf61eb66..4b2a437ff634 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1695,11 +1695,11 @@ static void veth_setup(struct net_device *dev)
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
dev->priv_flags |= IFF_NO_QUEUE;
dev->priv_flags |= IFF_PHONY_HEADROOM;
+ dev->priv_flags |= IFF_LLTX;

dev->netdev_ops = &veth_netdev_ops;
dev->xdp_metadata_ops = &veth_xdp_metadata_ops;
dev->ethtool_ops = &veth_ethtool_ops;
- dev->features |= NETIF_F_LLTX;
dev->features |= VETH_FEATURES;
dev->vlan_features = dev->features &
~(NETIF_F_HW_VLAN_CTAG_TX |
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index bb95ce43cd97..c3c009f2d39a 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1655,9 +1655,6 @@ static void vrf_setup(struct net_device *dev)
/* Fill in device structure with ethernet-generic values. */
eth_hw_addr_random(dev);

- /* don't acquire vrf device's netif_tx_lock when transmitting */
- dev->features |= NETIF_F_LLTX;
-
/* don't allow vrf devices to change network namespaces. */
dev->features |= NETIF_F_NETNS_LOCAL;

@@ -1676,6 +1673,8 @@ static void vrf_setup(struct net_device *dev)
dev->priv_flags |= IFF_NO_QUEUE;
dev->priv_flags |= IFF_NO_RX_HANDLER;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ /* don't acquire vrf device's netif_tx_lock when transmitting */
+ dev->priv_flags |= IFF_LLTX;

/* VRF devices do not care about MTU, but if the MTU is set
* too low then the ipv4 and ipv6 protocols are disabled
diff --git a/drivers/net/vsockmon.c b/drivers/net/vsockmon.c
index a1ba5169ed5d..2fcdd80850d9 100644
--- a/drivers/net/vsockmon.c
+++ b/drivers/net/vsockmon.c
@@ -82,14 +82,13 @@ static const struct ethtool_ops vsockmon_ethtool_ops = {
static void vsockmon_setup(struct net_device *dev)
{
dev->type = ARPHRD_VSOCKMON;
- dev->priv_flags |= IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;

dev->netdev_ops = &vsockmon_ops;
dev->ethtool_ops = &vsockmon_ethtool_ops;
dev->needs_free_netdev = true;

- dev->features = NETIF_F_SG | NETIF_F_FRAGLIST |
- NETIF_F_HIGHDMA | NETIF_F_LLTX;
+ dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;

dev->flags = IFF_NOARP;

diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index 72ecf6cf809c..4f2b48955073 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -3292,7 +3292,6 @@ static void vxlan_setup(struct net_device *dev)
dev->needs_free_netdev = true;
SET_NETDEV_DEVTYPE(dev, &vxlan_type);

- dev->features |= NETIF_F_LLTX;
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
dev->features |= NETIF_F_RXCSUM;
dev->features |= NETIF_F_GSO_SOFTWARE;
@@ -3302,7 +3301,7 @@ static void vxlan_setup(struct net_device *dev)
dev->hw_features |= NETIF_F_RXCSUM;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
netif_keep_dst(dev);
- dev->priv_flags |= IFF_NO_QUEUE | IFF_CHANGE_PROTO_DOWN;
+ dev->priv_flags |= IFF_NO_QUEUE | IFF_CHANGE_PROTO_DOWN | IFF_LLTX;

/* MTU range: 68 - 65535 */
dev->min_mtu = ETH_MIN_MTU;
diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c
index 3feb36ee5bfb..1492ea6c48b9 100644
--- a/drivers/net/wireguard/device.c
+++ b/drivers/net/wireguard/device.c
@@ -288,8 +288,7 @@ static void wg_setup(struct net_device *dev)
dev->needed_tailroom = noise_encrypted_len(MESSAGE_PADDING_MULTIPLE);
dev->type = ARPHRD_NONE;
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
- dev->priv_flags |= IFF_NO_QUEUE;
- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
dev->features |= WG_NETDEV_FEATURES;
dev->hw_features |= WG_NETDEV_FEATURES;
dev->hw_enc_features |= WG_NETDEV_FEATURES;
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 9eee28f2940c..4bd3d1a3b9df 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -425,7 +425,7 @@ int cvm_oct_common_init(struct net_device *dev)
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;

/* We do our own locking, Linux doesn't need to */
- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_LLTX;
dev->ethtool_ops = &cvm_oct_ethtool_ops;

cvm_oct_set_mac_filter(dev);
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 569e6d2dc55c..c13bb6d96b66 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -15077,8 +15077,7 @@ static struct skb_segment_test skb_segment_tests[] __initconst = {
.build_skb = build_test_skb_linear_no_head_frag,
.features = NETIF_F_SG | NETIF_F_FRAGLIST |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_GSO |
- NETIF_F_LLTX | NETIF_F_GRO |
- NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
+ NETIF_F_GRO | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
NETIF_F_HW_VLAN_STAG_TX
}
};
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 39876eff51d2..90b649a51199 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -569,7 +569,8 @@ static int vlan_dev_init(struct net_device *dev)
if (real_dev->vlan_features & NETIF_F_HW_MACSEC)
dev->hw_features |= NETIF_F_HW_MACSEC;

- dev->features |= dev->hw_features | NETIF_F_LLTX;
+ dev->features |= dev->hw_features;
+ dev->priv_flags |= IFF_LLTX;
netif_inherit_tso_max(dev, real_dev);
if (dev->features & NETIF_F_VLAN_FEATURES)
netdev_warn(real_dev, "VLAN features are set incorrectly. Q-in-Q configurations may not work correctly.\n");
@@ -655,7 +656,6 @@ static netdev_features_t vlan_dev_fix_features(struct net_device *dev,
lower_features |= NETIF_F_HW_CSUM;
features = netdev_intersect_features(features, lower_features);
features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE);
- features |= NETIF_F_LLTX;

return features;
}
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 89c51b3cf430..dd7173cf5069 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -1021,8 +1021,7 @@ static void batadv_softif_init_early(struct net_device *dev)
dev->needs_free_netdev = true;
dev->priv_destructor = batadv_softif_free;
dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_NETNS_LOCAL;
- dev->features |= NETIF_F_LLTX;
- dev->priv_flags |= IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;

/* can't call min_mtu, because the needed variables
* have not been initialized yet
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index c366ccc8b3db..acd43839f2f5 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -480,9 +480,9 @@ void br_dev_setup(struct net_device *dev)
dev->needs_free_netdev = true;
dev->ethtool_ops = &br_ethtool_ops;
SET_NETDEV_DEVTYPE(dev, &br_type);
- dev->priv_flags = IFF_EBRIDGE | IFF_NO_QUEUE;
+ dev->priv_flags = IFF_EBRIDGE | IFF_NO_QUEUE | IFF_LLTX;

- dev->features = COMMON_FEATURES | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL |
+ dev->features = COMMON_FEATURES | NETIF_F_NETNS_LOCAL |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
dev->hw_features = COMMON_FEATURES | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX;
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index e3d7a8cfa20b..1525024b1e51 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1764,8 +1764,7 @@ static const struct kobj_type netdev_queue_ktype = {

static bool netdev_uses_bql(const struct net_device *dev)
{
- if (dev->features & NETIF_F_LLTX ||
- dev->priv_flags & IFF_NO_QUEUE)
+ if (dev->priv_flags & (IFF_NO_QUEUE | IFF_LLTX))
return false;

return IS_ENABLED(CONFIG_BQL);
diff --git a/net/dsa/user.c b/net/dsa/user.c
index 16d395bb1a1f..08cca63d6b0a 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -2536,11 +2536,12 @@ void dsa_user_setup_tagger(struct net_device *user)

user->features = conduit->vlan_features | NETIF_F_HW_TC;
user->hw_features |= NETIF_F_HW_TC;
- user->features |= NETIF_F_LLTX;
if (user->needed_tailroom)
user->features &= ~(NETIF_F_SG | NETIF_F_FRAGLIST);
if (ds->needs_standalone_vlan_filtering)
user->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
+
+ user->priv_flags |= IFF_LLTX;
}

int dsa_user_suspend(struct net_device *user_dev)
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 6b2a360dcdf0..44199d1780d5 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -24,7 +24,6 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
[NETIF_F_HW_VLAN_STAG_FILTER_BIT] = "rx-vlan-stag-filter",
[NETIF_F_VLAN_CHALLENGED_BIT] = "vlan-challenged",
[NETIF_F_GSO_BIT] = "tx-generic-segmentation",
- [NETIF_F_LLTX_BIT] = "tx-lockless",
[NETIF_F_NETNS_LOCAL_BIT] = "netns-local",
[NETIF_F_GRO_BIT] = "rx-gro",
[NETIF_F_GRO_HW_BIT] = "rx-gro-hw",
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index e9d45133d641..561dba9e79f0 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -498,7 +498,7 @@ void hsr_dev_setup(struct net_device *dev)
dev->header_ops = &hsr_header_ops;
dev->netdev_ops = &hsr_device_ops;
SET_NETDEV_DEVTYPE(dev, &hsr_type);
- dev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL;
+ dev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL | IFF_LLTX;

dev->needs_free_netdev = true;

@@ -508,8 +508,6 @@ void hsr_dev_setup(struct net_device *dev)

dev->features = dev->hw_features;

- /* Prevent recursive tx locking */
- dev->features |= NETIF_F_LLTX;
/* VLAN on top of HSR needs testing and probably some work on
* hsr_header_create() etc.
*/
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index c3af965dc407..01f217190e25 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -996,7 +996,7 @@ static void __gre_tunnel_init(struct net_device *dev)
tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen;
dev->needed_headroom = tunnel->hlen + sizeof(tunnel->parms.iph);

- dev->features |= GRE_FEATURES | NETIF_F_LLTX;
+ dev->features |= GRE_FEATURES;
dev->hw_features |= GRE_FEATURES;

/* TCP offload with GRE SEQ is not supported, nor can we support 2
@@ -1010,6 +1010,8 @@ static void __gre_tunnel_init(struct net_device *dev)

dev->features |= NETIF_F_GSO_SOFTWARE;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+
+ dev->priv_flags |= IFF_LLTX;
}

static int ipgre_tunnel_init(struct net_device *dev)
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index 14536da9f5dc..08c22d426c85 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -443,7 +443,7 @@ static int vti_tunnel_init(struct net_device *dev)

dev->flags = IFF_NOARP;
dev->addr_len = 4;
- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_LLTX;
netif_keep_dst(dev);

return ip_tunnel_init(dev);
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 923a2ef68c2f..2ef9a06b0e34 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -378,7 +378,7 @@ static void ipip_tunnel_setup(struct net_device *dev)
dev->type = ARPHRD_TUNNEL;
dev->flags = IFF_NOARP;
dev->addr_len = 4;
- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_LLTX;
netif_keep_dst(dev);

dev->features |= IPIP_FEATURES;
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 95fbdaf85711..62326b6d7d92 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1472,7 +1472,7 @@ static void ip6gre_tnl_init_features(struct net_device *dev)
{
struct ip6_tnl *nt = netdev_priv(dev);

- dev->features |= GRE6_FEATURES | NETIF_F_LLTX;
+ dev->features |= GRE6_FEATURES;
dev->hw_features |= GRE6_FEATURES;

/* TCP offload with GRE SEQ is not supported, nor can we support 2
@@ -1486,6 +1486,8 @@ static void ip6gre_tnl_init_features(struct net_device *dev)

dev->features |= NETIF_F_GSO_SOFTWARE;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+
+ dev->priv_flags |= IFF_LLTX;
}

static int ip6gre_tunnel_init_common(struct net_device *dev)
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 57bb3b3ea0c5..16270e1acd23 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1846,7 +1846,7 @@ static void ip6_tnl_dev_setup(struct net_device *dev)
dev->type = ARPHRD_TUNNEL6;
dev->flags |= IFF_NOARP;
dev->addr_len = sizeof(struct in6_addr);
- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_LLTX;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
netif_keep_dst(dev);

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 83b195f09561..b8d229cf8f8d 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1435,7 +1435,7 @@ static void ipip6_tunnel_setup(struct net_device *dev)
dev->flags = IFF_NOARP;
netif_keep_dst(dev);
dev->addr_len = 4;
- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_LLTX;
dev->features |= SIT_FEATURES;
dev->hw_features |= SIT_FEATURES;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
index 39e487ccc468..6306ee2bc47b 100644
--- a/net/l2tp/l2tp_eth.c
+++ b/net/l2tp/l2tp_eth.c
@@ -109,7 +109,7 @@ static void l2tp_eth_dev_setup(struct net_device *dev)
SET_NETDEV_DEVTYPE(dev, &l2tpeth_type);
ether_setup(dev);
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_LLTX;
dev->netdev_ops = &l2tp_eth_netdev_ops;
dev->needs_free_netdev = true;
}
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 74c88a6baa43..7f96ba7a27c1 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -102,20 +102,20 @@ static void do_setup(struct net_device *netdev)

netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_OPENVSWITCH |
- IFF_NO_QUEUE;
+ IFF_NO_QUEUE | IFF_LLTX;
netdev->needs_free_netdev = true;
netdev->priv_destructor = NULL;
netdev->ethtool_ops = &internal_dev_ethtool_ops;
netdev->rtnl_link_ops = &internal_dev_link_ops;

- netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST |
- NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
- NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
+ netdev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
+ NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE |
+ NETIF_F_GSO_ENCAP_ALL;

netdev->vlan_features = netdev->features;
netdev->hw_enc_features = netdev->features;
netdev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
- netdev->hw_features = netdev->features & ~NETIF_F_LLTX;
+ netdev->hw_features = netdev->features;

eth_hw_addr_random(netdev);
}
diff --git a/net/xfrm/xfrm_interface_core.c b/net/xfrm/xfrm_interface_core.c
index 4df5c06e3ece..dd2b96bbf363 100644
--- a/net/xfrm/xfrm_interface_core.c
+++ b/net/xfrm/xfrm_interface_core.c
@@ -769,7 +769,7 @@ static int xfrmi_dev_init(struct net_device *dev)
if (err)
return err;

- dev->features |= NETIF_F_LLTX;
+ dev->priv_flags |= IFF_LLTX;
dev->features |= XFRMI_FEATURES;
dev->hw_features |= XFRMI_FEATURES;

--
2.44.0


2024-04-05 13:41:17

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH RFC net-next 6/7] netdev_features: convert NETIF_F_VLAN_CHALLENGED to IFF_VLAN_CHALLENGED

Inability to handle VLAN-tagged packets is more of an attribute, not
a feature.
Convert it to a private flag and add it to IFF_ONE_FOR_ALL with special
handling in netdev_increment_priv_flags() as it previously was in
netdev_increment_features().
Note that starting from this change, ETHTOOL_A_FEATURES_NOCHANGE
will always return 0 to userspace as there's no more
NETIF_F_NEVER_CHANGE.

Signed-off-by: Alexander Lobakin <[email protected]>
---
Documentation/networking/ethtool-netlink.rst | 2 +-
Documentation/networking/netdev-features.rst | 11 +----------
include/linux/netdev_features.h | 12 +++---------
include/linux/netdevice.h | 4 +++-
drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +--
drivers/net/bonding/bond_main.c | 12 ++++++------
drivers/net/ethernet/intel/e100.c | 2 +-
drivers/net/ethernet/toshiba/ps3_gelic_net.c | 3 +--
drivers/net/ethernet/wiznet/w5100.c | 2 +-
drivers/net/ethernet/wiznet/w5300.c | 2 +-
drivers/net/ethernet/xilinx/ll_temac_main.c | 1 -
drivers/net/ipvlan/ipvlan_main.c | 10 ++++------
drivers/net/loopback.c | 2 +-
drivers/net/net_failover.c | 2 +-
drivers/net/team/team_core.c | 2 +-
drivers/net/vrf.c | 5 ++---
drivers/net/wwan/t7xx/t7xx_netdev.c | 3 +--
drivers/s390/net/qeth_l2_main.c | 2 +-
net/8021q/vlan.c | 2 +-
net/core/dev.c | 3 ++-
net/ethtool/common.c | 1 -
net/ethtool/features.c | 2 +-
net/ethtool/ioctl.c | 3 +--
net/hsr/hsr_device.c | 10 ++++------
24 files changed, 39 insertions(+), 62 deletions(-)

diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst
index d583d9abf2f8..eff6a6a09ce2 100644
--- a/Documentation/networking/ethtool-netlink.rst
+++ b/Documentation/networking/ethtool-netlink.rst
@@ -756,7 +756,7 @@ Kernel response contents:
``ETHTOOL_A_FEATURES_HW`` bitset dev->hw_features
``ETHTOOL_A_FEATURES_WANTED`` bitset dev->wanted_features
``ETHTOOL_A_FEATURES_ACTIVE`` bitset dev->features
- ``ETHTOOL_A_FEATURES_NOCHANGE`` bitset NETIF_F_NEVER_CHANGE
+ ``ETHTOOL_A_FEATURES_NOCHANGE`` bitset 0
==================================== ====== ==========================

Bitmaps in kernel response have the same meaning as bitmaps used in ioctl
diff --git a/Documentation/networking/netdev-features.rst b/Documentation/networking/netdev-features.rst
index b95c9203b1aa..25150c955c50 100644
--- a/Documentation/networking/netdev-features.rst
+++ b/Documentation/networking/netdev-features.rst
@@ -82,9 +82,7 @@ This callback should not modify hardware nor driver state (should be
stateless). It can be called multiple times between successive
ndo_set_features calls.

-Callback must not alter features contained in NETIF_F_SOFT_FEATURES or
-NETIF_F_NEVER_CHANGE sets. The exception is NETIF_F_VLAN_CHALLENGED but
-care must be taken as the change won't affect already configured VLANs.
+Callback must not alter features contained in NETIF_F_SOFT_FEATURES.

* ndo_set_features:

@@ -134,13 +132,6 @@ chained skbs (skb->next/prev list).
Features contained in NETIF_F_SOFT_FEATURES are features of networking
stack. Driver should not change behaviour based on them.

- * VLAN challenged
-
-NETIF_F_VLAN_CHALLENGED should be set for devices which can't cope with VLAN
-headers. Some drivers set this because the cards can't handle the bigger MTU.
-[FIXME: Those cases could be fixed in VLAN code by allowing only reduced-MTU
-VLANs. This may be not useful, though.]
-
* rx-fcs

This requests that the NIC append the Ethernet Frame Checksum (FCS)
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index b8e4c7f79e88..318c35c94305 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -20,7 +20,6 @@ enum {
NETIF_F_HW_VLAN_CTAG_TX_BIT, /* Transmit VLAN CTAG HW acceleration */
NETIF_F_HW_VLAN_CTAG_RX_BIT, /* Receive VLAN CTAG HW acceleration */
NETIF_F_HW_VLAN_CTAG_FILTER_BIT,/* Receive filtering on VLAN CTAGs */
- NETIF_F_VLAN_CHALLENGED_BIT, /* Device cannot handle VLAN packets */
NETIF_F_GSO_BIT, /* Enable software GSO. */
NETIF_F_GRO_BIT, /* Generic receive offload */
NETIF_F_LRO_BIT, /* large receive offload */
@@ -125,7 +124,6 @@ enum {
#define NETIF_F_TSO6 __NETIF_F(TSO6)
#define NETIF_F_TSO_ECN __NETIF_F(TSO_ECN)
#define NETIF_F_TSO __NETIF_F(TSO)
-#define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED)
#define NETIF_F_RXFCS __NETIF_F(RXFCS)
#define NETIF_F_RXALL __NETIF_F(RXALL)
#define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE)
@@ -184,12 +182,9 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)

/* Features valid for ethtool to change */
/* = all defined minus driver/device-class-related */
-#define NETIF_F_NEVER_CHANGE NETIF_F_VLAN_CHALLENGED
-
/* remember that ((t)1 << t_BITS) is undefined in C99 */
-#define NETIF_F_ETHTOOL_BITS ((__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) | \
- (__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) - 1)) & \
- ~NETIF_F_NEVER_CHANGE)
+#define NETIF_F_ETHTOOL_BITS (__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) | \
+ (__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) - 1))

/* Segmentation offload feature mask */
#define NETIF_F_GSO_MASK (__NETIF_F_BIT(NETIF_F_GSO_LAST + 1) - \
@@ -217,8 +212,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)
* for all in netdev_increment_features.
*/
#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
- NETIF_F_SG | NETIF_F_FRAGLIST | \
- NETIF_F_VLAN_CHALLENGED)
+ NETIF_F_SG | NETIF_F_FRAGLIST)

/*
* If one device doesn't support one of these features, then disable it
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 622d135957ad..57b8d3783b3f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1653,6 +1653,7 @@ struct net_device_ops {
* such as tunnels.
* @IFF_NETNS_LOCAL: interface can't change network namespaces
* @IFF_HIGHDMA: device can transmit buffers from high memory
+ * @IFF_VLAN_CHALLENGED: device can't handle VLAN packets
* @IFF_LOGICAL: combines @IFF_NO_QUEUE and @IFF_LLTX, used by logical
* interfaces to avoid overhead from locking and Qdisc.
* @IFF_ONE_FOR_ALL: if one interface supports them, enable them for all in
@@ -1698,8 +1699,9 @@ enum netdev_priv_flags {
IFF_LLTX = BIT_ULL(34),
IFF_NETNS_LOCAL = BIT_ULL(35),
IFF_HIGHDMA = BIT_ULL(36),
+ IFF_VLAN_CHALLENGED = BIT_ULL(37),
IFF_LOGICAL = IFF_NO_QUEUE | IFF_LLTX,
- IFF_ONE_FOR_ALL = IFF_HIGHDMA,
+ IFF_ONE_FOR_ALL = IFF_HIGHDMA | IFF_VLAN_CHALLENGED,
IFF_ALL_FOR_ALL = IFF_XMIT_DST_RELEASE |
IFF_XMIT_DST_RELEASE_PERM,
};
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 888fb9c62f91..3c9db03c56a3 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2142,13 +2142,12 @@ void ipoib_setup_common(struct net_device *dev)
dev->watchdog_timeo = 10 * HZ;

dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
- dev->priv_flags |= IFF_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA | IFF_VLAN_CHALLENGED;

dev->hard_header_len = IPOIB_HARD_LEN;
dev->addr_len = INFINIBAND_ALEN;
dev->type = ARPHRD_INFINIBAND;
dev->tx_queue_len = ipoib_sendq_size * 2;
- dev->features = NETIF_F_VLAN_CHALLENGED;
netif_keep_dst(dev);

memcpy(dev->broadcast, ipv4_bcast_addr, INFINIBAND_ALEN);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index cebf1189241c..1de5efbde227 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1864,8 +1864,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,

/* vlan challenged mutual exclusion */
/* no need to lock since we're protected by rtnl_lock */
- if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) {
- slave_dbg(bond_dev, slave_dev, "is NETIF_F_VLAN_CHALLENGED\n");
+ if (slave_dev->priv_flags & IFF_VLAN_CHALLENGED) {
+ slave_dbg(bond_dev, slave_dev, "is IFF_VLAN_CHALLENGED\n");
if (vlan_uses_dev(bond_dev)) {
SLAVE_NL_ERR(bond_dev, slave_dev, extack,
"Can not enslave VLAN challenged device to VLAN enabled bond");
@@ -1874,7 +1874,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
slave_warn(bond_dev, slave_dev, "enslaved VLAN challenged slave. Adding VLANs will be blocked as long as it is part of bond.\n");
}
} else {
- slave_dbg(bond_dev, slave_dev, "is !NETIF_F_VLAN_CHALLENGED\n");
+ slave_dbg(bond_dev, slave_dev, "is !IFF_VLAN_CHALLENGED\n");
}

if (slave_dev->features & NETIF_F_HW_ESP)
@@ -2363,10 +2363,10 @@ static int __bond_release_one(struct net_device *bond_dev,
bool all, bool unregister)
{
struct bonding *bond = netdev_priv(bond_dev);
+ u64 old_priv_flags = bond_dev->priv_flags;
struct slave *slave, *oldcurrent;
struct sockaddr_storage ss;
int old_flags = bond_dev->flags;
- netdev_features_t old_features = bond_dev->features;

/* slave is not a slave or master is not master of this slave */
if (!(slave_dev->flags & IFF_SLAVE) ||
@@ -2470,8 +2470,8 @@ static int __bond_release_one(struct net_device *bond_dev,
}

bond_compute_features(bond);
- if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
- (old_features & NETIF_F_VLAN_CHALLENGED))
+ if (!(bond_dev->priv_flags & IFF_VLAN_CHALLENGED) &&
+ (old_priv_flags & IFF_VLAN_CHALLENGED))
slave_info(bond_dev, slave_dev, "last VLAN challenged slave left bond - VLAN blocking is removed\n");

vlan_vids_del_by_dev(slave_dev, bond_dev);
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 9b068d40778d..6a57c0d5072d 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -2893,7 +2893,7 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

/* D100 MAC doesn't allow rx of vlan packets with normal MTU */
if (nic->mac < mac_82558_D101_A4)
- netdev->features |= NETIF_F_VLAN_CHALLENGED;
+ netdev->priv_flags |= IFF_VLAN_CHALLENGED;

/* locks must be initialized before calling hw_reset */
spin_lock_init(&nic->cb_lock);
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index 5ee8e8980393..3aa351b8f877 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -1499,7 +1499,7 @@ int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card)
* As vlan is internally used,
* we can not receive vlan packets
*/
- netdev->features |= NETIF_F_VLAN_CHALLENGED;
+ netdev->priv_flags |= IFF_VLAN_CHALLENGED;
}

/* MTU range: 64 - 1518 */
@@ -1885,4 +1885,3 @@ module_init(ps3_gelic_driver_init);
module_exit(ps3_gelic_driver_exit);

MODULE_ALIAS(PS3_MODULE_ALIAS_GELIC);
-
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c
index b26fd15c25ae..a1c4f312387d 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -1136,7 +1136,7 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,
/* This chip doesn't support VLAN packets with normal MTU,
* so disable VLAN for this device.
*/
- ndev->features |= NETIF_F_VLAN_CHALLENGED;
+ ndev->priv_flags |= IFF_VLAN_CHALLENGED;

err = register_netdev(ndev);
if (err < 0)
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c
index f165616f36fe..2a741d604eb1 100644
--- a/drivers/net/ethernet/wiznet/w5300.c
+++ b/drivers/net/ethernet/wiznet/w5300.c
@@ -607,7 +607,7 @@ static int w5300_probe(struct platform_device *pdev)
/* This chip doesn't support VLAN packets with normal MTU,
* so disable VLAN for this device.
*/
- ndev->features |= NETIF_F_VLAN_CHALLENGED;
+ ndev->priv_flags |= IFF_VLAN_CHALLENGED;

err = register_netdev(ndev);
if (err < 0)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 09aa5c87e9c3..d6cec0a216ad 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -1408,7 +1408,6 @@ static int temac_probe(struct platform_device *pdev)
ndev->features |= NETIF_F_HW_VLAN_CTAG_TX; /* Transmit VLAN hw accel */
ndev->features |= NETIF_F_HW_VLAN_CTAG_RX; /* Receive VLAN hw acceleration */
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; /* Receive VLAN filtering */
- ndev->features |= NETIF_F_VLAN_CHALLENGED; /* cannot handle VLAN pkts */
ndev->features |= NETIF_F_GSO; /* Enable software GSO. */
ndev->features |= NETIF_F_MULTI_QUEUE; /* Has multiple TX/RX queues */
ndev->features |= NETIF_F_LRO; /* large receive offload */
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 62b4372dc205..98537ec29885 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -113,9 +113,6 @@ static void ipvlan_port_destroy(struct net_device *dev)
(NETIF_F_SG | NETIF_F_HW_CSUM | \
NETIF_F_GSO_ROBUST | NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL)

-#define IPVLAN_ALWAYS_ON \
- (IPVLAN_ALWAYS_ON_OFLOADS | NETIF_F_VLAN_CHALLENGED)
-
#define IPVLAN_FEATURES \
(NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST | \
NETIF_F_GSO | NETIF_F_ALL_TSO | NETIF_F_GSO_ROBUST | \
@@ -137,11 +134,12 @@ static int ipvlan_init(struct net_device *dev)
dev->state = (dev->state & ~IPVLAN_STATE_MASK) |
(phy_dev->state & IPVLAN_STATE_MASK);
dev->features = phy_dev->features & IPVLAN_FEATURES;
- dev->features |= IPVLAN_ALWAYS_ON;
+ dev->features |= IPVLAN_ALWAYS_ON_OFLOADS;
dev->vlan_features = phy_dev->vlan_features & IPVLAN_FEATURES;
dev->vlan_features |= IPVLAN_ALWAYS_ON_OFLOADS;
dev->hw_enc_features |= dev->features;
dev->priv_flags |= IFF_LLTX | (phy_dev->priv_flags & IFF_HIGHDMA);
+ dev->priv_flags |= IFF_VLAN_CHALLENGED;
netif_inherit_tso_max(dev, phy_dev);
dev->hard_header_len = phy_dev->hard_header_len;

@@ -245,8 +243,8 @@ static netdev_features_t ipvlan_fix_features(struct net_device *dev,
features &= (ipvlan->sfeatures | ~IPVLAN_FEATURES);
features = netdev_increment_features(ipvlan->phy_dev->features,
features, features);
- features |= IPVLAN_ALWAYS_ON;
- features &= (IPVLAN_FEATURES | IPVLAN_ALWAYS_ON);
+ features |= IPVLAN_ALWAYS_ON_OFLOADS;
+ features &= (IPVLAN_FEATURES | IPVLAN_ALWAYS_ON_OFLOADS);

return features;
}
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index a9ca447774ec..0a60bd1cc42a 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -176,6 +176,7 @@ static void gen_lo_setup(struct net_device *dev,
dev->flags = IFF_LOOPBACK;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LOGICAL;
dev->priv_flags |= IFF_NETNS_LOCAL | IFF_HIGHDMA;
+ dev->priv_flags |= IFF_VLAN_CHALLENGED;
netif_keep_dst(dev);
dev->hw_features = NETIF_F_GSO_SOFTWARE;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
@@ -183,7 +184,6 @@ static void gen_lo_setup(struct net_device *dev,
| NETIF_F_HW_CSUM
| NETIF_F_RXCSUM
| NETIF_F_SCTP_CRC
- | NETIF_F_VLAN_CHALLENGED
| NETIF_F_LOOPBACK;
dev->ethtool_ops = eth_ops;
dev->header_ops = hdr_ops;
diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index 53e6e05939fa..0862f24651f6 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -487,7 +487,7 @@ static int net_failover_slave_pre_register(struct net_device *slave_dev,
!dev_is_pci(slave_dev->dev.parent)))
return -EINVAL;

- if (failover_dev->features & NETIF_F_VLAN_CHALLENGED &&
+ if (failover_dev->priv_flags & IFF_VLAN_CHALLENGED &&
vlan_uses_dev(failover_dev)) {
netdev_err(failover_dev, "Device %s is VLAN challenged and failover device has VLAN set up\n",
failover_dev->name);
diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index 4393f94838c7..af39e8a9c91f 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -1172,7 +1172,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
return -EBUSY;
}

- if (port_dev->features & NETIF_F_VLAN_CHALLENGED &&
+ if (port_dev->priv_flags & IFF_VLAN_CHALLENGED &&
vlan_uses_dev(dev)) {
NL_SET_ERR_MSG(extack, "Device is VLAN challenged and team device has VLAN set up");
netdev_err(dev, "Device %s is VLAN challenged and team device has VLAN set up\n",
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 9f83061e3f86..0600600a8aa1 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1655,9 +1655,6 @@ static void vrf_setup(struct net_device *dev)
/* Fill in device structure with ethernet-generic values. */
eth_hw_addr_random(dev);

- /* does not make sense for a VLAN to be added to a vrf device */
- dev->features |= NETIF_F_VLAN_CHALLENGED;
-
/* enable offload features */
dev->features |= NETIF_F_GSO_SOFTWARE;
dev->features |= NETIF_F_RXCSUM | NETIF_F_HW_CSUM | NETIF_F_SCTP_CRC;
@@ -1670,6 +1667,8 @@ static void vrf_setup(struct net_device *dev)
dev->priv_flags |= IFF_NO_RX_HANDLER;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
dev->priv_flags |= IFF_HIGHDMA;
+ /* does not make sense for a VLAN to be added to a vrf device */
+ dev->priv_flags |= IFF_VLAN_CHALLENGED;

/* VRF devices do not care about MTU, but if the MTU is set
* too low then the ipv4 and ipv6 protocols are disabled
diff --git a/drivers/net/wwan/t7xx/t7xx_netdev.c b/drivers/net/wwan/t7xx/t7xx_netdev.c
index 3ef4a8a4f8fd..4fec45a5ac47 100644
--- a/drivers/net/wwan/t7xx/t7xx_netdev.c
+++ b/drivers/net/wwan/t7xx/t7xx_netdev.c
@@ -231,8 +231,7 @@ static void t7xx_ccmni_wwan_setup(struct net_device *dev)
dev->watchdog_timeo = CCMNI_NETDEV_WDT_TO;

dev->flags = IFF_POINTOPOINT | IFF_NOARP;
-
- dev->features = NETIF_F_VLAN_CHALLENGED;
+ dev->priv_flags |= IFF_VLAN_CHALLENGED;

dev->features |= NETIF_F_SG;
dev->hw_features |= NETIF_F_SG;
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 75910c0bcc2b..89c6e063fd6a 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -1093,7 +1093,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
card->dev->priv_flags |= IFF_UNICAST_FLT;

if (IS_OSM(card)) {
- card->dev->features |= NETIF_F_VLAN_CHALLENGED;
+ card->dev->priv_flags |= IFF_VLAN_CHALLENGED;
} else {
if (!IS_VM_NIC(card))
card->dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index e45187b88220..a414b1b82673 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -131,7 +131,7 @@ int vlan_check_real_dev(struct net_device *real_dev,
{
const char *name = real_dev->name;

- if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
+ if (real_dev->priv_flags & IFF_VLAN_CHALLENGED) {
pr_info("VLANs not supported on %s\n", name);
NL_SET_ERR_MSG_MOD(extack, "VLANs not supported on device");
return -EOPNOTSUPP;
diff --git a/net/core/dev.c b/net/core/dev.c
index 2e20db77d5d6..df56e9f25018 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -11484,7 +11484,6 @@ netdev_features_t netdev_increment_features(netdev_features_t all,
{
if (mask & NETIF_F_HW_CSUM)
mask |= NETIF_F_CSUM_MASK;
- mask |= NETIF_F_VLAN_CHALLENGED;

all |= one & (NETIF_F_ONE_FOR_ALL | NETIF_F_CSUM_MASK) & mask;
all &= one | ~NETIF_F_ALL_FOR_ALL;
@@ -11499,6 +11498,8 @@ EXPORT_SYMBOL(netdev_increment_features);

u64 netdev_increment_priv_flags(u64 all, u64 one, u64 mask)
{
+ mask |= IFF_VLAN_CHALLENGED;
+
all |= one & IFF_ONE_FOR_ALL & mask;
all &= one | ~IFF_ALL_FOR_ALL;

diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 64c736e897e9..2de4dd5a30de 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -21,7 +21,6 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
[NETIF_F_HW_VLAN_STAG_TX_BIT] = "tx-vlan-stag-hw-insert",
[NETIF_F_HW_VLAN_STAG_RX_BIT] = "rx-vlan-stag-hw-parse",
[NETIF_F_HW_VLAN_STAG_FILTER_BIT] = "rx-vlan-stag-filter",
- [NETIF_F_VLAN_CHALLENGED_BIT] = "vlan-challenged",
[NETIF_F_GSO_BIT] = "tx-generic-segmentation",
[NETIF_F_GRO_BIT] = "rx-gro",
[NETIF_F_GRO_HW_BIT] = "rx-gro-hw",
diff --git a/net/ethtool/features.c b/net/ethtool/features.c
index b6cb101d7f19..652759407f00 100644
--- a/net/ethtool/features.c
+++ b/net/ethtool/features.c
@@ -44,7 +44,7 @@ static int features_prepare_data(const struct ethnl_req_info *req_base,
ethnl_features_to_bitmap32(data->hw, dev->hw_features);
ethnl_features_to_bitmap32(data->wanted, dev->wanted_features);
ethnl_features_to_bitmap32(data->active, dev->features);
- ethnl_features_to_bitmap32(data->nochange, NETIF_F_NEVER_CHANGE);
+ ethnl_features_to_bitmap32(data->nochange, 0);
all_features = GENMASK_ULL(NETDEV_FEATURE_COUNT - 1, 0);
ethnl_features_to_bitmap32(data->all, all_features);

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 5a55270aa86e..2a20d7f70ffd 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -96,8 +96,7 @@ static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
features[i].available = (u32)(dev->hw_features >> (32 * i));
features[i].requested = (u32)(dev->wanted_features >> (32 * i));
features[i].active = (u32)(dev->features >> (32 * i));
- features[i].never_changed =
- (u32)(NETIF_F_NEVER_CHANGE >> (32 * i));
+ features[i].never_changed = 0;
}

sizeaddr = useraddr + offsetof(struct ethtool_gfeatures, size);
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index be1df345b841..4561a087e75d 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -499,7 +499,10 @@ void hsr_dev_setup(struct net_device *dev)
dev->netdev_ops = &hsr_device_ops;
SET_NETDEV_DEVTYPE(dev, &hsr_type);
dev->priv_flags |= IFF_LOGICAL | IFF_DISABLE_NETPOLL | IFF_NETNS_LOCAL;
- dev->priv_flags |= IFF_HIGHDMA;
+ /* VLAN on top of HSR needs testing and probably some work on
+ * hsr_header_create() etc.
+ */
+ dev->priv_flags |= IFF_HIGHDMA | IFF_VLAN_CHALLENGED;

dev->needs_free_netdev = true;

@@ -508,11 +511,6 @@ void hsr_dev_setup(struct net_device *dev)
NETIF_F_HW_VLAN_CTAG_TX;

dev->features = dev->hw_features;
-
- /* VLAN on top of HSR needs testing and probably some work on
- * hsr_header_create() etc.
- */
- dev->features |= NETIF_F_VLAN_CHALLENGED;
}

/* Return true if dev is a HSR master; return false otherwise.
--
2.44.0


2024-04-05 13:41:25

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH RFC net-next 7/7] netdev_features: convert NETIF_F_FCOE_MTU to IFF_FCOE_MTU

Ability to handle maximum FCoE frames of 2158 bytes can never be changed
and thus more of an attribute, not a toggleable feature.
Move it from netdev_features_t to netdev_priv_flags and free one more
feature bit.

Signed-off-by: Alexander Lobakin <[email protected]>
---
include/linux/netdev_features.h | 5 +----
include/linux/netdevice.h | 2 ++
drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c | 6 ++----
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 4 ++--
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | 3 +--
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 ++++-----
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 ++--
drivers/scsi/fcoe/fcoe.c | 4 ++--
net/8021q/vlan_dev.c | 1 +
net/ethtool/common.c | 1 -
11 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 318c35c94305..9713069198e1 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -53,7 +53,6 @@ enum {

NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */
NETIF_F_SCTP_CRC_BIT, /* SCTP checksum offload */
- NETIF_F_FCOE_MTU_BIT, /* Supports max FCoE MTU, 2158 bytes*/
NETIF_F_NTUPLE_BIT, /* N-tuple filters supported */
NETIF_F_RXHASH_BIT, /* Receive hashing offload */
NETIF_F_RXCSUM_BIT, /* Receive checksumming offload */
@@ -100,7 +99,6 @@ enum {
#define __NETIF_F(name) __NETIF_F_BIT(NETIF_F_##name##_BIT)

#define NETIF_F_FCOE_CRC __NETIF_F(FCOE_CRC)
-#define NETIF_F_FCOE_MTU __NETIF_F(FCOE_MTU)
#define NETIF_F_FRAGLIST __NETIF_F(FRAGLIST)
#define NETIF_F_FSO __NETIF_F(FSO)
#define NETIF_F_GRO __NETIF_F(GRO)
@@ -200,8 +198,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)
#define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | \
NETIF_F_TSO_ECN | NETIF_F_TSO_MANGLEID)

-#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
- NETIF_F_FSO)
+#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FSO)

/* List of features with software fallbacks. */
#define NETIF_F_GSO_SOFTWARE (NETIF_F_ALL_TSO | NETIF_F_GSO_SCTP | \
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 57b8d3783b3f..09e25163e3d8 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1654,6 +1654,7 @@ struct net_device_ops {
* @IFF_NETNS_LOCAL: interface can't change network namespaces
* @IFF_HIGHDMA: device can transmit buffers from high memory
* @IFF_VLAN_CHALLENGED: device can't handle VLAN packets
+ * @IFF_FCOE_MTU: device supports maximum FCoE MTU, 2158 bytes
* @IFF_LOGICAL: combines @IFF_NO_QUEUE and @IFF_LLTX, used by logical
* interfaces to avoid overhead from locking and Qdisc.
* @IFF_ONE_FOR_ALL: if one interface supports them, enable them for all in
@@ -1700,6 +1701,7 @@ enum netdev_priv_flags {
IFF_NETNS_LOCAL = BIT_ULL(35),
IFF_HIGHDMA = BIT_ULL(36),
IFF_VLAN_CHALLENGED = BIT_ULL(37),
+ IFF_FCOE_MTU = BIT_ULL(38),
IFF_LOGICAL = IFF_NO_QUEUE | IFF_LLTX,
IFF_ONE_FOR_ALL = IFF_HIGHDMA | IFF_VLAN_CHALLENGED,
IFF_ALL_FOR_ALL = IFF_XMIT_DST_RELEASE |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c
index 33b2c0c45509..6f6f36f06bb5 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_fcoe.c
@@ -81,8 +81,7 @@ int cxgb_fcoe_enable(struct net_device *netdev)

netdev->features |= NETIF_F_FCOE_CRC;
netdev->vlan_features |= NETIF_F_FCOE_CRC;
- netdev->features |= NETIF_F_FCOE_MTU;
- netdev->vlan_features |= NETIF_F_FCOE_MTU;
+ netdev->priv_flags |= IFF_FCOE_MTU;

netdev_features_change(netdev);

@@ -112,8 +111,7 @@ int cxgb_fcoe_disable(struct net_device *netdev)

netdev->features &= ~NETIF_F_FCOE_CRC;
netdev->vlan_features &= ~NETIF_F_FCOE_CRC;
- netdev->features &= ~NETIF_F_FCOE_MTU;
- netdev->vlan_features &= ~NETIF_F_FCOE_MTU;
+ netdev->priv_flags &= ~IFF_FCOE_MTU;

netdev_features_change(netdev);

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index e85f7d2e8810..dcfebe9f6aa6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -317,7 +317,7 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
int max_frame = adapter->netdev->mtu + ETH_HLEN + ETH_FCS_LEN;

#ifdef IXGBE_FCOE
- if (adapter->netdev->features & NETIF_F_FCOE_MTU)
+ if (adapter->netdev->priv_flags & IFF_FCOE_MTU)
max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
#endif

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index 18d63c8c2ff4..3be287a11a96 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -858,7 +858,7 @@ int ixgbe_fcoe_enable(struct net_device *netdev)

/* enable FCoE and notify stack */
adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
- netdev->features |= NETIF_F_FCOE_MTU;
+ netdev->priv_flags |= IFF_FCOE_MTU;
netdev_features_change(netdev);

/* release existing queues and reallocate them */
@@ -898,7 +898,7 @@ int ixgbe_fcoe_disable(struct net_device *netdev)

/* disable FCoE and notify stack */
adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
- netdev->features &= ~NETIF_F_FCOE_MTU;
+ netdev->priv_flags &= ~IFF_FCOE_MTU;

netdev_features_change(netdev);

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index 0ee943db3dc9..81eda51a79e0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -981,7 +981,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
set_bit(__IXGBE_RX_CSUM_UDP_ZERO_ERR, &ring->state);

#ifdef IXGBE_FCOE
- if (adapter->netdev->features & NETIF_F_FCOE_MTU) {
+ if (adapter->netdev->priv_flags & IFF_FCOE_MTU) {
struct ixgbe_ring_feature *f;
f = &adapter->ring_feature[RING_F_FCOE];
if ((rxr_idx >= f->offset) &&
@@ -1299,4 +1299,3 @@ void ixgbe_tx_ctxtdesc(struct ixgbe_ring *tx_ring, u32 vlan_macip_lens,
context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd);
context_desc->mss_l4len_idx = cpu_to_le32(mss_l4len_idx);
}
-
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index da5d21d55278..b49208a75c9c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -5080,7 +5080,7 @@ static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter)
netif_set_tso_max_size(adapter->netdev, 32768);

#ifdef IXGBE_FCOE
- if (adapter->netdev->features & NETIF_F_FCOE_MTU)
+ if (adapter->netdev->priv_flags & IFF_FCOE_MTU)
max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
#endif

@@ -5137,7 +5137,7 @@ static int ixgbe_hpbthresh(struct ixgbe_adapter *adapter, int pb)

#ifdef IXGBE_FCOE
/* FCoE traffic class uses FCOE jumbo frames */
- if ((dev->features & NETIF_F_FCOE_MTU) &&
+ if ((dev->priv_flags & IFF_FCOE_MTU) &&
(tc < IXGBE_FCOE_JUMBO_FRAME_SIZE) &&
(pb == ixgbe_fcoe_get_tc(adapter)))
tc = IXGBE_FCOE_JUMBO_FRAME_SIZE;
@@ -5198,7 +5198,7 @@ static int ixgbe_lpbthresh(struct ixgbe_adapter *adapter, int pb)

#ifdef IXGBE_FCOE
/* FCoE traffic class uses FCOE jumbo frames */
- if ((dev->features & NETIF_F_FCOE_MTU) &&
+ if ((dev->priv_flags & IFF_FCOE_MTU) &&
(tc < IXGBE_FCOE_JUMBO_FRAME_SIZE) &&
(pb == netdev_get_prio_tc_map(dev, adapter->fcoe.up)))
tc = IXGBE_FCOE_JUMBO_FRAME_SIZE;
@@ -11096,8 +11096,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_FCOE_CRC;

netdev->vlan_features |= NETIF_F_FSO |
- NETIF_F_FCOE_CRC |
- NETIF_F_FCOE_MTU;
+ NETIF_F_FCOE_CRC;
}
#endif /* IXGBE_FCOE */
if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index fcfd0a075eee..4e478cf79a2c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -495,7 +495,7 @@ static int ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 max_frame, u32 vf
int err = 0;

#ifdef CONFIG_FCOE
- if (dev->features & NETIF_F_FCOE_MTU)
+ if (dev->priv_flags & IFF_FCOE_MTU)
pf_max_frame = max_t(int, pf_max_frame,
IXGBE_FCOE_JUMBO_FRAME_SIZE);

@@ -857,7 +857,7 @@ static void ixgbe_set_vf_rx_tx(struct ixgbe_adapter *adapter, int vf)
int pf_max_frame = dev->mtu + ETH_HLEN;

#if IS_ENABLED(CONFIG_FCOE)
- if (dev->features & NETIF_F_FCOE_MTU)
+ if (dev->priv_flags & IFF_FCOE_MTU)
pf_max_frame = max_t(int, pf_max_frame,
IXGBE_FCOE_JUMBO_FRAME_SIZE);
#endif /* CONFIG_FCOE */
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index f1429f270170..19a16a63d969 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -722,7 +722,7 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev)
* will return 0, so do this first.
*/
mfs = netdev->mtu;
- if (netdev->features & NETIF_F_FCOE_MTU) {
+ if (netdev->priv_flags & IFF_FCOE_MTU) {
mfs = FCOE_MTU;
FCOE_NETDEV_DBG(netdev, "Supports FCOE_MTU of %d bytes\n", mfs);
}
@@ -1863,7 +1863,7 @@ static int fcoe_device_notification(struct notifier_block *notifier,
case NETDEV_CHANGE:
break;
case NETDEV_CHANGEMTU:
- if (netdev->features & NETIF_F_FCOE_MTU)
+ if (netdev->priv_flags & IFF_FCOE_MTU)
break;
mfs = netdev->mtu - (sizeof(struct fcoe_hdr) +
sizeof(struct fcoe_crc_eof));
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 421419ebac41..69afcba94b8e 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -570,6 +570,7 @@ static int vlan_dev_init(struct net_device *dev)

dev->features |= dev->hw_features;
dev->priv_flags |= IFF_LLTX | (real_dev->priv_flags & IFF_HIGHDMA);
+ dev->priv_flags |= IFF_FCOE_MTU;
netif_inherit_tso_max(dev, real_dev);
if (dev->features & NETIF_F_VLAN_FEATURES)
netdev_warn(real_dev, "VLAN features are set incorrectly. Q-in-Q configurations may not work correctly.\n");
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 2de4dd5a30de..71e36e1a1b15 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -47,7 +47,6 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {

[NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
[NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
- [NETIF_F_FCOE_MTU_BIT] = "fcoe-mtu",
[NETIF_F_NTUPLE_BIT] = "rx-ntuple-filter",
[NETIF_F_RXHASH_BIT] = "rx-hashing",
[NETIF_F_RXCSUM_BIT] = "rx-checksum",
--
2.44.0


2024-04-05 13:41:48

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH RFC net-next 5/7] netdev_features: convert NETIF_F_HIGHDMA to priv_flag IFF_HIGHDMA

The ability to send bufferst from the high memory is rather an
attribute, not a feature. It can't be toggled via Ethtool and
is constant for the whole interface lifetime.
Convert it to a private flag, carrying necessary inheritance for
lower interfaces.

Signed-off-by: Alexander Lobakin <[email protected]>
---
Documentation/driver-api/usb/dma.rst | 2 +-
Documentation/networking/netdev-features.rst | 5 ----
include/linux/if_vlan.h | 5 ++--
include/linux/netdev_features.h | 6 ++---
include/linux/netdevice.h | 13 +++++++++
include/net/mac80211.h | 1 +
include/net/net_failover.h | 6 ++++-
net/mac80211/ieee80211_i.h | 4 +--
drivers/firewire/net.c | 2 +-
drivers/infiniband/hw/hfi1/vnic_main.c | 3 ++-
drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 +--
drivers/net/bonding/bond_main.c | 20 +++++++-------
drivers/net/dummy.c | 4 +--
drivers/net/ethernet/adaptec/starfire.c | 2 +-
drivers/net/ethernet/aeroflex/greth.c | 3 ++-
drivers/net/ethernet/alteon/acenic.c | 2 +-
drivers/net/ethernet/altera/altera_tse_main.c | 3 ++-
drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 ++--
drivers/net/ethernet/broadcom/bcmsysport.c | 4 +--
drivers/net/ethernet/broadcom/bnx2.c | 2 +-
.../net/ethernet/broadcom/bnx2x/bnx2x_main.c | 5 ++--
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++---
.../net/ethernet/broadcom/genet/bcmgenet.c | 4 +--
drivers/net/ethernet/broadcom/tg3.c | 2 +-
drivers/net/ethernet/brocade/bna/bnad.c | 9 +++----
drivers/net/ethernet/calxeda/xgmac.c | 4 +--
.../net/ethernet/cavium/liquidio/lio_main.c | 4 +--
.../ethernet/cavium/liquidio/lio_vf_main.c | 4 +--
drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 4 +--
.../net/ethernet/chelsio/cxgb3/cxgb3_main.c | 4 +--
.../net/ethernet/chelsio/cxgb4/cxgb4_main.c | 6 ++---
.../ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 6 ++---
drivers/net/ethernet/cisco/enic/enic_main.c | 2 +-
drivers/net/ethernet/emulex/benet/be_main.c | 5 ++--
.../net/ethernet/freescale/dpaa/dpaa_eth.c | 4 +--
.../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 5 ++--
.../net/ethernet/freescale/enetc/enetc_pf.c | 4 +--
.../net/ethernet/freescale/enetc/enetc_vf.c | 3 ++-
drivers/net/ethernet/freescale/gianfar.c | 3 ++-
.../ethernet/fungible/funeth/funeth_main.c | 5 ++--
drivers/net/ethernet/google/gve/gve_main.c | 2 +-
drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 4 +--
.../net/ethernet/huawei/hinic/hinic_main.c | 4 ++-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 6 ++---
drivers/net/ethernet/intel/e1000/e1000_main.c | 6 ++---
drivers/net/ethernet/intel/e1000e/netdev.c | 5 +---
drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 6 ++---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
drivers/net/ethernet/intel/iavf/iavf_main.c | 3 +--
drivers/net/ethernet/intel/ice/ice_main.c | 5 ++--
drivers/net/ethernet/intel/idpf/idpf_lib.c | 5 ++--
drivers/net/ethernet/intel/igb/igb_main.c | 4 +--
drivers/net/ethernet/intel/igbvf/netdev.c | 3 ++-
drivers/net/ethernet/intel/igc/igc_main.c | 4 +--
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 +--
.../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 +--
drivers/net/ethernet/jme.c | 6 ++---
drivers/net/ethernet/marvell/skge.c | 2 +-
drivers/net/ethernet/marvell/sky2.c | 2 +-
.../net/ethernet/mellanox/mlx4/en_netdev.c | 3 ++-
.../net/ethernet/mellanox/mlx5/core/en_main.c | 3 +--
.../net/ethernet/myricom/myri10ge/myri10ge.c | 4 ++-
drivers/net/ethernet/natsemi/ns83820.c | 4 +--
drivers/net/ethernet/neterion/s2io.c | 4 +--
.../ethernet/netronome/nfp/nfp_net_common.c | 2 +-
.../net/ethernet/netronome/nfp/nfp_net_repr.c | 3 +--
drivers/net/ethernet/nvidia/forcedeth.c | 4 +--
drivers/net/ethernet/pasemi/pasemi_mac.c | 5 ++--
.../net/ethernet/pensando/ionic/ionic_lif.c | 4 +--
.../ethernet/qlogic/netxen/netxen_nic_main.c | 6 ++---
drivers/net/ethernet/qlogic/qede/qede_main.c | 6 ++---
drivers/net/ethernet/qlogic/qla3xxx.c | 2 +-
.../net/ethernet/qlogic/qlcnic/qlcnic_main.c | 6 ++---
drivers/net/ethernet/realtek/8139cp.c | 5 ++--
drivers/net/ethernet/realtek/8139too.c | 3 ++-
drivers/net/ethernet/realtek/r8169_main.c | 2 +-
.../net/ethernet/samsung/sxgbe/sxgbe_main.c | 4 +--
drivers/net/ethernet/sfc/ef100_netdev.c | 3 ++-
drivers/net/ethernet/sfc/ef100_nic.c | 2 +-
drivers/net/ethernet/sfc/efx.c | 4 +--
drivers/net/ethernet/sfc/falcon/efx.c | 3 +--
drivers/net/ethernet/sfc/siena/efx.c | 4 +--
drivers/net/ethernet/sgi/ioc3-eth.c | 3 ++-
drivers/net/ethernet/silan/sc92031.c | 4 +--
drivers/net/ethernet/socionext/netsec.c | 3 ++-
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +--
drivers/net/ethernet/sun/cassini.c | 2 +-
drivers/net/ethernet/sun/niu.c | 2 +-
drivers/net/ethernet/sun/sungem.c | 2 +-
drivers/net/ethernet/tehuti/tehuti.c | 5 ++--
drivers/net/ethernet/tundra/tsi108_eth.c | 2 +-
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 2 +-
.../net/ethernet/wangxun/txgbe/txgbe_main.c | 2 +-
drivers/net/ethernet/xilinx/ll_temac_main.c | 1 -
drivers/net/hyperv/netvsc_drv.c | 4 +--
drivers/net/ifb.c | 4 +--
drivers/net/ipvlan/ipvlan_main.c | 4 +--
drivers/net/loopback.c | 3 +--
drivers/net/macsec.c | 4 +--
drivers/net/macvlan.c | 9 ++++---
drivers/net/net_failover.c | 24 ++++++++++-------
drivers/net/netdevsim/netdev.c | 6 ++---
drivers/net/netkit.c | 2 +-
drivers/net/nlmon.c | 4 +--
drivers/net/ntb_netdev.c | 3 +--
drivers/net/tap.c | 3 ++-
drivers/net/team/team_core.c | 17 +++++++-----
drivers/net/thunderbolt/main.c | 3 ++-
drivers/net/usb/r8152.c | 5 ++--
drivers/net/veth.c | 3 ++-
drivers/net/virtio_net.c | 3 +--
drivers/net/vmxnet3/vmxnet3_drv.c | 3 ++-
drivers/net/vrf.c | 3 ++-
drivers/net/vsockmon.c | 4 +--
drivers/net/wireguard/device.c | 4 +--
.../net/wireless/intel/iwlwifi/dvm/mac80211.c | 6 +++--
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 6 +++--
drivers/usb/fotg210/fotg210-hcd.c | 2 +-
drivers/usb/host/ehci-hcd.c | 2 +-
drivers/usb/host/oxu210hp-hcd.c | 2 +-
net/8021q/vlan_dev.c | 5 ++--
net/bridge/br_device.c | 3 ++-
net/core/dev.c | 27 +++++++++++++++----
net/ethtool/common.c | 1 -
net/hsr/hsr_device.c | 3 ++-
net/ipv4/ip_gre.c | 3 +--
net/ipv4/ipip.c | 3 +--
net/ipv6/ip6_gre.c | 3 +--
net/ipv6/ip6_tunnel.c | 3 +--
net/ipv6/sit.c | 3 +--
net/mac80211/iface.c | 2 ++
net/openvswitch/vport-internal_dev.c | 4 +--
132 files changed, 304 insertions(+), 268 deletions(-)

diff --git a/Documentation/driver-api/usb/dma.rst b/Documentation/driver-api/usb/dma.rst
index 02f6825ff830..b015e43f9629 100644
--- a/Documentation/driver-api/usb/dma.rst
+++ b/Documentation/driver-api/usb/dma.rst
@@ -78,7 +78,7 @@ and effects like cache-trashing can impose subtle penalties.
way to expose these capabilities ... and in any case, HIGHMEM is mostly a
design wart specific to x86_32. So your best bet is to ensure you never
pass a highmem buffer into a USB driver. That's easy; it's the default
- behavior. Just don't override it; e.g. with ``NETIF_F_HIGHDMA``.
+ behavior. Just don't override it; e.g. with ``IFF_HIGHDMA``.

This may force your callers to do some bounce buffering, copying from
high memory to "normal" DMA memory. If you can come up with a good way
diff --git a/Documentation/networking/netdev-features.rst b/Documentation/networking/netdev-features.rst
index 5014f7cc1398..b95c9203b1aa 100644
--- a/Documentation/networking/netdev-features.rst
+++ b/Documentation/networking/netdev-features.rst
@@ -123,11 +123,6 @@ gso_size. On segmentation, it segments the payload on gso_size boundaries and
replicates the network and UDP headers (fixing up the last one if less than
gso_size).

- * Transmit DMA from high memory
-
-On platforms where this is relevant, NETIF_F_HIGHDMA signals that
-ndo_start_xmit can handle skbs with frags in high memory.
-
* Transmit scatter-gather

Those features say that ndo_start_xmit can handle fragmented skbs:
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index c1645c86eed9..29be1160a233 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -785,9 +785,8 @@ static inline netdev_features_t vlan_features_check(struct sk_buff *skb,
* sure that only devices supporting NETIF_F_HW_CSUM will
* have checksum offloading support.
*/
- features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
- NETIF_F_FRAGLIST | NETIF_F_HW_VLAN_CTAG_TX |
- NETIF_F_HW_VLAN_STAG_TX;
+ features &= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST |
+ NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
}

return features;
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 3bacd4b1adc9..b8e4c7f79e88 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -16,7 +16,6 @@ enum {
NETIF_F_IP_CSUM_BIT, /* Can checksum TCP/UDP over IPv4. */
NETIF_F_HW_CSUM_BIT, /* Can checksum all the packets. */
NETIF_F_IPV6_CSUM_BIT, /* Can checksum TCP/UDP over IPV6 */
- NETIF_F_HIGHDMA_BIT, /* Can DMA to high memory. */
NETIF_F_FRAGLIST_BIT, /* Scatter/gather IO. */
NETIF_F_HW_VLAN_CTAG_TX_BIT, /* Transmit VLAN CTAG HW acceleration */
NETIF_F_HW_VLAN_CTAG_RX_BIT, /* Receive VLAN CTAG HW acceleration */
@@ -109,7 +108,6 @@ enum {
#define NETIF_F_GRO_HW __NETIF_F(GRO_HW)
#define NETIF_F_GSO __NETIF_F(GSO)
#define NETIF_F_GSO_ROBUST __NETIF_F(GSO_ROBUST)
-#define NETIF_F_HIGHDMA __NETIF_F(HIGHDMA)
#define NETIF_F_HW_CSUM __NETIF_F(HW_CSUM)
#define NETIF_F_HW_VLAN_CTAG_FILTER __NETIF_F(HW_VLAN_CTAG_FILTER)
#define NETIF_F_HW_VLAN_CTAG_RX __NETIF_F(HW_VLAN_CTAG_RX)
@@ -219,8 +217,8 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)
* for all in netdev_increment_features.
*/
#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
- NETIF_F_SG | NETIF_F_HIGHDMA | \
- NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED)
+ NETIF_F_SG | NETIF_F_FRAGLIST | \
+ NETIF_F_VLAN_CHALLENGED)

/*
* If one device doesn't support one of these features, then disable it
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0fafb3db8f0b..622d135957ad 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1652,8 +1652,13 @@ struct net_device_ops {
@ @IFF_LLTX: device supports lockless Tx. Mainly used by logical interfaces,
* such as tunnels.
* @IFF_NETNS_LOCAL: interface can't change network namespaces
+ * @IFF_HIGHDMA: device can transmit buffers from high memory
* @IFF_LOGICAL: combines @IFF_NO_QUEUE and @IFF_LLTX, used by logical
* interfaces to avoid overhead from locking and Qdisc.
+ * @IFF_ONE_FOR_ALL: if one interface supports them, enable them for all in
+ * netdev_intrement_priv_flags()
+ * @IFF_ALL_FOR_ALL: if at least one interface doesn't support them, disable
+ * them for all in netdev_intrement_priv_flags()
*/
enum netdev_priv_flags {
IFF_802_1Q_VLAN = 1<<0,
@@ -1692,7 +1697,11 @@ enum netdev_priv_flags {
IFF_SEE_ALL_HWTSTAMP_REQUESTS = BIT_ULL(33),
IFF_LLTX = BIT_ULL(34),
IFF_NETNS_LOCAL = BIT_ULL(35),
+ IFF_HIGHDMA = BIT_ULL(36),
IFF_LOGICAL = IFF_NO_QUEUE | IFF_LLTX,
+ IFF_ONE_FOR_ALL = IFF_HIGHDMA,
+ IFF_ALL_FOR_ALL = IFF_XMIT_DST_RELEASE |
+ IFF_XMIT_DST_RELEASE_PERM,
};

#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -4931,6 +4940,10 @@ static inline netdev_features_t netdev_get_wanted_features(
netdev_features_t netdev_increment_features(netdev_features_t all,
netdev_features_t one, netdev_features_t mask);

+u64 netdev_increment_priv_flags(u64 all, u64 one, u64 mask);
+void netdev_increment_priv_flags_finalize(struct net_device *dev,
+ u64 priv_flags);
+
/* Allow TSO being used on stacked device :
* Performing the GSO segmentation before last device
* is a performance improvement.
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index f57c29de3a91..78e749f6b91f 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3007,6 +3007,7 @@ struct ieee80211_hw {
s16 accuracy;
} radiotap_timestamp;
netdev_features_t netdev_features;
+ u64 netdev_priv_flags;
u8 uapsd_queues;
u8 uapsd_max_sp_len;
u8 max_nan_de_entries;
diff --git a/include/net/net_failover.h b/include/net/net_failover.h
index b12a1c469d1c..9c3f38a3da86 100644
--- a/include/net/net_failover.h
+++ b/include/net/net_failover.h
@@ -32,9 +32,13 @@ void net_failover_destroy(struct failover *failover);

#define FAILOVER_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
- NETIF_F_HIGHDMA | NETIF_F_LRO)
+ NETIF_F_LRO)

#define FAILOVER_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_RXCSUM | NETIF_F_ALL_TSO)

+#define FAILOVER_PRIV_FLAGS (IFF_XMIT_DST_RELEASE | \
+ IFF_XMIT_DST_RELEASE_PERM | \
+ IFF_HIGHDMA)
+
#endif /* _NET_FAILOVER_H */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 458f63ce9a32..9cfc722b461d 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1992,11 +1992,11 @@ void ieee80211_color_collision_detection_work(struct work_struct *work);
/* interface handling */
#define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \
NETIF_F_HW_CSUM | NETIF_F_SG | \
- NETIF_F_HIGHDMA | NETIF_F_GSO_SOFTWARE | \
- NETIF_F_HW_TC)
+ NETIF_F_GSO_SOFTWARE | NETIF_F_HW_TC)
#define MAC80211_SUPPORTED_FEATURES_RX (NETIF_F_RXCSUM)
#define MAC80211_SUPPORTED_FEATURES (MAC80211_SUPPORTED_FEATURES_TX | \
MAC80211_SUPPORTED_FEATURES_RX)
+#define MAC80211_SUPPORTED_PRIV_FLAGS (IFF_HIGHDMA)

int ieee80211_iface_init(void);
void ieee80211_iface_exit(void);
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 7a4d1a478e33..903696bf3d8b 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -1377,7 +1377,7 @@ static void fwnet_init_dev(struct net_device *net)
net->netdev_ops = &fwnet_netdev_ops;
net->watchdog_timeo = 2 * HZ;
net->flags = IFF_BROADCAST | IFF_MULTICAST;
- net->features = NETIF_F_HIGHDMA;
+ net->priv_flags |= IFF_HIGHDMA;
net->addr_len = FWNET_ALEN;
net->hard_header_len = FWNET_HLEN;
net->type = ARPHRD_IEEE1394;
diff --git a/drivers/infiniband/hw/hfi1/vnic_main.c b/drivers/infiniband/hw/hfi1/vnic_main.c
index 16a4c297a897..2b8431338e0a 100644
--- a/drivers/infiniband/hw/hfi1/vnic_main.c
+++ b/drivers/infiniband/hw/hfi1/vnic_main.c
@@ -588,9 +588,10 @@ struct net_device *hfi1_vnic_alloc_rn(struct ib_device *device,
rn->free_rdma_netdev = hfi1_vnic_free_rn;
rn->set_id = hfi1_vnic_set_vesw_id;

- netdev->features = NETIF_F_HIGHDMA | NETIF_F_SG;
+ netdev->features = NETIF_F_SG;
netdev->hw_features = netdev->features;
netdev->vlan_features = netdev->features;
+ netdev->priv_flags |= IFF_HIGHDMA;
netdev->watchdog_timeo = msecs_to_jiffies(HFI_TX_TIMEOUT_MS);
netdev->netdev_ops = &hfi1_netdev_ops;
mutex_init(&vinfo->lock);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 6f2a688fccbf..888fb9c62f91 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2142,13 +2142,13 @@ void ipoib_setup_common(struct net_device *dev)
dev->watchdog_timeo = 10 * HZ;

dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
+ dev->priv_flags |= IFF_HIGHDMA;

dev->hard_header_len = IPOIB_HARD_LEN;
dev->addr_len = INFINIBAND_ALEN;
dev->type = ARPHRD_INFINIBAND;
dev->tx_queue_len = ipoib_sendq_size * 2;
- dev->features = (NETIF_F_VLAN_CHALLENGED |
- NETIF_F_HIGHDMA);
+ dev->features = NETIF_F_VLAN_CHALLENGED;
netif_keep_dst(dev);

memcpy(dev->broadcast, ipv4_bcast_addr, INFINIBAND_ALEN);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 3d28be39e211..cebf1189241c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1419,7 +1419,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,

#define BOND_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \
- NETIF_F_HIGHDMA | NETIF_F_LRO)
+ NETIF_F_LRO)

#define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE)
@@ -1427,11 +1427,12 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
#define BOND_MPLS_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_GSO_SOFTWARE)

+#define BOND_PRIV_FLAGS (IFF_XMIT_DST_RELEASE | \
+ IFF_XMIT_DST_RELEASE_PERM | \
+ IFF_HIGHDMA)

static void bond_compute_features(struct bonding *bond)
{
- unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
- IFF_XMIT_DST_RELEASE_PERM;
netdev_features_t vlan_features = BOND_VLAN_FEATURES;
netdev_features_t enc_features = BOND_ENC_FEATURES;
#ifdef CONFIG_XFRM_OFFLOAD
@@ -1439,6 +1440,7 @@ static void bond_compute_features(struct bonding *bond)
#endif /* CONFIG_XFRM_OFFLOAD */
netdev_features_t mpls_features = BOND_MPLS_FEATURES;
struct net_device *bond_dev = bond->dev;
+ u64 priv_flags = BOND_PRIV_FLAGS;
struct list_head *iter;
struct slave *slave;
unsigned short max_hard_header_len = ETH_HLEN;
@@ -1449,6 +1451,7 @@ static void bond_compute_features(struct bonding *bond)
goto done;
vlan_features &= NETIF_F_ALL_FOR_ALL;
mpls_features &= NETIF_F_ALL_FOR_ALL;
+ priv_flags &= IFF_ALL_FOR_ALL;

bond_for_each_slave(bond, slave, iter) {
vlan_features = netdev_increment_features(vlan_features,
@@ -1468,7 +1471,10 @@ static void bond_compute_features(struct bonding *bond)
slave->dev->mpls_features,
BOND_MPLS_FEATURES);

- dst_release_flag &= slave->dev->priv_flags;
+ priv_flags = netdev_increment_priv_flags(priv_flags,
+ slave->dev->priv_flags,
+ BOND_PRIV_FLAGS);
+
if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len;

@@ -1489,11 +1495,7 @@ static void bond_compute_features(struct bonding *bond)
netif_set_tso_max_segs(bond_dev, tso_max_segs);
netif_set_tso_max_size(bond_dev, tso_max_size);

- bond_dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
- if ((bond_dev->priv_flags & IFF_XMIT_DST_RELEASE_PERM) &&
- dst_release_flag == (IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM))
- bond_dev->priv_flags |= IFF_XMIT_DST_RELEASE;
-
+ netdev_increment_priv_flags_finalize(bond_dev, priv_flags);
netdev_change_features(bond_dev);
}

diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index a0122e867891..5a326ade7d2c 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -108,10 +108,10 @@ static void dummy_setup(struct net_device *dev)
/* Fill in device structure with ethernet-generic values. */
dev->flags |= IFF_NOARP;
dev->flags &= ~IFF_MULTICAST;
- dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LOGICAL;
+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LOGICAL | IFF_HIGHDMA;
dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST;
dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_HW_CSUM;
dev->features |= NETIF_F_GSO_ENCAP_ALL;
dev->hw_features |= dev->features;
dev->hw_enc_features |= dev->features;
diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c
index 857361c74f5d..de085fb720de 100644
--- a/drivers/net/ethernet/adaptec/starfire.c
+++ b/drivers/net/ethernet/adaptec/starfire.c
@@ -692,7 +692,7 @@ static int starfire_init_one(struct pci_dev *pdev,
dev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;
#endif /* VLAN_RX_KILL_VID */
#ifdef ADDR_64BITS
- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;
#endif /* ADDR_64BITS */

/* Serial EEPROM reads are hidden by the hardware. */
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index 27af7746d645..19d3bdf5d7e4 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -1486,7 +1486,8 @@ static int greth_of_probe(struct platform_device *ofdev)
if (greth->gbit_mac) {
dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
NETIF_F_RXCSUM;
- dev->features = dev->hw_features | NETIF_F_HIGHDMA;
+ dev->features = dev->hw_features;
+ dev->priv_flags |= IFF_HIGHDMA;
greth_netdev_ops.ndo_start_xmit = greth_start_xmit_gbit;
}

diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index eafef84fe3be..c51b61c4e092 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -589,7 +589,7 @@ static int acenic_probe_one(struct pci_dev *pdev,
}
ap->name = dev->name;

- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;

pci_set_drvdata(pdev, dev);

diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 1c8763be0e4b..a57350b27c07 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -1372,13 +1372,14 @@ static int altera_tse_probe(struct platform_device *pdev)
* so it is turned off
*/
ndev->hw_features &= ~NETIF_F_SG;
- ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
+ ndev->features |= ndev->hw_features;

/* VLAN offloading of tagging, stripping and filtering is not
* supported by hardware, but driver will accommodate the
* extra 4-byte VLAN tag for processing by upper layers
*/
ndev->features |= NETIF_F_HW_VLAN_CTAG_RX;
+ ndev->priv_flags |= IFF_HIGHDMA;

/* setup NAPI interface */
netif_napi_add(ndev, &priv->napi, tse_poll);
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 09e7da1a69c9..4ea6f732736e 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -3753,11 +3753,12 @@ static void ena_set_dev_offloads(struct ena_com_dev_get_features_ctx *feat,
netdev->features =
dev_features |
NETIF_F_SG |
- NETIF_F_RXHASH |
- NETIF_F_HIGHDMA;
+ NETIF_F_RXHASH;

netdev->hw_features |= netdev->features;
netdev->vlan_features |= netdev->features;
+
+ netdev->priv_flags |= IFF_HIGHDMA;
}

static void ena_set_conf_feat_params(struct ena_adapter *adapter,
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index c9faa8540859..cffb0468de32 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -2580,11 +2580,11 @@ static int bcm_sysport_probe(struct platform_device *pdev)
dev->netdev_ops = &bcm_sysport_netdev_ops;
netif_napi_add(dev, &priv->napi, bcm_sysport_poll);

- dev->features |= NETIF_F_RXCSUM | NETIF_F_HIGHDMA |
- NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+ dev->features |= NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_HW_VLAN_CTAG_TX;
dev->hw_features |= dev->features;
dev->vlan_features |= dev->features;
+ dev->priv_flags |= IFF_HIGHDMA;
dev->max_mtu = UMAC_MAX_MTU_SIZE;

/* Request the WOL interrupt and advertise suspend if available */
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index b65b8592ad75..f5237687a6ba 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -8190,7 +8190,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)

/* Configure DMA attributes. */
if (dma_set_mask(&pdev->dev, dma_mask) == 0) {
- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;
rc = dma_set_coherent_mask(&pdev->dev, persist_dma_mask);
if (rc) {
dev_err(&pdev->dev,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 678829646cec..f701ebf68763 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13182,7 +13182,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
dev->netdev_ops = &bnx2x_netdev_ops;
bnx2x_set_ethtool_ops(bp, dev);

- dev->priv_flags |= IFF_UNICAST_FLT;
+ dev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;

dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
@@ -13211,7 +13211,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
}

dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
- NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA;
+ NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6;

if (IS_PF(bp)) {
if (chip_is_e1x)
@@ -13224,7 +13224,6 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
*/

dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX;
- dev->features |= NETIF_F_HIGHDMA;
if (dev->features & NETIF_F_LRO)
dev->features &= ~NETIF_F_GRO_HW;

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 795f3f957eb5..dd690ac5ef1e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -15318,17 +15318,17 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)

dev->gso_partial_features = NETIF_F_GSO_UDP_TUNNEL_CSUM |
NETIF_F_GSO_GRE_CSUM;
- dev->vlan_features = dev->hw_features | NETIF_F_HIGHDMA;
+ dev->vlan_features = dev->hw_features;
if (bp->fw_cap & BNXT_FW_CAP_VLAN_RX_STRIP)
dev->hw_features |= BNXT_HW_FEATURE_VLAN_ALL_RX;
if (bp->fw_cap & BNXT_FW_CAP_VLAN_TX_INSERT)
dev->hw_features |= BNXT_HW_FEATURE_VLAN_ALL_TX;
if (BNXT_SUPPORTS_TPA(bp))
dev->hw_features |= NETIF_F_GRO_HW;
- dev->features |= dev->hw_features | NETIF_F_HIGHDMA;
+ dev->features |= dev->hw_features;
if (dev->features & NETIF_F_GRO_HW)
dev->features &= ~NETIF_F_LRO;
- dev->priv_flags |= IFF_UNICAST_FLT;
+ dev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;

netif_set_tso_max_size(dev, GSO_MAX_SIZE);

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index b1f84b37032a..a6371a82f125 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -4019,10 +4019,10 @@ static int bcmgenet_probe(struct platform_device *pdev)
priv->msg_enable = netif_msg_init(-1, GENET_MSG_DEFAULT);

/* Set default features */
- dev->features |= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
- NETIF_F_RXCSUM;
+ dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
dev->hw_features |= dev->features;
dev->vlan_features |= dev->features;
+ dev->priv_flags |= IFF_HIGHDMA;

/* Request the WOL interrupt and advertise suspend if available */
priv->wol_irq_disabled = true;
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index e6ff3c9bd7e5..11212c0db1b1 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -17809,7 +17809,7 @@ static int tg3_init_one(struct pci_dev *pdev,
if (dma_mask > DMA_BIT_MASK(32)) {
err = dma_set_mask(&pdev->dev, dma_mask);
if (!err) {
- features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;
err = dma_set_coherent_mask(&pdev->dev,
persist_dma_mask);
if (err < 0) {
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index c32174484a96..2843dc8bef08 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -3424,12 +3424,11 @@ bnad_netdev_init(struct bnad *bnad)
NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX;

- netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA |
- NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
- NETIF_F_TSO | NETIF_F_TSO6;
+ netdev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM |
+ NETIF_F_IPV6_CSUM | NETIF_F_TSO | NETIF_F_TSO6;

- netdev->features |= netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER |
- NETIF_F_HIGHDMA;
+ netdev->features |= netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
+ netdev->priv_flags |= IFF_HIGHDMA;

netdev->mem_start = bnad->mmio_start;
netdev->mem_end = bnad->mmio_start + bnad->mmio_len - 1;
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 5e97f1e4e38e..a037b83ae24f 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -1774,12 +1774,12 @@ static int xgmac_probe(struct platform_device *pdev)
if (device_can_wakeup(priv->device))
priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */

- ndev->hw_features = NETIF_F_SG | NETIF_F_HIGHDMA;
+ ndev->hw_features = NETIF_F_SG;
if (readl(priv->base + XGMAC_DMA_HW_FEATURE) & DMA_HW_FEAT_TXCOESEL)
ndev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_RXCSUM;
ndev->features |= ndev->hw_features;
- ndev->priv_flags |= IFF_UNICAST_FLT;
+ ndev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;

/* MTU range: 46 - 9000 */
ndev->min_mtu = ETH_ZLEN - ETH_HLEN;
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index 34f02a8ec2ca..79aa2db2511b 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -3565,13 +3565,13 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)

if (OCTEON_CN23XX_PF(octeon_dev) ||
OCTEON_CN6XXX(octeon_dev)) {
- lio->dev_capability = NETIF_F_HIGHDMA
- | NETIF_F_IP_CSUM
+ lio->dev_capability = NETIF_F_IP_CSUM
| NETIF_F_IPV6_CSUM
| NETIF_F_SG | NETIF_F_RXCSUM
| NETIF_F_GRO
| NETIF_F_TSO | NETIF_F_TSO6
| NETIF_F_LRO;
+ netdev->priv_flags |= IFF_HIGHDMA;
}
netif_set_tso_max_size(netdev, OCTNIC_GSO_MAX_SIZE);

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index 62c2eadc33e3..fb4db64830cc 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -2082,12 +2082,12 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)

lio->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);

- lio->dev_capability = NETIF_F_HIGHDMA
- | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
+ lio->dev_capability = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
| NETIF_F_SG | NETIF_F_RXCSUM
| NETIF_F_TSO | NETIF_F_TSO6
| NETIF_F_GRO
| NETIF_F_LRO;
+ netdev->priv_flags |= IFF_HIGHDMA;
netif_set_tso_max_size(netdev, OCTNIC_GSO_MAX_SIZE);

/* Copy of transmit encapsulation capabilities:
diff --git a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
index 9d0e8fc35ff9..76c9e7b643a5 100644
--- a/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
+++ b/drivers/net/ethernet/chelsio/cxgb/cxgb2.c
@@ -1031,11 +1031,11 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->mem_start = mmio_start;
netdev->mem_end = mmio_start + mmio_len - 1;
netdev->ml_priv = adapter;
- netdev->priv_flags |= IFF_LLTX;
+ netdev->priv_flags |= IFF_LLTX | IFF_HIGHDMA;
netdev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM |
NETIF_F_RXCSUM;
netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM |
- NETIF_F_RXCSUM | NETIF_F_HIGHDMA;
+ NETIF_F_RXCSUM;

if (vlan_tso_capable(adapter)) {
netdev->features |=
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
index 2236f1d35f2b..55c65b7bb249 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
@@ -3200,7 +3200,7 @@ static void cxgb3_init_iscsi_mac(struct net_device *dev)

#define TSO_FLAGS (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | TSO_FLAGS | \
- NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)
+ NETIF_F_IPV6_CSUM)
static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
int i, err;
@@ -3308,7 +3308,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_HW_VLAN_CTAG_TX;
netdev->vlan_features |= netdev->features & VLAN_FEAT;

- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->priv_flags |= IFF_HIGHDMA;

netdev->netdev_ops = &cxgb_netdev_ops;
netdev->ethtool_ops = &cxgb_ethtool_ops;
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 2eb33a727bba..f58e5c3a0086 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -6207,7 +6207,7 @@ static void free_some_resources(struct adapter *adapter)
#define TSO_FLAGS (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN | \
NETIF_F_GSO_UDP_L4)
#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | TSO_FLAGS | \
- NETIF_F_GRO | NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)
+ NETIF_F_GRO | NETIF_F_IPV6_CSUM)
#define SEGMENT_SIZE 128

static int t4_get_chip_type(struct adapter *adap, int ver)
@@ -6811,7 +6811,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_RXCSUM | NETIF_F_RXHASH | NETIF_F_GRO |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
- NETIF_F_HW_TC | NETIF_F_NTUPLE | NETIF_F_HIGHDMA;
+ NETIF_F_HW_TC | NETIF_F_NTUPLE;

if (chip_ver > CHELSIO_T5) {
netdev->hw_enc_features |= NETIF_F_IP_CSUM |
@@ -6847,7 +6847,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
}
#endif /* CONFIG_CHELSIO_IPSEC_INLINE */

- netdev->priv_flags |= IFF_UNICAST_FLT;
+ netdev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;

/* MTU range: 81 - 9600 */
netdev->min_mtu = 81; /* accommodate SACK */
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 9ba0864592e8..83a02b2aad74 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -1923,7 +1923,7 @@ static void cxgb4vf_get_wol(struct net_device *dev,
*/
#define TSO_FLAGS (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | TSO_FLAGS | \
- NETIF_F_GRO | NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)
+ NETIF_F_GRO | NETIF_F_IPV6_CSUM)

static const struct ethtool_ops cxgb4vf_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
@@ -3070,10 +3070,10 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
netdev->hw_features = NETIF_F_SG | TSO_FLAGS | NETIF_F_GRO |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
- netdev->features = netdev->hw_features | NETIF_F_HIGHDMA;
+ netdev->features = netdev->hw_features;
netdev->vlan_features = netdev->features & VLAN_FEAT;

- netdev->priv_flags |= IFF_UNICAST_FLT;
+ netdev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;
netdev->min_mtu = 81;
netdev->max_mtu = ETH_MAX_MTU;

diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index d266a87297a5..6ea7d29d4c59 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -2952,7 +2952,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
#endif

if (using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->priv_flags |= IFF_HIGHDMA;

netdev->priv_flags |= IFF_UNICAST_FLT;

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index a8596ebcdfd6..f13ab2481416 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -5189,13 +5189,12 @@ static void be_netdev_init(struct net_device *netdev)
netdev->hw_features |= NETIF_F_RXHASH;

netdev->features |= netdev->hw_features |
- NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER |
- NETIF_F_HIGHDMA;
+ NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;

netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;

- netdev->priv_flags |= IFF_UNICAST_FLT;
+ netdev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;

netdev->flags |= IFF_MULTICAST;

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 4129344e1541..75cea376ebef 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -231,14 +231,14 @@ static int dpaa_netdev_init(struct net_device *net_dev,
net_dev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_RXHASH);

- net_dev->hw_features |= NETIF_F_SG | NETIF_F_HIGHDMA;
+ net_dev->hw_features |= NETIF_F_SG;
/* The kernels enables GSO automatically, if we declare NETIF_F_SG.
* For conformity, we'll still declare GSO explicitly.
*/
net_dev->features |= NETIF_F_GSO;
net_dev->features |= NETIF_F_RXCSUM;

- net_dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LLTX;
+ net_dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LLTX | IFF_HIGHDMA;
/* we do not want shared skbs on TX */
net_dev->priv_flags &= ~IFF_TX_SKB_SHARING;

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index bbd846bf12b0..42938718e059 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -4585,7 +4585,7 @@ static int dpaa2_eth_netdev_init(struct net_device *net_dev)
dpaa2_eth_detect_features(priv);

/* Capabilities listing */
- supported |= IFF_LIVE_ADDR_CHANGE | IFF_LLTX;
+ supported |= IFF_LIVE_ADDR_CHANGE | IFF_LLTX | IFF_HIGHDMA;

if (options & DPNI_OPT_NO_MAC_FILTER)
not_supported |= IFF_UNICAST_FLT;
@@ -4598,8 +4598,7 @@ static int dpaa2_eth_netdev_init(struct net_device *net_dev)
/* Features */
net_dev->features = NETIF_F_RXCSUM |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
- NETIF_F_SG | NETIF_F_HIGHDMA |
- NETIF_F_HW_TC | NETIF_F_TSO;
+ NETIF_F_SG | NETIF_F_HW_TC | NETIF_F_TSO;
net_dev->gso_max_segs = DPAA2_ETH_ENQUEUE_MAX_FDS;
net_dev->hw_features = net_dev->features;
net_dev->xdp_features = NETDEV_XDP_ACT_BASIC |
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
index 11b14555802c..f5087b9f8dad 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
@@ -796,7 +796,7 @@ static void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev,
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_LOOPBACK |
NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6;
- ndev->features = NETIF_F_HIGHDMA | NETIF_F_SG | NETIF_F_RXCSUM |
+ ndev->features = NETIF_F_SG | NETIF_F_RXCSUM |
NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6;
@@ -806,7 +806,7 @@ static void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev,
if (si->num_rss)
ndev->hw_features |= NETIF_F_RXHASH;

- ndev->priv_flags |= IFF_UNICAST_FLT;
+ ndev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;
ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_NDO_XMIT | NETDEV_XDP_ACT_RX_SG |
NETDEV_XDP_ACT_NDO_XMIT_SG;
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_vf.c b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
index dfcaac302e24..cd18f66a5a0f 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_vf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
@@ -137,12 +137,13 @@ static void enetc_vf_netdev_setup(struct enetc_si *si, struct net_device *ndev,
NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6;
- ndev->features = NETIF_F_HIGHDMA | NETIF_F_SG | NETIF_F_RXCSUM |
+ ndev->features = NETIF_F_SG | NETIF_F_RXCSUM |
NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6;
ndev->vlan_features = NETIF_F_SG | NETIF_F_HW_CSUM |
NETIF_F_TSO | NETIF_F_TSO6;
+ ndev->priv_flags |= IFF_HIGHDMA;

if (si->num_rss)
ndev->hw_features |= NETIF_F_RXHASH;
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index a811238c018d..9cc61d21528a 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -3242,7 +3242,8 @@ static int gfar_probe(struct platform_device *ofdev)
dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
NETIF_F_RXCSUM;
dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG |
- NETIF_F_RXCSUM | NETIF_F_HIGHDMA;
+ NETIF_F_RXCSUM;
+ dev->priv_flags |= IFF_HIGHDMA;
}

if (priv->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) {
diff --git a/drivers/net/ethernet/fungible/funeth/funeth_main.c b/drivers/net/ethernet/fungible/funeth/funeth_main.c
index df86770731ad..f3f7d3bfc1b5 100644
--- a/drivers/net/ethernet/fungible/funeth/funeth_main.c
+++ b/drivers/net/ethernet/fungible/funeth/funeth_main.c
@@ -1356,7 +1356,7 @@ static const struct net_device_ops fun_netdev_ops = {
#define TSO_FLAGS (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN | \
NETIF_F_GSO_UDP_L4)
#define VLAN_FEAT (NETIF_F_SG | NETIF_F_HW_CSUM | TSO_FLAGS | \
- GSO_ENCAP_FLAGS | NETIF_F_HIGHDMA)
+ GSO_ENCAP_FLAGS)

static void fun_dflt_rss_indir(struct funeth_priv *fp, unsigned int nrx)
{
@@ -1766,11 +1766,12 @@ static int fun_create_netdev(struct fun_ethdev *ed, unsigned int portid)
if (fp->port_caps & FUN_PORT_CAP_ENCAP_OFFLOADS)
netdev->hw_features |= GSO_ENCAP_FLAGS;

- netdev->features |= netdev->hw_features | NETIF_F_HIGHDMA;
+ netdev->features |= netdev->hw_features;
netdev->vlan_features = netdev->features & VLAN_FEAT;
netdev->mpls_features = netdev->vlan_features;
netdev->hw_enc_features = netdev->hw_features;
netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT;
+ netdev->priv_flags |= IFF_HIGHDMA;

netdev->min_mtu = ETH_MIN_MTU;
netdev->max_mtu = FUN_MAX_MTU;
diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
index a515e5af843c..05574f4b2ec0 100644
--- a/drivers/net/ethernet/google/gve/gve_main.c
+++ b/drivers/net/ethernet/google/gve/gve_main.c
@@ -2537,7 +2537,6 @@ static int gve_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
* Features might be set in other locations as well (such as
* `gve_adminq_describe_device`).
*/
- dev->hw_features = NETIF_F_HIGHDMA;
dev->hw_features |= NETIF_F_SG;
dev->hw_features |= NETIF_F_HW_CSUM;
dev->hw_features |= NETIF_F_TSO;
@@ -2546,6 +2545,7 @@ static int gve_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->hw_features |= NETIF_F_RXCSUM;
dev->hw_features |= NETIF_F_RXHASH;
dev->features = dev->hw_features;
+ dev->priv_flags |= IFF_HIGHDMA;
dev->watchdog_timeo = 5 * HZ;
dev->min_mtu = ETH_MIN_MTU;
netif_carrier_off(dev);
diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
index 1a972b093a42..ff4be4a54cd6 100644
--- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
@@ -1222,7 +1222,7 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)

INIT_WORK(&priv->tx_timeout_task, hix5hd2_tx_timeout_task);
ndev->watchdog_timeo = 6 * HZ;
- ndev->priv_flags |= IFF_UNICAST_FLT;
+ ndev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;
ndev->netdev_ops = &hix5hd2_netdev_ops;
ndev->ethtool_ops = &hix5hd2_ethtools_ops;
SET_NETDEV_DEV(ndev, dev);
@@ -1230,7 +1230,7 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
if (HAS_CAP_TSO(priv->hw_cap))
ndev->hw_features |= NETIF_F_SG;

- ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
+ ndev->features |= ndev->hw_features;
ndev->vlan_features |= ndev->features;

ret = hix5hd2_init_hw_desc_queue(priv);
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
index 499c657d37a9..438303ee034b 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
@@ -918,7 +918,7 @@ static const struct net_device_ops hinicvf_netdev_ops = {

static void netdev_features_init(struct net_device *netdev)
{
- netdev->hw_features = NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_IP_CSUM |
+ netdev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM | NETIF_F_TSO | NETIF_F_TSO6 |
NETIF_F_RXCSUM | NETIF_F_LRO |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
@@ -931,6 +931,8 @@ static void netdev_features_init(struct net_device *netdev)
netdev->hw_enc_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_SCTP_CRC |
NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN |
NETIF_F_GSO_UDP_TUNNEL_CSUM | NETIF_F_GSO_UDP_TUNNEL;
+
+ netdev->priv_flags |= IFF_HIGHDMA;
}

static void hinic_refresh_nic_cfg(struct hinic_dev *nic_dev)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 1e29e5c9a2df..f02d8945e82e 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -2998,11 +2998,11 @@ static struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
dev->hw_features = NETIF_F_SG | NETIF_F_TSO |
NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_CTAG_TX;
dev->features = NETIF_F_SG | NETIF_F_TSO |
- NETIF_F_HIGHDMA | NETIF_F_IP_CSUM |
+ NETIF_F_IP_CSUM |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_RXCSUM;
- dev->vlan_features = NETIF_F_SG | NETIF_F_TSO | NETIF_F_HIGHDMA |
- NETIF_F_IP_CSUM;
+ dev->vlan_features = NETIF_F_SG | NETIF_F_TSO | NETIF_F_IP_CSUM;
+ dev->priv_flags |= IFF_HIGHDMA;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;

/* MTU range: 68 - 9022 */
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 5b43f9b194fc..22dba0ec50d1 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1051,10 +1051,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_RXALL |
NETIF_F_RXFCS);

- if (pci_using_dac) {
- netdev->features |= NETIF_F_HIGHDMA;
- netdev->vlan_features |= NETIF_F_HIGHDMA;
- }
+ if (pci_using_dac)
+ netdev->priv_flags |= IFF_HIGHDMA;

netdev->vlan_features |= (NETIF_F_TSO |
NETIF_F_HW_CSUM |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index bef65ee4c549..c65ab725660f 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -7559,10 +7559,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_TSO6 |
NETIF_F_HW_CSUM);

- netdev->priv_flags |= IFF_UNICAST_FLT;
-
- netdev->features |= NETIF_F_HIGHDMA;
- netdev->vlan_features |= NETIF_F_HIGHDMA;
+ netdev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;

/* MTU range: 68 - max_hw_frame_size */
netdev->min_mtu = ETH_MIN_MTU;
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 92de609b7218..f4ecfe7ad9ba 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -2008,10 +2008,8 @@ static int fm10k_sw_init(struct fm10k_intfc *interface,
hw->mac.ops.set_dma_mask(hw, dma_get_mask(&pdev->dev));

/* update netdev with DMA restrictions */
- if (dma_get_mask(&pdev->dev) > DMA_BIT_MASK(32)) {
- netdev->features |= NETIF_F_HIGHDMA;
- netdev->vlan_features |= NETIF_F_HIGHDMA;
- }
+ if (dma_get_mask(&pdev->dev) > DMA_BIT_MASK(32))
+ netdev->priv_flags |= IFF_HIGHDMA;

/* reset and initialize the hardware so it is in a known state */
err = hw->mac.ops.reset_hw(hw);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 164afd8ce5a0..40b62f782ee8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -13665,7 +13665,6 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)

hw_enc_features = NETIF_F_SG |
NETIF_F_HW_CSUM |
- NETIF_F_HIGHDMA |
NETIF_F_SOFT_FEATURES |
NETIF_F_TSO |
NETIF_F_TSO_ECN |
@@ -13794,6 +13793,7 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)

netdev->priv_flags |= IFF_UNICAST_FLT;
netdev->priv_flags |= IFF_SUPP_NOFCS;
+ netdev->priv_flags |= IFF_HIGHDMA;
/* Setup netdev TC information */
i40e_vsi_config_netdev_tc(vsi, vsi->tc_config.enabled_tc);

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 7e0de0a9b883..350fa76d4568 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -4769,7 +4769,6 @@ int iavf_process_config(struct iavf_adapter *adapter)
hw_enc_features = NETIF_F_SG |
NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM |
- NETIF_F_HIGHDMA |
NETIF_F_SOFT_FEATURES |
NETIF_F_TSO |
NETIF_F_TSO_ECN |
@@ -4832,7 +4831,7 @@ int iavf_process_config(struct iavf_adapter *adapter)
adapter->flags |= IAVF_FLAG_FDIR_ENABLED;
}

- netdev->priv_flags |= IFF_UNICAST_FLT;
+ netdev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;

/* Do not turn on offloads when they are requested to be turned off.
* TSO needs minimum 576 bytes to work correctly.
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 4f75ea4b9ea1..a65014ec0cdb 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -3545,15 +3545,16 @@ static void ice_set_netdev_features(struct net_device *netdev)
netdev_features_t dflt_features;
netdev_features_t tso_features;

+ netdev->priv_flags |= IFF_HIGHDMA;
+
if (ice_is_safe_mode(pf)) {
/* safe mode */
- netdev->features = NETIF_F_SG | NETIF_F_HIGHDMA;
+ netdev->features = NETIF_F_SG;
netdev->hw_features = netdev->features;
return;
}

dflt_features = NETIF_F_SG |
- NETIF_F_HIGHDMA |
NETIF_F_NTUPLE |
NETIF_F_RXHASH;

diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c
index 5d3532c27d57..f1a5c9336e3f 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_lib.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c
@@ -779,8 +779,9 @@ static int idpf_cfg_netdev(struct idpf_vport *vport)
netdev->min_mtu = ETH_MIN_MTU;
netdev->max_mtu = vport->max_mtu;

- dflt_features = NETIF_F_SG |
- NETIF_F_HIGHDMA;
+ netdev->priv_flags |= IFF_HIGHDMA;
+
+ dflt_features = NETIF_F_SG;

if (idpf_is_cap_ena_all(adapter, IDPF_RSS_CAPS, IDPF_CAP_RSS))
dflt_features |= NETIF_F_RXHASH;
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 74a998fcaa6f..93099ac95e08 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3314,8 +3314,6 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (hw->mac.type >= e1000_i350)
netdev->hw_features |= NETIF_F_NTUPLE;

- netdev->features |= NETIF_F_HIGHDMA;
-
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->mpls_features |= NETIF_F_HW_CSUM;
netdev->hw_enc_features |= netdev->vlan_features;
@@ -3325,7 +3323,7 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_TX;

- netdev->priv_flags |= IFF_SUPP_NOFCS;
+ netdev->priv_flags |= IFF_SUPP_NOFCS | IFF_HIGHDMA;

netdev->priv_flags |= IFF_UNICAST_FLT;
netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT;
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 40ccd24ffc53..33deb1854c97 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2806,7 +2806,7 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->hw_features |= NETIF_F_GSO_PARTIAL |
IGBVF_GSO_PARTIAL_FEATURES;

- netdev->features = netdev->hw_features | NETIF_F_HIGHDMA;
+ netdev->features = netdev->hw_features;

netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->mpls_features |= NETIF_F_HW_CSUM;
@@ -2816,6 +2816,7 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER |
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_TX;
+ netdev->priv_flags = IFF_HIGHDMA;

/* MTU range: 68 - 9216 */
netdev->min_mtu = ETH_MIN_MTU;
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index d9bd001af7ba..a4382f0c0521 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6856,12 +6856,12 @@ static int igc_probe(struct pci_dev *pdev,
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
netdev->hw_features |= netdev->features;

- netdev->features |= NETIF_F_HIGHDMA;
-
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->mpls_features |= NETIF_F_HW_CSUM;
netdev->hw_enc_features |= netdev->vlan_features;

+ netdev->priv_flags |= IFF_HIGHDMA;
+
netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_XSK_ZEROCOPY;

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 43e7e75ae18c..da5d21d55278 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -11049,8 +11049,6 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->hw_features |= NETIF_F_NTUPLE |
NETIF_F_HW_TC;

- netdev->features |= NETIF_F_HIGHDMA;
-
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->hw_enc_features |= netdev->vlan_features;
netdev->mpls_features |= NETIF_F_SG |
@@ -11066,6 +11064,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

netdev->priv_flags |= IFF_UNICAST_FLT;
netdev->priv_flags |= IFF_SUPP_NOFCS;
+ netdev->priv_flags |= IFF_HIGHDMA;

netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_XSK_ZEROCOPY;
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 3161a13079fe..f1115bcf8863 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -4618,7 +4618,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->hw_features |= NETIF_F_GSO_PARTIAL |
IXGBEVF_GSO_PARTIAL_FEATURES;

- netdev->features = netdev->hw_features | NETIF_F_HIGHDMA;
+ netdev->features = netdev->hw_features;

netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->mpls_features |= NETIF_F_SG |
@@ -4633,7 +4633,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_TX;

- netdev->priv_flags |= IFF_UNICAST_FLT;
+ netdev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;
netdev->xdp_features = NETDEV_XDP_ACT_BASIC;

/* MTU range: 68 - 1504 or 9710 */
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 1732ec3c3dbd..e0ac7be53f7b 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -716,7 +716,7 @@ jme_set_clean_rxdesc(struct jme_adapter *jme, int i)
rxdesc->desc1.bufaddrl = cpu_to_le32(
(__u64)rxbi->mapping & 0xFFFFFFFFUL);
rxdesc->desc1.datalen = cpu_to_le16(rxbi->len);
- if (jme->dev->features & NETIF_F_HIGHDMA)
+ if (jme->dev->priv_flags & IFF_HIGHDMA)
rxdesc->desc1.flags = RXFLAG_64BIT;
wmb();
rxdesc->desc1.flags |= RXFLAG_OWN | RXFLAG_INT;
@@ -2005,7 +2005,7 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx)
struct jme_ring *txring = &(jme->txring[0]);
struct txdesc *txdesc = txring->desc, *ctxdesc;
struct jme_buffer_info *txbi = txring->bufinf, *ctxbi;
- bool hidma = jme->dev->features & NETIF_F_HIGHDMA;
+ bool hidma = jme->dev->priv_flags & IFF_HIGHDMA;
int i, nr_frags = skb_shinfo(skb)->nr_frags;
int mask = jme->tx_ring_mask;
u32 len;
@@ -2969,7 +2969,7 @@ jme_init_one(struct pci_dev *pdev,
NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX;
if (using_dac)
- netdev->features |= NETIF_F_HIGHDMA;
+ netdev->priv_flags |= IFF_HIGHDMA;

/* MTU range: 1280 - 9202*/
netdev->min_mtu = IPV6_MIN_MTU;
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index 1b43704baceb..b2f9e6b570e7 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -3829,7 +3829,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
dev->max_mtu = ETH_JUMBO_MTU;

if (highmem)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;

skge = netdev_priv(dev);
netif_napi_add(dev, &skge->napi, skge_poll);
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 07720841a8d7..564582a17aef 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -4636,7 +4636,7 @@ static struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port,
dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO;

if (highmem)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;

/* Enable receive hashing unless hardware is known broken */
if (!(hw->flags & SKY2_HW_RSS_BROKEN))
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 5d3fde63b273..9229ebeac31e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -3291,9 +3291,10 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
}

dev->vlan_features = dev->hw_features;
+ dev->priv_flags |= IFF_HIGHDMA;

dev->hw_features |= NETIF_F_RXCSUM | NETIF_F_RXHASH;
- dev->features = dev->hw_features | NETIF_F_HIGHDMA |
+ dev->features = dev->hw_features |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER;
dev->hw_features |= NETIF_F_LOOPBACK |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index d51ab72d69b9..7bb45429a213 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5264,10 +5264,9 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
#endif
}

- netdev->features |= NETIF_F_HIGHDMA;
netdev->features |= NETIF_F_HW_VLAN_STAG_FILTER;

- netdev->priv_flags |= IFF_UNICAST_FLT;
+ netdev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;

netif_set_tso_max_size(netdev, GSO_MAX_SIZE);
mlx5e_set_xdp_feature(netdev);
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 7b7e1c5b00f4..ee98b4da71ce 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -3864,7 +3864,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* fake NETIF_F_HW_VLAN_CTAG_RX for good GRO performance */
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;

- netdev->features = netdev->hw_features | NETIF_F_HIGHDMA;
+ netdev->features = netdev->hw_features;

netdev->vlan_features |= mgp->features;
if (mgp->fw_ver_tiny < 37)
@@ -3872,6 +3872,8 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (mgp->fw_ver_tiny < 32)
netdev->vlan_features &= ~NETIF_F_TSO;

+ netdev->priv_flags |= IFF_HIGHDMA;
+
/* make sure we can get an irq, and that MSI can be
* setup (if available). */
status = myri10ge_request_irq(mgp);
diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
index 998586872599..12282ea8d0af 100644
--- a/drivers/net/ethernet/natsemi/ns83820.c
+++ b/drivers/net/ethernet/natsemi/ns83820.c
@@ -2155,7 +2155,7 @@ static int ns83820_init_one(struct pci_dev *pci_dev,
if (using_dac) {
printk(KERN_INFO "%s: using 64 bit addressing.\n",
ndev->name);
- ndev->features |= NETIF_F_HIGHDMA;
+ ndev->priv_flags |= IFF_HIGHDMA;
}

printk(KERN_INFO "%s: ns83820 v" VERSION ": DP83820 v%u.%u: %pM io=0x%08lx irq=%d f=%s\n",
@@ -2163,7 +2163,7 @@ static int ns83820_init_one(struct pci_dev *pci_dev,
(unsigned)readl(dev->base + SRR) >> 8,
(unsigned)readl(dev->base + SRR) & 0xff,
ndev->dev_addr, addr, pci_dev->irq,
- (ndev->features & NETIF_F_HIGHDMA) ? "h,sg" : "sg"
+ (ndev->priv_flags & IFF_HIGHDMA) ? "h,sg" : "sg"
);

#ifdef PHY_CODE_IS_FINISHED
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index 55408f16fbbc..ee96beb36f11 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -7861,8 +7861,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
NETIF_F_TSO | NETIF_F_TSO6 |
NETIF_F_RXCSUM | NETIF_F_LRO;
dev->features |= dev->hw_features |
- NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
- NETIF_F_HIGHDMA;
+ NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
+ dev->priv_flags |= IFF_HIGHDMA;
dev->watchdog_timeo = WATCH_DOG_TIMEOUT;
INIT_WORK(&sp->rst_timer_task, s2io_restart_nic);
INIT_WORK(&sp->set_link_task, s2io_set_link);
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 997cc4fcffdb..043e9688a9f2 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -2681,7 +2681,6 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
if (nn->cap & NFP_NET_CFG_CTRL_LIVE_ADDR)
netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;

- netdev->hw_features = NETIF_F_HIGHDMA;
if (nn->cap & NFP_NET_CFG_CTRL_RXCSUM_ANY) {
netdev->hw_features |= NETIF_F_RXCSUM;
nn->dp.ctrl |= nn->cap & NFP_NET_CFG_CTRL_RXCSUM_ANY;
@@ -2754,6 +2753,7 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
}

netdev->features = netdev->hw_features;
+ netdev->priv_flags |= IFF_HIGHDMA;

if (nfp_app_has_tc(nn->app) && nn->port)
netdev->hw_features |= NETIF_F_HW_TC;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
index 3cb3dbbd6240..d1bec1d3f6b2 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
@@ -338,7 +338,6 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev,
if (repr_cap & NFP_NET_CFG_CTRL_LIVE_ADDR)
netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;

- netdev->hw_features = NETIF_F_HIGHDMA;
if (repr_cap & NFP_NET_CFG_CTRL_RXCSUM_ANY)
netdev->hw_features |= NETIF_F_RXCSUM;
if (repr_cap & NFP_NET_CFG_CTRL_TXCSUM)
@@ -384,7 +383,7 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev,
netdev->features &= ~NETIF_F_HW_VLAN_STAG_RX;
netif_set_tso_max_segs(netdev, NFP_NET_LSO_MAX_SEGS);

- netdev->priv_flags |= IFF_LOGICAL | IFF_DISABLE_NETPOLL;
+ netdev->priv_flags |= IFF_LOGICAL | IFF_DISABLE_NETPOLL | IFF_HIGHDMA;

if (nfp_app_has_tc(app)) {
netdev->features |= NETIF_F_HW_TC;
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 31f896c4aa26..a0dd34aed97f 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -5793,7 +5793,7 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
dev_info(&pci_dev->dev,
"64-bit DMA failed, using 32-bit addressing\n");
else
- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;
}
} else if (id->driver_data & DEV_HAS_LARGEDESC) {
/* packet format 2: supports jumbo frames */
@@ -6118,7 +6118,7 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
dev->name, np->phy_oui, np->phyaddr, dev->dev_addr);

dev_info(&pci_dev->dev, "%s%s%s%s%s%s%s%s%s%s%sdesc-v%u\n",
- dev->features & NETIF_F_HIGHDMA ? "highdma " : "",
+ (dev->priv_flags & IFF_HIGHDMA) ? "highdma " : "",
dev->features & (NETIF_F_IP_CSUM | NETIF_F_SG) ?
"csum " : "",
dev->features & (NETIF_F_HW_VLAN_CTAG_RX |
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c
index 2dcbfe24134c..e144883d7ce9 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
@@ -1699,9 +1699,8 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

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

- dev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_HIGHDMA |
- NETIF_F_GSO;
- dev->priv_flags |= IFF_LLTX;
+ dev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_GSO;
+ dev->priv_flags |= IFF_LLTX | IFF_HIGHDMA;

mac->dma_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa007, NULL);
if (!mac->dma_pdev) {
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index 7f0c6cdc375e..b983f4746a19 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -1535,7 +1535,6 @@ static int ionic_init_nic_features(struct ionic_lif *lif)
return err;

/* tell the netdev what we actually can support */
- netdev->features |= NETIF_F_HIGHDMA;

if (lif->hw_features & IONIC_ETH_HW_VLAN_TX_TAG)
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX;
@@ -1576,7 +1575,8 @@ static int ionic_init_nic_features(struct ionic_lif *lif)
netdev->vlan_features |= netdev->features & ~NETIF_F_VLAN_FEATURES;

netdev->priv_flags |= IFF_UNICAST_FLT |
- IFF_LIVE_ADDR_CHANGE;
+ IFF_LIVE_ADDR_CHANGE |
+ IFF_HIGHDMA;

netdev->xdp_features = NETDEV_XDP_ACT_BASIC |
NETDEV_XDP_ACT_REDIRECT |
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index ed24d6af7487..5b5ecbaf8b92 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -1351,10 +1351,8 @@ netxen_setup_netdev(struct netxen_adapter *adapter,

netdev->vlan_features |= netdev->hw_features;

- if (adapter->pci_using_dac) {
- netdev->features |= NETIF_F_HIGHDMA;
- netdev->vlan_features |= NETIF_F_HIGHDMA;
- }
+ if (adapter->pci_using_dac)
+ netdev->priv_flags |= IFF_HIGHDMA;

if (adapter->capabilities & NX_FW_CAPABILITY_FVLANTX)
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX;
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 99df00c30b8c..7a021c505a74 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -900,16 +900,16 @@ static void qede_init_ndev(struct qede_dev *edev)
NETIF_F_GSO_GRE_CSUM);
}

- ndev->vlan_features = hw_features | NETIF_F_RXHASH | NETIF_F_RXCSUM |
- NETIF_F_HIGHDMA;
+ ndev->vlan_features = hw_features | NETIF_F_RXHASH | NETIF_F_RXCSUM;
ndev->features = hw_features | NETIF_F_RXHASH | NETIF_F_RXCSUM |
- NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HIGHDMA |
+ NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_CTAG_TX;

ndev->hw_features = hw_features;

ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_NDO_XMIT;
+ ndev->priv_flags |= IFF_HIGHDMA;

/* MTU range: 46 - 9600 */
ndev->min_mtu = ETH_ZLEN - ETH_HLEN;
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index fc78bc959ded..f69abca3759a 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -3797,7 +3797,7 @@ static int ql3xxx_probe(struct pci_dev *pdev,

qdev->msg_enable = netif_msg_init(debug, default_msg);

- ndev->features |= NETIF_F_HIGHDMA;
+ ndev->priv_flags |= IFF_HIGHDMA;
if (qdev->device_id == QL3032_DEVICE_ID)
ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 90df4a0909fa..1019ef4be20f 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2277,9 +2277,9 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev)

netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
NETIF_F_IPV6_CSUM | NETIF_F_GRO |
- NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HIGHDMA);
+ NETIF_F_HW_VLAN_CTAG_RX);
netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM |
- NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA);
+ NETIF_F_IPV6_CSUM);

if (QLCNIC_IS_TSO_CAPABLE(adapter)) {
netdev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
@@ -2312,7 +2312,7 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev)
}

netdev->hw_features = netdev->features;
- netdev->priv_flags |= IFF_UNICAST_FLT;
+ netdev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;
netdev->irq = adapter->msix_entries[0].vector;

/* MTU range: 68 - 9600 */
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index f5786d78ed23..8a65f29e82dc 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -1994,12 +1994,11 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;

if (pci_using_dac)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;

dev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
- dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
- NETIF_F_HIGHDMA;
+ dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;

/* MTU range: 60 - 4096 */
dev->min_mtu = CP_MIN_MTU;
diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
index 9ce0e8a64ba8..369d7347928b 100644
--- a/drivers/net/ethernet/realtek/8139too.c
+++ b/drivers/net/ethernet/realtek/8139too.c
@@ -1008,11 +1008,12 @@ static int rtl8139_init_one(struct pci_dev *pdev,
* through the use of skb_copy_and_csum_dev we enable these
* features
*/
- dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
dev->vlan_features = dev->features;

dev->hw_features |= NETIF_F_RXALL;
dev->hw_features |= NETIF_F_RXFCS;
+ dev->priv_flags |= IFF_HIGHDMA;

/* MTU range: 68 - 1770 */
dev->min_mtu = ETH_MIN_MTU;
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 6f1e6f386b7b..b486b0512c23 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5401,7 +5401,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)

if (sizeof(dma_addr_t) > 4 && tp->mac_version >= RTL_GIGA_MAC_VER_18 &&
!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)))
- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;

rtl_init_rxcfg(tp);

diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
index ecbe3994f2b1..03bdcf5c8fe6 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
@@ -2107,11 +2107,11 @@ struct sxgbe_priv_data *sxgbe_drv_probe(struct device *device,
ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_RXCSUM | NETIF_F_TSO | NETIF_F_TSO6 |
NETIF_F_GRO;
- ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
+ ndev->features |= ndev->hw_features;
ndev->watchdog_timeo = msecs_to_jiffies(TX_TIMEO);

/* assign filtering support */
- ndev->priv_flags |= IFF_UNICAST_FLT;
+ ndev->priv_flags |= IFF_UNICAST_FLT | IFF_HIGHDMA;

/* MTU range: 68 - 9000 */
ndev->min_mtu = MIN_MTU;
diff --git a/drivers/net/ethernet/sfc/ef100_netdev.c b/drivers/net/ethernet/sfc/ef100_netdev.c
index 7f7d560cb2b4..ed628a013d29 100644
--- a/drivers/net/ethernet/sfc/ef100_netdev.c
+++ b/drivers/net/ethernet/sfc/ef100_netdev.c
@@ -449,7 +449,8 @@ int ef100_probe_netdev(struct efx_probe_data *probe_data)
net_dev->hw_features |= efx->type->offload_features;
net_dev->hw_enc_features |= efx->type->offload_features;
net_dev->vlan_features |= NETIF_F_HW_CSUM | NETIF_F_SG |
- NETIF_F_HIGHDMA | NETIF_F_ALL_TSO;
+ NETIF_F_ALL_TSO;
+ net_dev->priv_flags |= IFF_HIGHDMA;
netif_set_tso_max_segs(net_dev,
ESE_EF100_DP_GZ_TSO_MAX_HDR_NUM_SEGS_DEFAULT);
efx->mdio.dev = net_dev;
diff --git a/drivers/net/ethernet/sfc/ef100_nic.c b/drivers/net/ethernet/sfc/ef100_nic.c
index 6da06931187d..270f2324c2d8 100644
--- a/drivers/net/ethernet/sfc/ef100_nic.c
+++ b/drivers/net/ethernet/sfc/ef100_nic.c
@@ -1222,7 +1222,7 @@ void ef100_remove(struct efx_nic *efx)
/* NIC level access functions
*/
#define EF100_OFFLOAD_FEATURES (NETIF_F_HW_CSUM | NETIF_F_RXCSUM | \
- NETIF_F_HIGHDMA | NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_NTUPLE | \
+ NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_NTUPLE | \
NETIF_F_RXHASH | NETIF_F_RXFCS | NETIF_F_TSO_ECN | NETIF_F_RXALL | \
NETIF_F_HW_VLAN_CTAG_TX)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index e9d9de8e648a..0873220702ce 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1021,8 +1021,7 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)

/* Mask for features that also apply to VLAN devices */
net_dev->vlan_features |= (NETIF_F_HW_CSUM | NETIF_F_SG |
- NETIF_F_HIGHDMA | NETIF_F_ALL_TSO |
- NETIF_F_RXCSUM);
+ NETIF_F_ALL_TSO | NETIF_F_RXCSUM);

/* Determine user configurable features */
net_dev->hw_features |= net_dev->features & ~efx->fixed_features;
@@ -1089,7 +1088,6 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
*probe_ptr = probe_data;
efx->net_dev = net_dev;
efx->type = (const struct efx_nic_type *) entry->driver_data;
- efx->fixed_features |= NETIF_F_HIGHDMA;

pci_set_drvdata(pci_dev, efx);
SET_NETDEV_DEV(net_dev, &pci_dev->dev);
diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c
index 1cb32aedd89c..3a4443fcf410 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -2873,7 +2873,6 @@ static int ef4_pci_probe(struct pci_dev *pci_dev,
return -ENOMEM;
efx = netdev_priv(net_dev);
efx->type = (const struct ef4_nic_type *) entry->driver_data;
- efx->fixed_features |= NETIF_F_HIGHDMA;

pci_set_drvdata(pci_dev, efx);
SET_NETDEV_DEV(net_dev, &pci_dev->dev);
@@ -2899,7 +2898,7 @@ static int ef4_pci_probe(struct pci_dev *pci_dev,
NETIF_F_RXCSUM);
/* Mask for features that also apply to VLAN devices */
net_dev->vlan_features |= (NETIF_F_HW_CSUM | NETIF_F_SG |
- NETIF_F_HIGHDMA | NETIF_F_RXCSUM);
+ NETIF_F_RXCSUM);

net_dev->hw_features = net_dev->features & ~efx->fixed_features;

diff --git a/drivers/net/ethernet/sfc/siena/efx.c b/drivers/net/ethernet/sfc/siena/efx.c
index 59d3a6043379..dcae1dc94f87 100644
--- a/drivers/net/ethernet/sfc/siena/efx.c
+++ b/drivers/net/ethernet/sfc/siena/efx.c
@@ -1003,8 +1003,7 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
net_dev->features &= ~NETIF_F_ALL_TSO;
/* Mask for features that also apply to VLAN devices */
net_dev->vlan_features |= (NETIF_F_HW_CSUM | NETIF_F_SG |
- NETIF_F_HIGHDMA | NETIF_F_ALL_TSO |
- NETIF_F_RXCSUM);
+ NETIF_F_ALL_TSO | NETIF_F_RXCSUM);

net_dev->hw_features |= net_dev->features & ~efx->fixed_features;

@@ -1053,7 +1052,6 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
return -ENOMEM;
efx = netdev_priv(net_dev);
efx->type = (const struct efx_nic_type *) entry->driver_data;
- efx->fixed_features |= NETIF_F_HIGHDMA;

pci_set_drvdata(pci_dev, efx);
SET_NETDEV_DEV(net_dev, &pci_dev->dev);
diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
index 98d0b561a057..3df3e03cf906 100644
--- a/drivers/net/ethernet/sgi/ioc3-eth.c
+++ b/drivers/net/ethernet/sgi/ioc3-eth.c
@@ -927,7 +927,8 @@ static int ioc3eth_probe(struct platform_device *pdev)
dev->netdev_ops = &ioc3_netdev_ops;
dev->ethtool_ops = &ioc3_ethtool_ops;
dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
- dev->features = NETIF_F_IP_CSUM | NETIF_F_HIGHDMA;
+ dev->features = NETIF_F_IP_CSUM;
+ dev->priv_flags |= IFF_HIGHDMA;

sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1);
sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2);
diff --git a/drivers/net/ethernet/silan/sc92031.c b/drivers/net/ethernet/silan/sc92031.c
index ff4197f5e46d..6f6e8779fcae 100644
--- a/drivers/net/ethernet/silan/sc92031.c
+++ b/drivers/net/ethernet/silan/sc92031.c
@@ -1437,8 +1437,8 @@ static int sc92031_probe(struct pci_dev *pdev, const struct pci_device_id *id)
SET_NETDEV_DEV(dev, &pdev->dev);

/* faked with skb_copy_and_csum_dev */
- dev->features = NETIF_F_SG | NETIF_F_HIGHDMA |
- NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
+ dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
+ dev->priv_flags |= IFF_HIGHDMA;

dev->netdev_ops = &sc92031_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index 5ab8b81b84e6..2de893dc95ac 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -2113,9 +2113,10 @@ static int netsec_probe(struct platform_device *pdev)
ndev->netdev_ops = &netsec_netdev_ops;
ndev->ethtool_ops = &netsec_ethtool_ops;

- ndev->features |= NETIF_F_HIGHDMA | NETIF_F_RXCSUM | NETIF_F_GSO |
+ ndev->features |= NETIF_F_RXCSUM | NETIF_F_GSO |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
ndev->hw_features = ndev->features;
+ ndev->priv_flags |= IFF_HIGHDMA;

ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_NDO_XMIT;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fe3498e86de9..07a5d97a6b8b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7666,7 +7666,7 @@ int stmmac_dvr_probe(struct device *device,
}
}

- ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
+ ndev->features |= ndev->hw_features;
ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
#ifdef STMMAC_VLAN_TAG_USED
/* Both mac100 and gmac support receive VLAN tag detection */
@@ -7723,7 +7723,7 @@ int stmmac_dvr_probe(struct device *device,
if (flow_ctrl)
priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */

- ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_HIGHDMA;

/* Setup channels NAPI */
stmmac_napi_add(ndev);
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index bfb903506367..c1c0947616fc 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -5037,7 +5037,7 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if ((cp->cas_flags & CAS_FLAG_NO_HW_CSUM) == 0)
dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;

- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;

/* MTU range: 60 - varies or 9000 */
dev->min_mtu = CAS_MIN_MTU;
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index f68aa813d4fb..98bf49ac3890 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -9802,7 +9802,7 @@ static int niu_pci_init_one(struct pci_dev *pdev,

err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(44));
if (!err)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;
if (err) {
err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
if (err) {
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index 9bd1df8308d2..958108efef2d 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -2993,7 +2993,7 @@ static int gem_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
dev->features = dev->hw_features;
if (pci_using_dac)
- dev->features |= NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;

/* MTU range: 68 - 1500 (Jumbo mode is broken) */
dev->min_mtu = GEM_MIN_MTU;
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index 5c44d27a9f48..7ad7e42b4bcd 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -1978,8 +1978,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ndev->if_port = port;
ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
- NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_RXCSUM |
- NETIF_F_HIGHDMA;
+ NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_RXCSUM;

ndev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
NETIF_F_TSO | NETIF_F_HW_VLAN_CTAG_TX;
@@ -2021,6 +2020,8 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
#ifdef BDX_LLTX
ndev->priv_flags |= IFF_LLTX;
#endif
+ ndev->priv_flags |= IFF_HIGHDMA;
+
/* MTU range: 60 - 16384 */
ndev->min_mtu = ETH_ZLEN;
ndev->max_mtu = BDX_MAX_MTU;
diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 554aff7c8f3b..f16564a5e57e 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -1600,7 +1600,7 @@ tsi108_init_one(struct platform_device *pdev)
* a new function skb_csum_dev() in net/core/skbuff.c).
*/

- dev->features = NETIF_F_HIGHDMA;
+ dev->priv_flags |= IFF_HIGHDMA;

spin_lock_init(&data->txlock);
spin_lock_init(&data->misclock);
diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
index fdd6b4f70b7a..d005cf3de5d9 100644
--- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
+++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
@@ -588,13 +588,13 @@ static int ngbe_probe(struct pci_dev *pdev,
/* copy netdev features into list of user selectable features */
netdev->hw_features |= netdev->features | NETIF_F_RXALL;
netdev->hw_features |= NETIF_F_NTUPLE | NETIF_F_HW_TC;
- netdev->features |= NETIF_F_HIGHDMA;
netdev->hw_features |= NETIF_F_GRO;
netdev->features |= NETIF_F_GRO;

netdev->priv_flags |= IFF_UNICAST_FLT;
netdev->priv_flags |= IFF_SUPP_NOFCS;
netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ netdev->priv_flags |= IFF_HIGHDMA;

netdev->min_mtu = ETH_MIN_MTU;
netdev->max_mtu = WX_MAX_JUMBO_FRAME_SIZE -
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
index bd4624d14ca0..8f8e428b1d7f 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
@@ -551,13 +551,13 @@ static int txgbe_probe(struct pci_dev *pdev,
/* copy netdev features into list of user selectable features */
netdev->hw_features |= netdev->features | NETIF_F_RXALL;
netdev->hw_features |= NETIF_F_NTUPLE | NETIF_F_HW_TC;
- netdev->features |= NETIF_F_HIGHDMA;
netdev->hw_features |= NETIF_F_GRO;
netdev->features |= NETIF_F_GRO;

netdev->priv_flags |= IFF_UNICAST_FLT;
netdev->priv_flags |= IFF_SUPP_NOFCS;
netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ netdev->priv_flags |= IFF_HIGHDMA;

netdev->min_mtu = ETH_MIN_MTU;
netdev->max_mtu = WX_MAX_JUMBO_FRAME_SIZE -
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 1072e2210aed..09aa5c87e9c3 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -1405,7 +1405,6 @@ static int temac_probe(struct platform_device *pdev)
ndev->features |= NETIF_F_IP_CSUM; /* Can checksum TCP/UDP over IPv4. */
ndev->features |= NETIF_F_HW_CSUM; /* Can checksum all the packets. */
ndev->features |= NETIF_F_IPV6_CSUM; /* Can checksum IPV6 TCP/UDP */
- ndev->features |= NETIF_F_HIGHDMA; /* Can DMA to high memory. */
ndev->features |= NETIF_F_HW_VLAN_CTAG_TX; /* Transmit VLAN hw accel */
ndev->features |= NETIF_F_HW_VLAN_CTAG_RX; /* Receive VLAN hw acceleration */
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; /* Receive VLAN filtering */
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 11831a1c9762..3323c7e5310f 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -2602,10 +2602,10 @@ static int netvsc_probe(struct hv_device *dev,
schedule_work(&nvdev->subchan_work);

/* hw_features computed in rndis_netdev_set_hwcaps() */
- net->features = net->hw_features |
- NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_CTAG_TX |
+ net->features = net->hw_features | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX;
net->vlan_features = net->features;
+ net->priv_flags |= IFF_HIGHDMA;

netdev_lockdep_set_classes(net);

diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 2c1b5def4a0b..f7ea7dea7bf2 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -290,8 +290,7 @@ static const struct ethtool_ops ifb_ethtool_ops = {

#define IFB_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_FRAGLIST | \
NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL | \
- NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_CTAG_TX | \
- NETIF_F_HW_VLAN_STAG_TX)
+ NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX)

static void ifb_dev_free(struct net_device *dev)
{
@@ -325,6 +324,7 @@ static void ifb_setup(struct net_device *dev)

dev->flags |= IFF_NOARP;
dev->flags &= ~IFF_MULTICAST;
+ dev->priv_flags |= IFF_HIGHDMA;
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
netif_keep_dst(dev);
eth_hw_addr_random(dev);
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 5a2e7fc397e1..62b4372dc205 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -117,7 +117,7 @@ static void ipvlan_port_destroy(struct net_device *dev)
(IPVLAN_ALWAYS_ON_OFLOADS | NETIF_F_VLAN_CHALLENGED)

#define IPVLAN_FEATURES \
- (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
+ (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST | \
NETIF_F_GSO | NETIF_F_ALL_TSO | NETIF_F_GSO_ROBUST | \
NETIF_F_GRO | NETIF_F_RXCSUM | \
NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER)
@@ -141,7 +141,7 @@ static int ipvlan_init(struct net_device *dev)
dev->vlan_features = phy_dev->vlan_features & IPVLAN_FEATURES;
dev->vlan_features |= IPVLAN_ALWAYS_ON_OFLOADS;
dev->hw_enc_features |= dev->features;
- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LLTX | (phy_dev->priv_flags & IFF_HIGHDMA);
netif_inherit_tso_max(dev, phy_dev);
dev->hard_header_len = phy_dev->hard_header_len;

diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 860f1a3df838..a9ca447774ec 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -175,7 +175,7 @@ static void gen_lo_setup(struct net_device *dev,
dev->type = ARPHRD_LOOPBACK; /* 0x0001*/
dev->flags = IFF_LOOPBACK;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LOGICAL;
- dev->priv_flags |= IFF_NETNS_LOCAL;
+ dev->priv_flags |= IFF_NETNS_LOCAL | IFF_HIGHDMA;
netif_keep_dst(dev);
dev->hw_features = NETIF_F_GSO_SOFTWARE;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
@@ -183,7 +183,6 @@ static void gen_lo_setup(struct net_device *dev,
| NETIF_F_HW_CSUM
| NETIF_F_RXCSUM
| NETIF_F_SCTP_CRC
- | NETIF_F_HIGHDMA
| NETIF_F_VLAN_CHALLENGED
| NETIF_F_LOOPBACK;
dev->ethtool_ops = eth_ops;
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 5146feb52be7..4adb34f2fa45 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -3511,7 +3511,7 @@ static netdev_tx_t macsec_start_xmit(struct sk_buff *skb,
}

#define MACSEC_FEATURES \
- (NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST)
+ (NETIF_F_SG | NETIF_F_FRAGLIST)

static int macsec_dev_init(struct net_device *dev)
{
@@ -3525,7 +3525,7 @@ static int macsec_dev_init(struct net_device *dev)

dev->features = real_dev->features & MACSEC_FEATURES;
dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LLTX | (real_dev->priv_flags & IFF_HIGHDMA);
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;

macsec_set_head_tail_room(dev);
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index d8fca9e355cf..040546613ebc 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -903,10 +903,10 @@ static struct lock_class_key macvlan_netdev_addr_lock_key;
#define ALWAYS_ON_FEATURES ALWAYS_ON_OFFLOADS

#define MACVLAN_FEATURES \
- (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
- NETIF_F_GSO | NETIF_F_TSO | NETIF_F_LRO | \
- NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \
- NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER)
+ (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST | NETIF_F_GSO | \
+ NETIF_F_TSO | NETIF_F_LRO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | \
+ NETIF_F_GRO | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_FILTER | \
+ NETIF_F_HW_VLAN_STAG_FILTER)

#define MACVLAN_STATE_MASK \
((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT))
@@ -933,6 +933,7 @@ static int macvlan_init(struct net_device *dev)
dev->vlan_features |= ALWAYS_ON_OFFLOADS;
dev->hw_enc_features |= dev->features;
dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= (lowerdev->priv_flags & IFF_HIGHDMA);
netif_inherit_tso_max(dev, lowerdev);
dev->hard_header_len = lowerdev->hard_header_len;
macvlan_set_lockdep_class(dev);
diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index 8b8a84ed88b0..53e6e05939fa 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -379,10 +379,9 @@ static void net_failover_compute_features(struct net_device *dev)
NETIF_F_ALL_FOR_ALL;
netdev_features_t enc_features = FAILOVER_ENC_FEATURES;
unsigned short max_hard_header_len = ETH_HLEN;
- unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
- IFF_XMIT_DST_RELEASE_PERM;
struct net_failover_info *nfo_info = netdev_priv(dev);
struct net_device *primary_dev, *standby_dev;
+ u64 priv_flags = FAILOVER_PRIV_FLAGS;

primary_dev = rcu_dereference(nfo_info->primary_dev);
if (primary_dev) {
@@ -395,7 +394,12 @@ static void net_failover_compute_features(struct net_device *dev)
primary_dev->hw_enc_features,
FAILOVER_ENC_FEATURES);

- dst_release_flag &= primary_dev->priv_flags;
+ priv_flags &= IFF_ALL_FOR_ALL;
+ priv_flags =
+ netdev_increment_priv_flags(priv_flags,
+ primary_dev->priv_flags,
+ FAILOVER_PRIV_FLAGS);
+
if (primary_dev->hard_header_len > max_hard_header_len)
max_hard_header_len = primary_dev->hard_header_len;
}
@@ -411,7 +415,13 @@ static void net_failover_compute_features(struct net_device *dev)
standby_dev->hw_enc_features,
FAILOVER_ENC_FEATURES);

- dst_release_flag &= standby_dev->priv_flags;
+ if (!primary_dev)
+ priv_flags &= IFF_ALL_FOR_ALL;
+ priv_flags =
+ netdev_increment_priv_flags(priv_flags,
+ standby_dev->priv_flags,
+ FAILOVER_PRIV_FLAGS);
+
if (standby_dev->hard_header_len > max_hard_header_len)
max_hard_header_len = standby_dev->hard_header_len;
}
@@ -420,11 +430,7 @@ static void net_failover_compute_features(struct net_device *dev)
dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
dev->hard_header_len = max_hard_header_len;

- dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
- if (dst_release_flag == (IFF_XMIT_DST_RELEASE |
- IFF_XMIT_DST_RELEASE_PERM))
- dev->priv_flags |= IFF_XMIT_DST_RELEASE;
-
+ netdev_increment_priv_flags_finalize(dev, priv_flags);
netdev_change_features(dev);
}

diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index 8330bc0bcb7e..1082970c4314 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -338,9 +338,9 @@ static void nsim_setup(struct net_device *dev)
dev->tx_queue_len = 0;
dev->flags &= ~IFF_MULTICAST;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE |
- IFF_NO_QUEUE;
- dev->features |= NETIF_F_HIGHDMA |
- NETIF_F_SG |
+ IFF_NO_QUEUE |
+ IFF_HIGHDMA;
+ dev->features |= NETIF_F_SG |
NETIF_F_FRAGLIST |
NETIF_F_HW_CSUM |
NETIF_F_TSO;
diff --git a/drivers/net/netkit.c b/drivers/net/netkit.c
index bd7abb2d6c7b..5c6028532bcb 100644
--- a/drivers/net/netkit.c
+++ b/drivers/net/netkit.c
@@ -229,7 +229,6 @@ static void netkit_setup(struct net_device *dev)
NETIF_F_HW_CSUM |
NETIF_F_RXCSUM |
NETIF_F_SCTP_CRC |
- NETIF_F_HIGHDMA |
NETIF_F_GSO_SOFTWARE |
NETIF_F_GSO_ENCAP_ALL;

@@ -242,6 +241,7 @@ static void netkit_setup(struct net_device *dev)
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
dev->priv_flags |= IFF_PHONY_HEADROOM;
dev->priv_flags |= IFF_LOGICAL;
+ dev->priv_flags |= IFF_HIGHDMA;

dev->ethtool_ops = &netkit_ethtool_ops;
dev->netdev_ops = &netkit_netdev_ops;
diff --git a/drivers/net/nlmon.c b/drivers/net/nlmon.c
index e319a0d0771d..a2312a91f214 100644
--- a/drivers/net/nlmon.c
+++ b/drivers/net/nlmon.c
@@ -62,13 +62,13 @@ static const struct net_device_ops nlmon_ops = {
static void nlmon_setup(struct net_device *dev)
{
dev->type = ARPHRD_NETLINK;
- dev->priv_flags |= IFF_LOGICAL;
+ dev->priv_flags |= IFF_LOGICAL | IFF_HIGHDMA;

dev->netdev_ops = &nlmon_ops;
dev->ethtool_ops = &nlmon_ethtool_ops;
dev->needs_free_netdev = true;

- dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
+ dev->features = NETIF_F_SG | NETIF_F_FRAGLIST;
dev->flags = IFF_NOARP;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_LSTATS;

diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
index 536bd6564f8b..9bc277a77dc9 100644
--- a/drivers/net/ntb_netdev.c
+++ b/drivers/net/ntb_netdev.c
@@ -420,9 +420,8 @@ static int ntb_netdev_probe(struct device *client_dev)
dev = netdev_priv(ndev);
dev->ndev = ndev;
dev->pdev = pdev;
- ndev->features = NETIF_F_HIGHDMA;

- ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_HIGHDMA;

ndev->hw_features = ndev->features;
ndev->watchdog_timeo = msecs_to_jiffies(NTB_TX_TIMEOUT_MS);
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 9f0495e8df4d..c71d2c709ea1 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -548,7 +548,8 @@ static int tap_open(struct inode *inode, struct file *file)
* The macvlan supports zerocopy iff the lower device supports zero
* copy so we don't have to look at the lower device directly.
*/
- if ((tap->dev->features & NETIF_F_HIGHDMA) && (tap->dev->features & NETIF_F_SG))
+ if ((tap->dev->priv_flags & IFF_HIGHDMA) &&
+ (tap->dev->features & NETIF_F_SG))
sock_set_flag(&q->sk, SOCK_ZEROCOPY);

err = tap_set_queue(tap, file, q);
diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index 0fcb3b9ac4af..4393f94838c7 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -983,20 +983,23 @@ static void team_port_disable(struct team *team,

#define TEAM_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | \
- NETIF_F_HIGHDMA | NETIF_F_LRO)
+ NETIF_F_LRO)

#define TEAM_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE)

+#define TEAM_PRIV_FLAGS (IFF_XMIT_DST_RELEASE | \
+ IFF_XMIT_DST_RELEASE_PERM | \
+ IFF_HIGHDMA)
+
static void __team_compute_features(struct team *team)
{
struct team_port *port;
netdev_features_t vlan_features = TEAM_VLAN_FEATURES &
NETIF_F_ALL_FOR_ALL;
netdev_features_t enc_features = TEAM_ENC_FEATURES;
+ u64 priv_flags = TEAM_PRIV_FLAGS & IFF_ALL_FOR_ALL;
unsigned short max_hard_header_len = ETH_HLEN;
- unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
- IFF_XMIT_DST_RELEASE_PERM;

rcu_read_lock();
list_for_each_entry_rcu(port, &team->port_list, list) {
@@ -1008,8 +1011,10 @@ static void __team_compute_features(struct team *team)
port->dev->hw_enc_features,
TEAM_ENC_FEATURES);

+ priv_flags = netdev_increment_priv_flags(priv_flags,
+ port->dev->priv_flags,
+ TEAM_PRIV_FLAGS);

- dst_release_flag &= port->dev->priv_flags;
if (port->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = port->dev->hard_header_len;
}
@@ -1021,9 +1026,7 @@ static void __team_compute_features(struct team *team)
NETIF_F_HW_VLAN_STAG_TX;
team->dev->hard_header_len = max_hard_header_len;

- team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
- if (dst_release_flag == (IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM))
- team->dev->priv_flags |= IFF_XMIT_DST_RELEASE;
+ netdev_increment_priv_flags_finalize(team->dev, priv_flags);
}

static void team_compute_features(struct team *team)
diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c
index 0a53ec293d04..e7b4e4d5f2e8 100644
--- a/drivers/net/thunderbolt/main.c
+++ b/drivers/net/thunderbolt/main.c
@@ -1328,7 +1328,8 @@ static int tbnet_probe(struct tb_service *svc, const struct tb_service_id *id)
*/
dev->hw_features = NETIF_F_SG | NETIF_F_ALL_TSO | NETIF_F_GRO |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
- dev->features = dev->hw_features | NETIF_F_HIGHDMA;
+ dev->features = dev->hw_features;
+ dev->priv_flags |= IFF_HIGHDMA;
dev->hard_header_len += sizeof(struct thunderbolt_ip_frame_header);

netif_napi_add(dev, &net->napi, tbnet_poll);
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 5d6aeb086fc7..8420bd92ab50 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -9833,8 +9833,9 @@ static int rtl8152_probe_once(struct usb_interface *intf,
NETIF_F_IPV6_CSUM | NETIF_F_TSO6 |
NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX;
netdev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
- NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
- NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
+ NETIF_F_FRAGLIST | NETIF_F_IPV6_CSUM |
+ NETIF_F_TSO6;
+ netdev->priv_flags |= IFF_HIGHDMA;

if (tp->version == RTL_VER_01) {
netdev->features &= ~NETIF_F_RXCSUM;
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index f17c5aab1f78..c39911122b75 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1682,7 +1682,7 @@ static const struct xdp_metadata_ops veth_xdp_metadata_ops = {
};

#define VETH_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HW_CSUM | \
- NETIF_F_RXCSUM | NETIF_F_SCTP_CRC | NETIF_F_HIGHDMA | \
+ NETIF_F_RXCSUM | NETIF_F_SCTP_CRC | \
NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL | \
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | \
NETIF_F_HW_VLAN_STAG_TX | NETIF_F_HW_VLAN_STAG_RX )
@@ -1695,6 +1695,7 @@ static void veth_setup(struct net_device *dev)
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
dev->priv_flags |= IFF_LOGICAL;
dev->priv_flags |= IFF_PHONY_HEADROOM;
+ dev->priv_flags |= IFF_HIGHDMA;

dev->netdev_ops = &veth_netdev_ops;
dev->xdp_metadata_ops = &veth_xdp_metadata_ops;
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index c22d1118a133..c87d990b3156 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -4648,9 +4648,8 @@ static int virtnet_probe(struct virtio_device *vdev)

/* Set up network device as normal. */
dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE |
- IFF_TX_SKB_NO_LINEAR;
+ IFF_TX_SKB_NO_LINEAR | IFF_HIGHDMA;
dev->netdev_ops = &virtnet_netdev;
- dev->features = NETIF_F_HIGHDMA;

dev->ethtool_ops = &virtnet_ethtool_ops;
SET_NETDEV_DEV(dev, &vdev->dev);
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 0578864792b6..8de901f9546b 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -3507,7 +3507,7 @@ vmxnet3_declare_features(struct vmxnet3_adapter *adapter)
netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
NETIF_F_HW_CSUM | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_TSO | NETIF_F_TSO6 |
- NETIF_F_LRO | NETIF_F_HIGHDMA;
+ NETIF_F_LRO;

if (VMXNET3_VERSION_GE_4(adapter)) {
netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL |
@@ -3572,6 +3572,7 @@ vmxnet3_declare_features(struct vmxnet3_adapter *adapter)
~(NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX);
netdev->features = netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
+ netdev->priv_flags |= IFF_HIGHDMA;
}


diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 48c84ec3227c..9f83061e3f86 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1661,7 +1661,7 @@ static void vrf_setup(struct net_device *dev)
/* enable offload features */
dev->features |= NETIF_F_GSO_SOFTWARE;
dev->features |= NETIF_F_RXCSUM | NETIF_F_HW_CSUM | NETIF_F_SCTP_CRC;
- dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
+ dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST;

dev->hw_features = dev->features;
dev->hw_enc_features = dev->features;
@@ -1669,6 +1669,7 @@ static void vrf_setup(struct net_device *dev)
dev->priv_flags |= IFF_LOGICAL | IFF_NETNS_LOCAL;
dev->priv_flags |= IFF_NO_RX_HANDLER;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ dev->priv_flags |= IFF_HIGHDMA;

/* VRF devices do not care about MTU, but if the MTU is set
* too low then the ipv4 and ipv6 protocols are disabled
diff --git a/drivers/net/vsockmon.c b/drivers/net/vsockmon.c
index f0903f66d137..f3af8846dac5 100644
--- a/drivers/net/vsockmon.c
+++ b/drivers/net/vsockmon.c
@@ -82,13 +82,13 @@ static const struct ethtool_ops vsockmon_ethtool_ops = {
static void vsockmon_setup(struct net_device *dev)
{
dev->type = ARPHRD_VSOCKMON;
- dev->priv_flags |= IFF_LOGICAL;
+ dev->priv_flags |= IFF_LOGICAL | IFF_HIGHDMA;

dev->netdev_ops = &vsockmon_ops;
dev->ethtool_ops = &vsockmon_ethtool_ops;
dev->needs_free_netdev = true;

- dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
+ dev->features = NETIF_F_SG | NETIF_F_FRAGLIST;

dev->flags = IFF_NOARP;

diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c
index ef1a05e1b46e..d44d573d4b97 100644
--- a/drivers/net/wireguard/device.c
+++ b/drivers/net/wireguard/device.c
@@ -276,7 +276,7 @@ static void wg_setup(struct net_device *dev)
struct wg_device *wg = netdev_priv(dev);
enum { WG_NETDEV_FEATURES = NETIF_F_HW_CSUM | NETIF_F_RXCSUM |
NETIF_F_SG | NETIF_F_GSO |
- NETIF_F_GSO_SOFTWARE | NETIF_F_HIGHDMA };
+ NETIF_F_GSO_SOFTWARE };
const int overhead = MESSAGE_MINIMUM_LENGTH + sizeof(struct udphdr) +
max(sizeof(struct ipv6hdr), sizeof(struct iphdr));

@@ -288,7 +288,7 @@ static void wg_setup(struct net_device *dev)
dev->needed_tailroom = noise_encrypted_len(MESSAGE_PADDING_MULTIPLE);
dev->type = ARPHRD_NONE;
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
- dev->priv_flags |= IFF_LOGICAL;
+ dev->priv_flags |= IFF_LOGICAL | IFF_HIGHDMA;
dev->features |= WG_NETDEV_FEATURES;
dev->hw_features |= WG_NETDEV_FEATURES;
dev->hw_enc_features |= WG_NETDEV_FEATURES;
diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
index 52b008ce53bd..6b0599e731f0 100644
--- a/drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
@@ -96,8 +96,10 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
ieee80211_hw_set(hw, WANT_MONITOR_VIF);

- if (priv->trans->max_skb_frags)
- hw->netdev_features = NETIF_F_HIGHDMA | NETIF_F_SG;
+ if (priv->trans->max_skb_frags) {
+ hw->netdev_features = NETIF_F_SG;
+ hw->netdev_priv_flags = IFF_HIGHDMA;
+ }

hw->offchannel_tx_hw_queue = IWL_AUX_QUEUE;
hw->radiotap_mcs_details |= IEEE80211_RADIOTAP_MCS_HAVE_FMT;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index ac7d986d9cd7..98766c2829b8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -417,8 +417,10 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
if (mvm->trans->num_rx_queues > 1)
ieee80211_hw_set(hw, USES_RSS);

- if (mvm->trans->max_skb_frags)
- hw->netdev_features = NETIF_F_HIGHDMA | NETIF_F_SG;
+ if (mvm->trans->max_skb_frags) {
+ hw->netdev_features = NETIF_F_SG;
+ hw->netdev_priv_flags = IFF_HIGHDMA;
+ }

hw->queues = IEEE80211_NUM_ACS;
hw->offchannel_tx_hw_queue = IWL_MVM_OFFCHANNEL_QUEUE;
diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c
index 8c5aaf860635..4ed791a02a35 100644
--- a/drivers/usb/fotg210/fotg210-hcd.c
+++ b/drivers/usb/fotg210/fotg210-hcd.c
@@ -5015,7 +5015,7 @@ static int fotg210_run(struct usb_hcd *hcd)
* can return segments above 4GB, if the device allows.
*
* NOTE: the dma mask is visible through dev->dma_mask, so
- * drivers can pass this info along ... like NETIF_F_HIGHDMA,
+ * drivers can pass this info along ... IFF_HIGHDMA,
* Scsi_Host.highmem_io, and so forth. It's readonly to all
* host side drivers though.
*/
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 802bfafb1012..b8d3cc2a422a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -592,7 +592,7 @@ static int ehci_run (struct usb_hcd *hcd)
* can return segments above 4GB, if the device allows.
*
* NOTE: the dma mask is visible through dev->dma_mask, so
- * drivers can pass this info along ... like NETIF_F_HIGHDMA,
+ * drivers can pass this info along ... like IFF_HIGHDMA,
* Scsi_Host.highmem_io, and so forth. It's readonly to all
* host side drivers though.
*/
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index d467472f9d3c..13963a9a3eea 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -3135,7 +3135,7 @@ static int oxu_run(struct usb_hcd *hcd)
* can return segments above 4GB, if the device allows.
*
* NOTE: the dma mask is visible through dev->dma_mask, so
- * drivers can pass this info along ... like NETIF_F_HIGHDMA,
+ * drivers can pass this info along ... like IFF_HIGHDMA,
* Scsi_Host.highmem_io, and so forth. It's readonly to all
* host side drivers though.
*/
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 90b649a51199..421419ebac41 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -563,14 +563,13 @@ static int vlan_dev_init(struct net_device *dev)
dev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG |
NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE |
NETIF_F_GSO_ENCAP_ALL |
- NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC |
- NETIF_F_ALL_FCOE;
+ NETIF_F_SCTP_CRC | NETIF_F_ALL_FCOE;

if (real_dev->vlan_features & NETIF_F_HW_MACSEC)
dev->hw_features |= NETIF_F_HW_MACSEC;

dev->features |= dev->hw_features;
- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LLTX | (real_dev->priv_flags & IFF_HIGHDMA);
netif_inherit_tso_max(dev, real_dev);
if (dev->features & NETIF_F_VLAN_FEATURES)
netdev_warn(real_dev, "VLAN features are set incorrectly. Q-in-Q configurations may not work correctly.\n");
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index a4410a8d5993..3fc6e2469648 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -18,7 +18,7 @@
#include <linux/uaccess.h>
#include "br_private.h"

-#define COMMON_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | \
+#define COMMON_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | \
NETIF_F_GSO_MASK | NETIF_F_HW_CSUM)

const struct nf_br_ops __rcu *nf_br_ops __read_mostly;
@@ -481,6 +481,7 @@ void br_dev_setup(struct net_device *dev)
dev->ethtool_ops = &br_ethtool_ops;
SET_NETDEV_DEVTYPE(dev, &br_type);
dev->priv_flags = IFF_EBRIDGE | IFF_LOGICAL | IFF_NETNS_LOCAL;
+ dev->priv_flags |= IFF_HIGHDMA;

dev->features = COMMON_FEATURES | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX;
diff --git a/net/core/dev.c b/net/core/dev.c
index 1022ab4c0b89..2e20db77d5d6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3411,7 +3411,7 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
#ifdef CONFIG_HIGHMEM
int i;

- if (!(dev->features & NETIF_F_HIGHDMA)) {
+ if (!(dev->priv_flags & IFF_HIGHDMA)) {
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];

@@ -10327,10 +10327,6 @@ int register_netdevice(struct net_device *dev)
if (dev->hw_enc_features & NETIF_F_TSO)
dev->hw_enc_features |= NETIF_F_TSO_MANGLEID;

- /* Make NETIF_F_HIGHDMA inheritable to VLAN devices.
- */
- dev->vlan_features |= NETIF_F_HIGHDMA;
-
/* Make NETIF_F_SG inheritable to tunnel devices.
*/
dev->hw_enc_features |= NETIF_F_SG | NETIF_F_GSO_PARTIAL;
@@ -11501,6 +11497,27 @@ netdev_features_t netdev_increment_features(netdev_features_t all,
}
EXPORT_SYMBOL(netdev_increment_features);

+u64 netdev_increment_priv_flags(u64 all, u64 one, u64 mask)
+{
+ all |= one & IFF_ONE_FOR_ALL & mask;
+ all &= one | ~IFF_ALL_FOR_ALL;
+
+ return all;
+}
+EXPORT_SYMBOL(netdev_increment_priv_flags);
+
+void netdev_increment_priv_flags_finalize(struct net_device *dev,
+ u64 priv_flags)
+{
+ dev->priv_flags |= priv_flags;
+
+ dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
+ if ((priv_flags & (IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM)) ==
+ (IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM))
+ dev->priv_flags |= IFF_XMIT_DST_RELEASE;
+}
+EXPORT_SYMBOL(netdev_increment_priv_flags_finalize);
+
static struct hlist_head * __net_init netdev_create_hash(void)
{
int i;
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 66c8b6739260..64c736e897e9 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -13,7 +13,6 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
[NETIF_F_IP_CSUM_BIT] = "tx-checksum-ipv4",
[NETIF_F_HW_CSUM_BIT] = "tx-checksum-ip-generic",
[NETIF_F_IPV6_CSUM_BIT] = "tx-checksum-ipv6",
- [NETIF_F_HIGHDMA_BIT] = "highdma",
[NETIF_F_FRAGLIST_BIT] = "tx-scatter-gather-fraglist",
[NETIF_F_HW_VLAN_CTAG_TX_BIT] = "tx-vlan-hw-insert",

diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index 066e30ea5042..be1df345b841 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -499,10 +499,11 @@ void hsr_dev_setup(struct net_device *dev)
dev->netdev_ops = &hsr_device_ops;
SET_NETDEV_DEVTYPE(dev, &hsr_type);
dev->priv_flags |= IFF_LOGICAL | IFF_DISABLE_NETPOLL | IFF_NETNS_LOCAL;
+ dev->priv_flags |= IFF_HIGHDMA;

dev->needs_free_netdev = true;

- dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
+ dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST |
NETIF_F_GSO_MASK | NETIF_F_HW_CSUM |
NETIF_F_HW_VLAN_CTAG_TX;

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 01f217190e25..597a449d8c17 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -975,7 +975,6 @@ static const struct net_device_ops ipgre_netdev_ops = {

#define GRE_FEATURES (NETIF_F_SG | \
NETIF_F_FRAGLIST | \
- NETIF_F_HIGHDMA | \
NETIF_F_HW_CSUM)

static void ipgre_tunnel_setup(struct net_device *dev)
@@ -1011,7 +1010,7 @@ static void __gre_tunnel_init(struct net_device *dev)
dev->features |= NETIF_F_GSO_SOFTWARE;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;

- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LLTX | IFF_HIGHDMA;
}

static int ipgre_tunnel_init(struct net_device *dev)
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 2ef9a06b0e34..5e9284da19a0 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -366,7 +366,6 @@ static const struct net_device_ops ipip_netdev_ops = {

#define IPIP_FEATURES (NETIF_F_SG | \
NETIF_F_FRAGLIST | \
- NETIF_F_HIGHDMA | \
NETIF_F_GSO_SOFTWARE | \
NETIF_F_HW_CSUM)

@@ -378,7 +377,7 @@ static void ipip_tunnel_setup(struct net_device *dev)
dev->type = ARPHRD_TUNNEL;
dev->flags = IFF_NOARP;
dev->addr_len = 4;
- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LLTX | IFF_HIGHDMA;
netif_keep_dst(dev);

dev->features |= IPIP_FEATURES;
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 36a5f8997fc2..9a85c8b520c1 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1465,7 +1465,6 @@ static void ip6gre_tunnel_setup(struct net_device *dev)

#define GRE6_FEATURES (NETIF_F_SG | \
NETIF_F_FRAGLIST | \
- NETIF_F_HIGHDMA | \
NETIF_F_HW_CSUM)

static void ip6gre_tnl_init_features(struct net_device *dev)
@@ -1487,7 +1486,7 @@ static void ip6gre_tnl_init_features(struct net_device *dev)
dev->features |= NETIF_F_GSO_SOFTWARE;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;

- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LLTX | IFF_HIGHDMA;
}

static int ip6gre_tunnel_init_common(struct net_device *dev)
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 206a936427da..ebcd52e9d1dc 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1824,7 +1824,6 @@ static const struct net_device_ops ip6_tnl_netdev_ops = {

#define IPXIPX_FEATURES (NETIF_F_SG | \
NETIF_F_FRAGLIST | \
- NETIF_F_HIGHDMA | \
NETIF_F_GSO_SOFTWARE | \
NETIF_F_HW_CSUM)

@@ -1846,7 +1845,7 @@ static void ip6_tnl_dev_setup(struct net_device *dev)
dev->type = ARPHRD_TUNNEL6;
dev->flags |= IFF_NOARP;
dev->addr_len = sizeof(struct in6_addr);
- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LLTX | IFF_HIGHDMA;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
netif_keep_dst(dev);

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 23df3c0638d6..02d344c4ebd1 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1414,7 +1414,6 @@ static void ipip6_dev_free(struct net_device *dev)

#define SIT_FEATURES (NETIF_F_SG | \
NETIF_F_FRAGLIST | \
- NETIF_F_HIGHDMA | \
NETIF_F_GSO_SOFTWARE | \
NETIF_F_HW_CSUM)

@@ -1435,7 +1434,7 @@ static void ipip6_tunnel_setup(struct net_device *dev)
dev->flags = IFF_NOARP;
netif_keep_dst(dev);
dev->addr_len = 4;
- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LLTX | IFF_HIGHDMA;
dev->features |= SIT_FEATURES;
dev->hw_features |= SIT_FEATURES;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 395de62d9cb2..e64003fa1b73 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -2191,6 +2191,8 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,

ndev->features |= local->hw.netdev_features;
ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+ ndev->priv_flags |= local->hw.netdev_priv_flags &
+ MAC80211_SUPPORTED_PRIV_FLAGS;
ndev->hw_features |= ndev->features &
MAC80211_SUPPORTED_FEATURES_TX;
sdata->vif.netdev_features = local->hw.netdev_features;
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index e916b95a8d28..dc22a4c88940 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -102,13 +102,13 @@ static void do_setup(struct net_device *netdev)

netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_OPENVSWITCH |
- IFF_LOGICAL;
+ IFF_LOGICAL | IFF_HIGHDMA;
netdev->needs_free_netdev = true;
netdev->priv_destructor = NULL;
netdev->ethtool_ops = &internal_dev_ethtool_ops;
netdev->rtnl_link_ops = &internal_dev_link_ops;

- netdev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
+ netdev->features = NETIF_F_SG | NETIF_F_FRAGLIST |
NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE |
NETIF_F_GSO_ENCAP_ALL;

--
2.44.0


2024-04-05 13:43:04

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH RFC net-next 1/7] netdev_features: remove unused __UNUSED_NETIF_F_1

NETIF_F_NO_CSUM was removed in 3.2-rc2 by commit 34324dc2bf27
("net: remove NETIF_F_NO_CSUM feature bit") and became
__UNUSED_NETIF_F_1. It's not used anywhere in the code.
Remove this bit waste.

Signed-off-by: Alexander Lobakin <[email protected]>
---
include/linux/netdev_features.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 7c2d77d75a88..44c428d62db4 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -14,7 +14,6 @@ typedef u64 netdev_features_t;
enum {
NETIF_F_SG_BIT, /* Scatter/gather IO. */
NETIF_F_IP_CSUM_BIT, /* Can checksum TCP/UDP over IPv4. */
- __UNUSED_NETIF_F_1,
NETIF_F_HW_CSUM_BIT, /* Can checksum all the packets. */
NETIF_F_IPV6_CSUM_BIT, /* Can checksum TCP/UDP over IPV6 */
NETIF_F_HIGHDMA_BIT, /* Can DMA to high memory. */
--
2.44.0


2024-04-05 13:43:56

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH RFC net-next 3/7] netdevice: introduce IFF_LOGICAL as (IFF_NO_QUEUE | IFF_LLTX)

These two are often used together when creating logical interfaces w/o
locking and Qdisc overhead.
Introduce a shorthand to avoid repeating the same pattern.

Signed-off-by: Alexander Lobakin <[email protected]>
---
include/linux/netdevice.h | 3 +++
drivers/net/amt.c | 2 +-
drivers/net/bareudp.c | 2 +-
drivers/net/bonding/bond_main.c | 4 +---
drivers/net/dummy.c | 2 +-
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 2 +-
drivers/net/geneve.c | 2 +-
drivers/net/gtp.c | 2 +-
drivers/net/loopback.c | 3 +--
drivers/net/net_failover.c | 2 +-
drivers/net/netkit.c | 3 +--
drivers/net/nlmon.c | 2 +-
drivers/net/team/team_core.c | 4 ++--
drivers/net/veth.c | 3 +--
drivers/net/vrf.c | 4 +---
drivers/net/vsockmon.c | 2 +-
drivers/net/vxlan/vxlan_core.c | 2 +-
drivers/net/wireguard/device.c | 2 +-
net/batman-adv/soft-interface.c | 2 +-
net/bridge/br_device.c | 2 +-
net/core/net-sysfs.c | 2 +-
net/hsr/hsr_device.c | 2 +-
net/openvswitch/vport-internal_dev.c | 2 +-
23 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 065dd68fe97c..5234dd2144eb 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1651,6 +1651,8 @@ struct net_device_ops {
* even if those aren't HWTSTAMP_SOURCE_NETDEV.
@ @IFF_LLTX: device supports lockless Tx. Mainly used by logical interfaces,
* such as tunnels.
+ * @IFF_LOGICAL: combines @IFF_NO_QUEUE and @IFF_LLTX, used by logical
+ * interfaces to avoid overhead from locking and Qdisc.
*/
enum netdev_priv_flags {
IFF_802_1Q_VLAN = 1<<0,
@@ -1688,6 +1690,7 @@ enum netdev_priv_flags {
IFF_CHANGE_PROTO_DOWN = BIT_ULL(32),
IFF_SEE_ALL_HWTSTAMP_REQUESTS = BIT_ULL(33),
IFF_LLTX = BIT_ULL(34),
+ IFF_LOGICAL = IFF_NO_QUEUE | IFF_LLTX,
};

#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 9312274c330a..74ce40279316 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -3097,7 +3097,7 @@ static void amt_link_setup(struct net_device *dev)
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
dev->hard_header_len = 0;
dev->addr_len = 0;
- dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL;
dev->features |= NETIF_F_GSO_SOFTWARE;
dev->features |= NETIF_F_NETNS_LOCAL;
dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM;
diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index 958ee2c55c9e..74f7072182b9 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -564,7 +564,7 @@ static void bareudp_setup(struct net_device *dev)
dev->max_mtu = IP_MAX_MTU - BAREUDP_BASE_HLEN;
dev->type = ARPHRD_NONE;
netif_keep_dst(dev);
- dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL;
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
}
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 70bfe60e5868..d503ccbdb6b5 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -5875,9 +5875,7 @@ void bond_setup(struct net_device *bond_dev)

/* Initialize the device options */
bond_dev->flags |= IFF_MASTER;
- bond_dev->priv_flags |= IFF_BONDING | IFF_UNICAST_FLT | IFF_NO_QUEUE;
- /* don't acquire bond device's netif_tx_lock when transmitting */
- bond_dev->priv_flags |= IFF_LLTX;
+ bond_dev->priv_flags |= IFF_BONDING | IFF_UNICAST_FLT | IFF_LOGICAL;
bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);

#ifdef CONFIG_XFRM_OFFLOAD
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index 6cd38b646d5e..a0122e867891 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -108,7 +108,7 @@ static void dummy_setup(struct net_device *dev)
/* Fill in device structure with ethernet-generic values. */
dev->flags |= IFF_NOARP;
dev->flags &= ~IFF_MULTICAST;
- dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LOGICAL;
dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST;
dev->features |= NETIF_F_GSO_SOFTWARE;
dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
index 5c79f3e3ad58..3cb3dbbd6240 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
@@ -384,7 +384,7 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev,
netdev->features &= ~NETIF_F_HW_VLAN_STAG_RX;
netif_set_tso_max_segs(netdev, NFP_NET_LSO_MAX_SEGS);

- netdev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL | IFF_LLTX;
+ netdev->priv_flags |= IFF_LOGICAL | IFF_DISABLE_NETPOLL;

if (nfp_app_has_tc(app)) {
netdev->features |= NETIF_F_HW_TC;
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 51ef6d8f1f46..9ae7aaffd9fd 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1211,7 +1211,7 @@ static void geneve_setup(struct net_device *dev)

netif_keep_dst(dev);
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
- dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LOGICAL;
eth_hw_addr_random(dev);
}

diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index 2933ef5f0d5b..54dd0a134d97 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -956,7 +956,7 @@ static void gtp_link_setup(struct net_device *dev)
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;

dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
- dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL;
netif_keep_dst(dev);

dev->needed_headroom = LL_MAX_HEADER + max_gtp_header_len;
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index f38f0017b70a..f43e2c20d8b5 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -174,8 +174,7 @@ static void gen_lo_setup(struct net_device *dev,
dev->addr_len = ETH_ALEN; /* 6 */
dev->type = ARPHRD_LOOPBACK; /* 0x0001*/
dev->flags = IFF_LOOPBACK;
- dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LOGICAL;
netif_keep_dst(dev);
dev->hw_features = NETIF_F_GSO_SOFTWARE;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index 5ce1df4a6e3d..c7dc3b071dbf 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -726,7 +726,7 @@ struct failover *net_failover_create(struct net_device *standby_dev)
failover_dev->ethtool_ops = &failover_ethtool_ops;

/* Initialize the device options */
- failover_dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE | IFF_LLTX;
+ failover_dev->priv_flags |= IFF_UNICAST_FLT | IFF_LOGICAL;
failover_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE |
IFF_TX_SKB_SHARING);

diff --git a/drivers/net/netkit.c b/drivers/net/netkit.c
index 65247de21761..bd7abb2d6c7b 100644
--- a/drivers/net/netkit.c
+++ b/drivers/net/netkit.c
@@ -241,8 +241,7 @@ static void netkit_setup(struct net_device *dev)
dev->priv_flags &= ~IFF_TX_SKB_SHARING;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
dev->priv_flags |= IFF_PHONY_HEADROOM;
- dev->priv_flags |= IFF_NO_QUEUE;
- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL;

dev->ethtool_ops = &netkit_ethtool_ops;
dev->netdev_ops = &netkit_netdev_ops;
diff --git a/drivers/net/nlmon.c b/drivers/net/nlmon.c
index e08eec154227..e319a0d0771d 100644
--- a/drivers/net/nlmon.c
+++ b/drivers/net/nlmon.c
@@ -62,7 +62,7 @@ static const struct net_device_ops nlmon_ops = {
static void nlmon_setup(struct net_device *dev)
{
dev->type = ARPHRD_NETLINK;
- dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL;

dev->netdev_ops = &nlmon_ops;
dev->ethtool_ops = &nlmon_ethtool_ops;
diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index 396c1f7cae09..f5a55ebecf25 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -2180,7 +2180,7 @@ static void team_setup(struct net_device *dev)
dev->needs_free_netdev = true;
dev->priv_destructor = team_destructor;
dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
- dev->priv_flags |= IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_LOGICAL;
dev->priv_flags |= IFF_TEAM;

/*
@@ -2188,7 +2188,7 @@ static void team_setup(struct net_device *dev)
* bring us to promisc mode in case a unicast addr is added.
* Let this up to underlay drivers.
*/
- dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE | IFF_LLTX;
+ dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;

dev->features |= NETIF_F_GRO;

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 4b2a437ff634..f17c5aab1f78 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1693,9 +1693,8 @@ static void veth_setup(struct net_device *dev)

dev->priv_flags &= ~IFF_TX_SKB_SHARING;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
- dev->priv_flags |= IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_LOGICAL;
dev->priv_flags |= IFF_PHONY_HEADROOM;
- dev->priv_flags |= IFF_LLTX;

dev->netdev_ops = &veth_netdev_ops;
dev->xdp_metadata_ops = &veth_xdp_metadata_ops;
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index c3c009f2d39a..8da8875f411e 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1670,11 +1670,9 @@ static void vrf_setup(struct net_device *dev)
dev->hw_enc_features = dev->features;

/* default to no qdisc; user can add if desired */
- dev->priv_flags |= IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_LOGICAL;
dev->priv_flags |= IFF_NO_RX_HANDLER;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
- /* don't acquire vrf device's netif_tx_lock when transmitting */
- dev->priv_flags |= IFF_LLTX;

/* VRF devices do not care about MTU, but if the MTU is set
* too low then the ipv4 and ipv6 protocols are disabled
diff --git a/drivers/net/vsockmon.c b/drivers/net/vsockmon.c
index 2fcdd80850d9..f0903f66d137 100644
--- a/drivers/net/vsockmon.c
+++ b/drivers/net/vsockmon.c
@@ -82,7 +82,7 @@ static const struct ethtool_ops vsockmon_ethtool_ops = {
static void vsockmon_setup(struct net_device *dev)
{
dev->type = ARPHRD_VSOCKMON;
- dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL;

dev->netdev_ops = &vsockmon_ops;
dev->ethtool_ops = &vsockmon_ethtool_ops;
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index 4f2b48955073..95625e9779ac 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -3301,7 +3301,7 @@ static void vxlan_setup(struct net_device *dev)
dev->hw_features |= NETIF_F_RXCSUM;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
netif_keep_dst(dev);
- dev->priv_flags |= IFF_NO_QUEUE | IFF_CHANGE_PROTO_DOWN | IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL | IFF_CHANGE_PROTO_DOWN;

/* MTU range: 68 - 65535 */
dev->min_mtu = ETH_MIN_MTU;
diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c
index 1492ea6c48b9..ef1a05e1b46e 100644
--- a/drivers/net/wireguard/device.c
+++ b/drivers/net/wireguard/device.c
@@ -288,7 +288,7 @@ static void wg_setup(struct net_device *dev)
dev->needed_tailroom = noise_encrypted_len(MESSAGE_PADDING_MULTIPLE);
dev->type = ARPHRD_NONE;
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
- dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL;
dev->features |= WG_NETDEV_FEATURES;
dev->hw_features |= WG_NETDEV_FEATURES;
dev->hw_enc_features |= WG_NETDEV_FEATURES;
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index dd7173cf5069..aeed74eb5957 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -1021,7 +1021,7 @@ static void batadv_softif_init_early(struct net_device *dev)
dev->needs_free_netdev = true;
dev->priv_destructor = batadv_softif_free;
dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_NETNS_LOCAL;
- dev->priv_flags |= IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL;

/* can't call min_mtu, because the needed variables
* have not been initialized yet
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index acd43839f2f5..aa1d7ab43a6b 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -480,7 +480,7 @@ void br_dev_setup(struct net_device *dev)
dev->needs_free_netdev = true;
dev->ethtool_ops = &br_ethtool_ops;
SET_NETDEV_DEVTYPE(dev, &br_type);
- dev->priv_flags = IFF_EBRIDGE | IFF_NO_QUEUE | IFF_LLTX;
+ dev->priv_flags = IFF_EBRIDGE | IFF_LOGICAL;

dev->features = COMMON_FEATURES | NETIF_F_NETNS_LOCAL |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 1525024b1e51..34e3ed07ab9c 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1764,7 +1764,7 @@ static const struct kobj_type netdev_queue_ktype = {

static bool netdev_uses_bql(const struct net_device *dev)
{
- if (dev->priv_flags & (IFF_NO_QUEUE | IFF_LLTX))
+ if (dev->priv_flags & IFF_LOGICAL)
return false;

return IS_ENABLED(CONFIG_BQL);
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index 561dba9e79f0..1f779ca3ac00 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -498,7 +498,7 @@ void hsr_dev_setup(struct net_device *dev)
dev->header_ops = &hsr_header_ops;
dev->netdev_ops = &hsr_device_ops;
SET_NETDEV_DEVTYPE(dev, &hsr_type);
- dev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL | IFF_LLTX;
+ dev->priv_flags |= IFF_LOGICAL | IFF_DISABLE_NETPOLL;

dev->needs_free_netdev = true;

diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 7f96ba7a27c1..99a0251922cf 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -102,7 +102,7 @@ static void do_setup(struct net_device *netdev)

netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_OPENVSWITCH |
- IFF_NO_QUEUE | IFF_LLTX;
+ IFF_LOGICAL;
netdev->needs_free_netdev = true;
netdev->priv_destructor = NULL;
netdev->ethtool_ops = &internal_dev_ethtool_ops;
--
2.44.0


2024-04-05 13:44:29

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH RFC net-next 4/7] netdev_features: convert NETIF_F_NETNS_LOCAL to IFF_NETNS_LOCAL

"Interface can't change network namespaces" is rather an attribute,
not a feature, and it can't be changed via Ethtool.
Make it a private flag instead of a netdev_feature and free one more
bit.

Signed-off-by: Alexander Lobakin <[email protected]>
---
Documentation/networking/netdev-features.rst | 7 -------
Documentation/networking/switchdev.rst | 4 ++--
include/linux/netdev_features.h | 5 +----
include/linux/netdevice.h | 2 ++
drivers/net/amt.c | 3 +--
drivers/net/bonding/bond_main.c | 5 ++---
drivers/net/ethernet/adi/adin1110.c | 3 +--
drivers/net/ethernet/marvell/prestera/prestera_main.c | 3 ++-
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 ++--
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 6 +++---
drivers/net/ethernet/rocker/rocker_main.c | 3 ++-
drivers/net/ethernet/ti/cpsw_new.c | 3 ++-
drivers/net/loopback.c | 2 +-
drivers/net/net_failover.c | 5 ++---
drivers/net/team/team_core.c | 5 ++---
drivers/net/vrf.c | 6 +-----
net/batman-adv/soft-interface.c | 4 ++--
net/bridge/br_device.c | 6 +++---
net/core/dev.c | 4 ++--
net/ethtool/common.c | 1 -
net/hsr/hsr_device.c | 6 +-----
net/ieee802154/6lowpan/core.c | 3 +--
net/ieee802154/core.c | 10 +++++-----
net/ipv4/ip_tunnel.c | 2 +-
net/ipv4/ipmr.c | 2 +-
net/ipv6/ip6_gre.c | 3 +--
net/ipv6/ip6_tunnel.c | 2 +-
net/ipv6/ip6mr.c | 2 +-
net/ipv6/sit.c | 2 +-
net/openvswitch/vport-internal_dev.c | 2 +-
net/wireless/core.c | 10 +++++-----
tools/testing/selftests/net/forwarding/README | 2 +-
33 files changed, 54 insertions(+), 75 deletions(-)

diff --git a/Documentation/networking/netdev-features.rst b/Documentation/networking/netdev-features.rst
index f29d982ebf5d..5014f7cc1398 100644
--- a/Documentation/networking/netdev-features.rst
+++ b/Documentation/networking/netdev-features.rst
@@ -139,13 +139,6 @@ chained skbs (skb->next/prev list).
Features contained in NETIF_F_SOFT_FEATURES are features of networking
stack. Driver should not change behaviour based on them.

- * netns-local device
-
-NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between
-network namespaces (e.g. loopback).
-
-Don't use it in drivers.
-
* VLAN challenged

NETIF_F_VLAN_CHALLENGED should be set for devices which can't cope with VLAN
diff --git a/Documentation/networking/switchdev.rst b/Documentation/networking/switchdev.rst
index 758f1dae3fce..4b02287d210b 100644
--- a/Documentation/networking/switchdev.rst
+++ b/Documentation/networking/switchdev.rst
@@ -137,10 +137,10 @@ would be sub-port 0 on port 1 on switch 1.
Port Features
^^^^^^^^^^^^^

-NETIF_F_NETNS_LOCAL
+IFF_NETNS_LOCAL

If the switchdev driver (and device) only supports offloading of the default
-network namespace (netns), the driver should set this feature flag to prevent
+network namespace (netns), the driver should set this private flag to prevent
the port netdev from being moved out of the default netns. A netns-aware
driver/device would not set this flag and be responsible for partitioning
hardware to preserve netns containment. This means hardware cannot forward
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 54d1578f6642..3bacd4b1adc9 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -23,7 +23,6 @@ enum {
NETIF_F_HW_VLAN_CTAG_FILTER_BIT,/* Receive filtering on VLAN CTAGs */
NETIF_F_VLAN_CHALLENGED_BIT, /* Device cannot handle VLAN packets */
NETIF_F_GSO_BIT, /* Enable software GSO. */
- NETIF_F_NETNS_LOCAL_BIT, /* Does not change network namespaces */
NETIF_F_GRO_BIT, /* Generic receive offload */
NETIF_F_LRO_BIT, /* large receive offload */

@@ -119,7 +118,6 @@ enum {
#define NETIF_F_IPV6_CSUM __NETIF_F(IPV6_CSUM)
#define NETIF_F_LOOPBACK __NETIF_F(LOOPBACK)
#define NETIF_F_LRO __NETIF_F(LRO)
-#define NETIF_F_NETNS_LOCAL __NETIF_F(NETNS_LOCAL)
#define NETIF_F_NOCACHE_COPY __NETIF_F(NOCACHE_COPY)
#define NETIF_F_NTUPLE __NETIF_F(NTUPLE)
#define NETIF_F_RXCSUM __NETIF_F(RXCSUM)
@@ -188,8 +186,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start)

/* Features valid for ethtool to change */
/* = all defined minus driver/device-class-related */
-#define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \
- NETIF_F_NETNS_LOCAL)
+#define NETIF_F_NEVER_CHANGE NETIF_F_VLAN_CHALLENGED

/* remember that ((t)1 << t_BITS) is undefined in C99 */
#define NETIF_F_ETHTOOL_BITS ((__NETIF_F_BIT(NETDEV_FEATURE_COUNT - 1) | \
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5234dd2144eb..0fafb3db8f0b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1651,6 +1651,7 @@ struct net_device_ops {
* even if those aren't HWTSTAMP_SOURCE_NETDEV.
@ @IFF_LLTX: device supports lockless Tx. Mainly used by logical interfaces,
* such as tunnels.
+ * @IFF_NETNS_LOCAL: interface can't change network namespaces
* @IFF_LOGICAL: combines @IFF_NO_QUEUE and @IFF_LLTX, used by logical
* interfaces to avoid overhead from locking and Qdisc.
*/
@@ -1690,6 +1691,7 @@ enum netdev_priv_flags {
IFF_CHANGE_PROTO_DOWN = BIT_ULL(32),
IFF_SEE_ALL_HWTSTAMP_REQUESTS = BIT_ULL(33),
IFF_LLTX = BIT_ULL(34),
+ IFF_NETNS_LOCAL = BIT_ULL(35),
IFF_LOGICAL = IFF_NO_QUEUE | IFF_LLTX,
};

diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 74ce40279316..82c9429c408b 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -3097,9 +3097,8 @@ static void amt_link_setup(struct net_device *dev)
dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
dev->hard_header_len = 0;
dev->addr_len = 0;
- dev->priv_flags |= IFF_LOGICAL;
+ dev->priv_flags |= IFF_LOGICAL | IFF_NETNS_LOCAL;
dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->features |= NETIF_F_NETNS_LOCAL;
dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM;
dev->hw_features |= NETIF_F_FRAGLIST | NETIF_F_RXCSUM;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d503ccbdb6b5..3d28be39e211 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -5876,6 +5876,8 @@ void bond_setup(struct net_device *bond_dev)
/* Initialize the device options */
bond_dev->flags |= IFF_MASTER;
bond_dev->priv_flags |= IFF_BONDING | IFF_UNICAST_FLT | IFF_LOGICAL;
+ /* Don't allow bond devices to change network namespaces. */
+ bond_dev->priv_flags |= IFF_NETNS_LOCAL;
bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);

#ifdef CONFIG_XFRM_OFFLOAD
@@ -5892,9 +5894,6 @@ void bond_setup(struct net_device *bond_dev)
* capable
*/

- /* Don't allow bond devices to change network namespaces. */
- bond_dev->features |= NETIF_F_NETNS_LOCAL;
-
bond_dev->hw_features = BOND_VLAN_FEATURES |
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER |
diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c
index 8b4ef5121308..3ff90a7e8bb5 100644
--- a/drivers/net/ethernet/adi/adin1110.c
+++ b/drivers/net/ethernet/adi/adin1110.c
@@ -1598,8 +1598,7 @@ static int adin1110_probe_netdevs(struct adin1110_priv *priv)
netdev->if_port = IF_PORT_10BASET;
netdev->netdev_ops = &adin1110_netdev_ops;
netdev->ethtool_ops = &adin1110_ethtool_ops;
- netdev->priv_flags |= IFF_UNICAST_FLT;
- netdev->features |= NETIF_F_NETNS_LOCAL;
+ netdev->priv_flags |= IFF_UNICAST_FLT | IFF_NETNS_LOCAL;

port_priv->phydev = get_phy_device(priv->mii_bus, i + 1, false);
if (IS_ERR(port_priv->phydev)) {
diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c
index 4fb886c57cd7..afa277def8a3 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_main.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c
@@ -633,7 +633,8 @@ static int prestera_port_create(struct prestera_switch *sw, u32 id)
if (err)
goto err_dl_port_register;

- dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_HW_TC;
+ dev->features |= NETIF_F_HW_TC;
+ dev->priv_flags |= IFF_NETNS_LOCAL;
dev->netdev_ops = &prestera_netdev_ops;
dev->ethtool_ops = &prestera_ethtool_ops;
SET_NETDEV_DEV(dev, sw->dev->dev);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 81e1c1e401f9..d51ab72d69b9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -4243,9 +4243,9 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,

if (mlx5e_is_uplink_rep(priv)) {
features = mlx5e_fix_uplink_rep_features(netdev, features);
- features |= NETIF_F_NETNS_LOCAL;
+ netdev->priv_flags |= IFF_NETNS_LOCAL;
} else {
- features &= ~NETIF_F_NETNS_LOCAL;
+ netdev->priv_flags &= ~IFF_NETNS_LOCAL;
}

mutex_unlock(&priv->state_lock);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index a74ee698671c..62598f803a98 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -864,7 +864,7 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev,
netdev->hw_features |= NETIF_F_RXCSUM;

netdev->features |= netdev->hw_features;
- netdev->features |= NETIF_F_NETNS_LOCAL;
+ netdev->priv_flags |= IFF_NETNS_LOCAL;
}

static int mlx5e_init_rep(struct mlx5_core_dev *mdev,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index ba228f500539..342d435da439 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1693,10 +1693,10 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u16 local_port,

netif_carrier_off(dev);

- dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG |
- NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_TC;
+ dev->features |= NETIF_F_SG | NETIF_F_HW_VLAN_CTAG_FILTER |
+ NETIF_F_HW_TC;
dev->hw_features |= NETIF_F_HW_TC | NETIF_F_LOOPBACK;
- dev->priv_flags |= IFF_LLTX;
+ dev->priv_flags |= IFF_LLTX | IFF_NETNS_LOCAL;

dev->min_mtu = 0;
dev->max_mtu = ETH_MAX_MTU;
diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
index 755db89db909..e5d4ccbb5be8 100644
--- a/drivers/net/ethernet/rocker/rocker_main.c
+++ b/drivers/net/ethernet/rocker/rocker_main.c
@@ -2575,7 +2575,8 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number)
netif_napi_add(dev, &rocker_port->napi_rx, rocker_port_poll_rx);
rocker_carrier_init(rocker_port);

- dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG;
+ dev->features |= NETIF_F_SG;
+ dev->priv_flags |= IFF_NETNS_LOCAL;

/* MTU range: 68 - 9000 */
dev->min_mtu = ROCKER_PORT_MIN_MTU;
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index 087dcb67505a..4cb17b5f9f95 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -1407,7 +1407,8 @@ static int cpsw_create_ports(struct cpsw_common *cpsw)
cpsw->slaves[i].ndev = ndev;

ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER |
- NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_NETNS_LOCAL | NETIF_F_HW_TC;
+ NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_TC;
+ ndev->priv_flags |= IFF_NETNS_LOCAL;

ndev->xdp_features = NETDEV_XDP_ACT_BASIC |
NETDEV_XDP_ACT_REDIRECT |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index f43e2c20d8b5..860f1a3df838 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -175,6 +175,7 @@ static void gen_lo_setup(struct net_device *dev,
dev->type = ARPHRD_LOOPBACK; /* 0x0001*/
dev->flags = IFF_LOOPBACK;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_LOGICAL;
+ dev->priv_flags |= IFF_NETNS_LOCAL;
netif_keep_dst(dev);
dev->hw_features = NETIF_F_GSO_SOFTWARE;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
@@ -183,7 +184,6 @@ static void gen_lo_setup(struct net_device *dev,
| NETIF_F_RXCSUM
| NETIF_F_SCTP_CRC
| NETIF_F_HIGHDMA
- | NETIF_F_NETNS_LOCAL
| NETIF_F_VLAN_CHALLENGED
| NETIF_F_LOOPBACK;
dev->ethtool_ops = eth_ops;
diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index c7dc3b071dbf..8b8a84ed88b0 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -727,12 +727,11 @@ struct failover *net_failover_create(struct net_device *standby_dev)

/* Initialize the device options */
failover_dev->priv_flags |= IFF_UNICAST_FLT | IFF_LOGICAL;
+ /* Don't allow failover devices to change network namespaces. */
+ failover_dev->priv_flags |= IFF_NETNS_LOCAL;
failover_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE |
IFF_TX_SKB_SHARING);

- /* Don't allow failover devices to change network namespaces. */
- failover_dev->features |= NETIF_F_NETNS_LOCAL;
-
failover_dev->hw_features = FAILOVER_VLAN_FEATURES |
NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX |
diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index f5a55ebecf25..0fcb3b9ac4af 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -2189,12 +2189,11 @@ static void team_setup(struct net_device *dev)
* Let this up to underlay drivers.
*/
dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
+ /* Don't allow team devices to change network namespaces. */
+ dev->priv_flags |= IFF_NETNS_LOCAL;

dev->features |= NETIF_F_GRO;

- /* Don't allow team devices to change network namespaces. */
- dev->features |= NETIF_F_NETNS_LOCAL;
-
dev->hw_features = TEAM_VLAN_FEATURES |
NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER |
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 8da8875f411e..48c84ec3227c 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1655,9 +1655,6 @@ static void vrf_setup(struct net_device *dev)
/* Fill in device structure with ethernet-generic values. */
eth_hw_addr_random(dev);

- /* don't allow vrf devices to change network namespaces. */
- dev->features |= NETIF_F_NETNS_LOCAL;
-
/* does not make sense for a VLAN to be added to a vrf device */
dev->features |= NETIF_F_VLAN_CHALLENGED;

@@ -1669,8 +1666,7 @@ static void vrf_setup(struct net_device *dev)
dev->hw_features = dev->features;
dev->hw_enc_features = dev->features;

- /* default to no qdisc; user can add if desired */
- dev->priv_flags |= IFF_LOGICAL;
+ dev->priv_flags |= IFF_LOGICAL | IFF_NETNS_LOCAL;
dev->priv_flags |= IFF_NO_RX_HANDLER;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index aeed74eb5957..e8c88d2978c7 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -1020,8 +1020,8 @@ static void batadv_softif_init_early(struct net_device *dev)
dev->netdev_ops = &batadv_netdev_ops;
dev->needs_free_netdev = true;
dev->priv_destructor = batadv_softif_free;
- dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_NETNS_LOCAL;
- dev->priv_flags |= IFF_LOGICAL;
+ dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
+ dev->priv_flags |= IFF_LOGICAL | IFF_NETNS_LOCAL;

/* can't call min_mtu, because the needed variables
* have not been initialized yet
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index aa1d7ab43a6b..a4410a8d5993 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -480,10 +480,10 @@ void br_dev_setup(struct net_device *dev)
dev->needs_free_netdev = true;
dev->ethtool_ops = &br_ethtool_ops;
SET_NETDEV_DEVTYPE(dev, &br_type);
- dev->priv_flags = IFF_EBRIDGE | IFF_LOGICAL;
+ dev->priv_flags = IFF_EBRIDGE | IFF_LOGICAL | IFF_NETNS_LOCAL;

- dev->features = COMMON_FEATURES | NETIF_F_NETNS_LOCAL |
- NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
+ dev->features = COMMON_FEATURES | NETIF_F_HW_VLAN_CTAG_TX |
+ NETIF_F_HW_VLAN_STAG_TX;
dev->hw_features = COMMON_FEATURES | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX;
dev->vlan_features = COMMON_FEATURES;
diff --git a/net/core/dev.c b/net/core/dev.c
index 92f5bddbc2de..1022ab4c0b89 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -11275,7 +11275,7 @@ int __dev_change_net_namespace(struct net_device *dev, struct net *net,

/* Don't allow namespace local devices to be moved. */
err = -EINVAL;
- if (dev->features & NETIF_F_NETNS_LOCAL)
+ if (dev->priv_flags & IFF_NETNS_LOCAL)
goto out;

/* Ensure the device has been registrered */
@@ -11653,7 +11653,7 @@ static void __net_exit default_device_exit_net(struct net *net)
char fb_name[IFNAMSIZ];

/* Ignore unmoveable devices (i.e. loopback) */
- if (dev->features & NETIF_F_NETNS_LOCAL)
+ if (dev->priv_flags & IFF_NETNS_LOCAL)
continue;

/* Leave virtual devices for the generic cleanup */
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 44199d1780d5..66c8b6739260 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -24,7 +24,6 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
[NETIF_F_HW_VLAN_STAG_FILTER_BIT] = "rx-vlan-stag-filter",
[NETIF_F_VLAN_CHALLENGED_BIT] = "vlan-challenged",
[NETIF_F_GSO_BIT] = "tx-generic-segmentation",
- [NETIF_F_NETNS_LOCAL_BIT] = "netns-local",
[NETIF_F_GRO_BIT] = "rx-gro",
[NETIF_F_GRO_HW_BIT] = "rx-gro-hw",
[NETIF_F_LRO_BIT] = "rx-lro",
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index 1f779ca3ac00..066e30ea5042 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -498,7 +498,7 @@ void hsr_dev_setup(struct net_device *dev)
dev->header_ops = &hsr_header_ops;
dev->netdev_ops = &hsr_device_ops;
SET_NETDEV_DEVTYPE(dev, &hsr_type);
- dev->priv_flags |= IFF_LOGICAL | IFF_DISABLE_NETPOLL;
+ dev->priv_flags |= IFF_LOGICAL | IFF_DISABLE_NETPOLL | IFF_NETNS_LOCAL;

dev->needs_free_netdev = true;

@@ -512,10 +512,6 @@ void hsr_dev_setup(struct net_device *dev)
* hsr_header_create() etc.
*/
dev->features |= NETIF_F_VLAN_CHALLENGED;
- /* Not sure about this. Taken from bridge code. netdev_features.h says
- * it means "Does not change network namespaces".
- */
- dev->features |= NETIF_F_NETNS_LOCAL;
}

/* Return true if dev is a HSR master; return false otherwise.
diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
index 77b4e92027c5..3d3e083fd9e1 100644
--- a/net/ieee802154/6lowpan/core.c
+++ b/net/ieee802154/6lowpan/core.c
@@ -111,12 +111,11 @@ static void lowpan_setup(struct net_device *ldev)
/* We need an ipv6hdr as minimum len when calling xmit */
ldev->hard_header_len = sizeof(struct ipv6hdr);
ldev->flags = IFF_BROADCAST | IFF_MULTICAST;
- ldev->priv_flags |= IFF_NO_QUEUE;
+ ldev->priv_flags |= IFF_NO_QUEUE | IFF_NETNS_LOCAL;

ldev->netdev_ops = &lowpan_netdev_ops;
ldev->header_ops = &lowpan_header_ops;
ldev->needs_free_netdev = true;
- ldev->features |= NETIF_F_NETNS_LOCAL;
}

static int lowpan_validate(struct nlattr *tb[], struct nlattr *data[],
diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c
index 60e8fff1347e..32e1354a3cff 100644
--- a/net/ieee802154/core.c
+++ b/net/ieee802154/core.c
@@ -226,11 +226,11 @@ int cfg802154_switch_netns(struct cfg802154_registered_device *rdev,
list_for_each_entry(wpan_dev, &rdev->wpan_dev_list, list) {
if (!wpan_dev->netdev)
continue;
- wpan_dev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
+ wpan_dev->netdev->priv_flags &= ~IFF_NETNS_LOCAL;
err = dev_change_net_namespace(wpan_dev->netdev, net, "wpan%d");
if (err)
break;
- wpan_dev->netdev->features |= NETIF_F_NETNS_LOCAL;
+ wpan_dev->netdev->priv_flags |= IFF_NETNS_LOCAL;
}

if (err) {
@@ -242,11 +242,11 @@ int cfg802154_switch_netns(struct cfg802154_registered_device *rdev,
list) {
if (!wpan_dev->netdev)
continue;
- wpan_dev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
+ wpan_dev->netdev->priv_flags &= ~IFF_NETNS_LOCAL;
err = dev_change_net_namespace(wpan_dev->netdev, net,
"wpan%d");
WARN_ON(err);
- wpan_dev->netdev->features |= NETIF_F_NETNS_LOCAL;
+ wpan_dev->netdev->priv_flags |= IFF_NETNS_LOCAL;
}

return err;
@@ -291,7 +291,7 @@ static int cfg802154_netdev_notifier_call(struct notifier_block *nb,
switch (state) {
/* TODO NETDEV_DEVTYPE */
case NETDEV_REGISTER:
- dev->features |= NETIF_F_NETNS_LOCAL;
+ dev->priv_flags |= IFF_NETNS_LOCAL;
wpan_dev->identifier = ++rdev->wpan_dev_id;
list_add_rcu(&wpan_dev->list, &rdev->wpan_dev_list);
rdev->devlist_generation++;
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 177f40c3a8e8..6ec4365cefa5 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -1162,7 +1162,7 @@ int ip_tunnel_init_net(struct net *net, unsigned int ip_tnl_net_id,
* Allowing to move it to another netns is clearly unsafe.
*/
if (!IS_ERR(itn->fb_tunnel_dev)) {
- itn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL;
+ itn->fb_tunnel_dev->priv_flags |= IFF_NETNS_LOCAL;
itn->fb_tunnel_dev->mtu = ip_tunnel_bind_dev(itn->fb_tunnel_dev);
ip_tunnel_add(itn, netdev_priv(itn->fb_tunnel_dev));
itn->type = itn->fb_tunnel_dev->type;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 6c750bd13dd8..ecc1159bb2ce 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -536,7 +536,7 @@ static void reg_vif_setup(struct net_device *dev)
dev->flags = IFF_NOARP;
dev->netdev_ops = &reg_vif_netdev_ops;
dev->needs_free_netdev = true;
- dev->features |= NETIF_F_NETNS_LOCAL;
+ dev->priv_flags |= IFF_NETNS_LOCAL;
}

static struct net_device *ipmr_reg_vif(struct net *net, struct mr_table *mrt)
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 62326b6d7d92..36a5f8997fc2 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1629,8 +1629,7 @@ static int __net_init ip6gre_init_net(struct net *net)
/* FB netdevice is special: we have one, and only one per netns.
* Allowing to move it to another netns is clearly unsafe.
*/
- ign->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL;
-
+ ign->fb_tunnel_dev->priv_flags |= IFF_NETNS_LOCAL;

ip6gre_fb_tunnel_init(ign->fb_tunnel_dev);
ign->fb_tunnel_dev->rtnl_link_ops = &ip6gre_link_ops;
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 16270e1acd23..206a936427da 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -2256,7 +2256,7 @@ static int __net_init ip6_tnl_init_net(struct net *net)
/* FB netdevice is special: we have one, and only one per netns.
* Allowing to move it to another netns is clearly unsafe.
*/
- ip6n->fb_tnl_dev->features |= NETIF_F_NETNS_LOCAL;
+ ip6n->fb_tnl_dev->priv_flags |= IFF_NETNS_LOCAL;

err = ip6_fb_tnl_dev_init(ip6n->fb_tnl_dev);
if (err < 0)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index cb0ee81a068a..f896c76ab9eb 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -640,7 +640,7 @@ static void reg_vif_setup(struct net_device *dev)
dev->flags = IFF_NOARP;
dev->netdev_ops = &reg_vif_netdev_ops;
dev->needs_free_netdev = true;
- dev->features |= NETIF_F_NETNS_LOCAL;
+ dev->priv_flags |= IFF_NETNS_LOCAL;
}

static struct net_device *ip6mr_reg_vif(struct net *net, struct mr_table *mrt)
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index b8d229cf8f8d..23df3c0638d6 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1855,7 +1855,7 @@ static int __net_init sit_init_net(struct net *net)
/* FB netdevice is special: we have one, and only one per netns.
* Allowing to move it to another netns is clearly unsafe.
*/
- sitn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL;
+ sitn->fb_tunnel_dev->priv_flags |= IFF_NETNS_LOCAL;

err = register_netdev(sitn->fb_tunnel_dev);
if (err)
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 99a0251922cf..e916b95a8d28 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -153,7 +153,7 @@ static struct vport *internal_dev_create(const struct vport_parms *parms)

/* Restrict bridge port to current netns. */
if (vport->port_no == OVSP_LOCAL)
- vport->dev->features |= NETIF_F_NETNS_LOCAL;
+ vport->dev->priv_flags |= IFF_NETNS_LOCAL;

rtnl_lock();
err = register_netdevice(vport->dev);
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 3fb1b637352a..dec3bdc47726 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -165,11 +165,11 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
if (!wdev->netdev)
continue;
- wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
+ wdev->netdev->priv_flags &= ~IFF_NETNS_LOCAL;
err = dev_change_net_namespace(wdev->netdev, net, "wlan%d");
if (err)
break;
- wdev->netdev->features |= NETIF_F_NETNS_LOCAL;
+ wdev->netdev->priv_flags |= IFF_NETNS_LOCAL;
}

if (err) {
@@ -181,11 +181,11 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
list) {
if (!wdev->netdev)
continue;
- wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
+ wdev->netdev->priv_flags &= ~IFF_NETNS_LOCAL;
err = dev_change_net_namespace(wdev->netdev, net,
"wlan%d");
WARN_ON(err);
- wdev->netdev->features |= NETIF_F_NETNS_LOCAL;
+ wdev->netdev->priv_flags |= IFF_NETNS_LOCAL;
}

return err;
@@ -1468,7 +1468,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
SET_NETDEV_DEVTYPE(dev, &wiphy_type);
wdev->netdev = dev;
/* can only change netns with wiphy */
- dev->features |= NETIF_F_NETNS_LOCAL;
+ dev->priv_flags |= IFF_NETNS_LOCAL;

cfg80211_init_wdev(wdev);
break;
diff --git a/tools/testing/selftests/net/forwarding/README b/tools/testing/selftests/net/forwarding/README
index 7fdb6a9ca543..24d9ed84ce42 100644
--- a/tools/testing/selftests/net/forwarding/README
+++ b/tools/testing/selftests/net/forwarding/README
@@ -6,7 +6,7 @@ to easily create and test complex environments.

Unfortunately, these namespaces can not be used with actual switching
ASICs, as their ports can not be migrated to other network namespaces
-(NETIF_F_NETNS_LOCAL) and most of them probably do not support the
+(IFF_NETNS_LOCAL) and most of them probably do not support the
L1-separation provided by namespaces.

However, a similar kind of flexibility can be achieved by using VRFs and
--
2.44.0


2024-04-05 14:13:26

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 1/7] netdev_features: remove unused __UNUSED_NETIF_F_1

On Fri, Apr 05, 2024 at 03:37:25PM +0200, Alexander Lobakin wrote:
> NETIF_F_NO_CSUM was removed in 3.2-rc2 by commit 34324dc2bf27
> ("net: remove NETIF_F_NO_CSUM feature bit") and became
> __UNUSED_NETIF_F_1. It's not used anywhere in the code.
> Remove this bit waste.
>
> Signed-off-by: Alexander Lobakin <[email protected]>
> ---
> include/linux/netdev_features.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
> index 7c2d77d75a88..44c428d62db4 100644
> --- a/include/linux/netdev_features.h
> +++ b/include/linux/netdev_features.h
> @@ -14,7 +14,6 @@ typedef u64 netdev_features_t;
> enum {
> NETIF_F_SG_BIT, /* Scatter/gather IO. */
> NETIF_F_IP_CSUM_BIT, /* Can checksum TCP/UDP over IPv4. */
> - __UNUSED_NETIF_F_1,
> NETIF_F_HW_CSUM_BIT, /* Can checksum all the packets. */
> NETIF_F_IPV6_CSUM_BIT, /* Can checksum TCP/UDP over IPV6 */
> NETIF_F_HIGHDMA_BIT, /* Can DMA to high memory. */

Are you sure this enum is not ABI?

It would be good to add an explanation why it is not ABI to the cover
letter.

Andrew

2024-04-05 15:17:45

by Alexander Lobakin

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 1/7] netdev_features: remove unused __UNUSED_NETIF_F_1

From: Andrew Lunn <[email protected]>
Date: Fri, 5 Apr 2024 16:12:50 +0200

> On Fri, Apr 05, 2024 at 03:37:25PM +0200, Alexander Lobakin wrote:
>> NETIF_F_NO_CSUM was removed in 3.2-rc2 by commit 34324dc2bf27
>> ("net: remove NETIF_F_NO_CSUM feature bit") and became
>> __UNUSED_NETIF_F_1. It's not used anywhere in the code.
>> Remove this bit waste.
>>
>> Signed-off-by: Alexander Lobakin <[email protected]>
>> ---
>> include/linux/netdev_features.h | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
>> index 7c2d77d75a88..44c428d62db4 100644
>> --- a/include/linux/netdev_features.h
>> +++ b/include/linux/netdev_features.h
>> @@ -14,7 +14,6 @@ typedef u64 netdev_features_t;
>> enum {
>> NETIF_F_SG_BIT, /* Scatter/gather IO. */
>> NETIF_F_IP_CSUM_BIT, /* Can checksum TCP/UDP over IPv4. */
>> - __UNUSED_NETIF_F_1,
>> NETIF_F_HW_CSUM_BIT, /* Can checksum all the packets. */
>> NETIF_F_IPV6_CSUM_BIT, /* Can checksum TCP/UDP over IPV6 */
>> NETIF_F_HIGHDMA_BIT, /* Can DMA to high memory. */
>
> Are you sure this enum is not ABI?

Why should this be ABI? It's not a part of UAPI and Ethtool receives
these bits together with string names.

>
> It would be good to add an explanation why it is not ABI to the cover
> letter.
>
> Andrew

Thanks,
Olek

2024-04-05 15:54:02

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 1/7] netdev_features: remove unused __UNUSED_NETIF_F_1

On Fri, Apr 05, 2024 at 05:15:58PM +0200, Alexander Lobakin wrote:
> From: Andrew Lunn <[email protected]>
> Date: Fri, 5 Apr 2024 16:12:50 +0200
>
> > On Fri, Apr 05, 2024 at 03:37:25PM +0200, Alexander Lobakin wrote:
> >> NETIF_F_NO_CSUM was removed in 3.2-rc2 by commit 34324dc2bf27
> >> ("net: remove NETIF_F_NO_CSUM feature bit") and became
> >> __UNUSED_NETIF_F_1. It's not used anywhere in the code.
> >> Remove this bit waste.
> >>
> >> Signed-off-by: Alexander Lobakin <[email protected]>
> >> ---
> >> include/linux/netdev_features.h | 1 -
> >> 1 file changed, 1 deletion(-)
> >>
> >> diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
> >> index 7c2d77d75a88..44c428d62db4 100644
> >> --- a/include/linux/netdev_features.h
> >> +++ b/include/linux/netdev_features.h
> >> @@ -14,7 +14,6 @@ typedef u64 netdev_features_t;
> >> enum {
> >> NETIF_F_SG_BIT, /* Scatter/gather IO. */
> >> NETIF_F_IP_CSUM_BIT, /* Can checksum TCP/UDP over IPv4. */
> >> - __UNUSED_NETIF_F_1,
> >> NETIF_F_HW_CSUM_BIT, /* Can checksum all the packets. */
> >> NETIF_F_IPV6_CSUM_BIT, /* Can checksum TCP/UDP over IPV6 */
> >> NETIF_F_HIGHDMA_BIT, /* Can DMA to high memory. */
> >
> > Are you sure this enum is not ABI?
>
> Why should this be ABI? It's not a part of UAPI and Ethtool receives
> these bits together with string names.

As a reviewer, i think about ABI. When looking at a change like this,
it is the first thing i think of. Our code is not always clean, there
could well be things outside of include/uapi which influence the
ABI. For some reason ("net: remove NETIF_F_NO_CSUM feature bit")
renamed rather than removed it? Why?

I assume you have looked into the code in this respect, you have
tested both and ioctl and netlink code, and concluded it does not
cause an ABI change. It could of been removed in 3.2-rc2. But i don't
see anything in the cover letter or commit message which indicates you
have done that. That is partially what the cover letter and the commit
message is about. Explaining things you have done, but cannot be seen
in the code change.

Andrew

2024-04-09 02:33:15

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 3/7] netdevice: introduce IFF_LOGICAL as (IFF_NO_QUEUE | IFF_LLTX)

On Fri, 5 Apr 2024 15:37:27 +0200 Alexander Lobakin wrote:
> + * @IFF_LOGICAL: combines @IFF_NO_QUEUE and @IFF_LLTX, used by logical
> + * interfaces to avoid overhead from locking and Qdisc.

????️????️????️

2024-04-09 02:38:29

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 7/7] netdev_features: convert NETIF_F_FCOE_MTU to IFF_FCOE_MTU

On Fri, 5 Apr 2024 15:37:31 +0200 Alexander Lobakin wrote:
> Ability to handle maximum FCoE frames of 2158 bytes can never be changed
> and thus more of an attribute, not a toggleable feature.
> Move it from netdev_features_t to netdev_priv_flags and free one more
> feature bit.

> @@ -1700,6 +1701,7 @@ enum netdev_priv_flags {
> IFF_NETNS_LOCAL = BIT_ULL(35),
> IFF_HIGHDMA = BIT_ULL(36),
> IFF_VLAN_CHALLENGED = BIT_ULL(37),
> + IFF_FCOE_MTU = BIT_ULL(38),
> IFF_LOGICAL = IFF_NO_QUEUE | IFF_LLTX,
> IFF_ONE_FOR_ALL = IFF_HIGHDMA | IFF_VLAN_CHALLENGED,
> IFF_ALL_FOR_ALL = IFF_XMIT_DST_RELEASE |

Any reason not to make it a bitfield? I haven't looked at the longer
patches but this one seems to be used like a basic bool.

> diff --git a/net/ethtool/common.c b/net/ethtool/common.c
> index 2de4dd5a30de..71e36e1a1b15 100644
> --- a/net/ethtool/common.c
> +++ b/net/ethtool/common.c
> @@ -47,7 +47,6 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
>
> [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
> [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
> - [NETIF_F_FCOE_MTU_BIT] = "fcoe-mtu",


But this definitely _is_ a uAPI change, right?
Some analysis why this is fine and why avoiding the problem isn't worth
it in the cover letter would be great.

> [NETIF_F_NTUPLE_BIT] = "rx-ntuple-filter",
> [NETIF_F_RXHASH_BIT] = "rx-hashing",
> [NETIF_F_RXCSUM_BIT] = "rx-checksum",


2024-04-11 10:31:33

by Alexander Lobakin

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 7/7] netdev_features: convert NETIF_F_FCOE_MTU to IFF_FCOE_MTU

From: Jakub Kicinski <[email protected]>
Date: Mon, 8 Apr 2024 19:38:06 -0700

> On Fri, 5 Apr 2024 15:37:31 +0200 Alexander Lobakin wrote:
>> Ability to handle maximum FCoE frames of 2158 bytes can never be changed
>> and thus more of an attribute, not a toggleable feature.
>> Move it from netdev_features_t to netdev_priv_flags and free one more
>> feature bit.
>
>> @@ -1700,6 +1701,7 @@ enum netdev_priv_flags {
>> IFF_NETNS_LOCAL = BIT_ULL(35),
>> IFF_HIGHDMA = BIT_ULL(36),
>> IFF_VLAN_CHALLENGED = BIT_ULL(37),
>> + IFF_FCOE_MTU = BIT_ULL(38),
>> IFF_LOGICAL = IFF_NO_QUEUE | IFF_LLTX,
>> IFF_ONE_FOR_ALL = IFF_HIGHDMA | IFF_VLAN_CHALLENGED,
>> IFF_ALL_FOR_ALL = IFF_XMIT_DST_RELEASE |
>
> Any reason not to make it a bitfield? I haven't looked at the longer
> patches but this one seems to be used like a basic bool.

This whole enum could be made as bitfields, should we convert it? Would
be a big patch tho ._.

>
>> diff --git a/net/ethtool/common.c b/net/ethtool/common.c
>> index 2de4dd5a30de..71e36e1a1b15 100644
>> --- a/net/ethtool/common.c
>> +++ b/net/ethtool/common.c
>> @@ -47,7 +47,6 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
>>
>> [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
>> [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
>> - [NETIF_F_FCOE_MTU_BIT] = "fcoe-mtu",
>
>
> But this definitely _is_ a uAPI change, right?

Why?

> Some analysis why this is fine and why avoiding the problem isn't worth
> it in the cover letter would be great.
>
>> [NETIF_F_NTUPLE_BIT] = "rx-ntuple-filter",
>> [NETIF_F_RXHASH_BIT] = "rx-hashing",
>> [NETIF_F_RXCSUM_BIT] = "rx-checksum",

Thanks,
Olek

2024-04-11 10:40:41

by Alexander Lobakin

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 3/7] netdevice: introduce IFF_LOGICAL as (IFF_NO_QUEUE | IFF_LLTX)

From: Jakub Kicinski <[email protected]>
Date: Mon, 8 Apr 2024 19:32:14 -0700

> On Fri, 5 Apr 2024 15:37:27 +0200 Alexander Lobakin wrote:
>> + * @IFF_LOGICAL: combines @IFF_NO_QUEUE and @IFF_LLTX, used by logical
>> + * interfaces to avoid overhead from locking and Qdisc.
>
> ????️????️????️

¯\_(ツ)_/¯

2024-04-11 14:24:24

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 7/7] netdev_features: convert NETIF_F_FCOE_MTU to IFF_FCOE_MTU

> >> @@ -47,7 +47,6 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
> >>
> >> [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
> >> [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
> >> - [NETIF_F_FCOE_MTU_BIT] = "fcoe-mtu",
> >
> >
> > But this definitely _is_ a uAPI change, right?
>
> Why?

That it is not obvious why this is not a uAPI change makes it clear
this needs explaining in the commit message.

Andrew

2024-04-11 15:12:34

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 7/7] netdev_features: convert NETIF_F_FCOE_MTU to IFF_FCOE_MTU

On Thu, 11 Apr 2024 12:28:08 +0200 Alexander Lobakin wrote:
> > Any reason not to make it a bitfield? I haven't looked at the longer
> > patches but this one seems to be used like a basic bool.
>
> This whole enum could be made as bitfields, should we convert it? Would
> be a big patch tho ._.

As always, I haven't investigated closely :) But my thinking was -
we are at 34 bits in priv. We just need to convert 2 of them to
a bitfield, pick two with fewest uses. Then we can downgrade
the field to u32 from ulonglong, and we can carry on adding bitfields?

> > But this definitely _is_ a uAPI change, right?
>
> Why?

It will be user visible, ethtool -k is losing a field.
Whether that's actually going to break anything depends on how silly
user space is.

As Andrew pointed out, definitely something that should be called out
in the commit message.

2024-04-15 14:39:44

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 5/7] netdev_features: convert NETIF_F_HIGHDMA to priv_flag IFF_HIGHDMA

On Fri, Apr 05, 2024 at 03:37:29PM +0200, Alexander Lobakin wrote:
> The ability to send bufferst from the high memory is rather an
> attribute, not a feature. It can't be toggled via Ethtool and
> is constant for the whole interface lifetime.
> Convert it to a private flag, carrying necessary inheritance for
> lower interfaces.
>
> Signed-off-by: Alexander Lobakin <[email protected]>

..

> index f57c29de3a91..78e749f6b91f 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -3007,6 +3007,7 @@ struct ieee80211_hw {
> s16 accuracy;
> } radiotap_timestamp;
> netdev_features_t netdev_features;
> + u64 netdev_priv_flags;
> u8 uapsd_queues;
> u8 uapsd_max_sp_len;
> u8 max_nan_de_entries;

nit: please add netdev_features to the kernel-doc for struct ieee80211_hw.

Flagged by ./scripts/kernel-doc -none

..

2024-04-15 14:40:39

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 2/7] netdev_features: convert NETIF_F_LLTX to priv_flag IFF_LLTX

On Fri, Apr 05, 2024 at 03:37:26PM +0200, Alexander Lobakin wrote:
> NETIF_F_LLTX can't be changed via Ethtool and is not a feature, rather
> an attribute, very similar to IFF_NO_QUEUE.
> Free one netdev_features_t bit and make it a private flag.
>
> Signed-off-by: Alexander Lobakin <[email protected]>

..

> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 0c198620ac93..065dd68fe97c 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1649,6 +1649,8 @@ struct net_device_ops {
> * @IFF_SEE_ALL_HWTSTAMP_REQUESTS: device wants to see calls to
> * ndo_hwtstamp_set() for all timestamp requests regardless of source,
> * even if those aren't HWTSTAMP_SOURCE_NETDEV.
> + @ @IFF_LLTX: device supports lockless Tx. Mainly used by logical interfaces,

Hi Alexander,

Sorry if this has already been flagged - I thought so but I can't find it now.

" @ @IFF_LLTX:" should probably be " * @IFF_LLTX:"

Flagged by ./scripts/kernel-doc -none

> + * such as tunnels.
> */
> enum netdev_priv_flags {
> IFF_802_1Q_VLAN = 1<<0,

..

2024-04-16 12:40:19

by Alexander Lobakin

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 2/7] netdev_features: convert NETIF_F_LLTX to priv_flag IFF_LLTX

From: Simon Horman <[email protected]>
Date: Mon, 15 Apr 2024 15:37:28 +0100

> On Fri, Apr 05, 2024 at 03:37:26PM +0200, Alexander Lobakin wrote:
>> NETIF_F_LLTX can't be changed via Ethtool and is not a feature, rather
>> an attribute, very similar to IFF_NO_QUEUE.
>> Free one netdev_features_t bit and make it a private flag.
>>
>> Signed-off-by: Alexander Lobakin <[email protected]>
>
> ...
>
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index 0c198620ac93..065dd68fe97c 100644
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -1649,6 +1649,8 @@ struct net_device_ops {
>> * @IFF_SEE_ALL_HWTSTAMP_REQUESTS: device wants to see calls to
>> * ndo_hwtstamp_set() for all timestamp requests regardless of source,
>> * even if those aren't HWTSTAMP_SOURCE_NETDEV.
>> + @ @IFF_LLTX: device supports lockless Tx. Mainly used by logical interfaces,
>
> Hi Alexander,
>
> Sorry if this has already been flagged - I thought so but I can't find it now.
>
> " @ @IFF_LLTX:" should probably be " * @IFF_LLTX:"

Sorry, yes, I messed it up.
It's an RFC though, I fixed it already for the next sub.

>
> Flagged by ./scripts/kernel-doc -none
>
>> + * such as tunnels.
>> */
>> enum netdev_priv_flags {
>> IFF_802_1Q_VLAN = 1<<0,
>
> ...

Thanks,
Olek

2024-04-16 12:46:03

by Alexander Lobakin

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 7/7] netdev_features: convert NETIF_F_FCOE_MTU to IFF_FCOE_MTU

From: Jakub Kicinski <[email protected]>
Date: Thu, 11 Apr 2024 07:47:09 -0700

> On Thu, 11 Apr 2024 12:28:08 +0200 Alexander Lobakin wrote:
>>> Any reason not to make it a bitfield? I haven't looked at the longer
>>> patches but this one seems to be used like a basic bool.
>>
>> This whole enum could be made as bitfields, should we convert it? Would
>> be a big patch tho ._.
>
> As always, I haven't investigated closely :) But my thinking was -
> we are at 34 bits in priv. We just need to convert 2 of them to
> a bitfield, pick two with fewest uses. Then we can downgrade
> the field to u32 from ulonglong, and we can carry on adding bitfields?

Hmm, sounds good. You mean convert the existing bits which don't fit
into u32 to bitfields and then add new priv flags as bitfields?

>
>>> But this definitely _is_ a uAPI change, right?
>>
>> Why?
>
> It will be user visible, ethtool -k is losing a field.
> Whether that's actually going to break anything depends on how silly
> user space is.

ethtool -{k,K} output would definitely change, but it's not an ABI.
Rather some corpo scripts may break, OTOH those "features" never were
available for toggling.

>
> As Andrew pointed out, definitely something that should be called out
> in the commit message.

Sure, good point.

Thanks,
Olek

2024-04-16 14:23:59

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH RFC net-next 7/7] netdev_features: convert NETIF_F_FCOE_MTU to IFF_FCOE_MTU

On Tue, 16 Apr 2024 14:45:42 +0200 Alexander Lobakin wrote:
> >> This whole enum could be made as bitfields, should we convert it? Would
> >> be a big patch tho ._.
> >
> > As always, I haven't investigated closely :) But my thinking was -
> > we are at 34 bits in priv. We just need to convert 2 of them to
> > a bitfield, pick two with fewest uses. Then we can downgrade
> > the field to u32 from ulonglong, and we can carry on adding bitfields?
>
> Hmm, sounds good. You mean convert the existing bits which don't fit
> into u32 to bitfields and then add new priv flags as bitfields?

Yes