net: vlan: sync VLAN features with lower device
Subsystems (2)
PATCH v2 1/1 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().
---
v2:
- Add Fixes tag (Paolo Abeni)
- Use netdev_update_features instead of netdev_change_features (Paolo Abeni)
- v1 link: https://lore.kernel.org/netdev/[email protected]
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(+)
net/8021q/vlan.c +2 -0
@@ -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:
Signature · 1 line
2.50.1
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Thu, 30 Oct 2025 07:35:39 +0000 you wrote:
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_LROflag, it should be synchronized with the lower device based on theNETIF_F_UPPER_DISABLESdefinition.As the
dev->vlan_featureshas changed, we need to callnetdev_update_features(). The caller must run afternetdev_upper_dev_link()links the lower devices, so this patch adds thenetdev_update_features()call inregister_vlan_dev().[...]
Here is the summary with links:
- [PATCHv2,net] net: vlan: sync VLAN features with lower device
https://git.kernel.org/netdev/net/c/c211f5d7cbd5
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html