diff mbox series

[RFCv8,net-next,50/55] net: tap: adjust the prototype of update_features()

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

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count fail Series longer than 15 patches (and no cover letter)
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 4 maintainers not CCed: edumazet@google.com sakiwit@gmail.com pabeni@redhat.com maze@google.com
netdev/build_clang fail Errors and warnings before: 1012 this patch: 214
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 106 this patch: 160
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 45 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shenjian (K) Sept. 18, 2022, 9:43 a.m. UTC
The function tap_dev.update_features() using netdev_features_t
as parameters.

For the prototype of netdev_features_t will be extended to be
larger than 8 bytes, so change the prototype of the function,
change the prototype of input features to 'netdev_features_t *'.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 drivers/net/ipvlan/ipvtap.c | 4 ++--
 drivers/net/macvtap.c       | 4 ++--
 drivers/net/tap.c           | 2 +-
 include/linux/if_tap.h      | 3 ++-
 4 files changed, 7 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ipvlan/ipvtap.c b/drivers/net/ipvlan/ipvtap.c
index ba2730ba5c1f..37988c869f6e 100644
--- a/drivers/net/ipvlan/ipvtap.c
+++ b/drivers/net/ipvlan/ipvtap.c
@@ -63,12 +63,12 @@  static void ipvtap_count_rx_dropped(struct tap_dev *tap)
 }
 
 static void ipvtap_update_features(struct tap_dev *tap,
-				   netdev_features_t features)
+				   const netdev_features_t *features)
 {
 	struct ipvtap_dev *vlantap = container_of(tap, struct ipvtap_dev, tap);
 	struct ipvl_dev *vlan = &vlantap->vlan;
 
-	vlan->sfeatures = features;
+	netdev_features_copy(vlan->sfeatures, *features);
 	netdev_update_features(vlan->dev);
 }
 
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 14f75986f4c4..1a6cbb987ad2 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -67,12 +67,12 @@  static void macvtap_count_rx_dropped(struct tap_dev *tap)
 }
 
 static void macvtap_update_features(struct tap_dev *tap,
-				    netdev_features_t features)
+				    const netdev_features_t *features)
 {
 	struct macvtap_dev *vlantap = container_of(tap, struct macvtap_dev, tap);
 	struct macvlan_dev *vlan = &vlantap->vlan;
 
-	vlan->set_features = features;
+	netdev_features_copy(vlan->set_features, *features);
 	netdev_update_features(vlan->dev);
 }
 
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index e3045a7badd8..a13c0479079f 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -985,7 +985,7 @@  static int set_offload(struct tap_queue *q, unsigned long arg)
 	 */
 	tap->tap_features = feature_mask;
 	if (tap->update_features)
-		tap->update_features(tap, features);
+		tap->update_features(tap, &features);
 
 	return 0;
 }
diff --git a/include/linux/if_tap.h b/include/linux/if_tap.h
index 553552fa635c..7f5678f9df09 100644
--- a/include/linux/if_tap.h
+++ b/include/linux/if_tap.h
@@ -44,7 +44,8 @@  struct tap_dev {
 	netdev_features_t	tap_features;
 	int			minor;
 
-	void (*update_features)(struct tap_dev *tap, netdev_features_t features);
+	void (*update_features)(struct tap_dev *tap,
+				const netdev_features_t *features);
 	void (*count_tx_dropped)(struct tap_dev *tap);
 	void (*count_rx_dropped)(struct tap_dev *tap);
 };