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

[202012] Fix for "orchagent crashed when trying to delete fdb static entry with swssconfig #11046" #2374

Merged
merged 2 commits into from
Sep 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion orchagent/fdborch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,12 @@ void FdbOrch::doTask(NotificationConsumer& consumer)
* so far only support flush all the FDB entries
* flush per port and flush per vlan will be added later.
*/
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 @@ -811,6 +816,11 @@ void FdbOrch::flushFDBEntries(sai_object_id_t bridge_port_oid,
attrs.push_back(attr);
}

/* do not flush static mac */
attr.id = SAI_FDB_FLUSH_ATTR_ENTRY_TYPE;
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);

rv = sai_fdb_api->flush_fdb_entries(gSwitchId, (uint32_t)attrs.size(), attrs.data());
Expand Down