Skip to content
Merged
12 changes: 11 additions & 1 deletion orchagent/fdborch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,12 @@ void FdbOrch::doTask(NotificationConsumer& consumer)
{
if (op == "ALL")
{
status = sai_fdb_api->flush_fdb_entries(gSwitchId, 0, NULL);
vector<sai_attribute_t> attrs;
sai_attribute_t attr;
attr.id = SAI_FDB_FLUSH_ATTR_ENTRY_TYPE;
attr.value.s32 = SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC;
attrs.push_back(attr);
status = sai_fdb_api->flush_fdb_entries(gSwitchId, (uint32_t)attrs.size(), attrs.data());
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Flush fdb failed, return code %x", status);
Expand Down Expand Up @@ -1056,6 +1061,11 @@ void FdbOrch::flushFDBEntries(sai_object_id_t bridge_port_oid,
attr.value.oid = vlan_oid;
attrs.push_back(attr);
}

/* do not flush static mac */
attr.id = SAI_FDB_FLUSH_ATTR_ENTRY_TYPE;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change added here it means for any "FDB flush" operations whether it is based on port, or VLAN it will never flush out Static MACs. Not sure if this may impact MLAG operations where they may want to flush out remotely learnt MAC that were programmed as Static MAC? Adding MLAG owner @Praveen-Brcm to the review to ensure this is ok.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gechiang : MCLAG remote MAC's are programmed dynamic with aging disabled instead of STATIC MAC. this change will not affect the MCLAG. Thanks

attr.value.s32 = SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC;
attrs.push_back(attr);

SWSS_LOG_INFO("Flushing FDB bridge_port_oid: 0x%" PRIx64 ", and bvid_oid:0x%" PRIx64 ".", bridge_port_oid, vlan_oid);

Expand Down