Re: [PATCH net] net: dsa: fix VLAN 0 filter imbalance when toggling filtering

From: Paolo Abeni
Date: Thu Apr 24 2025 - 05:16:15 EST




On 4/22/25 8:49 PM, Jonas Gorski wrote:
> When a net device has NETIF_F_HW_VLAN_CTAG_FILTER set, the 8021q code
> will add VLAN 0 when enabling the device, and remove it on disabling it
> again.
>
> But since we are changing NETIF_F_HW_VLAN_CTAG_FILTER during runtime in
> dsa_user_manage_vlan_filtering(), user ports that are already enabled
> may end up with no VLAN 0 configured, or VLAN 0 left configured.

Why this is a problem specifically for dsa and not a generic one? others
devices allow flipping the NETIF_F_HW_VLAN_CTAG_FILTER feature at runtime.

AFAICS dsa_user_manage_vlan_filtering() is currently missing a call to
netdev_update_features(), why is that not sufficient nor necessary?

Thanks,

Paolo