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(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c index 3b8e675..466e898 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c @@ -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;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index bd8d5b8..f96e31a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4990,8 +4990,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) @@ -5000,7 +5001,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( diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 0c21d1f..2987201 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -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;
diff --git a/net/core/dev.c b/net/core/dev.c index 8865079..dfd5fa9 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3546,10 +3546,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,