[PATCH] realtek: net: dsa: configure better brport flags when ports leave the bridge

Daniel Golle daniel at makrotopia.org
Sun Mar 6 06:45:09 PST 2022


On Sat, Mar 05, 2022 at 10:36:07AM +0100, Bjørn Mork wrote:
> Ensures that the DSA driver set exactly the same default flags as the
> bridge when a port joins or leaves.  Without this we end up with a
> confusing flag mismatch, where DSA and bridge ports use different sets
> of flags.
> 
> This is critical as the "learning" mismatch will be harmful to the
> network, causing all traffic to be flooded on all ports.
> 
> The original commit was buggy, trying to set the flags one-by-one in a
> loop.  This was not supported by the API and the end result was that
> all but the last flag were cleared.  This bug was implicitly fixed
> upstream by commit e18f4c18ab5b ("net: switchdev: pass flags and mask
> to both {PRE_,}BRIDGE_FLAGS attributes").
> 
> This is a minimum temporary stop meaure fix for the critical lack of
> "learning" only.  The major API change associated with a full v5.12+
> backport is neither required nor wanted. A simpler fix, moving the
> call to dsa_port_bridge_flags() out of the loop,  has therefore been
> merged into this modified backport.
> 
> Fixes: afa3ab54c03d ("realtek: Backport bridge configuration for DSA")
> Signed-off-by: Bjørn Mork <bjorn at mork.no>
Acked-by: Daniel Golle <daniel at makrotopia.org>
(reviewed and lgtm, but can't test it before thursday)




More information about the openwrt-devel mailing list