@@ -1467,8 +1467,8 @@ static void bond_compute_features(struct bonding *bond)
if (!bond_has_slaves(bond))
goto done;
- vlan_features &= NETIF_F_ALL_FOR_ALL;
- mpls_features &= NETIF_F_ALL_FOR_ALL;
+ netdev_features_mask(&vlan_features, NETIF_F_ALL_FOR_ALL);
+ netdev_features_mask(&mpls_features, NETIF_F_ALL_FOR_ALL);
bond_for_each_slave(bond, slave, iter) {
vlan_features = netdev_increment_features(vlan_features,
@@ -7757,7 +7757,7 @@ bnx2_set_features(struct net_device *dev, netdev_features_t features)
if (netdev_feature_test(NETIF_F_HW_VLAN_CTAG_TX_BIT, features)) {
netdev_features_t tso;
- tso = dev->hw_features & NETIF_F_ALL_TSO;
+ tso = netdev_hw_features_and(dev, NETIF_F_ALL_TSO);
netdev_vlan_features_set(dev, tso);
} else {
netdev_vlan_features_clear(dev, NETIF_F_ALL_TSO);
@@ -11198,7 +11198,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
/* Both CTAG and STAG VLAN accelaration on the RX side have to be
* turned on or off together.
*/
- vlan_features = features & BNXT_HW_FEATURE_VLAN_ALL_RX;
+ vlan_features = netdev_features_and(features, BNXT_HW_FEATURE_VLAN_ALL_RX);
if (vlan_features != BNXT_HW_FEATURE_VLAN_ALL_RX) {
if (netdev_active_features_intersects(dev, BNXT_HW_FEATURE_VLAN_ALL_RX))
netdev_features_clear(&features,
@@ -3327,7 +3327,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
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_features_mask(&vlan_feat, netdev->features);
netdev_vlan_features_set(netdev, vlan_feat);
netdev_active_feature_add(netdev, NETIF_F_HIGHDMA_BIT);
@@ -6867,7 +6867,8 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
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;
+ netdev->vlan_features = netdev_active_features_and(netdev,
+ vlan_features);
#if IS_ENABLED(CONFIG_CHELSIO_TLS_DEVICE)
if (pi->adapter->params.crypto & FW_CAPS_CONFIG_TLS_HW) {
netdev_hw_feature_add(netdev, NETIF_F_HW_TLS_TX_BIT);
@@ -3098,7 +3098,8 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
vlan_features = tso_features;
netdev_features_set_array(&cxgb4vf_vlan_feature_set,
&vlan_features);
- netdev->vlan_features = netdev->features & vlan_features;
+ netdev->vlan_features = netdev_active_features_and(netdev,
+ vlan_features);
netdev->priv_flags |= IFF_UNICAST_FLT;
netdev->min_mtu = 81;
@@ -1797,7 +1797,7 @@ static int fun_create_netdev(struct fun_ethdev *ed, unsigned int portid)
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->vlan_features = netdev_active_features_and(netdev, vlan_feat);
netdev->mpls_features = netdev->vlan_features;
netdev->hw_enc_features = netdev->hw_features;
@@ -4899,11 +4899,12 @@ static void send_control_ip_offload(struct ibmvnic_adapter *adapter)
netdev_features_t tmp = netdev_empty_features;
/* disable features no longer supported */
- adapter->netdev->features &= adapter->netdev->hw_features;
+ netdev_active_features_mask(adapter->netdev,
+ adapter->netdev->hw_features);
/* turn on features now supported if previously enabled */
tmp = netdev_hw_features_xor(adapter->netdev, old_hw_features);
- tmp &= adapter->netdev->hw_features;
- tmp &= adapter->netdev->wanted_features;
+ netdev_features_mask(&tmp, adapter->netdev->hw_features);
+ netdev_features_mask(&tmp, adapter->netdev->wanted_features);
netdev_active_features_set(adapter->netdev, tmp);
}
@@ -5780,13 +5780,13 @@ ice_fix_features(struct net_device *netdev, netdev_features_t features)
netdev_features_t req_vlan_fltr, cur_vlan_fltr;
bool cur_ctag, cur_stag, req_ctag, req_stag;
- cur_vlan_fltr = netdev->features & NETIF_VLAN_FILTERING_FEATURES;
+ cur_vlan_fltr = netdev_active_features_and(netdev, NETIF_VLAN_FILTERING_FEATURES);
cur_ctag = netdev_feature_test(NETIF_F_HW_VLAN_CTAG_FILTER_BIT,
cur_vlan_fltr);
cur_stag = netdev_feature_test(NETIF_F_HW_VLAN_STAG_FILTER_BIT,
cur_vlan_fltr);
- req_vlan_fltr = features & NETIF_VLAN_FILTERING_FEATURES;
+ req_vlan_fltr = netdev_features_and(features, NETIF_VLAN_FILTERING_FEATURES);
req_ctag = netdev_feature_test(NETIF_F_HW_VLAN_CTAG_FILTER_BIT,
req_vlan_fltr);
req_stag = netdev_feature_test(NETIF_F_HW_VLAN_STAG_FILTER_BIT,
@@ -5917,8 +5917,10 @@ ice_set_vlan_features(struct net_device *netdev, netdev_features_t features)
struct ice_vsi *vsi = np->vsi;
int err;
- current_vlan_features = netdev->features & NETIF_VLAN_OFFLOAD_FEATURES;
- requested_vlan_features = features & NETIF_VLAN_OFFLOAD_FEATURES;
+ current_vlan_features = netdev_active_features_and(netdev,
+ NETIF_VLAN_OFFLOAD_FEATURES);
+ requested_vlan_features = netdev_features_and(features,
+ NETIF_VLAN_OFFLOAD_FEATURES);
diff = netdev_features_xor(current_vlan_features, requested_vlan_features);
if (diff) {
err = ice_set_vlan_offload_features(vsi, features);
@@ -5926,9 +5928,10 @@ ice_set_vlan_features(struct net_device *netdev, netdev_features_t features)
return err;
}
- current_vlan_features = netdev->features &
- NETIF_VLAN_FILTERING_FEATURES;
- requested_vlan_features = features & NETIF_VLAN_FILTERING_FEATURES;
+ current_vlan_features = netdev_active_features_and(netdev,
+ NETIF_VLAN_FILTERING_FEATURES);
+ requested_vlan_features = netdev_features_and(features,
+ NETIF_VLAN_FILTERING_FEATURES);
diff = netdev_features_xor(current_vlan_features, requested_vlan_features);
if (diff) {
err = ice_set_vlan_filtering_features(vsi, features);
@@ -1785,7 +1785,7 @@ nfp_net_features_check(struct sk_buff *skb, struct net_device *dev,
u8 l4_hdr;
/* We can't do TSO over double tagged packets (802.1AD) */
- features &= vlan_features_check(skb, features);
+ netdev_features_mask(&features, vlan_features_check(skb, features));
if (!skb->encapsulation)
return features;
@@ -251,7 +251,7 @@ nfp_repr_fix_features(struct net_device *netdev, netdev_features_t features)
features = netdev_intersect_features(features, lower_features);
tmp = NETIF_F_SOFT_FEATURES;
netdev_feature_add(NETIF_F_HW_TC_BIT, &tmp);
- tmp &= old_features;
+ netdev_features_mask(&tmp, old_features);
netdev_features_set(&features, tmp);
netdev_feature_add(NETIF_F_LLTX_BIT, &features);
@@ -1081,7 +1081,7 @@ netdev_features_t qlcnic_fix_features(struct net_device *netdev,
netdev_features_zero(&changeable);
netdev_features_set_array(&qlcnic_changable_feature_set,
&changeable);
- changed &= changeable;
+ netdev_features_mask(&changed, changeable);
netdev_features_toggle(&features, changed);
}
}
@@ -1434,7 +1434,7 @@ static int rndis_netdev_set_hwcaps(struct rndis_device *rndis_device,
netdev_features_fill(&features);
netdev_features_clear(&features, NETVSC_SUPPORTED_HW_FEATURES);
netdev_features_set(&features, net->hw_features);
- net->features &= features;
+ netdev_active_features_mask(net, features);
netif_set_tso_max_size(net, gso_max_size);
@@ -151,9 +151,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 = netdev_active_features_and(phy_dev, IPVLAN_FEATURES);
netdev_active_features_set(dev, IPVLAN_ALWAYS_ON);
- dev->vlan_features = phy_dev->vlan_features & IPVLAN_FEATURES;
+ dev->vlan_features = netdev_vlan_features_and(phy_dev,
+ IPVLAN_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);
@@ -260,12 +261,12 @@ static netdev_features_t ipvlan_fix_features(struct net_device *dev,
netdev_features_fill(&tmp);
netdev_features_clear(&tmp, IPVLAN_FEATURES);
netdev_features_set(&tmp, ipvlan->sfeatures);
- features &= tmp;
+ netdev_features_mask(&features, tmp);
features = netdev_increment_features(ipvlan->phy_dev->features,
features, features);
netdev_features_set(&features, IPVLAN_ALWAYS_ON);
tmp = netdev_features_or(IPVLAN_FEATURES, IPVLAN_ALWAYS_ON);
- features &= tmp;
+ netdev_features_mask(&features, tmp);
return features;
}
@@ -3456,7 +3456,8 @@ static int macsec_dev_init(struct net_device *dev)
if (macsec_is_offloaded(macsec)) {
dev->features = REAL_DEV_FEATURES(real_dev);
} else {
- dev->features = real_dev->features & SW_MACSEC_FEATURES;
+ dev->features = netdev_active_features_and(real_dev,
+ SW_MACSEC_FEATURES);
netdev_active_feature_add(dev, NETIF_F_LLTX_BIT);
netdev_active_features_set(dev, NETIF_F_GSO_SOFTWARE);
}
@@ -3495,10 +3496,10 @@ static netdev_features_t macsec_fix_features(struct net_device *dev,
if (macsec_is_offloaded(macsec))
return REAL_DEV_FEATURES(real_dev);
- tmp = real_dev->features & SW_MACSEC_FEATURES;
+ tmp = netdev_active_features_and(real_dev, SW_MACSEC_FEATURES);
netdev_features_set(&tmp, NETIF_F_GSO_SOFTWARE);
netdev_features_set(&tmp, NETIF_F_SOFT_FEATURES);
- features &= tmp;
+ netdev_features_mask(&features, tmp);
netdev_feature_add(NETIF_F_LLTX_BIT, &features);
return features;
@@ -916,10 +916,10 @@ 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 = netdev_active_features_and(lowerdev, MACVLAN_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 = netdev_vlan_features_and(lowerdev, MACVLAN_FEATURES);
netdev_vlan_features_set(dev, ALWAYS_ON_OFFLOADS);
netdev_hw_enc_features_set(dev, dev->features);
netif_inherit_tso_max(dev, lowerdev);
@@ -1105,16 +1105,16 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev,
netdev_features_fill(&tmp);
netdev_features_clear(&tmp, MACVLAN_FEATURES);
netdev_features_set(&tmp, vlan->set_features);
- features &= tmp;
+ netdev_features_mask(&features, tmp);
mask = features;
tmp = features;
netdev_feature_del(NETIF_F_LRO_BIT, &tmp);
- lowerdev_features &= tmp;
+ netdev_features_mask(&lowerdev_features, tmp);
features = netdev_increment_features(lowerdev_features, features, mask);
netdev_features_set(&features, ALWAYS_ON_FEATURES);
tmp = netdev_features_or(ALWAYS_ON_FEATURES, MACVLAN_FEATURES);
- features &= tmp;
+ netdev_features_mask(&features, tmp);
return features;
}
@@ -393,8 +393,8 @@ static rx_handler_result_t net_failover_handle_frame(struct sk_buff **pskb)
static void net_failover_compute_features(struct net_device *dev)
{
- netdev_features_t vlan_features = FAILOVER_VLAN_FEATURES &
- NETIF_F_ALL_FOR_ALL;
+ netdev_features_t vlan_features = netdev_features_and(FAILOVER_VLAN_FEATURES,
+ NETIF_F_ALL_FOR_ALL);
netdev_features_t enc_features = FAILOVER_ENC_FEATURES;
unsigned short max_hard_header_len = ETH_HLEN;
unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
@@ -999,8 +999,8 @@ static netdev_features_t team_enc_features __ro_after_init;
static void __team_compute_features(struct team *team)
{
struct team_port *port;
- netdev_features_t vlan_features = TEAM_VLAN_FEATURES &
- NETIF_F_ALL_FOR_ALL;
+ netdev_features_t vlan_features = netdev_features_and(TEAM_VLAN_FEATURES,
+ NETIF_F_ALL_FOR_ALL);
netdev_features_t enc_features = TEAM_ENC_FEATURES;
unsigned short max_hard_header_len = ETH_HLEN;
unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
@@ -1178,7 +1178,7 @@ static netdev_features_t tun_net_fix_features(struct net_device *dev,
struct tun_struct *tun = netdev_priv(dev);
netdev_features_t tmp1, tmp2;
- tmp1 = features & tun->set_features;
+ tmp1 = netdev_features_and(features, tun->set_features);
tmp2 = netdev_features_andnot(features, TUN_USER_FEATURES);
return netdev_features_or(tmp1, tmp2);
}
@@ -3538,7 +3538,8 @@ static int virtnet_probe(struct virtio_device *vdev)
netdev_active_feature_add(dev, NETIF_F_GSO_ROBUST_BIT);
if (gso) {
- netdev_features_t tmp = dev->hw_features & NETIF_F_ALL_TSO;
+ netdev_features_t tmp = netdev_hw_features_and(dev,
+ NETIF_F_ALL_TSO);
netdev_active_features_set(dev, tmp);
}
@@ -8,6 +8,7 @@
#define _LINUX_IF_VLAN_H_
#include <linux/netdevice.h>
+#include <linux/netdev_features_helper.h>
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>
#include <linux/bug.h>
@@ -743,7 +744,8 @@ static inline netdev_features_t vlan_features_check(struct sk_buff *skb,
* sure that only devices supporting NETIF_F_HW_CSUM will
* have checksum offloading support.
*/
- features &= netdev_multi_tags_features_mask;
+ netdev_features_mask(&features,
+ netdev_multi_tags_features_mask);
}
return features;
@@ -696,7 +696,7 @@ static inline netdev_features_t netdev_intersect_features(netdev_features_t f1,
netdev_features_set(&f2, netdev_ip_csum_features);
}
- return f1 & f2;
+ return netdev_features_and(f1, f2);
}
static inline netdev_features_t
@@ -110,7 +110,7 @@ static inline netdev_features_t vlan_tnl_features(struct net_device *real_dev)
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;
+ netdev_features_mask(&ret, real_dev->hw_enc_features);
if (netdev_features_intersects(ret, NETIF_F_GSO_ENCAP_ALL) &&
netdev_features_intersects(ret, NETIF_F_CSUM_MASK)) {
@@ -668,7 +668,7 @@ static netdev_features_t vlan_dev_fix_features(struct net_device *dev,
netdev_feature_add(NETIF_F_HW_CSUM_BIT, &lower_features);
features = netdev_intersect_features(features, lower_features);
tmp = netdev_features_or(NETIF_F_SOFT_FEATURES, NETIF_F_GSO_SOFTWARE);
- tmp &= old_features;
+ netdev_features_mask(&tmp, old_features);
netdev_features_set(&features, tmp);
netdev_feature_add(NETIF_F_LLTX_BIT, &features);
@@ -3398,7 +3398,7 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
netdev_features_t partial_features;
struct net_device *dev = skb->dev;
- partial_features = dev->features & dev->gso_partial_features;
+ partial_features = netdev_active_features_and(dev, dev->gso_partial_features);
netdev_feature_add(NETIF_F_GSO_ROBUST_BIT, &partial_features);
if (!skb_gso_ok(skb, netdev_features_or(features, partial_features)))
netdev_feature_del(NETIF_F_GSO_PARTIAL_BIT, &features);
@@ -3465,7 +3465,7 @@ static netdev_features_t net_mpls_features(struct sk_buff *skb,
__be16 type)
{
if (eth_p_mpls(type))
- features &= skb->dev->mpls_features;
+ netdev_features_mask(&features, skb->dev->mpls_features);
return features;
}
@@ -3563,7 +3563,7 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
* features for the netdev
*/
if (skb->encapsulation)
- features &= dev->hw_enc_features;
+ netdev_features_mask(&features, dev->hw_enc_features);
if (skb_vlan_tagged(skb)) {
tmp = netdev_vlan_features_or(dev, netdev_tx_vlan_features);
@@ -3574,7 +3574,7 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
tmp = dev->netdev_ops->ndo_features_check(skb, dev, features);
else
tmp = dflt_features_check(skb, dev, features);
- features &= tmp;
+ netdev_features_mask(&features, tmp);
return harmonize_features(skb, features);
}
@@ -10046,7 +10046,8 @@ int register_netdevice(struct net_device *dev)
netdev_hw_feature_add(dev, NETIF_F_RX_UDP_TUNNEL_PORT_BIT);
}
- dev->wanted_features = dev->features & dev->hw_features;
+ dev->wanted_features = netdev_active_features_and(dev,
+ dev->hw_features);
if (!(dev->flags & IFF_LOOPBACK))
netdev_hw_feature_add(dev, NETIF_F_NOCACHE_COPY_BIT);
@@ -11168,14 +11169,14 @@ netdev_features_t netdev_increment_features(netdev_features_t all,
netdev_feature_add(NETIF_F_VLAN_CHALLENGED_BIT, &mask);
tmp = netdev_features_or(NETIF_F_ONE_FOR_ALL, NETIF_F_CSUM_MASK);
- tmp &= one;
- tmp &= mask;
+ netdev_features_mask(&tmp, one);
+ netdev_features_mask(&tmp, mask);
netdev_features_set(&all, tmp);
netdev_features_fill(&tmp);
netdev_features_clear(&tmp, NETIF_F_ALL_FOR_ALL);
netdev_features_set(&tmp, one);
- all &= tmp;
+ netdev_features_mask(&all, tmp);
/* If one device supports hw checksumming, set for all. */
if (netdev_feature_test(NETIF_F_HW_CSUM_BIT, all)) {
@@ -289,7 +289,7 @@ static int ethtool_set_one_feature(struct net_device *dev,
return -EFAULT;
mask = ethtool_get_feature_mask(ethcmd);
- mask &= dev->hw_features;
+ netdev_features_mask(&mask, dev->hw_features);
if (!mask)
return -EOPNOTSUPP;
@@ -357,14 +357,14 @@ static int __ethtool_set_flags(struct net_device *dev, u32 data)
/* allow changing only bits set in hw_features */
changed = netdev_active_features_xor(dev, features);
- changed &= eth_all_features;
+ netdev_features_mask(&changed, eth_all_features);
tmp = netdev_hw_features_andnot_r(dev, changed);
if (tmp)
return netdev_hw_features_intersects(dev, changed) ?
-EINVAL : -EOPNOTSUPP;
netdev_wanted_features_clear(dev, changed);
- tmp = features & changed;
+ tmp = netdev_features_and(features, changed);
netdev_wanted_features_set(dev, tmp);
__netdev_update_features(dev);
@@ -1359,7 +1359,7 @@ struct sk_buff *inet_gso_segment(struct sk_buff *skb,
encap = SKB_GSO_CB(skb)->encap_level > 0;
if (encap)
- features &= skb->dev->hw_enc_features;
+ netdev_features_mask(&features, skb->dev->hw_enc_features);
SKB_GSO_CB(skb)->encap_level += ihl;
skb_reset_transport_header(skb);
@@ -44,7 +44,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
need_csum = !!(skb_shinfo(skb)->gso_type & SKB_GSO_GRE_CSUM);
skb->encap_hdr_csum = need_csum;
- features &= skb->dev->hw_enc_features;
+ netdev_features_mask(&features, skb->dev->hw_enc_features);
if (need_csum)
netdev_feature_del(NETIF_F_SCTP_CRC_BIT, &features);
@@ -68,7 +68,7 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
(is_ipv6 ? netdev_active_feature_test(skb->dev, NETIF_F_IPV6_CSUM_BIT) :
netdev_active_feature_test(skb->dev, NETIF_F_IP_CSUM_BIT))));
- features &= skb->dev->hw_enc_features;
+ netdev_features_mask(&features, skb->dev->hw_enc_features);
if (need_csum)
netdev_feature_del(NETIF_F_SCTP_CRC_BIT, &features);
@@ -115,7 +115,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb,
encap = SKB_GSO_CB(skb)->encap_level > 0;
if (encap)
- features &= skb->dev->hw_enc_features;
+ netdev_features_mask(&features, skb->dev->hw_enc_features);
SKB_GSO_CB(skb)->encap_level += sizeof(*ipv6h);
ipv6h = ipv6_hdr(skb);
@@ -2398,7 +2398,8 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
sdata->u.mgd.use_4addr = params->use_4addr;
netdev_active_features_set(ndev, local->hw.netdev_features);
- tmp = ndev->features & MAC80211_SUPPORTED_FEATURES_TX;
+ tmp = netdev_active_features_and(ndev,
+ MAC80211_SUPPORTED_FEATURES_TX);
netdev_hw_features_set(ndev, tmp);
netdev_set_default_ethtool_ops(ndev, &ieee80211_ethtool_ops);
@@ -12,6 +12,7 @@
#include <linux/err.h>
#include <linux/module.h>
#include <linux/netdev_features.h>
+#include <linux/netdev_features_helper.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <net/mpls.h>
@@ -43,7 +44,7 @@ static struct sk_buff *mpls_gso_segment(struct sk_buff *skb,
skb_reset_mac_header(skb);
/* Segment inner packet. */
- mpls_features = skb->dev->mpls_features & features;
+ mpls_features = netdev_mpls_features_and(skb->dev, features);
segs = skb_mac_gso_segment(skb, mpls_features);
if (IS_ERR_OR_NULL(segs)) {
skb_gso_error_unwind(skb, mpls_protocol, mpls_hlen, mac_offset,
@@ -107,7 +107,7 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
skb->protocol = proto;
netdev_feature_add(NETIF_F_SG_BIT, &tmp);
- features &= tmp;
+ netdev_features_mask(&features, tmp);
segs = skb_mac_gso_segment(skb, features);
if (IS_ERR_OR_NULL(segs)) {
skb_gso_error_unwind(skb, htons(ETH_P_NSH), nsh_len,
Replace the '&' expressions of features by netdev_features_and helpers, and replace the '& =' expressions by netdev_features_clear helpers. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/bonding/bond_main.c | 4 ++-- drivers/net/ethernet/broadcom/bnx2.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 3 ++- .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 3 ++- .../net/ethernet/fungible/funeth/funeth_main.c | 2 +- drivers/net/ethernet/ibm/ibmvnic.c | 7 ++++--- drivers/net/ethernet/intel/ice/ice_main.c | 17 ++++++++++------- .../net/ethernet/netronome/nfp/nfp_net_common.c | 2 +- .../net/ethernet/netronome/nfp/nfp_net_repr.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 2 +- drivers/net/hyperv/rndis_filter.c | 2 +- drivers/net/ipvlan/ipvlan_main.c | 9 +++++---- drivers/net/macsec.c | 7 ++++--- drivers/net/macvlan.c | 10 +++++----- drivers/net/net_failover.c | 4 ++-- drivers/net/team/team.c | 4 ++-- drivers/net/tun.c | 2 +- drivers/net/virtio_net.c | 3 ++- include/linux/if_vlan.h | 4 +++- include/linux/netdev_features_helper.h | 2 +- net/8021q/vlan.h | 2 +- net/8021q/vlan_dev.c | 2 +- net/core/dev.c | 17 +++++++++-------- net/ethtool/ioctl.c | 6 +++--- net/ipv4/af_inet.c | 2 +- net/ipv4/gre_offload.c | 2 +- net/ipv4/udp_offload.c | 2 +- net/ipv6/ip6_offload.c | 2 +- net/mac80211/iface.c | 3 ++- net/mpls/mpls_gso.c | 3 ++- net/nsh/nsh.c | 2 +- 33 files changed, 76 insertions(+), 62 deletions(-)