diff mbox series

[RFCv2,net-next,040/167] macvtap: use netdev feature helpers

Message ID 20210929155334.12454-41-shenjian15@huawei.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series net: extend the netdev_features_t | expand

Commit Message

shenjian (K) Sept. 29, 2021, 3:51 p.m. UTC
Use netdev_feature_xxx helpers to replace the logical operation
for netdev features.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 drivers/net/macvtap.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 694e2f5dbbe5..2162080133bb 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -74,7 +74,7 @@  static void macvtap_update_features(struct tap_dev *tap,
 	struct macvtap_dev *vlantap = container_of(tap, struct macvtap_dev, tap);
 	struct macvlan_dev *vlan = &vlantap->vlan;
 
-	vlan->set_features = features;
+	netdev_feature_copy(&vlan->set_features, features);
 	netdev_update_features(vlan->dev);
 }
 
@@ -90,7 +90,8 @@  static int macvtap_newlink(struct net *src_net, struct net_device *dev,
 	/* Since macvlan supports all offloads by default, make
 	 * tap support all offloads also.
 	 */
-	vlantap->tap.tap_features = TUN_OFFLOADS;
+	netdev_feature_zero(&vlantap->tap.tap_features);
+	netdev_feature_set_bits(TUN_OFFLOADS, &vlantap->tap.tap_features);
 
 	/* Register callbacks for rx/tx drops accounting and updating
 	 * net_device features