@@ -1861,7 +1861,7 @@ static void ipoib_set_dev_features(struct ipoib_dev_priv *priv)
if (priv->kernel_caps & IBK_UD_TSO)
netdev_hw_feature_add(priv->dev, NETIF_F_TSO_BIT);
- priv->dev->features |= priv->dev->hw_features;
+ netdev_active_features_set(priv->dev, priv->dev->hw_features);
}
}
@@ -3117,9 +3117,9 @@ static void amt_link_setup(struct net_device *dev)
dev->hard_header_len = 0;
dev->addr_len = 0;
dev->priv_flags |= IFF_NO_QUEUE;
- dev->features |= NETIF_F_GSO_SOFTWARE;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
netdev_active_features_set_array(dev, &amt_feature_set);
- dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+ netdev_hw_features_set(dev, NETIF_F_GSO_SOFTWARE);
netdev_hw_features_set_array(dev, &amt_hw_feature_set);
eth_hw_addr_random(dev);
eth_zero_addr(dev->broadcast);
@@ -557,9 +557,9 @@ static void bareudp_setup(struct net_device *dev)
dev->needs_free_netdev = true;
SET_NETDEV_DEVTYPE(dev, &bareudp_type);
netdev_active_features_set_array(dev, &bareudp_feature_set);
- dev->features |= NETIF_F_GSO_SOFTWARE;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
netdev_hw_features_set_array(dev, &bareudp_hw_feature_set);
- dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+ netdev_hw_features_set(dev, NETIF_F_GSO_SOFTWARE);
dev->hard_header_len = 0;
dev->addr_len = 0;
dev->mtu = ETH_DATA_LEN;
@@ -1421,7 +1421,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
#if IS_ENABLED(CONFIG_TLS_DEVICE)
if (bond_sk_check(bond))
- features |= BOND_TLS_FEATURES;
+ netdev_features_set(&features, BOND_TLS_FEATURES);
else
features &= ~BOND_TLS_FEATURES;
#endif
@@ -1429,7 +1429,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
mask = features;
features &= ~NETIF_F_ONE_FOR_ALL;
- features |= NETIF_F_ALL_FOR_ALL;
+ netdev_features_set(&features, NETIF_F_ALL_FOR_ALL);
bond_for_each_slave(bond, slave, iter) {
features = netdev_increment_features(features,
@@ -1498,10 +1498,11 @@ static void bond_compute_features(struct bonding *bond)
done:
bond_dev->vlan_features = vlan_features;
- bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
- bond_dev->hw_enc_features |= netdev_tx_vlan_features;
+ bond_dev->hw_enc_features = netdev_features_or(enc_features,
+ NETIF_F_GSO_ENCAP_ALL);
+ netdev_hw_enc_features_set(bond_dev, netdev_tx_vlan_features);
#ifdef CONFIG_XFRM_OFFLOAD
- bond_dev->hw_enc_features |= xfrm_features;
+ netdev_hw_enc_features_set(bond_dev, xfrm_features);
#endif /* CONFIG_XFRM_OFFLOAD */
bond_dev->mpls_features = mpls_features;
netif_set_tso_max_segs(bond_dev, tso_max_segs);
@@ -5769,18 +5770,18 @@ void bond_setup(struct net_device *bond_dev)
netdev_hw_feature_add(bond_dev, NETIF_F_HW_VLAN_CTAG_RX_BIT);
netdev_hw_feature_add(bond_dev, NETIF_F_HW_VLAN_CTAG_FILTER_BIT);
- bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
- bond_dev->features |= bond_dev->hw_features;
- bond_dev->features |= netdev_tx_vlan_features;
+ netdev_hw_features_set(bond_dev, NETIF_F_GSO_ENCAP_ALL);
+ netdev_active_features_set(bond_dev, bond_dev->hw_features);
+ netdev_active_features_set(bond_dev, netdev_tx_vlan_features);
#ifdef CONFIG_XFRM_OFFLOAD
- bond_dev->hw_features |= BOND_XFRM_FEATURES;
+ netdev_hw_features_set(bond_dev, BOND_XFRM_FEATURES);
/* Only enable XFRM features if this is an active-backup config */
if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)
- bond_dev->features |= BOND_XFRM_FEATURES;
+ netdev_active_features_set(bond_dev, BOND_XFRM_FEATURES);
#endif /* CONFIG_XFRM_OFFLOAD */
#if IS_ENABLED(CONFIG_TLS_DEVICE)
if (bond_sk_check(bond))
- bond_dev->features |= BOND_TLS_FEATURES;
+ netdev_active_features_set(bond_dev, BOND_TLS_FEATURES);
#endif
}
@@ -8,6 +8,7 @@
#include <linux/errno.h>
#include <linux/if.h>
#include <linux/netdevice.h>
+#include <linux/netdev_features_helper.h>
#include <linux/spinlock.h>
#include <linux/rcupdate.h>
#include <linux/ctype.h>
@@ -835,7 +836,7 @@ static bool bond_set_xfrm_features(struct bonding *bond)
return false;
if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)
- bond->dev->wanted_features |= BOND_XFRM_FEATURES;
+ netdev_wanted_features_set(bond->dev, BOND_XFRM_FEATURES);
else
bond->dev->wanted_features &= ~BOND_XFRM_FEATURES;
@@ -848,7 +849,7 @@ static bool bond_set_tls_features(struct bonding *bond)
return false;
if (bond_sk_check(bond))
- bond->dev->wanted_features |= BOND_TLS_FEATURES;
+ netdev_wanted_features_set(bond->dev, BOND_TLS_FEATURES);
else
bond->dev->wanted_features &= ~BOND_TLS_FEATURES;
@@ -132,10 +132,10 @@ static void dummy_setup(struct net_device *dev)
dev->flags &= ~IFF_MULTICAST;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
netdev_active_features_set_array(dev, &dummy_feature_set);
- dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->features |= NETIF_F_GSO_ENCAP_ALL;
- dev->hw_features |= dev->features;
- dev->hw_enc_features |= dev->features;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
+ netdev_active_features_set(dev, NETIF_F_GSO_ENCAP_ALL);
+ netdev_hw_features_set(dev, dev->features);
+ netdev_hw_enc_features_set(dev, dev->features);
eth_hw_addr_random(dev);
dev->min_mtu = 0;
@@ -1781,7 +1781,7 @@ static int slic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->netdev_ops = &slic_netdev_ops;
netdev_hw_features_zero(dev);
netdev_hw_feature_add(dev, NETIF_F_RXCSUM_BIT);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
dev->ethtool_ops = &slic_ethtool_ops;
@@ -1558,7 +1558,7 @@ 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;
+ netdev_active_features_set(ndev, ndev->hw_features);
netdev_active_feature_add(ndev, NETIF_F_HIGHDMA_BIT);
/* VLAN offloading of tagging, stripping and filtering is not
@@ -4050,8 +4050,8 @@ static void ena_set_dev_offloads(struct ena_com_dev_get_features_ctx *feat,
netdev->features = dev_features;
netdev_active_features_set_array(netdev, &ena_feature_set);
- netdev->hw_features |= netdev->features;
- netdev->vlan_features |= netdev->features;
+ netdev_hw_features_set(netdev, netdev->features);
+ netdev_vlan_features_set(netdev, netdev->features);
}
static void ena_set_conf_feat_params(struct ena_adapter *adapter,
@@ -63,6 +63,7 @@ Revision History:
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
+#include <linux/netdev_features_helper.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
@@ -1791,7 +1792,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
SET_NETDEV_DEV(dev, &pdev->dev);
#if AMD8111E_VLAN_TAG_USED
- dev->features |= netdev_ctag_vlan_offload_features;
+ netdev_active_features_set(dev, netdev_ctag_vlan_offload_features);
#endif
lp = netdev_priv(dev);
@@ -2203,7 +2203,7 @@ static netdev_features_t xgbe_fix_features(struct net_device *netdev,
if ((features & vxlan_base) != vxlan_base) {
netdev_notice(netdev,
"forcing both tx and rx udp tunnel support\n");
- features |= vxlan_base;
+ netdev_features_set(&features, vxlan_base);
}
if (features & netdev_ip_csum_features) {
@@ -390,7 +390,7 @@ int xgbe_config_netdev(struct xgbe_prv_data *pdata)
netdev_vlan_features_set_array(netdev, &xgbe_vlan_feature_set);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
pdata->netdev_features = netdev->features;
netdev->priv_flags |= IFF_UNICAST_FLT;
@@ -383,7 +383,7 @@ void aq_nic_ndev_init(struct aq_nic_s *self)
const struct aq_hw_caps_s *aq_hw_caps = self->aq_nic_cfg.aq_hw_caps;
struct aq_nic_cfg_s *aq_nic_cfg = &self->aq_nic_cfg;
- self->ndev->hw_features |= *aq_hw_caps->hw_features;
+ netdev_hw_features_set(self->ndev, *aq_hw_caps->hw_features);
self->ndev->features = *aq_hw_caps->hw_features;
netdev_vlan_features_set_array(self->ndev, &aq_nic_vlan_feature_set);
netdev_gso_partial_features_zero(self->ndev);
@@ -1029,8 +1029,8 @@ static int ax88796c_probe(struct spi_device *spi)
ndev->irq = spi->irq;
ndev->netdev_ops = &ax88796c_netdev_ops;
ndev->ethtool_ops = &ax88796c_ethtool_ops;
- ndev->hw_features |= ax88796c_features;
- ndev->features |= ax88796c_features;
+ netdev_hw_features_set(ndev, ax88796c_features);
+ netdev_active_features_set(ndev, ax88796c_features);
ndev->needed_headroom = TX_OVERHEAD;
ndev->needed_tailroom = TX_EOP_SIZE;
@@ -1392,7 +1392,7 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_hw_features_zero(netdev);
netdev_hw_feature_add(netdev, NETIF_F_HW_VLAN_CTAG_RX_BIT);
- netdev->features |= netdev_ctag_vlan_offload_features;
+ netdev_active_features_set(netdev, netdev_ctag_vlan_offload_features);
/* Init PHY as early as possible due to power saving issue */
atl2_phy_init(&adapter->hw);
@@ -18,6 +18,7 @@
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/netdevice.h>
+#include <linux/netdev_features_helper.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/if_ether.h>
@@ -2359,7 +2360,7 @@ static int b44_init_one(struct ssb_device *sdev,
SET_NETDEV_DEV(dev, sdev->dev);
/* No interesting netdevice features in this card... */
- dev->features |= netdev_empty_features;
+ netdev_active_features_set(dev, netdev_empty_features);
bp = netdev_priv(dev);
bp->sdev = sdev;
@@ -2583,8 +2583,8 @@ static int bcm_sysport_probe(struct platform_device *pdev)
netif_napi_add(dev, &priv->napi, bcm_sysport_poll, 64);
netdev_active_features_set_array(dev, &bcm_feature_set);
- dev->hw_features |= dev->features;
- dev->vlan_features |= dev->features;
+ netdev_hw_features_set(dev, dev->features);
+ netdev_vlan_features_set(dev, dev->features);
dev->max_mtu = UMAC_MAX_MTU_SIZE;
/* Request the WOL interrupt and advertise suspend if available */
@@ -7758,7 +7758,7 @@ bnx2_set_features(struct net_device *dev, netdev_features_t features)
netdev_features_t tso;
tso = dev->hw_features & NETIF_F_ALL_TSO;
- dev->vlan_features |= tso;
+ netdev_vlan_features_set(dev, tso);
} else {
dev->vlan_features &= ~NETIF_F_ALL_TSO;
}
@@ -8602,8 +8602,8 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
}
dev->vlan_features = dev->hw_features;
- dev->hw_features |= netdev_ctag_vlan_offload_features;
- dev->features |= dev->hw_features;
+ netdev_hw_features_set(dev, netdev_ctag_vlan_offload_features);
+ netdev_active_features_set(dev, dev->hw_features);
dev->priv_flags |= IFF_UNICAST_FLT;
dev->min_mtu = MIN_ETHERNET_PACKET_SIZE;
dev->max_mtu = MAX_ETHERNET_JUMBO_PACKET_SIZE;
@@ -13278,7 +13278,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
* getting a response to CHANNEL_TLV_ACQUIRE from PF.
*/
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
netdev_active_feature_add(dev, NETIF_F_HW_VLAN_CTAG_RX_BIT);
netdev_active_feature_add(dev, NETIF_F_HIGHDMA_BIT);
if (dev->features & NETIF_F_LRO)
@@ -11203,7 +11203,8 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
if (dev->features & BNXT_HW_FEATURE_VLAN_ALL_RX)
features &= ~BNXT_HW_FEATURE_VLAN_ALL_RX;
else if (vlan_features)
- features |= BNXT_HW_FEATURE_VLAN_ALL_RX;
+ netdev_features_set(&features,
+ BNXT_HW_FEATURE_VLAN_ALL_RX);
}
#ifdef CONFIG_BNXT_SRIOV
if (BNXT_VF(bp) && bp->vf.vlan)
@@ -13648,12 +13649,12 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->vlan_features = dev->hw_features;
netdev_vlan_feature_add(dev, NETIF_F_HIGHDMA_BIT);
if (bp->fw_cap & BNXT_FW_CAP_VLAN_RX_STRIP)
- dev->hw_features |= BNXT_HW_FEATURE_VLAN_ALL_RX;
+ netdev_hw_features_set(dev, 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;
+ netdev_hw_features_set(dev, BNXT_HW_FEATURE_VLAN_ALL_TX);
if (BNXT_SUPPORTS_TPA(bp))
netdev_hw_feature_add(dev, NETIF_F_GRO_HW_BIT);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
netdev_active_feature_add(dev, NETIF_F_HIGHDMA_BIT);
if (dev->features & NETIF_F_GRO_HW)
dev->features &= ~NETIF_F_LRO;
@@ -8,6 +8,7 @@
*/
#include <linux/pci.h>
#include <linux/netdevice.h>
+#include <linux/netdev_features_helper.h>
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>
#include <linux/jhash.h>
@@ -472,7 +473,7 @@ static void bnxt_vf_rep_netdev_init(struct bnxt *bp, struct bnxt_vf_rep *vf_rep,
dev->gso_partial_features = pf_dev->gso_partial_features;
dev->vlan_features = pf_dev->vlan_features;
dev->hw_enc_features = pf_dev->hw_enc_features;
- dev->features |= pf_dev->features;
+ netdev_active_features_set(dev, pf_dev->features);
bnxt_vf_rep_eth_addr_gen(bp->pf.mac_addr, vf_rep->vf_idx,
dev->perm_addr);
eth_hw_addr_set(dev, dev->perm_addr);
@@ -4033,8 +4033,8 @@ static int bcmgenet_probe(struct platform_device *pdev)
/* Set default features */
netdev_active_features_set_array(dev, &bcmgenet_feature_set);
- dev->hw_features |= dev->features;
- dev->vlan_features |= dev->features;
+ netdev_hw_features_set(dev, dev->features);
+ netdev_vlan_features_set(dev, dev->features);
/* Request the WOL interrupt and advertise suspend if available */
priv->wol_irq_disabled = true;
@@ -17755,9 +17755,9 @@ static int tg3_init_one(struct pci_dev *pdev,
netdev_feature_add(NETIF_F_TSO_ECN_BIT, &features);
}
- dev->features |= features;
- dev->features |= netdev_ctag_vlan_offload_features;
- dev->vlan_features |= features;
+ netdev_active_features_set(dev, features);
+ netdev_active_features_set(dev, netdev_ctag_vlan_offload_features);
+ netdev_vlan_features_set(dev, features);
/*
* Add loopback capability only for a subset of devices that support
@@ -17769,7 +17769,7 @@ static int tg3_init_one(struct pci_dev *pdev,
/* Add the loopback capability */
netdev_feature_add(NETIF_F_LOOPBACK_BIT, &features);
- dev->hw_features |= features;
+ netdev_hw_features_set(dev, features);
dev->priv_flags |= IFF_UNICAST_FLT;
/* MTU range: 60 - 9000 or 1500, depending on hardware */
@@ -3450,7 +3450,7 @@ bnad_netdev_init(struct bnad *bnad)
netdev_vlan_features_zero(netdev);
netdev_vlan_features_set_array(netdev, &bnad_vlan_feature_set);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev_active_features_set_array(netdev, &bnad_feature_set);
netdev->mem_start = bnad->mmio_start;
@@ -1787,7 +1787,7 @@ static int xgmac_probe(struct platform_device *pdev)
netdev_hw_features_set_array(ndev, &xgmac_hw_feature_set);
if (readl(priv->base + XGMAC_DMA_HW_FEATURE) & DMA_HW_FEAT_TXCOESEL)
netdev_hw_features_set_array(ndev, &xgmac_csum_feature_set);
- ndev->features |= ndev->hw_features;
+ netdev_active_features_set(ndev, ndev->hw_features);
ndev->priv_flags |= IFF_UNICAST_FLT;
/* MTU range: 46 - 9000 */
@@ -3600,7 +3600,7 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
netdev->vlan_features = lio->dev_capability;
/* Add any unchangeable hw features */
- lio->dev_capability |= netdev_ctag_vlan_features;
+ netdev_features_set(&lio->dev_capability, netdev_ctag_vlan_features);
netdev->features = lio->dev_capability;
netdev->features &= ~NETIF_F_LRO;
@@ -2128,7 +2128,7 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
netdev->vlan_features = lio->dev_capability;
/* Add any unchangeable hw features */
- lio->dev_capability |= netdev_ctag_vlan_features;
+ netdev_features_set(&lio->dev_capability, netdev_ctag_vlan_features);
netdev->features = lio->dev_capability;
netdev->features &= ~NETIF_F_LRO;
@@ -2225,7 +2225,7 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_hw_feature_add(netdev, NETIF_F_RXHASH_BIT);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev_hw_feature_add(netdev, NETIF_F_LOOPBACK_BIT);
netdev_vlan_features_zero(netdev);
@@ -1048,7 +1048,8 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_active_features_set_array(netdev, &cxgb_feature_set);
if (vlan_tso_capable(adapter)) {
- netdev->features |= netdev_ctag_vlan_offload_features;
+ netdev_active_features_set(netdev,
+ netdev_ctag_vlan_offload_features);
netdev_hw_feature_add(netdev,
NETIF_F_HW_VLAN_CTAG_RX_BIT);
@@ -3321,12 +3321,12 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->mem_end = mmio_start + mmio_len - 1;
netdev_hw_features_zero(netdev);
netdev_hw_features_set_array(netdev, &cxgb_hw_feature_set);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev_active_feature_add(netdev, NETIF_F_HW_VLAN_CTAG_TX_BIT);
netdev_features_zero(&vlan_feat);
netdev_features_set_array(&cxgb_vlan_feature_set, &vlan_feat);
vlan_feat &= netdev->features;
- netdev->vlan_features |= vlan_feat;
+ netdev_vlan_features_set(netdev, vlan_feat);
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
@@ -6861,7 +6861,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->udp_tunnel_nic_info = &cxgb_udp_tunnels;
}
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
vlan_features = tso_features;
netdev_features_set_array(&cxgb4_vlan_feature_set, &vlan_features);
netdev->vlan_features = netdev->features & vlan_features;
@@ -2894,7 +2894,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->watchdog_timeo = 2 * HZ;
enic_set_ethtool_ops(netdev);
- netdev->features |= netdev_ctag_vlan_offload_features;
+ netdev_active_features_set(netdev, netdev_ctag_vlan_offload_features);
if (ENIC_SETTING(enic, LOOP)) {
netdev->features &= ~NETIF_F_HW_VLAN_CTAG_TX;
enic->loop_enable = 1;
@@ -2906,7 +2906,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_hw_feature_add(netdev, NETIF_F_HW_CSUM_BIT);
}
if (ENIC_SETTING(enic, TSO)) {
- netdev->hw_features |= netdev_general_tso_features;
+ netdev_hw_features_set(netdev, netdev_general_tso_features);
netdev_hw_feature_add(netdev, NETIF_F_TSO_ECN_BIT);
}
if (ENIC_SETTING(enic, RSS))
@@ -2919,7 +2919,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_hw_enc_features_set_array(netdev,
&enic_hw_enc_feature_set);
- netdev->hw_features |= netdev->hw_enc_features;
+ netdev_hw_features_set(netdev, netdev->hw_enc_features);
/* get bit mask from hw about supported offload bit level
* BIT(0) = fw supports patch_level 0
* fcoe bit = encap
@@ -2952,8 +2952,8 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
}
- netdev->features |= netdev->hw_features;
- netdev->vlan_features |= netdev->features;
+ netdev_active_features_set(netdev, netdev->hw_features);
+ netdev_vlan_features_set(netdev, netdev->features);
#ifdef CONFIG_RFS_ACCEL
netdev_hw_feature_add(netdev, NETIF_F_NTUPLE_BIT);
@@ -2471,7 +2471,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
gmac_clear_hw_stats(netdev);
netdev->hw_features = GMAC_OFFLOAD_FEATURES;
- netdev->features |= GMAC_OFFLOAD_FEATURES;
+ netdev_active_features_set(netdev, GMAC_OFFLOAD_FEATURES);
netdev_active_feature_add(netdev, NETIF_F_GRO_BIT);
/* We can handle jumbo frames up to 10236 bytes so, let's accept
* payloads of 10236 bytes minus VLAN and ethernet header
@@ -1648,7 +1648,7 @@ dm9000_probe(struct platform_device *pdev)
netdev_hw_features_zero(ndev);
netdev_hw_feature_add(ndev, NETIF_F_RXCSUM_BIT);
netdev_hw_feature_add(ndev, NETIF_F_IP_CSUM_BIT);
- ndev->features |= ndev->hw_features;
+ netdev_active_features_set(ndev, ndev->hw_features);
}
/* from this point we assume that we have found a DM9000 */
@@ -14,6 +14,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
+#include <linux/netdev_features_helper.h>
#include <linux/etherdevice.h>
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
@@ -763,7 +764,7 @@ static int dnet_probe(struct platform_device *pdev)
return -ENOMEM;
/* TODO: Actually, we have some interesting features... */
- dev->features |= netdev_empty_features;
+ netdev_active_features_set(dev, netdev_empty_features);
bp = netdev_priv(dev);
bp->dev = dev;
@@ -5218,7 +5218,7 @@ static void be_netdev_init(struct net_device *netdev)
if ((be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS))
netdev_hw_feature_add(netdev, NETIF_F_RXHASH_BIT);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev_active_features_set_array(netdev, &be_feature_set);
netdev_vlan_features_set_array(netdev, &be_vlan_feature_set);
@@ -15,6 +15,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mii.h>
+#include <linux/netdev_features_helper.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
@@ -1220,7 +1221,7 @@ static int ethoc_probe(struct platform_device *pdev)
/* setup the net_device structure */
netdev->netdev_ops = ðoc_netdev_ops;
netdev->watchdog_timeo = ETHOC_TIMEOUT;
- netdev->features |= netdev_empty_features;
+ netdev_active_features_set(netdev, netdev_empty_features);
netdev->ethtool_ops = ðoc_ethtool_ops;
/* setup NAPI */
@@ -1957,7 +1957,7 @@ static int ftgmac100_probe(struct platform_device *pdev)
netdev->hw_features &= ~NETIF_F_HW_CSUM;
netdev->hw_features &= ~NETIF_F_RXCSUM;
}
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
/* register network device */
err = register_netdev(netdev);
@@ -244,7 +244,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
/* we do not want shared skbs on TX */
net_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
- net_dev->features |= net_dev->hw_features;
+ netdev_active_features_set(net_dev, net_dev->hw_features);
net_dev->vlan_features = net_dev->features;
if (is_valid_ether_addr(mac_addr)) {
@@ -3257,7 +3257,7 @@ static int gfar_probe(struct platform_device *ofdev)
}
if (priv->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) {
- dev->hw_features |= netdev_ctag_vlan_offload_features;
+ netdev_hw_features_set(dev, netdev_ctag_vlan_offload_features);
netdev_active_feature_add(dev, NETIF_F_HW_VLAN_CTAG_RX_BIT);
}
@@ -1784,18 +1784,18 @@ static int fun_create_netdev(struct fun_ethdev *ed, unsigned int portid)
netdev_features_set_array(&fun_gso_encap_feature_set, &gso_encap_flags);
netdev_features_set_array(&fun_tso_feature_set, &tso_flags);
- vlan_feat = gso_encap_flags | tso_flags;
+ vlan_feat = netdev_features_or(gso_encap_flags, tso_flags);
netdev_features_set_array(&fun_vlan_feature_set, &vlan_feat);
netdev_hw_features_set_array(netdev, &fun_hw_feature_set);
if (fp->port_caps & FUN_PORT_CAP_OFFLOADS) {
netdev_hw_feature_add(netdev, NETIF_F_HW_CSUM_BIT);
- netdev->hw_features |= tso_flags;
+ netdev_hw_features_set(netdev, tso_flags);
}
if (fp->port_caps & FUN_PORT_CAP_ENCAP_OFFLOADS)
- netdev->hw_features |= gso_encap_flags;
+ netdev_hw_features_set(netdev, gso_encap_flags);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
netdev->vlan_features = netdev->features & vlan_feat;
netdev->mpls_features = netdev->vlan_features;
@@ -1237,9 +1237,9 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
if (HAS_CAP_TSO(priv->hw_cap))
netdev_hw_feature_add(ndev, NETIF_F_SG_BIT);
- ndev->features |= ndev->hw_features;
+ netdev_active_features_set(ndev, ndev->hw_features);
netdev_active_feature_add(ndev, NETIF_F_HIGHDMA_BIT);
- ndev->vlan_features |= ndev->features;
+ netdev_vlan_features_set(ndev, ndev->features);
ret = hix5hd2_init_hw_desc_queue(priv);
if (ret)
@@ -2364,7 +2364,7 @@ static int hns_nic_dev_probe(struct platform_device *pdev)
case AE_VERSION_2:
netdev_active_features_set_array(ndev, &hns_v2_feature_set);
netdev_hw_features_set_array(ndev, &hns_hw_feature_set);
- ndev->vlan_features |= netdev_general_tso_features;
+ netdev_vlan_features_set(ndev, netdev_general_tso_features);
ndev->max_mtu = MAC_MAX_MTU_V2 -
(ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN);
break;
@@ -3305,7 +3305,7 @@ static void hns3_set_default_feature(struct net_device *netdev)
if (test_bit(HNAE3_DEV_SUPPORT_HW_TX_CSUM_B, ae_dev->caps))
netdev_active_feature_add(netdev, NETIF_F_HW_CSUM_BIT);
else
- netdev->features |= netdev_ip_csum_features;
+ netdev_active_features_set(netdev, netdev_ip_csum_features);
if (test_bit(HNAE3_DEV_SUPPORT_UDP_TUNNEL_CSUM_B, ae_dev->caps))
netdev_active_feature_add(netdev,
@@ -3314,7 +3314,7 @@ static void hns3_set_default_feature(struct net_device *netdev)
if (test_bit(HNAE3_DEV_SUPPORT_FD_FORWARD_TC_B, ae_dev->caps))
netdev_active_feature_add(netdev, NETIF_F_HW_TC_BIT);
- netdev->hw_features |= netdev->features;
+ netdev_hw_features_set(netdev, netdev->features);
if (!test_bit(HNAE3_DEV_SUPPORT_VLAN_FLTR_MDF_B, ae_dev->caps))
netdev->hw_features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
@@ -3322,9 +3322,9 @@ static void hns3_set_default_feature(struct net_device *netdev)
netdev_features_set_array(&hns3_vlan_off_feature_set,
&vlan_off_features);
features = netdev->features & ~vlan_off_features;
- netdev->vlan_features |= features;
+ netdev_vlan_features_set(netdev, features);
- netdev->hw_enc_features |= netdev->vlan_features;
+ netdev_hw_enc_features_set(netdev, netdev->vlan_features);
netdev_hw_enc_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
}
@@ -3177,7 +3177,7 @@ static int emac_probe(struct platform_device *ofdev)
if (dev->tah_dev) {
netdev_hw_features_zero(ndev);
netdev_hw_features_set_array(ndev, &emac_hw_feature_set);
- ndev->features |= ndev->hw_features;
+ netdev_active_features_set(ndev, ndev->hw_features);
netdev_active_feature_add(ndev, NETIF_F_RXCSUM_BIT);
}
ndev->watchdog_timeo = 5 * HZ;
@@ -1689,15 +1689,15 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
if (vio_get_attribute(dev, "ibm,illan-options", NULL) != NULL)
netdev_hw_features_set_array(netdev, &ibmveth_hw_feature_set);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
ret = h_illan_attributes(adapter->vdev->unit_address, 0, 0, &ret_attr);
/* If running older firmware, TSO should not be enabled by default */
if (ret == H_SUCCESS && (ret_attr & IBMVETH_ILLAN_LRG_SND_SUPPORT) &&
!old_large_send) {
- netdev->hw_features |= netdev_general_tso_features;
- netdev->features |= netdev->hw_features;
+ netdev_hw_features_set(netdev, netdev_general_tso_features);
+ netdev_active_features_set(netdev, netdev->hw_features);
} else {
netdev_hw_feature_add(netdev, NETIF_F_TSO_BIT);
}
@@ -4893,7 +4893,8 @@ static void send_control_ip_offload(struct ibmvnic_adapter *adapter)
netdev_hw_feature_add(adapter->netdev, NETIF_F_TSO6_BIT);
if (adapter->state == VNIC_PROBING) {
- adapter->netdev->features |= adapter->netdev->hw_features;
+ netdev_active_features_set(adapter->netdev,
+ adapter->netdev->hw_features);
} else if (old_hw_features != adapter->netdev->hw_features) {
netdev_features_t tmp = netdev_empty_features;
@@ -4903,7 +4904,7 @@ static void send_control_ip_offload(struct ibmvnic_adapter *adapter)
tmp = old_hw_features ^ adapter->netdev->hw_features;
tmp &= adapter->netdev->hw_features;
tmp &= adapter->netdev->wanted_features;
- adapter->netdev->features |= tmp;
+ netdev_active_features_set(adapter->netdev, tmp);
}
memset(&crq, 0, sizeof(crq));
@@ -1063,7 +1063,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->priv_flags |= IFF_SUPP_NOFCS;
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev_hw_features_set_array(netdev, &e1000_hw_rx_feature_set);
if (pci_using_dac) {
@@ -5305,7 +5305,8 @@ static void e1000_watchdog_task(struct work_struct *work)
netdev->features &= ~netdev_general_tso_features;
break;
case SPEED_1000:
- netdev->features |= netdev_general_tso_features;
+ netdev_active_features_set(netdev,
+ netdev_general_tso_features);
break;
default:
/* oops */
@@ -1595,17 +1595,17 @@ struct net_device *fm10k_alloc_netdev(const struct fm10k_info *info)
netdev_feature_add(NETIF_F_HW_L2FW_DOFFLOAD_BIT, &hw_features);
/* configure VLAN features */
- dev->vlan_features |= dev->features;
+ netdev_vlan_features_set(dev, dev->features);
/* we want to leave these both on as we cannot disable VLAN tag
* insertion or stripping on the hardware since it is contained
* in the FTAG and not in the frame itself.
*/
- dev->features |= netdev_ctag_vlan_features;
+ netdev_active_features_set(dev, netdev_ctag_vlan_features);
dev->priv_flags |= IFF_UNICAST_FLT;
- dev->hw_features |= hw_features;
+ netdev_hw_features_set(dev, hw_features);
/* MTU range: 68 - 15342 */
dev->min_mtu = ETH_MIN_MTU;
@@ -13687,10 +13687,10 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
netdev_gso_partial_feature_add(netdev, NETIF_F_GSO_GRE_CSUM_BIT);
- netdev->hw_enc_features |= hw_enc_features;
+ netdev_hw_enc_features_set(netdev, hw_enc_features);
/* record features VLANs can make use of */
- netdev->vlan_features |= hw_enc_features;
+ netdev_vlan_features_set(netdev, hw_enc_features);
netdev_vlan_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
netdev_features_zero(&gso_partial_features);
@@ -13698,24 +13698,25 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
&gso_partial_features);
netdev->gso_partial_features = gso_partial_features;
netdev_active_feature_add(netdev, NETIF_F_GSO_PARTIAL_BIT);
- netdev->features |= gso_partial_features;
+ netdev_active_features_set(netdev, gso_partial_features);
netdev_mpls_features_set_array(netdev, &i40e_mpls_feature_set);
- netdev->mpls_features |= gso_partial_features;
+ netdev_mpls_features_set(netdev, gso_partial_features);
/* enable macvlan offloads */
netdev_hw_feature_add(netdev, NETIF_F_HW_L2FW_DOFFLOAD_BIT);
- hw_features = hw_enc_features | netdev_ctag_vlan_offload_features;
+ hw_features = netdev_features_or(hw_enc_features,
+ netdev_ctag_vlan_offload_features);
if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) {
netdev_feature_add(NETIF_F_NTUPLE_BIT, &hw_features);
netdev_feature_add(NETIF_F_HW_TC_BIT, &hw_features);
}
- netdev->hw_features |= hw_features;
+ netdev_hw_features_set(netdev, hw_features);
- netdev->features |= hw_features;
+ netdev_active_features_set(netdev, hw_features);
netdev_active_feature_add(netdev, NETIF_F_HW_VLAN_CTAG_FILTER_BIT);
netdev_hw_enc_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
@@ -4324,7 +4324,8 @@ iavf_get_netdev_vlan_hw_features(struct iavf_adapter *adapter)
/* Enable VLAN features if supported */
if (VLAN_ALLOWED(adapter)) {
- hw_features |= netdev_ctag_vlan_offload_features;
+ netdev_features_set(&hw_features,
+ netdev_ctag_vlan_offload_features);
} else if (VLAN_V2_ALLOWED(adapter)) {
struct virtchnl_vlan_caps *vlan_v2_caps =
&adapter->vlan_v2_caps;
@@ -4390,7 +4391,7 @@ iavf_get_netdev_vlan_features(struct iavf_adapter *adapter)
return features;
if (VLAN_ALLOWED(adapter)) {
- features |= netdev_ctag_vlan_features;
+ netdev_features_set(&features, netdev_ctag_vlan_features);
} else if (VLAN_V2_ALLOWED(adapter)) {
struct virtchnl_vlan_caps *vlan_v2_caps =
&adapter->vlan_v2_caps;
@@ -4497,8 +4498,8 @@ iavf_fix_netdev_vlan_features(struct iavf_adapter *adapter,
{
netdev_features_t allowed_features;
- allowed_features = iavf_get_netdev_vlan_hw_features(adapter) |
- iavf_get_netdev_vlan_features(adapter);
+ allowed_features = netdev_features_or(iavf_get_netdev_vlan_hw_features(adapter),
+ iavf_get_netdev_vlan_features(adapter));
if (!IAVF_NETDEV_VLAN_FEATURE_ALLOWED(requested_features,
allowed_features,
@@ -4646,10 +4647,10 @@ int iavf_process_config(struct iavf_adapter *adapter)
netdev_gso_partial_feature_add(netdev,
NETIF_F_GSO_GRE_CSUM_BIT);
netdev_hw_enc_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
- netdev->hw_enc_features |= hw_enc_features;
+ netdev_hw_enc_features_set(netdev, hw_enc_features);
}
/* record features VLANs can make use of */
- netdev->vlan_features |= hw_enc_features;
+ netdev_vlan_features_set(netdev, hw_enc_features);
netdev_vlan_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
/* Write features and hw_features separately to avoid polluting
@@ -4666,12 +4667,12 @@ int iavf_process_config(struct iavf_adapter *adapter)
if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_USO)
netdev_feature_add(NETIF_F_GSO_UDP_L4_BIT, &hw_features);
- netdev->hw_features |= hw_features;
- netdev->hw_features |= hw_vlan_features;
+ netdev_hw_features_set(netdev, hw_features);
+ netdev_hw_features_set(netdev, hw_vlan_features);
vlan_features = iavf_get_netdev_vlan_features(adapter);
- netdev->features |= hw_features;
- netdev->features |= vlan_features;
+ netdev_active_features_set(netdev, hw_features);
+ netdev_active_features_set(netdev, vlan_features);
if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)
netdev_active_feature_add(netdev,
@@ -3365,27 +3365,27 @@ static void ice_set_netdev_features(struct net_device *netdev)
NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT);
netdev_gso_partial_feature_add(netdev, NETIF_F_GSO_GRE_CSUM_BIT);
/* set features that user can change */
- netdev->hw_features = dflt_features | csumo_features;
- netdev->hw_features |= vlano_features;
- netdev->hw_features |= tso_features;
+ netdev->hw_features = netdev_features_or(dflt_features, csumo_features);
+ netdev_hw_features_set(netdev, vlano_features);
+ netdev_hw_features_set(netdev, tso_features);
/* add support for HW_CSUM on packets with MPLS header */
netdev_mpls_features_zero(netdev);
netdev_mpls_features_set_array(netdev, &ice_mpls_feature_set);
/* enable features */
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev_hw_feature_add(netdev, NETIF_F_HW_TC_BIT);
netdev_hw_feature_add(netdev, NETIF_F_LOOPBACK_BIT);
/* encap and VLAN devices inherit default, csumo and tso features */
- netdev->hw_enc_features |= dflt_features;
- netdev->hw_enc_features |= csumo_features;
- netdev->hw_enc_features |= tso_features;
- netdev->vlan_features |= dflt_features;
- netdev->vlan_features |= csumo_features;
- netdev->vlan_features |= tso_features;
+ netdev_hw_enc_features_set(netdev, dflt_features);
+ netdev_hw_enc_features_set(netdev, csumo_features);
+ netdev_hw_enc_features_set(netdev, tso_features);
+ netdev_vlan_features_set(netdev, dflt_features);
+ netdev_vlan_features_set(netdev, csumo_features);
+ netdev_vlan_features_set(netdev, tso_features);
/* advertise support but don't enable by default since only one type of
* VLAN offload can be enabled at a time (i.e. CTAG or STAG). When one
@@ -3393,7 +3393,7 @@ static void ice_set_netdev_features(struct net_device *netdev)
* ice_fix_features() ndo callback.
*/
if (is_dvm_ena)
- netdev->hw_features |= netdev_stag_vlan_offload_features;
+ netdev_hw_features_set(netdev, netdev_stag_vlan_offload_features);
}
/**
@@ -5791,12 +5791,14 @@ ice_fix_features(struct net_device *netdev, netdev_features_t features)
if (req_vlan_fltr != cur_vlan_fltr) {
if (ice_is_dvm_ena(&np->vsi->back->hw)) {
if (req_ctag && req_stag) {
- features |= NETIF_VLAN_FILTERING_FEATURES;
+ netdev_features_set(&features,
+ NETIF_VLAN_FILTERING_FEATURES);
} else if (!req_ctag && !req_stag) {
features &= ~NETIF_VLAN_FILTERING_FEATURES;
} else if ((!cur_ctag && req_ctag && !cur_stag) ||
(!cur_stag && req_stag && !cur_ctag)) {
- features |= NETIF_VLAN_FILTERING_FEATURES;
+ netdev_features_set(&features,
+ NETIF_VLAN_FILTERING_FEATURES);
netdev_warn(netdev, "802.1Q and 802.1ad VLAN filtering must be either both on or both off. VLAN filtering has been enabled for both types.\n");
} else if ((cur_ctag && !req_ctag && cur_stag) ||
(cur_stag && !req_stag && cur_ctag)) {
@@ -3310,11 +3310,11 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_features_set_array(&igb_feature_set, &gso_partial_features);
netdev->gso_partial_features = gso_partial_features;
netdev_active_feature_add(netdev, NETIF_F_GSO_PARTIAL_BIT);
- netdev->features |= gso_partial_features;
+ netdev_active_features_set(netdev, gso_partial_features);
/* copy netdev features into list of user selectable features */
- netdev->hw_features |= netdev->features;
- netdev->hw_features |= netdev_ctag_vlan_offload_features;
+ netdev_hw_features_set(netdev, netdev->features);
+ netdev_hw_features_set(netdev, netdev_ctag_vlan_offload_features);
netdev_hw_feature_add(netdev, NETIF_F_RXALL_BIT);
if (hw->mac.type >= e1000_i350)
@@ -3322,13 +3322,13 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
- netdev->vlan_features |= netdev->features;
+ netdev_vlan_features_set(netdev, netdev->features);
netdev_vlan_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
netdev_mpls_feature_add(netdev, NETIF_F_HW_CSUM_BIT);
- netdev->hw_enc_features |= netdev->vlan_features;
+ netdev_hw_enc_features_set(netdev, netdev->vlan_features);
/* set this bit last since it cannot be part of vlan_features */
- netdev->features |= netdev_ctag_vlan_features;
+ netdev_active_features_set(netdev, netdev_ctag_vlan_features);
netdev->priv_flags |= IFF_SUPP_NOFCS;
@@ -2795,18 +2795,18 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->gso_partial_features = gso_partial_features;
netdev_hw_feature_add(netdev, NETIF_F_GSO_PARTIAL_BIT);
- netdev->hw_features |= gso_partial_features;
+ netdev_hw_features_set(netdev, gso_partial_features);
netdev->features = netdev->hw_features;
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
- netdev->vlan_features |= netdev->features;
+ netdev_vlan_features_set(netdev, netdev->features);
netdev_vlan_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
netdev_mpls_feature_add(netdev, NETIF_F_HW_CSUM_BIT);
- netdev->hw_enc_features |= netdev->vlan_features;
+ netdev_hw_enc_features_set(netdev, netdev->vlan_features);
/* set this bit last since it cannot be part of vlan_features */
- netdev->features |= netdev_ctag_vlan_features;
+ netdev_active_features_set(netdev, netdev_ctag_vlan_features);
/* MTU range: 68 - 9216 */
netdev->min_mtu = ETH_MIN_MTU;
@@ -6336,7 +6336,7 @@ static int igc_probe(struct pci_dev *pdev,
&gso_partial_features);
netdev->gso_partial_features = gso_partial_features;
netdev_active_feature_add(netdev, NETIF_F_GSO_PARTIAL_BIT);
- netdev->features |= gso_partial_features;
+ netdev_active_features_set(netdev, gso_partial_features);
/* setup the private structure */
err = igc_sw_init(adapter);
@@ -6347,14 +6347,14 @@ static int igc_probe(struct pci_dev *pdev,
netdev_hw_feature_add(netdev, NETIF_F_NTUPLE_BIT);
netdev_hw_feature_add(netdev, NETIF_F_HW_VLAN_CTAG_TX_BIT);
netdev_hw_feature_add(netdev, NETIF_F_HW_VLAN_CTAG_RX_BIT);
- netdev->hw_features |= netdev->features;
+ netdev_hw_features_set(netdev, netdev->features);
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
- netdev->vlan_features |= netdev->features;
+ netdev_vlan_features_set(netdev, netdev->features);
netdev_vlan_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
netdev_mpls_feature_add(netdev, NETIF_F_HW_CSUM_BIT);
- netdev->hw_enc_features |= netdev->vlan_features;
+ netdev_hw_enc_features_set(netdev, netdev->vlan_features);
/* MTU range: 68 - 9216 */
netdev->min_mtu = ETH_MIN_MTU;
@@ -11022,7 +11022,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->gso_partial_features = gso_partial_features;
netdev_active_feature_add(netdev, NETIF_F_GSO_PARTIAL_BIT);
- netdev->features |= gso_partial_features;
+ netdev_active_features_set(netdev, gso_partial_features);
if (hw->mac.type >= ixgbe_mac_82599EB) {
netdev_active_feature_add(netdev, NETIF_F_SCTP_CRC_BIT);
@@ -11034,7 +11034,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_active_features_set_array(netdev, &ixgbe_esp_feature_set);
#endif
/* copy netdev features into list of user selectable features */
- netdev->hw_features |= netdev->features;
+ netdev_hw_features_set(netdev, netdev->features);
netdev_hw_features_set_array(netdev, &ixgbe_hw_feature_set);
if (hw->mac.type >= ixgbe_mac_82599EB) {
@@ -11044,14 +11044,14 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
- netdev->vlan_features |= netdev->features;
+ netdev_vlan_features_set(netdev, netdev->features);
netdev_vlan_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
- netdev->hw_enc_features |= netdev->vlan_features;
+ netdev_hw_enc_features_set(netdev, netdev->vlan_features);
netdev_mpls_features_set_array(netdev, &ixgbe_mpls_feature_set);
- netdev->mpls_features |= gso_partial_features;
+ netdev_mpls_features_set(netdev, gso_partial_features);
/* set this bit last since it cannot be part of vlan_features */
- netdev->features |= netdev_ctag_vlan_features;
+ netdev_active_features_set(netdev, netdev_ctag_vlan_features);
netdev->priv_flags |= IFF_UNICAST_FLT;
netdev->priv_flags |= IFF_SUPP_NOFCS;
@@ -4634,20 +4634,20 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
&gso_partial_features);
netdev->gso_partial_features = gso_partial_features;
netdev_hw_feature_add(netdev, NETIF_F_GSO_PARTIAL_BIT);
- netdev->hw_features |= gso_partial_features;
+ netdev_hw_features_set(netdev, gso_partial_features);
netdev->features = netdev->hw_features;
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
- netdev->vlan_features |= netdev->features;
+ netdev_vlan_features_set(netdev, netdev->features);
netdev_vlan_feature_add(netdev, NETIF_F_TSO_MANGLEID_BIT);
netdev_mpls_features_set_array(netdev, &ixgbevf_mpls_feature_set);
- netdev->mpls_features |= gso_partial_features;
- netdev->hw_enc_features |= netdev->vlan_features;
+ netdev_mpls_features_set(netdev, gso_partial_features);
+ netdev_hw_enc_features_set(netdev, netdev->vlan_features);
/* set this bit last since it cannot be part of vlan_features */
- netdev->features |= netdev_ctag_vlan_features;
+ netdev_active_features_set(netdev, netdev_ctag_vlan_features);
netdev->priv_flags |= IFF_UNICAST_FLT;
@@ -5623,8 +5623,8 @@ static int mvneta_probe(struct platform_device *pdev)
netdev_active_features_zero(dev);
netdev_active_features_set_array(dev, &mvneta_feature_set);
- dev->hw_features |= dev->features;
- dev->vlan_features |= dev->features;
+ netdev_hw_features_set(dev, dev->features);
+ netdev_vlan_features_set(dev, dev->features);
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
netif_set_tso_max_segs(dev, MVNETA_MAX_TSO_SEGS);
@@ -1278,8 +1278,8 @@ static void mvpp2_set_hw_csum(struct mvpp2_port *port,
port->dev->features &= ~csums;
port->dev->hw_features &= ~csums;
} else {
- port->dev->features |= csums;
- port->dev->hw_features |= csums;
+ netdev_active_features_set(port->dev, csums);
+ netdev_hw_features_set(port->dev, csums);
}
}
@@ -1344,8 +1344,9 @@ static int mvpp2_bm_update_mtu(struct net_device *dev, int mtu)
dev->features &= ~netdev_ip_csum_features;
dev->hw_features &= ~netdev_ip_csum_features;
} else {
- dev->features |= netdev_ip_csum_features;
- dev->hw_features |= netdev_ip_csum_features;
+ netdev_active_features_set(dev,
+ netdev_ip_csum_features);
+ netdev_hw_features_set(dev, netdev_ip_csum_features);
}
}
@@ -6860,7 +6861,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
netdev_features_set_array(&mvpp2_feature_set, &features);
dev->features = features;
netdev_active_feature_add(dev, NETIF_F_RXCSUM_BIT);
- dev->hw_features |= features;
+ netdev_hw_features_set(dev, features);
netdev_hw_features_set_array(dev, &mvpp2_hw_feature_set);
if (mvpp22_rss_is_supported(port)) {
@@ -6871,7 +6872,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
if (!port->priv->percpu_pools)
mvpp2_set_hw_csum(port, port->pool_long->id);
- dev->vlan_features |= features;
+ netdev_vlan_features_set(dev, features);
netif_set_tso_max_segs(dev, MVPP2_MAX_TSO_SEGS);
dev->priv_flags |= IFF_UNICAST_FLT;
@@ -1067,7 +1067,7 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev_hw_features_zero(netdev);
netdev_hw_feature_add(netdev, NETIF_F_SG_BIT);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev->min_mtu = OCTEP_MIN_MTU;
netdev->max_mtu = OCTEP_MAX_MTU;
netdev->mtu = OCTEP_DEFAULT_MTU;
@@ -2705,7 +2705,7 @@ static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id)
netdev_hw_features_zero(netdev);
netdev_hw_features_set_array(netdev, &otx2_hw_feature_set);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
err = otx2_mcam_flow_init(pf);
if (err)
@@ -2718,11 +2718,11 @@ static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id)
netdev->priv_flags |= IFF_UNICAST_FLT;
/* Support TSO on tag interface */
- netdev->vlan_features |= netdev->features;
- netdev->hw_features |= netdev_tx_vlan_features;
+ netdev_vlan_features_set(netdev, netdev->features);
+ netdev_hw_features_set(netdev, netdev_tx_vlan_features);
if (pf->flags & OTX2_FLAG_RX_VLAN_SUPPORT)
- netdev->hw_features |= netdev_rx_vlan_features;
- netdev->features |= netdev->hw_features;
+ netdev_hw_features_set(netdev, netdev_rx_vlan_features);
+ netdev_active_features_set(netdev, netdev->hw_features);
/* HW supports tc offload but mutually exclusive with n-tuple filters */
if (pf->flags & OTX2_FLAG_TC_FLOWER_SUPPORT)
@@ -652,9 +652,9 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
netdev_hw_features_set_array(netdev, &otx2vf_hw_feature_set);
netdev->features = netdev->hw_features;
/* Support TSO on tag interface */
- netdev->vlan_features |= netdev->features;
- netdev->hw_features |= netdev_tx_vlan_features;
- netdev->features |= netdev->hw_features;
+ netdev_vlan_features_set(netdev, netdev->features);
+ netdev_hw_features_set(netdev, netdev_tx_vlan_features);
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev_hw_feature_add(netdev, NETIF_F_NTUPLE_BIT);
netdev_hw_feature_add(netdev, NETIF_F_RXALL_BIT);
@@ -3867,7 +3867,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
else {
netdev_hw_features_zero(dev);
netdev_hw_features_set_array(dev, &skge_hw_feature_set);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
}
/* read the mac address */
@@ -4655,11 +4655,11 @@ static struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port,
netdev_hw_feature_add(dev, NETIF_F_RXHASH_BIT);
if (!(hw->flags & SKY2_HW_VLAN_BROKEN)) {
- dev->hw_features |= netdev_ctag_vlan_offload_features;
+ netdev_hw_features_set(dev, netdev_ctag_vlan_offload_features);
netdev_vlan_features_set_array(dev, &sky2_vlan_feature_set);
}
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
/* MTU range: 60 - 1500 or 9000 */
dev->min_mtu = ETH_ZLEN;
@@ -3901,7 +3901,7 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
eth->netdev[id]->vlan_features = *eth->soc->hw_features &
~netdev_ctag_vlan_offload_features;
- eth->netdev[id]->features |= *eth->soc->hw_features;
+ netdev_active_features_set(eth->netdev[id], *eth->soc->hw_features);
eth->netdev[id]->ethtool_ops = &mtk_ethtool_ops;
eth->netdev[id]->irq = eth->irq[0];
@@ -3361,7 +3361,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
netdev_hw_features_zero(dev);
netdev_hw_features_set_array(dev, &mlx4_hw_feature_set1);
if (mdev->LSO_support)
- dev->hw_features |= netdev_general_tso_features;
+ netdev_hw_features_set(dev, netdev_general_tso_features);
if (mdev->dev->caps.tunnel_offload_mode ==
MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) {
@@ -687,7 +687,7 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev,
netdev_hw_feature_add(netdev, NETIF_F_TSO6_BIT);
netdev_hw_feature_add(netdev, NETIF_F_RXCSUM_BIT);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev_active_feature_add(netdev, NETIF_F_NETNS_LOCAL_BIT);
}
@@ -6720,7 +6720,7 @@ static int __init netdev_init(struct net_device *dev)
*/
netdev_hw_feature_add(dev, NETIF_F_IPV6_CSUM_BIT);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
sema_init(&priv->proc_sem, 1);
@@ -5,6 +5,7 @@
#include <linux/if_vlan.h>
#include <linux/iopoll.h>
#include <linux/ip.h>
+#include <linux/netdev_features_helper.h>
#include <linux/of_platform.h>
#include <linux/of_net.h>
#include <linux/packing.h>
@@ -753,7 +754,7 @@ static int lan966x_probe_port(struct lan966x *lan966x, u32 p,
dev->netdev_ops = &lan966x_port_netdev_ops;
dev->ethtool_ops = &lan966x_ethtool_ops;
- dev->features |= netdev_tx_vlan_features;
+ netdev_active_features_set(dev, netdev_tx_vlan_features);
dev->needed_headroom = IFH_LEN * sizeof(u32);
eth_hw_addr_gen(dev, lan966x->base_mac, p + 1);
@@ -3876,7 +3876,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->features = netdev->hw_features;
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
- netdev->vlan_features |= mgp->features;
+ netdev_vlan_features_set(netdev, mgp->features);
if (mgp->fw_ver_tiny < 37)
netdev->vlan_features &= ~NETIF_F_TSO6;
if (mgp->fw_ver_tiny < 32)
@@ -2150,7 +2150,7 @@ static int ns83820_init_one(struct pci_dev *pci_dev,
#ifdef NS83820_VLAN_ACCEL_SUPPORT
/* We also support hardware vlan acceleration */
- ndev->features |= netdev_ctag_vlan_offload_features;
+ netdev_active_features_set(ndev, netdev_ctag_vlan_offload_features);
#endif
if (using_dac) {
@@ -7869,7 +7869,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
dev->ethtool_ops = &netdev_ethtool_ops;
netdev_hw_features_zero(dev);
netdev_hw_features_set_array(dev, &s2io_hw_feature_set);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
netdev_active_features_set_array(dev, &s2io_feature_set);
dev->watchdog_timeo = WATCH_DOG_TIMEOUT;
INIT_WORK(&sp->rst_timer_task, s2io_restart_nic);
@@ -2359,7 +2359,7 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
nn->dp.ctrl |= nn->cap & NFP_NET_CFG_CTRL_RXCSUM_ANY;
}
if (nn->cap & NFP_NET_CFG_CTRL_TXCSUM) {
- netdev->hw_features |= netdev_ip_csum_features;
+ netdev_hw_features_set(netdev, netdev_ip_csum_features);
nn->dp.ctrl |= NFP_NET_CFG_CTRL_TXCSUM;
}
if (nn->cap & NFP_NET_CFG_CTRL_GATHER) {
@@ -2368,7 +2368,7 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
}
if ((nn->cap & NFP_NET_CFG_CTRL_LSO && nn->fw_ver.major > 2) ||
nn->cap & NFP_NET_CFG_CTRL_LSO2) {
- netdev->hw_features |= netdev_general_tso_features;
+ netdev_hw_features_set(netdev, netdev_general_tso_features);
nn->dp.ctrl |= nn->cap & NFP_NET_CFG_CTRL_LSO2 ?:
NFP_NET_CFG_CTRL_LSO;
}
@@ -252,7 +252,7 @@ nfp_repr_fix_features(struct net_device *netdev, netdev_features_t features)
tmp = NETIF_F_SOFT_FEATURES;
netdev_feature_add(NETIF_F_HW_TC_BIT, &tmp);
tmp &= old_features;
- features |= tmp;
+ netdev_features_set(&features, tmp);
netdev_feature_add(NETIF_F_LLTX_BIT, &features);
return features;
@@ -350,12 +350,12 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev,
if (repr_cap & NFP_NET_CFG_CTRL_RXCSUM_ANY)
netdev_hw_feature_add(netdev, NETIF_F_RXCSUM_BIT);
if (repr_cap & NFP_NET_CFG_CTRL_TXCSUM)
- netdev->hw_features |= netdev_ip_csum_features;
+ netdev_hw_features_set(netdev, netdev_ip_csum_features);
if (repr_cap & NFP_NET_CFG_CTRL_GATHER)
netdev_hw_feature_add(netdev, NETIF_F_SG_BIT);
if ((repr_cap & NFP_NET_CFG_CTRL_LSO && nn->fw_ver.major > 2) ||
repr_cap & NFP_NET_CFG_CTRL_LSO2)
- netdev->hw_features |= netdev_general_tso_features;
+ netdev_hw_features_set(netdev, netdev_general_tso_features);
if (repr_cap & NFP_NET_CFG_CTRL_RSS_ANY)
netdev_hw_feature_add(netdev, NETIF_F_RXHASH_BIT);
if (repr_cap & NFP_NET_CFG_CTRL_VXLAN) {
@@ -5825,10 +5825,10 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
np->vlanctl_bits = 0;
if (id->driver_data & DEV_HAS_VLAN) {
np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE;
- dev->hw_features |= netdev_ctag_vlan_offload_features;
+ netdev_hw_features_set(dev, netdev_ctag_vlan_offload_features);
}
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
/* Add loopback capability to the device. */
netdev_hw_feature_add(dev, NETIF_F_LOOPBACK_BIT);
@@ -1546,10 +1546,10 @@ static int ionic_init_nic_features(struct ionic_lif *lif)
netdev_hw_enc_feature_add(netdev,
NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT);
- netdev->hw_features |= netdev->hw_enc_features;
- netdev->features |= netdev->hw_features;
+ netdev_hw_features_set(netdev, netdev->hw_enc_features);
+ netdev_active_features_set(netdev, netdev->hw_features);
features = netdev->features & ~NETIF_F_VLAN_FEATURES;
- netdev->vlan_features |= features;
+ netdev_vlan_features_set(netdev, features);
netdev->priv_flags |= IFF_UNICAST_FLT |
IFF_LIVE_ADDR_CHANGE;
@@ -1364,7 +1364,7 @@ netxen_setup_netdev(struct netxen_adapter *adapter,
netdev_hw_feature_add(netdev, NETIF_F_TSO6_BIT);
}
- netdev->vlan_features |= netdev->hw_features;
+ netdev_vlan_features_set(netdev, netdev->hw_features);
if (adapter->pci_using_dac) {
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
@@ -1377,7 +1377,7 @@ netxen_setup_netdev(struct netxen_adapter *adapter,
if (adapter->capabilities & NX_FW_CAPABILITY_HW_LRO)
netdev_hw_feature_add(netdev, NETIF_F_LRO_BIT);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev->irq = adapter->msix_entries[0].vector;
@@ -2300,8 +2300,9 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev)
netdev_vlan_features_set_array(netdev, &qlcnic_vlan_feature_set);
if (QLCNIC_IS_TSO_CAPABLE(adapter)) {
- netdev->features |= netdev_general_tso_features;
- netdev->vlan_features |= netdev_general_tso_features;
+ netdev_active_features_set(netdev,
+ netdev_general_tso_features);
+ netdev_vlan_features_set(netdev, netdev_general_tso_features);
}
if (qlcnic_vlan_tx_check(adapter))
@@ -5445,7 +5445,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rtl_chip_supports_csum_v2(tp))
netdev_hw_feature_add(dev, NETIF_F_IPV6_CSUM_BIT);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
/* There has been a number of reports that using SG/TSO results in
* tx timeouts. However for a lot of people SG/TSO works fine.
@@ -5454,7 +5454,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
*/
if (rtl_chip_supports_csum_v2(tp)) {
netdev_hw_feature_add(dev, NETIF_F_SG_BIT);
- dev->hw_features |= netdev_general_tso_features;
+ netdev_hw_features_set(dev, netdev_general_tso_features);
netif_set_tso_max_size(dev, RTL_GSO_MAX_SIZE_V2);
netif_set_tso_max_segs(dev, RTL_GSO_MAX_SEGS_V2);
} else {
@@ -2117,7 +2117,7 @@ struct sxgbe_priv_data *sxgbe_drv_probe(struct device *device,
netdev_hw_features_zero(ndev);
netdev_hw_features_set_array(ndev, &sxgbe_hw_feature_set);
- ndev->features |= ndev->hw_features;
+ netdev_active_features_set(ndev, ndev->hw_features);
netdev_active_feature_add(ndev, NETIF_F_HIGHDMA_BIT);
ndev->watchdog_timeo = msecs_to_jiffies(TX_TIMEO);
@@ -1357,7 +1357,7 @@ static int efx_ef10_init_nic(struct efx_nic *efx)
/* add encapsulated checksum offload features */
if (efx_has_cap(efx, VXLAN_NVGRE) && !efx_ef10_is_vf(efx))
- hw_enc_features |= netdev_ip_csum_features;
+ netdev_features_set(&hw_enc_features, netdev_ip_csum_features);
/* add encapsulated TSO features */
if (efx_has_cap(efx, TX_TSO_V2_ENCAP)) {
netdev_features_t encap_tso_features;
@@ -1366,9 +1366,9 @@ static int efx_ef10_init_nic(struct efx_nic *efx)
netdev_features_set_array(&ef10_tso_feature_set,
&encap_tso_features);
- hw_enc_features |= encap_tso_features;
+ netdev_features_set(&hw_enc_features, encap_tso_features);
netdev_feature_add(NETIF_F_TSO_BIT, &hw_enc_features);
- efx->net_dev->features |= encap_tso_features;
+ netdev_active_features_set(efx->net_dev, encap_tso_features);
}
efx->net_dev->hw_enc_features = hw_enc_features;
@@ -372,10 +372,10 @@ int ef100_probe_netdev(struct efx_probe_data *probe_data)
efx->net_dev = net_dev;
SET_NETDEV_DEV(net_dev, &efx->pci_dev->dev);
- net_dev->features |= *efx->type->offload_features;
- net_dev->hw_features |= *efx->type->offload_features;
- net_dev->hw_enc_features |= *efx->type->offload_features;
- net_dev->vlan_features |= NETIF_F_ALL_TSO;
+ netdev_active_features_set(net_dev, *efx->type->offload_features);
+ netdev_hw_features_set(net_dev, *efx->type->offload_features);
+ netdev_hw_enc_features_set(net_dev, *efx->type->offload_features);
+ netdev_vlan_features_set(net_dev, NETIF_F_ALL_TSO);
netdev_vlan_features_set_array(net_dev, &ef100_vlan_feature_set);
netif_set_tso_max_segs(net_dev,
ESE_EF100_DP_GZ_TSO_MAX_HDR_NUM_SEGS_DEFAULT);
@@ -201,9 +201,9 @@ int efx_ef100_init_datapath_caps(struct efx_nic *efx)
netdev_features_zero(&tso);
netdev_features_set_array(&ef100_tso_feature_set, &tso);
- net_dev->features |= tso;
- net_dev->hw_features |= tso;
- net_dev->hw_enc_features |= tso;
+ netdev_active_features_set(net_dev, tso);
+ netdev_hw_features_set(net_dev, tso);
+ netdev_hw_enc_features_set(net_dev, tso);
/* EF100 HW can only offload outer checksums if they are UDP,
* so for GRE_CSUM we have to use GSO_PARTIAL.
*/
@@ -1014,7 +1014,7 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
}
/* Determine netdevice features */
- net_dev->features |= *efx->type->offload_features;
+ netdev_active_features_set(net_dev, *efx->type->offload_features);
netdev_active_features_set_array(net_dev, &efx_active_feature_set);
if ((*efx->type->offload_features & NETIF_F_IPV6_CSUM) ||
(*efx->type->offload_features & NETIF_F_HW_CSUM))
@@ -1023,11 +1023,11 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
if (!efx->type->tso_versions || !efx->type->tso_versions(efx))
net_dev->features &= ~NETIF_F_ALL_TSO;
/* Mask for features that also apply to VLAN devices */
- net_dev->vlan_features |= NETIF_F_ALL_TSO;
+ netdev_vlan_features_set(net_dev, NETIF_F_ALL_TSO);
netdev_vlan_features_set_array(net_dev, &efx_vlan_feature_set);
tmp = net_dev->features & ~efx->fixed_features;
- net_dev->hw_features |= tmp;
+ netdev_hw_features_set(net_dev, tmp);
/* Disable receiving frames with bad FCS, by default. */
net_dev->features &= ~NETIF_F_RXALL;
@@ -1037,7 +1037,7 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
* receive VLAN tagged packets due to vPort restrictions).
*/
net_dev->features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
- net_dev->features |= efx->fixed_features;
+ netdev_active_features_set(net_dev, efx->fixed_features);
rc = efx_register_netdev(efx);
if (!rc)
@@ -414,9 +414,9 @@ static void efx_start_datapath(struct efx_nic *efx)
/* Restore previously fixed features in hw_features and remove
* features which are fixed now
*/
- efx->net_dev->hw_features |= efx->net_dev->features;
+ netdev_hw_features_set(efx->net_dev, efx->net_dev->features);
efx->net_dev->hw_features &= ~efx->fixed_features;
- efx->net_dev->features |= efx->fixed_features;
+ netdev_active_features_set(efx->net_dev, efx->fixed_features);
if (efx->net_dev->features != old_features)
netdev_features_change(efx->net_dev);
@@ -635,9 +635,9 @@ static void ef4_start_datapath(struct ef4_nic *efx)
/* Restore previously fixed features in hw_features and remove
* features which are fixed now
*/
- efx->net_dev->hw_features |= efx->net_dev->features;
+ netdev_hw_features_set(efx->net_dev, efx->net_dev->features);
efx->net_dev->hw_features &= ~efx->fixed_features;
- efx->net_dev->features |= efx->fixed_features;
+ netdev_active_features_set(efx->net_dev, efx->fixed_features);
if (efx->net_dev->features != old_features)
netdev_features_change(efx->net_dev);
@@ -2907,7 +2907,7 @@ static int ef4_pci_probe(struct pci_dev *pci_dev,
if (rc)
goto fail3;
- net_dev->features |= *efx->type->offload_features;
+ netdev_active_features_set(net_dev, *efx->type->offload_features);
netdev_active_feature_add(net_dev, NETIF_F_SG_BIT);
netdev_active_feature_add(net_dev, NETIF_F_RXCSUM_BIT);
/* Mask for features that also apply to VLAN devices */
@@ -2919,7 +2919,7 @@ static int ef4_pci_probe(struct pci_dev *pci_dev,
* receive VLAN tagged packets due to vPort restrictions).
*/
net_dev->features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
- net_dev->features |= efx->fixed_features;
+ netdev_active_features_set(net_dev, efx->fixed_features);
rc = ef4_register_netdev(efx);
if (rc)
@@ -1303,7 +1303,7 @@ static inline netdev_features_t ef4_supported_features(const struct ef4_nic *efx
{
const struct net_device *net_dev = efx->net_dev;
- return net_dev->features | net_dev->hw_features;
+ return netdev_active_features_or(net_dev, net_dev->hw_features);
}
/* Get the current TX queue insert index. */
@@ -1754,7 +1754,7 @@ static inline netdev_features_t efx_supported_features(const struct efx_nic *efx
{
const struct net_device *net_dev = efx->net_dev;
- return net_dev->features | net_dev->hw_features;
+ return netdev_active_features_or(net_dev, net_dev->hw_features);
}
/* Get the current TX queue insert index. */
@@ -996,7 +996,7 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
}
/* Determine netdevice features */
- net_dev->features |= *efx->type->offload_features;
+ netdev_active_features_set(net_dev, *efx->type->offload_features);
netdev_active_features_set_array(net_dev, &efx_active_feature_set);
if ((*efx->type->offload_features & NETIF_F_IPV6_CSUM) ||
(*efx->type->offload_features & NETIF_F_HW_CSUM))
@@ -1005,10 +1005,11 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
if (!efx->type->tso_versions || !efx->type->tso_versions(efx))
net_dev->features &= ~NETIF_F_ALL_TSO;
/* Mask for features that also apply to VLAN devices */
- net_dev->vlan_features |= NETIF_F_ALL_TSO;
+ netdev_vlan_features_set(net_dev, NETIF_F_ALL_TSO);
netdev_vlan_features_set_array(net_dev, &efx_vlan_feature_set);
- net_dev->hw_features |= net_dev->features & ~efx->fixed_features;
+ netdev_hw_features_set(net_dev,
+ net_dev->features & ~efx->fixed_features);
/* Disable receiving frames with bad FCS, by default. */
net_dev->features &= ~NETIF_F_RXALL;
@@ -1018,7 +1019,7 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
* receive VLAN tagged packets due to vPort restrictions).
*/
net_dev->features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
- net_dev->features |= efx->fixed_features;
+ netdev_active_features_set(net_dev, efx->fixed_features);
rc = efx_register_netdev(efx);
if (!rc)
@@ -411,9 +411,9 @@ static void efx_start_datapath(struct efx_nic *efx)
/* Restore previously fixed features in hw_features and remove
* features which are fixed now
*/
- efx->net_dev->hw_features |= efx->net_dev->features;
+ netdev_hw_features_set(efx->net_dev, efx->net_dev->features);
efx->net_dev->hw_features &= ~efx->fixed_features;
- efx->net_dev->features |= efx->fixed_features;
+ netdev_active_features_set(efx->net_dev, efx->fixed_features);
if (efx->net_dev->features != old_features)
netdev_features_change(efx->net_dev);
@@ -11,6 +11,7 @@
#define EFX_NET_DRIVER_H
#include <linux/netdevice.h>
+#include <linux/netdev_features_helper.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
@@ -1681,7 +1682,7 @@ static inline netdev_features_t efx_supported_features(const struct efx_nic *efx
{
const struct net_device *net_dev = efx->net_dev;
- return net_dev->features | net_dev->hw_features;
+ return netdev_active_features_or(net_dev, net_dev->hw_features);
}
/* Get the current TX queue insert index. */
@@ -7148,7 +7148,7 @@ int stmmac_dvr_probe(struct device *device,
}
if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) {
- ndev->hw_features |= netdev_general_tso_features;
+ netdev_hw_features_set(ndev, netdev_general_tso_features);
if (priv->plat->has_gmac4)
netdev_hw_feature_add(ndev, NETIF_F_GSO_UDP_L4_BIT);
priv->tso = true;
@@ -7194,14 +7194,14 @@ int stmmac_dvr_probe(struct device *device,
}
}
- ndev->features |= ndev->hw_features;
+ netdev_active_features_set(ndev, ndev->hw_features);
netdev_active_feature_add(ndev, NETIF_F_HIGHDMA_BIT);
ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
#ifdef STMMAC_VLAN_TAG_USED
/* Both mac100 and gmac support receive VLAN tag detection */
- ndev->features |= netdev_rx_vlan_features;
+ netdev_active_features_set(ndev, netdev_rx_vlan_features);
if (priv->dma_cap.vlhash)
- ndev->features |= netdev_vlan_filter_features;
+ netdev_active_features_set(ndev, netdev_vlan_filter_features);
if (priv->dma_cap.vlins) {
netdev_active_feature_add(ndev, NETIF_F_HW_VLAN_CTAG_TX_BIT);
if (priv->dma_cap.dvlan)
@@ -9743,7 +9743,7 @@ static void niu_set_basic_features(struct net_device *dev)
{
netdev_hw_features_zero(dev);
netdev_hw_features_set_array(dev, &niu_hw_feature_set);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
netdev_active_feature_add(dev, NETIF_F_RXCSUM_BIT);
}
@@ -2788,7 +2788,7 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe)
netdev_hw_features_zero(dev);
netdev_hw_feature_add(dev, NETIF_F_SG_BIT);
netdev_hw_feature_add(dev, NETIF_F_HW_CSUM_BIT);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
netdev_active_feature_add(dev, NETIF_F_RXCSUM_BIT);
hp->irq = op->archdata.irqs[0];
@@ -3111,7 +3111,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
netdev_hw_features_zero(dev);
netdev_hw_feature_add(dev, NETIF_F_SG_BIT);
netdev_hw_feature_add(dev, NETIF_F_HW_CSUM_BIT);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
netdev_active_feature_add(dev, NETIF_F_RXCSUM_BIT);
#if defined(CONFIG_SBUS) && defined(CONFIG_PCI)
@@ -181,7 +181,7 @@ static int xlgmac_init(struct xlgmac_pdata *pdata)
if (pdata->hw_feat.tso) {
netdev->hw_features = netdev_general_tso_features;
netdev_hw_feature_add(netdev, NETIF_F_SG_BIT);
- netdev->hw_features |= netdev_ip_csum_features;
+ netdev_hw_features_set(netdev, netdev_ip_csum_features);
} else if (pdata->hw_feat.tx_coe) {
netdev->hw_features = netdev_ip_csum_features;
}
@@ -194,7 +194,7 @@ static int xlgmac_init(struct xlgmac_pdata *pdata)
if (pdata->hw_feat.rss)
netdev_hw_feature_add(netdev, NETIF_F_RXHASH_BIT);
- netdev->vlan_features |= netdev->hw_features;
+ netdev_vlan_features_set(netdev, netdev->hw_features);
netdev_hw_feature_add(netdev, NETIF_F_HW_VLAN_CTAG_RX_BIT);
if (pdata->hw_feat.sa_vlan_ins)
@@ -202,7 +202,7 @@ static int xlgmac_init(struct xlgmac_pdata *pdata)
if (pdata->hw_feat.vlhash)
netdev_hw_feature_add(netdev, NETIF_F_HW_VLAN_CTAG_FILTER_BIT);
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
pdata->netdev_features = netdev->features;
netdev->priv_flags |= IFF_UNICAST_FLT;
@@ -974,7 +974,7 @@ static int rhine_init_one_common(struct device *hwdev, u32 quirks,
}
if (rp->quirks & rqMgmt)
- dev->features |= netdev_ctag_vlan_features;
+ netdev_active_features_set(dev, netdev_ctag_vlan_features);
/* dev->name not defined before register_netdev()! */
rc = register_netdev(dev);
@@ -1259,10 +1259,10 @@ static void geneve_setup(struct net_device *dev)
SET_NETDEV_DEVTYPE(dev, &geneve_type);
netdev_active_features_set_array(dev, &geneve_feature_set);
- dev->features |= NETIF_F_GSO_SOFTWARE;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
netdev_hw_features_set_array(dev, &geneve_hw_feature_set);
- dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+ netdev_hw_features_set(dev, NETIF_F_GSO_SOFTWARE);
/* MTU range: 68 - (something less than 65535) */
dev->min_mtu = ETH_MIN_MTU;
@@ -1433,7 +1433,7 @@ static int rndis_netdev_set_hwcaps(struct rndis_device *rndis_device,
*/
netdev_features_fill(&features);
features &= ~NETVSC_SUPPORTED_HW_FEATURES;
- features |= net->hw_features;
+ netdev_features_set(&features, net->hw_features);
net->features &= features;
netif_set_tso_max_size(net, gso_max_size);
@@ -323,13 +323,14 @@ static void ifb_setup(struct net_device *dev)
ether_setup(dev);
dev->tx_queue_len = TX_Q_LIMIT;
- ifb_features = NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
+ ifb_features = netdev_features_or(NETIF_F_GSO_SOFTWARE,
+ NETIF_F_GSO_ENCAP_ALL);
netdev_features_set_array(&ifb_feature_set, &ifb_features);
- dev->features |= ifb_features;
- dev->hw_features |= dev->features;
- dev->hw_enc_features |= dev->features;
+ netdev_active_features_set(dev, ifb_features);
+ netdev_hw_features_set(dev, dev->features);
+ netdev_hw_enc_features_set(dev, dev->features);
ifb_features &= ~netdev_tx_vlan_features;
- dev->vlan_features |= ifb_features;
+ netdev_vlan_features_set(dev, ifb_features);
dev->flags |= IFF_NOARP;
dev->flags &= ~IFF_MULTICAST;
@@ -152,10 +152,10 @@ 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;
+ netdev_active_features_set(dev, IPVLAN_ALWAYS_ON);
dev->vlan_features = phy_dev->vlan_features & IPVLAN_FEATURES;
- dev->vlan_features |= IPVLAN_ALWAYS_ON_OFLOADS;
- dev->hw_enc_features |= dev->features;
+ netdev_vlan_features_set(dev, IPVLAN_ALWAYS_ON_OFLOADS);
+ netdev_hw_enc_features_set(dev, dev->features);
netif_inherit_tso_max(dev, phy_dev);
dev->hard_header_len = phy_dev->hard_header_len;
@@ -256,15 +256,15 @@ static netdev_features_t ipvlan_fix_features(struct net_device *dev,
struct ipvl_dev *ipvlan = netdev_priv(dev);
netdev_features_t tmp;
- features |= NETIF_F_ALL_FOR_ALL;
+ netdev_features_set(&features, NETIF_F_ALL_FOR_ALL);
netdev_features_fill(&tmp);
tmp &= ~IPVLAN_FEATURES;
- tmp |= ipvlan->sfeatures;
+ netdev_features_set(&tmp, ipvlan->sfeatures);
features &= tmp;
features = netdev_increment_features(ipvlan->phy_dev->features,
features, features);
- features |= IPVLAN_ALWAYS_ON;
- tmp = IPVLAN_FEATURES | IPVLAN_ALWAYS_ON;
+ netdev_features_set(&features, IPVLAN_ALWAYS_ON);
+ tmp = netdev_features_or(IPVLAN_FEATURES, IPVLAN_ALWAYS_ON);
features &= tmp;
return features;
@@ -1042,7 +1042,8 @@ static struct notifier_block ipvlan_addr6_vtor_notifier_block __read_mostly = {
static void __init ipvlan_features_init(void)
{
- ipvlan_offload_features = NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
+ ipvlan_offload_features = netdev_features_or(NETIF_F_GSO_SOFTWARE,
+ NETIF_F_GSO_ENCAP_ALL);
netdev_features_set_array(&ipvlan_on_offload_feature_set,
&ipvlan_offload_features);
@@ -3457,7 +3457,7 @@ static int macsec_dev_init(struct net_device *dev)
} else {
dev->features = real_dev->features & SW_MACSEC_FEATURES;
netdev_active_feature_add(dev, NETIF_F_LLTX_BIT);
- dev->features |= NETIF_F_GSO_SOFTWARE;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
}
dev->needed_headroom = real_dev->needed_headroom +
@@ -3495,8 +3495,8 @@ static netdev_features_t macsec_fix_features(struct net_device *dev,
return REAL_DEV_FEATURES(real_dev);
tmp = real_dev->features & SW_MACSEC_FEATURES;
- tmp |= NETIF_F_GSO_SOFTWARE;
- tmp |= NETIF_F_SOFT_FEATURES;
+ netdev_features_set(&tmp, NETIF_F_GSO_SOFTWARE);
+ netdev_features_set(&tmp, NETIF_F_SOFT_FEATURES);
features &= tmp;
netdev_feature_add(NETIF_F_LLTX_BIT, &features);
@@ -917,11 +917,11 @@ static int macvlan_init(struct net_device *dev)
dev->state = (dev->state & ~MACVLAN_STATE_MASK) |
(lowerdev->state & MACVLAN_STATE_MASK);
dev->features = lowerdev->features & MACVLAN_FEATURES;
- dev->features |= ALWAYS_ON_FEATURES;
+ netdev_active_features_set(dev, ALWAYS_ON_FEATURES);
netdev_hw_feature_add(dev, NETIF_F_LRO_BIT);
dev->vlan_features = lowerdev->vlan_features & MACVLAN_FEATURES;
- dev->vlan_features |= ALWAYS_ON_OFFLOADS;
- dev->hw_enc_features |= dev->features;
+ netdev_vlan_features_set(dev, ALWAYS_ON_OFFLOADS);
+ netdev_hw_enc_features_set(dev, dev->features);
netif_inherit_tso_max(dev, lowerdev);
dev->hard_header_len = lowerdev->hard_header_len;
macvlan_set_lockdep_class(dev);
@@ -1101,10 +1101,10 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev,
netdev_features_t mask;
netdev_features_t tmp;
- features |= NETIF_F_ALL_FOR_ALL;
+ netdev_features_set(&features, NETIF_F_ALL_FOR_ALL);
netdev_features_fill(&tmp);
tmp &= ~MACVLAN_FEATURES;
- tmp |= vlan->set_features;
+ netdev_features_set(&tmp, vlan->set_features);
features &= tmp;
mask = features;
@@ -1112,8 +1112,8 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev,
tmp &= ~NETIF_F_LRO;
lowerdev_features &= tmp;
features = netdev_increment_features(lowerdev_features, features, mask);
- features |= ALWAYS_ON_FEATURES;
- tmp = ALWAYS_ON_FEATURES | MACVLAN_FEATURES;
+ netdev_features_set(&features, ALWAYS_ON_FEATURES);
+ tmp = netdev_features_or(ALWAYS_ON_FEATURES, MACVLAN_FEATURES);
features &= tmp;
return features;
@@ -1840,7 +1840,8 @@ static struct notifier_block macvlan_notifier_block __read_mostly = {
static void __init macvlan_features_init(void)
{
- macvlan_offload_features = NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
+ macvlan_offload_features = netdev_features_or(NETIF_F_GSO_SOFTWARE,
+ NETIF_F_GSO_ENCAP_ALL);
netdev_features_set_array(&macvlan_on_offload_feature_set,
&macvlan_offload_features);
@@ -435,7 +435,8 @@ static void net_failover_compute_features(struct net_device *dev)
}
dev->vlan_features = vlan_features;
- dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
+ dev->hw_enc_features = netdev_features_or(enc_features,
+ NETIF_F_GSO_ENCAP_ALL);
dev->hard_header_len = max_hard_header_len;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
@@ -754,11 +755,11 @@ struct failover *net_failover_create(struct net_device *standby_dev)
/* Don't allow failover devices to change network namespaces. */
netdev_active_feature_add(failover_dev, NETIF_F_NETNS_LOCAL_BIT);
- failover_dev->hw_features = FAILOVER_VLAN_FEATURES |
- netdev_ctag_vlan_features;
+ failover_dev->hw_features = netdev_features_or(FAILOVER_VLAN_FEATURES,
+ netdev_ctag_vlan_features);
- failover_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
- failover_dev->features |= failover_dev->hw_features;
+ netdev_hw_features_set(failover_dev, NETIF_F_GSO_ENCAP_ALL);
+ netdev_active_features_set(failover_dev, failover_dev->hw_features);
dev_addr_set(failover_dev, standby_dev->dev_addr);
@@ -347,7 +347,7 @@ rx_handler_result_t tap_handle_frame(struct sk_buff **pskb)
* enabled.
*/
if (q->flags & IFF_VNET_HDR)
- features |= tap->tap_features;
+ netdev_features_set(&features, tap->tap_features);
if (netif_needs_gso(skb, features)) {
struct sk_buff *segs = __skb_gso_segment(skb, features, false);
struct sk_buff *next;
@@ -1024,8 +1024,9 @@ static void __team_compute_features(struct team *team)
rcu_read_unlock();
team->dev->vlan_features = vlan_features;
- team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
- team->dev->hw_enc_features |= netdev_tx_vlan_features;
+ team->dev->hw_enc_features = netdev_features_or(enc_features,
+ NETIF_F_GSO_ENCAP_ALL);
+ netdev_hw_enc_features_set(team->dev, netdev_tx_vlan_features);
team->dev->hard_header_len = max_hard_header_len;
team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
@@ -2017,7 +2018,7 @@ static netdev_features_t team_fix_features(struct net_device *dev,
mask = features;
features &= ~NETIF_F_ONE_FOR_ALL;
- features |= NETIF_F_ALL_FOR_ALL;
+ netdev_features_set(&features, NETIF_F_ALL_FOR_ALL);
rcu_read_lock();
list_for_each_entry_rcu(port, &team->port_list, list) {
@@ -2188,9 +2189,9 @@ static void team_setup(struct net_device *dev)
netdev_hw_feature_add(dev, NETIF_F_HW_VLAN_CTAG_RX_BIT);
netdev_hw_feature_add(dev, NETIF_F_HW_VLAN_CTAG_FILTER_BIT);
- dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
- dev->features |= dev->hw_features;
- dev->features |= netdev_tx_vlan_features;
+ netdev_hw_features_set(dev, NETIF_F_GSO_ENCAP_ALL);
+ netdev_active_features_set(dev, dev->hw_features);
+ netdev_active_features_set(dev, netdev_tx_vlan_features);
}
static int team_newlink(struct net *src_net, struct net_device *dev,
@@ -1179,7 +1179,7 @@ static netdev_features_t tun_net_fix_features(struct net_device *dev,
tmp1 = features & tun->set_features;
tmp2 = features & ~TUN_USER_FEATURES;
- return tmp1 | tmp2;
+ return netdev_features_or(tmp1, tmp2);
}
static void tun_set_headroom(struct net_device *dev, int new_hr)
@@ -2895,7 +2895,7 @@ static int set_offload(struct tun_struct *tun, unsigned long arg)
tun->set_features = features;
tun->dev->wanted_features &= ~TUN_USER_FEATURES;
- tun->dev->wanted_features |= features;
+ netdev_wanted_features_set(tun->dev, features);
netdev_update_features(tun->dev);
return 0;
@@ -1301,7 +1301,7 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
netdev_active_features_set_array(dev->net, &ax88179_feature_set);
- dev->net->hw_features |= dev->net->features;
+ netdev_hw_features_set(dev->net, dev->net->features);
netif_set_tso_max_size(dev->net, 16384);
@@ -1479,7 +1479,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write);
if (DEFAULT_TX_CSUM_ENABLE)
- dev->net->features |= netdev_ip_csum_features;
+ netdev_active_features_set(dev->net, netdev_ip_csum_features);
if (DEFAULT_RX_CSUM_ENABLE)
netdev_active_feature_add(dev->net, NETIF_F_RXCSUM_BIT);
@@ -1575,7 +1575,8 @@ static int veth_xdp_set(struct net_device *dev, struct bpf_prog *prog,
veth_disable_xdp(dev);
if (peer) {
- peer->hw_features |= NETIF_F_GSO_SOFTWARE;
+ netdev_hw_features_set(peer,
+ NETIF_F_GSO_SOFTWARE);
peer->max_mtu = ETH_MAX_MTU;
}
}
@@ -1648,10 +1649,11 @@ static void veth_setup(struct net_device *dev)
dev->netdev_ops = &veth_netdev_ops;
dev->ethtool_ops = &veth_ethtool_ops;
- veth_features = NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
+ veth_features = netdev_features_or(NETIF_F_GSO_SOFTWARE,
+ NETIF_F_GSO_ENCAP_ALL);
netdev_features_set_array(&veth_feature_set, &veth_features);
netdev_active_feature_add(dev, NETIF_F_LLTX_BIT);
- dev->features |= veth_features;
+ netdev_active_features_set(dev, veth_features);
dev->vlan_features = dev->features & ~netdev_vlan_offload_features;
dev->needs_free_netdev = true;
dev->priv_destructor = veth_dev_free;
@@ -3521,7 +3521,8 @@ static int virtnet_probe(struct virtio_device *vdev)
}
if (virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) {
- dev->hw_features |= netdev_general_tso_features;
+ netdev_hw_features_set(dev,
+ netdev_general_tso_features);
netdev_hw_feature_add(dev, NETIF_F_TSO_ECN_BIT);
}
/* Individual feature bits: what can host handle? */
@@ -3537,7 +3538,7 @@ static int virtnet_probe(struct virtio_device *vdev)
if (gso) {
netdev_features_t tmp = dev->hw_features & NETIF_F_ALL_TSO;
- dev->features |= tmp;
+ netdev_active_features_set(dev, tmp);
}
/* (!csum && gso) case will be fixed by register_netdev() */
}
@@ -1696,7 +1696,7 @@ static void vrf_setup(struct net_device *dev)
netdev_active_feature_add(dev, NETIF_F_VLAN_CHALLENGED_BIT);
/* enable offload features */
- dev->features |= NETIF_F_GSO_SOFTWARE;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
netdev_active_features_set_array(dev, &vrf_offload_feature_set);
dev->hw_features = dev->features;
@@ -3179,11 +3179,11 @@ static void vxlan_setup(struct net_device *dev)
SET_NETDEV_DEVTYPE(dev, &vxlan_type);
netdev_active_features_set_array(dev, &vxlan_feature_set);
- dev->features |= NETIF_F_GSO_SOFTWARE;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
dev->vlan_features = dev->features;
netdev_hw_features_set_array(dev, &vxlan_hw_feature_set);
- dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+ netdev_hw_features_set(dev, NETIF_F_GSO_SOFTWARE);
netif_keep_dst(dev);
dev->priv_flags |= IFF_NO_QUEUE | IFF_CHANGE_PROTO_DOWN;
@@ -298,9 +298,9 @@ static void wg_setup(struct net_device *dev)
netdev_active_feature_add(dev, NETIF_F_LLTX_BIT);
wg_netdev_features = NETIF_F_GSO_SOFTWARE;
netdev_features_set_array(&wg_feature_set, &wg_netdev_features);
- dev->features |= wg_netdev_features;
- dev->hw_features |= wg_netdev_features;
- dev->hw_enc_features |= wg_netdev_features;
+ netdev_active_features_set(dev, wg_netdev_features);
+ netdev_hw_features_set(dev, wg_netdev_features);
+ netdev_hw_enc_features_set(dev, wg_netdev_features);
dev->mtu = ETH_DATA_LEN - overhead;
dev->max_mtu = round_down(INT_MAX, MESSAGE_PADDING_MULTIPLE) - overhead;
@@ -347,7 +347,7 @@ wil_vif_alloc(struct wil6210_priv *wil, const char *name,
netdev_hw_features_zero(ndev);
netdev_hw_features_set_array(ndev, &wil_hw_feature_set);
- ndev->features |= ndev->hw_features;
+ netdev_active_features_set(ndev, ndev->hw_features);
SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
wdev->netdev = ndev;
return vif;
@@ -615,7 +615,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
hw->wiphy->features |= NL80211_FEATURE_TDLS_CHANNEL_SWITCH;
}
- hw->netdev_features |= *mvm->cfg->features;
+ netdev_features_set(&hw->netdev_features, *mvm->cfg->features);
if (!iwl_mvm_is_csum_supported(mvm))
hw->netdev_features &= ~IWL_CSUM_NETIF_FLAGS_MASK;
@@ -1416,7 +1416,7 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
goto out_unlock;
}
- mvmvif->features |= hw->netdev_features;
+ netdev_features_set(&mvmvif->features, hw->netdev_features);
ret = iwl_mvm_mac_ctxt_add(mvm, vif);
if (ret)
@@ -1750,7 +1750,7 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
* xennet_connect() which is the earliest point where we can
* negotiate with the backend regarding supported features.
*/
- netdev->features |= netdev->hw_features;
+ netdev_active_features_set(netdev, netdev->hw_features);
netdev->ethtool_ops = &xennet_ethtool_ops;
netdev->min_mtu = ETH_MIN_MTU;
@@ -6945,7 +6945,7 @@ netdev_features_t qeth_features_check(struct sk_buff *skb,
netdev_features_t restricted = netdev_empty_features;
if (skb_is_gso(skb) && !netif_needs_gso(skb, features))
- restricted |= NETIF_F_ALL_TSO;
+ netdev_features_set(&restricted, NETIF_F_ALL_TSO);
switch (vlan_get_protocol(skb)) {
case htons(ETH_P_IP):
@@ -1909,7 +1909,8 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
return -ENODEV;
card->dev->needed_headroom = headroom;
- card->dev->features |= netdev_ctag_vlan_offload_features;
+ netdev_active_features_set(card->dev,
+ netdev_ctag_vlan_offload_features);
netif_keep_dst(card->dev);
if (card->dev->hw_features & netdev_general_tso_features)
@@ -690,9 +690,9 @@ static inline netdev_features_t netdev_intersect_features(netdev_features_t f1,
{
if ((f1 & NETIF_F_HW_CSUM) != (f2 & NETIF_F_HW_CSUM)) {
if (f1 & NETIF_F_HW_CSUM)
- f1 |= netdev_ip_csum_features;
+ netdev_features_set(&f1, netdev_ip_csum_features);
else
- f2 |= netdev_ip_csum_features;
+ netdev_features_set(&f2, netdev_ip_csum_features);
}
return f1 & f2;
@@ -704,7 +704,7 @@ netdev_get_wanted_features(struct net_device *dev)
netdev_features_t tmp;
tmp = dev->features & ~dev->hw_features;
- return dev->wanted_features | tmp;
+ return netdev_wanted_features_or(dev, tmp);
}
#endif
@@ -467,7 +467,7 @@ static inline struct sk_buff *udp_rcv_segment(struct sock *sk,
* asks for the final checksum values
*/
if (!inet_get_convert_csum(sk))
- features |= netdev_ip_csum_features;
+ netdev_features_set(&features, netdev_ip_csum_features);
/* UDP segmentation expects packets of type CHECKSUM_PARTIAL or
* CHECKSUM_NONE in __udp_gso_segment. UDP GRO indeed builds partial
@@ -108,8 +108,8 @@ static inline netdev_features_t vlan_tnl_features(struct net_device *real_dev)
{
netdev_features_t ret;
- ret = NETIF_F_CSUM_MASK | NETIF_F_GSO_SOFTWARE;
- ret |= NETIF_F_GSO_ENCAP_ALL;
+ ret = netdev_features_or(NETIF_F_CSUM_MASK, NETIF_F_GSO_SOFTWARE);
+ netdev_features_set(&ret, NETIF_F_GSO_ENCAP_ALL);
ret &= real_dev->hw_enc_features;
if ((ret & NETIF_F_GSO_ENCAP_ALL) && (ret & NETIF_F_CSUM_MASK)) {
@@ -574,11 +574,12 @@ static int vlan_dev_init(struct net_device *dev)
if (vlan->flags & VLAN_FLAG_BRIDGE_BINDING)
dev->state |= (1 << __LINK_STATE_NOCARRIER);
- dev->hw_features = NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
- dev->hw_features |= NETIF_F_ALL_FCOE;
+ dev->hw_features = netdev_features_or(NETIF_F_GSO_SOFTWARE,
+ NETIF_F_GSO_ENCAP_ALL);
+ netdev_hw_features_set(dev, NETIF_F_ALL_FCOE);
netdev_hw_features_set_array(dev, &vlan_hw_feature_set);
- dev->features |= dev->hw_features;
+ netdev_active_features_set(dev, dev->hw_features);
netdev_active_feature_add(dev, NETIF_F_LLTX_BIT);
netif_inherit_tso_max(dev, real_dev);
if (dev->features & NETIF_F_VLAN_FEATURES)
@@ -665,9 +666,9 @@ static netdev_features_t vlan_dev_fix_features(struct net_device *dev,
if (lower_features & netdev_ip_csum_features)
netdev_feature_add(NETIF_F_HW_CSUM_BIT, &lower_features);
features = netdev_intersect_features(features, lower_features);
- tmp = NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE;
+ tmp = netdev_features_or(NETIF_F_SOFT_FEATURES, NETIF_F_GSO_SOFTWARE);
tmp &= old_features;
- features |= tmp;
+ netdev_features_set(&features, tmp);
netdev_feature_add(NETIF_F_LLTX_BIT, &features);
return features;
@@ -507,7 +507,8 @@ void br_dev_setup(struct net_device *dev)
netdev_features_set_array(&br_common_feature_set, &common_features);
dev->features = common_features;
netdev_active_features_set_array(dev, &br_feature_set);
- dev->hw_features = common_features | netdev_tx_vlan_features;
+ dev->hw_features = netdev_features_or(common_features,
+ netdev_tx_vlan_features);
dev->vlan_features = common_features;
br->dev = dev;
@@ -3400,7 +3400,7 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
partial_features = dev->features & dev->gso_partial_features;
netdev_feature_add(NETIF_F_GSO_ROBUST_BIT, &partial_features);
- if (!skb_gso_ok(skb, features | partial_features))
+ if (!skb_gso_ok(skb, netdev_features_or(features, partial_features)))
features &= ~NETIF_F_GSO_PARTIAL;
}
@@ -3565,7 +3565,7 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
features &= dev->hw_enc_features;
if (skb_vlan_tagged(skb)) {
- tmp = dev->vlan_features | netdev_tx_vlan_features;
+ tmp = netdev_vlan_features_or(dev, netdev_tx_vlan_features);
features = netdev_intersect_features(features, tmp);
}
@@ -10027,9 +10027,9 @@ int register_netdevice(struct net_device *dev)
/* Transfer changeable features to wanted_features and enable
* software offloads (GSO and GRO).
*/
- dev->hw_features |= NETIF_F_SOFT_FEATURES;
- dev->hw_features |= NETIF_F_SOFT_FEATURES_OFF;
- dev->features |= NETIF_F_SOFT_FEATURES;
+ netdev_hw_features_set(dev, NETIF_F_SOFT_FEATURES);
+ netdev_hw_features_set(dev, NETIF_F_SOFT_FEATURES_OFF);
+ netdev_active_features_set(dev, NETIF_F_SOFT_FEATURES);
if (dev->udp_tunnel_nic_info) {
netdev_active_feature_add(dev, NETIF_F_RX_UDP_TUNNEL_PORT_BIT);
@@ -11154,17 +11154,17 @@ netdev_features_t netdev_increment_features(netdev_features_t all,
netdev_features_t tmp;
if (mask & NETIF_F_HW_CSUM)
- mask |= NETIF_F_CSUM_MASK;
+ netdev_features_set(&mask, NETIF_F_CSUM_MASK);
netdev_feature_add(NETIF_F_VLAN_CHALLENGED_BIT, &mask);
- tmp = NETIF_F_ONE_FOR_ALL | NETIF_F_CSUM_MASK;
+ tmp = netdev_features_or(NETIF_F_ONE_FOR_ALL, NETIF_F_CSUM_MASK);
tmp &= one;
tmp &= mask;
- all |= tmp;
+ netdev_features_set(&all, tmp);
netdev_features_fill(&tmp);
tmp &= ~NETIF_F_ALL_FOR_ALL;
- tmp |= one;
+ netdev_features_set(&tmp, one);
all &= tmp;
/* If one device supports hw checksumming, set for all. */
@@ -2320,7 +2320,7 @@ void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
if (sk_is_tcp(sk))
netdev_feature_add(NETIF_F_GSO_BIT, &sk->sk_route_caps);
if (sk->sk_route_caps & NETIF_F_GSO)
- sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE;
+ netdev_features_set(&sk->sk_route_caps, NETIF_F_GSO_SOFTWARE);
if (unlikely(sk->sk_gso_disabled))
sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
if (sk_can_gso(sk)) {
@@ -294,7 +294,7 @@ static int ethtool_set_one_feature(struct net_device *dev,
return -EOPNOTSUPP;
if (edata.data)
- dev->wanted_features |= mask;
+ netdev_wanted_features_set(dev, mask);
else
dev->wanted_features &= ~mask;
@@ -356,7 +356,7 @@ static int __ethtool_set_flags(struct net_device *dev, u32 data)
netdev_features_set_array(ðtool_all_feature_set, ð_all_features);
/* allow changing only bits set in hw_features */
- changed = dev->features ^ features;
+ changed = netdev_active_features_xor(dev, features);
changed &= eth_all_features;
tmp = changed & ~dev->hw_features;
if (tmp)
@@ -364,7 +364,7 @@ static int __ethtool_set_flags(struct net_device *dev, u32 data)
dev->wanted_features &= ~changed;
tmp = features & changed;
- dev->wanted_features |= tmp;
+ netdev_wanted_features_set(dev, tmp);
__netdev_update_features(dev);
@@ -776,8 +776,8 @@ static void ipgre_link_update(struct net_device *dev, bool set_mtu)
dev->features &= ~NETIF_F_GSO_SOFTWARE;
dev->hw_features &= ~NETIF_F_GSO_SOFTWARE;
} else {
- dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
+ netdev_hw_features_set(dev, NETIF_F_GSO_SOFTWARE);
}
}
@@ -975,8 +975,8 @@ static void __gre_tunnel_init(struct net_device *dev)
if (flags & TUNNEL_CSUM && tunnel->encap.type != TUNNEL_ENCAP_NONE)
return;
- dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
+ netdev_hw_features_set(dev, NETIF_F_GSO_SOFTWARE);
}
static int ipgre_tunnel_init(struct net_device *dev)
@@ -376,8 +376,8 @@ static void ipip_tunnel_setup(struct net_device *dev)
ipip_features = NETIF_F_GSO_SOFTWARE;
netdev_features_set_array(&ipip_feature_set, &ipip_features);
- dev->features |= ipip_features;
- dev->hw_features |= ipip_features;
+ netdev_active_features_set(dev, ipip_features);
+ netdev_hw_features_set(dev, ipip_features);
ip_tunnel_setup(dev, ipip_net_id);
}
@@ -1490,8 +1490,8 @@ static void ip6gre_tnl_init_features(struct net_device *dev)
if (flags & TUNNEL_CSUM && nt->encap.type != TUNNEL_ENCAP_NONE)
return;
- dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+ netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
+ netdev_hw_features_set(dev, NETIF_F_GSO_SOFTWARE);
}
static int ip6gre_tunnel_init_common(struct net_device *dev)
@@ -1845,8 +1845,8 @@ static void ip6_tnl_dev_setup(struct net_device *dev)
ipxipx_features = NETIF_F_GSO_SOFTWARE;
netdev_features_set_array(&ipxipx_feature_set, &ipxipx_features);
- dev->features |= ipxipx_features;
- dev->hw_features |= ipxipx_features;
+ netdev_active_features_set(dev, ipxipx_features);
+ netdev_hw_features_set(dev, ipxipx_features);
/* This perm addr will be used as interface identifier by IPv6 */
dev->addr_assign_type = NET_ADDR_RANDOM;
@@ -1435,8 +1435,8 @@ static void ipip6_tunnel_setup(struct net_device *dev)
sit_features = NETIF_F_GSO_SOFTWARE;
netdev_features_set_array(&sit_feature_set, &sit_features);
netdev_active_feature_add(dev, NETIF_F_LLTX_BIT);
- dev->features |= sit_features;
- dev->hw_features |= sit_features;
+ netdev_active_features_set(dev, sit_features);
+ netdev_hw_features_set(dev, sit_features);
}
static int ipip6_tunnel_init(struct net_device *dev)
@@ -2397,9 +2397,9 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
if (type == NL80211_IFTYPE_STATION)
sdata->u.mgd.use_4addr = params->use_4addr;
- ndev->features |= local->hw.netdev_features;
+ netdev_active_features_set(ndev, local->hw.netdev_features);
tmp = ndev->features & MAC80211_SUPPORTED_FEATURES_TX;
- ndev->hw_features |= tmp;
+ netdev_hw_features_set(ndev, tmp);
netdev_set_default_ethtool_ops(ndev, &ieee80211_ethtool_ops);
@@ -1546,7 +1546,8 @@ static void __init ieee80211_features_init(void)
&mac80211_tx_features);
netdev_features_set_array(&mac80211_rx_feature_set,
&mac80211_rx_features);
- mac80211_supported_features = mac80211_tx_features | mac80211_rx_features;
+ mac80211_supported_features = netdev_features_or(mac80211_tx_features,
+ mac80211_rx_features);
}
static int __init ieee80211_init(void)
@@ -116,12 +116,13 @@ static void do_setup(struct net_device *netdev)
netdev->ethtool_ops = &internal_dev_ethtool_ops;
netdev->rtnl_link_ops = &internal_dev_link_ops;
- netdev->features = NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
+ netdev->features = netdev_features_or(NETIF_F_GSO_SOFTWARE,
+ NETIF_F_GSO_ENCAP_ALL);
netdev_active_features_set_array(netdev, &ovs_feature_set);
netdev->vlan_features = netdev->features;
netdev->hw_enc_features = netdev->features;
- netdev->features |= netdev_tx_vlan_features;
+ netdev_active_features_set(netdev, netdev_tx_vlan_features);
netdev->hw_features = netdev->features;
netdev->hw_features &= ~NETIF_F_LLTX;
@@ -11,6 +11,7 @@
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/netdevice.h>
+#include <linux/netdev_features_helper.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -156,7 +157,7 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
}
if (!skb->next) {
- esp_features |= skb->dev->gso_partial_features;
+ netdev_features_set(&esp_features, skb->dev->gso_partial_features);
xfrm_outer_mode_prep(x, skb);
xo->flags |= XFRM_DEV_RESUME;
@@ -177,7 +178,7 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
}
skb_list_walk_safe(skb, skb2, nskb) {
- esp_features |= skb->dev->gso_partial_features;
+ netdev_features_set(&esp_features, skb->dev->gso_partial_features);
skb_mark_not_on_list(skb2);
xo = xfrm_offload(skb2);
@@ -598,8 +598,8 @@ static int xfrmi_dev_init(struct net_device *dev)
xfrmi_features = NETIF_F_GSO_SOFTWARE;
netdev_features_set_array(&xfrmi_feature_set, &xfrmi_features);
netdev_active_feature_add(dev, NETIF_F_LLTX_BIT);
- dev->features |= xfrmi_features;
- dev->hw_features |= xfrmi_features;
+ netdev_active_features_set(dev, xfrmi_features);
+ netdev_hw_features_set(dev, xfrmi_features);
if (phydev) {
dev->needed_headroom = phydev->needed_headroom;
Replace the '|' expressions of features by netdev_features_or helpers, and '|=' expressions by netdev_features_set helpers. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- drivers/net/amt.c | 4 +-- drivers/net/bareudp.c | 4 +-- drivers/net/bonding/bond_main.c | 23 +++++++-------- drivers/net/bonding/bond_options.c | 5 ++-- drivers/net/dummy.c | 8 +++--- drivers/net/ethernet/alacritech/slicoss.c | 2 +- drivers/net/ethernet/altera/altera_tse_main.c | 2 +- drivers/net/ethernet/amazon/ena/ena_netdev.c | 4 +-- drivers/net/ethernet/amd/amd8111e.c | 3 +- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 2 +- drivers/net/ethernet/amd/xgbe/xgbe-main.c | 2 +- .../net/ethernet/aquantia/atlantic/aq_nic.c | 2 +- drivers/net/ethernet/asix/ax88796c_main.c | 4 +-- drivers/net/ethernet/atheros/atlx/atl2.c | 2 +- drivers/net/ethernet/broadcom/b44.c | 3 +- drivers/net/ethernet/broadcom/bcmsysport.c | 4 +-- drivers/net/ethernet/broadcom/bnx2.c | 6 ++-- .../net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 +++--- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 3 +- .../net/ethernet/broadcom/genet/bcmgenet.c | 4 +-- drivers/net/ethernet/broadcom/tg3.c | 8 +++--- drivers/net/ethernet/brocade/bna/bnad.c | 2 +- drivers/net/ethernet/calxeda/xgmac.c | 2 +- .../net/ethernet/cavium/liquidio/lio_main.c | 2 +- .../ethernet/cavium/liquidio/lio_vf_main.c | 2 +- .../net/ethernet/cavium/thunder/nicvf_main.c | 2 +- drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 3 +- .../net/ethernet/chelsio/cxgb3/cxgb3_main.c | 4 +-- .../net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- drivers/net/ethernet/cisco/enic/enic_main.c | 10 +++---- drivers/net/ethernet/cortina/gemini.c | 2 +- drivers/net/ethernet/davicom/dm9000.c | 2 +- drivers/net/ethernet/dnet.c | 3 +- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- drivers/net/ethernet/ethoc.c | 3 +- drivers/net/ethernet/faraday/ftgmac100.c | 2 +- .../net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +- drivers/net/ethernet/freescale/gianfar.c | 2 +- .../ethernet/fungible/funeth/funeth_main.c | 8 +++--- drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 4 +-- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 2 +- .../net/ethernet/hisilicon/hns3/hns3_enet.c | 8 +++--- drivers/net/ethernet/ibm/emac/core.c | 2 +- drivers/net/ethernet/ibm/ibmveth.c | 6 ++-- drivers/net/ethernet/ibm/ibmvnic.c | 5 ++-- drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- drivers/net/ethernet/intel/e1000e/netdev.c | 3 +- .../net/ethernet/intel/fm10k/fm10k_netdev.c | 6 ++-- drivers/net/ethernet/intel/i40e/i40e_main.c | 15 +++++----- drivers/net/ethernet/intel/iavf/iavf_main.c | 21 +++++++------- drivers/net/ethernet/intel/ice/ice_main.c | 28 ++++++++++--------- drivers/net/ethernet/intel/igb/igb_main.c | 12 ++++---- drivers/net/ethernet/intel/igbvf/netdev.c | 8 +++--- drivers/net/ethernet/intel/igc/igc_main.c | 8 +++--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 ++++---- .../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 10 +++---- drivers/net/ethernet/marvell/mvneta.c | 4 +-- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 13 +++++---- .../ethernet/marvell/octeon_ep/octep_main.c | 2 +- .../ethernet/marvell/octeontx2/nic/otx2_pf.c | 10 +++---- .../ethernet/marvell/octeontx2/nic/otx2_vf.c | 6 ++-- drivers/net/ethernet/marvell/skge.c | 2 +- drivers/net/ethernet/marvell/sky2.c | 4 +-- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- .../net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +- drivers/net/ethernet/micrel/ksz884x.c | 2 +- .../ethernet/microchip/lan966x/lan966x_main.c | 3 +- .../net/ethernet/myricom/myri10ge/myri10ge.c | 2 +- drivers/net/ethernet/natsemi/ns83820.c | 2 +- drivers/net/ethernet/neterion/s2io.c | 2 +- .../ethernet/netronome/nfp/nfp_net_common.c | 4 +-- .../net/ethernet/netronome/nfp/nfp_net_repr.c | 6 ++-- drivers/net/ethernet/nvidia/forcedeth.c | 4 +-- .../net/ethernet/pensando/ionic/ionic_lif.c | 6 ++-- .../ethernet/qlogic/netxen/netxen_nic_main.c | 4 +-- .../net/ethernet/qlogic/qlcnic/qlcnic_main.c | 5 ++-- drivers/net/ethernet/realtek/r8169_main.c | 4 +-- .../net/ethernet/samsung/sxgbe/sxgbe_main.c | 2 +- drivers/net/ethernet/sfc/ef10.c | 6 ++-- drivers/net/ethernet/sfc/ef100_netdev.c | 8 +++--- drivers/net/ethernet/sfc/ef100_nic.c | 6 ++-- drivers/net/ethernet/sfc/efx.c | 8 +++--- drivers/net/ethernet/sfc/efx_common.c | 4 +-- drivers/net/ethernet/sfc/falcon/efx.c | 8 +++--- drivers/net/ethernet/sfc/falcon/net_driver.h | 2 +- drivers/net/ethernet/sfc/net_driver.h | 2 +- drivers/net/ethernet/sfc/siena/efx.c | 9 +++--- drivers/net/ethernet/sfc/siena/efx_common.c | 4 +-- drivers/net/ethernet/sfc/siena/net_driver.h | 3 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 8 +++--- drivers/net/ethernet/sun/niu.c | 2 +- drivers/net/ethernet/sun/sunhme.c | 4 +-- .../net/ethernet/synopsys/dwc-xlgmac-common.c | 6 ++-- drivers/net/ethernet/via/via-rhine.c | 2 +- drivers/net/geneve.c | 4 +-- drivers/net/hyperv/rndis_filter.c | 2 +- drivers/net/ifb.c | 11 ++++---- drivers/net/ipvlan/ipvlan_main.c | 17 +++++------ drivers/net/macsec.c | 6 ++-- drivers/net/macvlan.c | 17 +++++------ drivers/net/net_failover.c | 11 ++++---- drivers/net/tap.c | 2 +- drivers/net/team/team.c | 13 +++++---- drivers/net/tun.c | 4 +-- drivers/net/usb/ax88179_178a.c | 2 +- drivers/net/usb/smsc75xx.c | 2 +- drivers/net/veth.c | 8 ++++-- drivers/net/virtio_net.c | 5 ++-- drivers/net/vrf.c | 2 +- drivers/net/vxlan/vxlan_core.c | 4 +-- drivers/net/wireguard/device.c | 6 ++-- drivers/net/wireless/ath/wil6210/netdev.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 +-- drivers/net/xen-netfront.c | 2 +- drivers/s390/net/qeth_core_main.c | 2 +- drivers/s390/net/qeth_l3_main.c | 3 +- include/linux/netdev_features_helper.h | 6 ++-- include/net/udp.h | 2 +- net/8021q/vlan.h | 4 +-- net/8021q/vlan_dev.c | 11 ++++---- net/bridge/br_device.c | 3 +- net/core/dev.c | 18 ++++++------ net/core/sock.c | 2 +- net/ethtool/ioctl.c | 6 ++-- net/ipv4/ip_gre.c | 8 +++--- net/ipv4/ipip.c | 4 +-- net/ipv6/ip6_gre.c | 4 +-- net/ipv6/ip6_tunnel.c | 4 +-- net/ipv6/sit.c | 4 +-- net/mac80211/iface.c | 4 +-- net/mac80211/main.c | 3 +- net/openvswitch/vport-internal_dev.c | 5 ++-- net/xfrm/xfrm_device.c | 5 ++-- net/xfrm/xfrm_interface.c | 4 +-- 137 files changed, 375 insertions(+), 341 deletions(-)