From 127d8f22b2a9be94080eb0afa7630a8981e3c2e3 Mon Sep 17 00:00:00 2001 From: Kishore Kunal Date: Mon, 14 Nov 2022 16:08:54 -0800 Subject: [PATCH] [Fdbsyncd] Bug Fix for remote MAC move to local MAC and Fix for Static MAC advertisement in EVPN. - 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 0cdcc63214..0d71f721dc 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; }