Re: [RFC PATCH net-next 0/5] Replay and offload host VLAN entries in DSA
flat view
From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2022-02-13 20:13:46
On Sun, Feb 13, 2022 at 10:02:55PM +0200, Vladimir Oltean wrote:
(a) call br_vlan_get_info() from the DSA switchdev notification handler
to figure out whether the VLAN is new or not. As far as I can see in
__vlan_add(), br_switchdev_port_vlan_add() is called before the
insertion of the VLAN into &vg->vlan_hash, so the absence from there
could be used as an indicator that the VLAN is new, and that the
refcount needs to be bumped, regardless of knowing exactly which
bridge or bridge port the VLAN came from. The important part is that
it isn't just a flag change, for which we don't want to bump the
refcount, and that we can rely on the bridge database and not keep a
separate one. The disadvantage seems to be that the solution is a
bit fragile and puts a bit too much pressure on the bridge code
structure, if it even works (need to try).Ah, this is too fragile, I thought of a case where it's broken already: for VLAN replays, it's technically a 'new VLAN' not a changed one, yet br_vlan_get_info() will still find it so it will get detected as changed. So the bridge has to pass the information that the switchdev notifier is just for a change of flags somehow.