From dca78d804fd8439464bfcb59cc63b8e5d17d1fdf Mon Sep 17 00:00:00 2001 From: KISHORE KUNAL <64033340+kishorekunal01@users.noreply.github.com> Date: Fri, 18 Nov 2022 11:46:59 -0800 Subject: [PATCH] [Fdbsyncd] Bug Fix for remote MAC move to local MAC and Fix for Static MAC advertisement in EVPN. (#2521) - What I did On local MAC learning, update the MAC entry as local then delete the DST entry from the Kernel for remote MAC. This will make sure that FRR doesn't reinstall the remote MAC(#12363) When installing the static MAC in the kernel set the sticky flag as well. (#12419) - How I did it Move the DST entry delete code after the MAC update code.(#12363) Pass sticky flag to the kernel in fdbsyncd code.((#12419) - How to verify it Tested MAC move from remote to local and verified the MAC is local in Kernel.(#12363) Verified in Kernel that sticky bit is set and the same as advertised by FRR in the network.((#12419) Signed-off-by: kishore.kunal@broadcom.com --- fdbsyncd/fdbsync.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/fdbsyncd/fdbsync.cpp b/fdbsyncd/fdbsync.cpp index 0cdcc63214f9..0d71f721dce2 100644 --- a/fdbsyncd/fdbsync.cpp +++ b/fdbsyncd/fdbsync.cpp @@ -307,13 +307,6 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info) op = "replace"; port_name = info->port_name; fdb_type = info->type; - /* Check if this vlan+key is also learned by vxlan neighbor then delete learned on */ - if (m_mac.find(key) != m_mac.end()) - { - macDelVxlanEntry(key, info); - SWSS_LOG_INFO("Local learn event deleting from VXLAN table DEL_KEY %s", key.c_str()); - macDelVxlan(key); - } } else { @@ -335,7 +328,7 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info) } else { - type = "static"; + type = "sticky static"; } const std::string cmds = std::string("") @@ -347,6 +340,17 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info) SWSS_LOG_INFO("cmd:%s, res=%s, ret=%d", cmds.c_str(), res.c_str(), ret); + if (info->op_type == FDB_OPER_ADD) + { + /* Check if this vlan+key is also learned by vxlan neighbor then delete the dest entry */ + if (m_mac.find(key) != m_mac.end()) + { + macDelVxlanEntry(key, info); + SWSS_LOG_INFO("Local learn event deleting from VXLAN table DEL_KEY %s", key.c_str()); + macDelVxlan(key); + } + } + return; }