[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251030073539.133779-1-liuhangbin@gmail.com>
Date: Thu, 30 Oct 2025 07:35:39 +0000
From: Hangbin Liu <liuhangbin@...il.com>
To: netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>,
"Dr. David Alan Gilbert" <linux@...blig.org>,
Dong Chenchen <dongchenchen2@...wei.com>,
Oscar Maes <oscmaes92@...il.com>,
Hangbin Liu <liuhangbin@...il.com>
Subject: [PATCHv2 net] net: vlan: sync VLAN features with lower device
After registering a VLAN device and setting its feature flags, we need to
synchronize the VLAN features with the lower device. For example, the VLAN
device does not have the NETIF_F_LRO flag, it should be synchronized with
the lower device based on the NETIF_F_UPPER_DISABLES definition.
As the dev->vlan_features has changed, we need to call
netdev_update_features(). The caller must run after netdev_upper_dev_link()
links the lower devices, so this patch adds the netdev_update_features()
call in register_vlan_dev().
Fixes: fd867d51f889 ("net/core: generic support for disabling netdev features down stack")
Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
---
v2:
- Add Fixes tag (Paolo Abeni)
- Use netdev_update_features instead of netdev_change_features (Paolo Abeni)
- v1 link: https://lore.kernel.org/netdev/20251021095658.86478-1-liuhangbin@gmail.com
Jakub suggested to add netdev_upper_dev_link to __netdev_upper_dev_link, but
this change touches too many callers, I need to check each one carefully. And
I'm also considering add a callback for netdev_compute_master_upper_features.
So it's better to make this change in net-next. Before that, let's fix the
VLAN issue first.
---
net/8021q/vlan.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index fda3a80e9340..2b74ed56eb16 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -193,6 +193,8 @@ int register_vlan_dev(struct net_device *dev, struct netlink_ext_ack *extack)
vlan_group_set_device(grp, vlan->vlan_proto, vlan_id, dev);
grp->nr_vlan_devs++;
+ netdev_update_features(dev);
+
return 0;
out_unregister_netdev:
--
2.50.1
Powered by blists - more mailing lists