Skip to content

Commit

Permalink
[Fdbsyncd] Bug Fix for remote MAC move to local MAC and Fix for Stati…
Browse files Browse the repository at this point in the history
…c MAC advertisement in EVPN. (sonic-net#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(sonic-net#12363)
    When installing the static MAC in the kernel set the sticky flag as well. (sonic-net#12419)

    - How I did it
    Move the DST entry delete code after the MAC update code.(sonic-net#12363)
    Pass sticky flag to the kernel in fdbsyncd code.((sonic-net#12419)

    - How to verify it
    Tested MAC move from remote to local and verified the MAC is local in Kernel.(sonic-net#12363)
    Verified in Kernel that sticky bit is set and the same as advertised by FRR in the network.((sonic-net#12419)

Signed-off-by: kishore.kunal@broadcom.com
  • Loading branch information
kishorekunal01 authored Nov 18, 2022
1 parent 28aa309 commit dca78d8
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions fdbsyncd/fdbsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -335,7 +328,7 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info)
}
else
{
type = "static";
type = "sticky static";
}

const std::string cmds = std::string("")
Expand All @@ -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;
}

Expand Down

0 comments on commit dca78d8

Please sign in to comment.