Review-by: Jie Wang wangjie125@huawei.com
On 2021/9/22 22:57, Jian Shen wrote:
Use netdev_feature_xxx helpers to replace the logical operation for netdev features.
Signed-off-by: Jian Shen shenjian15@huawei.com
drivers/net/dummy.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index f82ad7419508..54ebb638a57b 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c @@ -123,12 +123,14 @@ static void dummy_setup(struct net_device *dev) dev->flags |= IFF_NOARP; dev->flags &= ~IFF_MULTICAST; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
- dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST;
- dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
- dev->features |= NETIF_F_GSO_ENCAP_ALL;
- dev->hw_features |= dev->features;
- dev->hw_enc_features |= dev->features;
netdev_feature_set_bits(NETIF_F_SG | NETIF_F_FRAGLIST, &dev->features);
netdev_feature_set_bits(NETIF_F_GSO_SOFTWARE, &dev->features);
netdev_feature_set_bits(NETIF_F_HW_CSUM | NETIF_F_HIGHDMA |
NETIF_F_LLTX, &dev->features);
netdev_feature_set_bits(NETIF_F_GSO_ENCAP_ALL, &dev->features);
netdev_feature_or(&dev->hw_features, dev->hw_features, dev->features);
netdev_feature_or(&dev->hw_enc_features, dev->hw_enc_features,
dev->features);
eth_hw_addr_random(dev);
dev->min_mtu = 0;