Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for "orchagent crashed when trying to delete fdb static entry with swssconfig #11046" #2332

Merged
merged 12 commits into from
Jun 22, 2022
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
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
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