@@ -246,7 +246,7 @@ nfp_repr_fix_features(struct net_device *netdev, netdev_features_t features)
if (lower_features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM))
lower_features |= NETIF_F_HW_CSUM;
- features = netdev_intersect_features(features, lower_features);
+ netdev_intersect_features(&features, features, lower_features);
features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_HW_TC);
features |= NETIF_F_LLTX;
@@ -5017,8 +5017,9 @@ const char *netdev_drivername(const struct net_device *dev);
void linkwatch_run_queue(void);
-static inline netdev_features_t netdev_intersect_features(netdev_features_t f1,
- netdev_features_t f2)
+static inline void netdev_intersect_features(netdev_features_t *ret,
+ netdev_features_t f1,
+ netdev_features_t f2)
{
if ((f1 ^ f2) & NETIF_F_HW_CSUM) {
if (f1 & NETIF_F_HW_CSUM)
@@ -5027,7 +5028,7 @@ static inline netdev_features_t netdev_intersect_features(netdev_features_t f1,
f2 |= (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM);
}
- return f1 & f2;
+ *ret = f1 & f2;
}
static inline netdev_features_t netdev_get_wanted_features(
@@ -640,16 +640,16 @@ static netdev_features_t vlan_dev_fix_features(struct net_device *dev,
netdev_features_t old_features = features;
netdev_features_t lower_features;
- lower_features = netdev_intersect_features((real_dev->vlan_features |
- NETIF_F_RXCSUM),
- real_dev->features);
+ netdev_intersect_features(&lower_features,
+ (real_dev->vlan_features | NETIF_F_RXCSUM),
+ real_dev->features);
/* Add HW_CSUM setting to preserve user ability to control
* checksum offload on the vlan device.
*/
if (lower_features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))
lower_features |= NETIF_F_HW_CSUM;
- features = netdev_intersect_features(features, lower_features);
+ netdev_intersect_features(&features, features, lower_features);
features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE);
features |= NETIF_F_LLTX;
@@ -3548,10 +3548,10 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
features &= dev->hw_enc_features;
if (skb_vlan_tagged(skb))
- features = netdev_intersect_features(features,
- dev->vlan_features |
- NETIF_F_HW_VLAN_CTAG_TX |
- NETIF_F_HW_VLAN_STAG_TX);
+ netdev_intersect_features(&features, features,
+ dev->vlan_features |
+ NETIF_F_HW_VLAN_CTAG_TX |
+ NETIF_F_HW_VLAN_STAG_TX);
if (dev->netdev_ops->ndo_features_check)
features &= dev->netdev_ops->ndo_features_check(skb, dev,
For the origin type for netdev_features_t would be changed to be unsigned long * from u64, so changes the prototype of netdev_intersect_features for adaption. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 2 +- include/linux/netdevice.h | 7 ++++--- net/8021q/vlan_dev.c | 8 ++++---- net/core/dev.c | 8 ++++---- 4 files changed, 13 insertions(+), 12 deletions(-)