net: bridge: fdb: don't flush ext_learn entries
Subsystems (3)
Nikolay Aleksandrov
maintainerPATCH 1/1 net: bridge: fdb: don't flush ext_learn entries
From: Nikolay Aleksandrov <[email protected]>
When a user-space software manages fdb entries externally it should set the ext_learn flag which marks the fdb entry as externally managed and avoids expiring it (they're treated as static fdbs). Unfortunately on events where fdb entries are flushed (STP down, netlink fdb flush etc) these fdbs are also deleted automatically by the bridge. That in turn causes trouble for the managing user-space software (e.g. in MLAG setups we lose remote fdb entries on port flaps).
These entries are completely externally managed so we should avoid automatically deleting them, the only exception are offloaded entries (i.e. BR_FDB_ADDED_BY_EXT_LEARN + BR_FDB_OFFLOADED). They are flushed as before.
--- net/bridge/br_fdb.c | 2 ++ 1 file changed, 2 insertions(+)
net/bridge/br_fdb.c +2 -0
@@ -413,6 +413,8 @@ void br_fdb_delete_by_port(struct net_bridge *br,if (!do_all)if (test_bit (BR_FDB_STATIC , &f->flags) || + (test_bit (BR_FDB_ADDED_BY_EXT_LEARN , &f->flags) && + !test_bit (BR_FDB_OFFLOADED , &f->flags)) || (vid && f->key.vlan_id != vid))continue ;
Signature · 1 line
2.26.2
David Miller
maintainerFrom: Nikolay Aleksandrov <[email protected]>
Date: Mon, 28 Sep 2020 18:30:02 +0300
Quoted 14 lines
From: Nikolay Aleksandrov <[email protected]>
When a user-space software manages fdb entries externally it should set the
ext_learnflag which marks the fdb entry as externally managed and avoids expiring it (they're treated as static fdbs). Unfortunately on events where fdb entries are flushed (STP down, netlink fdb flush etc) these fdbs are also deleted automatically by the bridge. That in turn causes trouble for the managing user-space software (e.g. in MLAG setups we lose remote fdb entries on port flaps).
These entries are completely externally managed so we should avoid automatically deleting them, the only exception are offloaded entries (i.e.BR_FDB_ADDED_BY_EXT_LEARN+BR_FDB_OFFLOADED). They are flushed as before.
Quoted 2 lines
Fixes eb100e0e24a2 ("net: bridge: allow to add externally learned entries from user-space")Signed-off-by Nikolay Aleksandrov <[email protected]>
Applied and queued up for -stable, thank you.