summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_fdb.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2017-03-23 11:27:12 +0100
committerDavid S. Miller <davem@davemloft.net>2017-03-24 20:30:21 +0100
commit7e26bf45e4cb4ffaa113dc4a95a3d78bcc51e4cb (patch)
tree41975fa9ec23f322a3c2718e5d9a8d0b68c400b3 /net/bridge/br_fdb.c
parentmlxsw: Remove debugfs interface (diff)
downloadlinux-7e26bf45e4cb4ffaa113dc4a95a3d78bcc51e4cb.tar.xz
linux-7e26bf45e4cb4ffaa113dc4a95a3d78bcc51e4cb.zip
net: bridge: allow SW learn to take over HW fdb entries
Allow to take over an entry which was previously learned via HW when it shows up from a SW port. This is analogous to how HW takes over SW learned entries already. Suggested-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_fdb.c')
-rw-r--r--net/bridge/br_fdb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 6e08b7199dd7..daebce89dba8 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -594,6 +594,9 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
fdb->updated = now;
if (unlikely(added_by_user))
fdb->added_by_user = 1;
+ /* Take over HW learned entry */
+ if (unlikely(fdb->added_by_external_learn))
+ fdb->added_by_external_learn = 0;
if (unlikely(fdb_modified))
fdb_notify(br, fdb, RTM_NEWNEIGH);
}