-
Notifications
You must be signed in to change notification settings - Fork 370
[meta] Flush fdb entries after flush api success #581
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1683,7 +1683,29 @@ sai_status_t Meta::flushFdbEntries( | |
|
|
||
| if (status == SAI_STATUS_SUCCESS) | ||
| { | ||
| SWSS_LOG_WARN("TODO, remove all matching fdb entries here, currently removed in FDB notification"); | ||
| // use same logic as notification, so create notification event | ||
|
|
||
| sai_fdb_event_notification_data_t data = {}; | ||
|
|
||
| auto *bv_id = sai_metadata_get_attr_by_id(SAI_FDB_FLUSH_ATTR_BV_ID, attr_count, attr_list); | ||
| auto *bp_id = sai_metadata_get_attr_by_id(SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID, attr_count, attr_list); | ||
| auto *et = sai_metadata_get_attr_by_id(SAI_FDB_FLUSH_ATTR_ENTRY_TYPE, attr_count, attr_list); | ||
|
|
||
| sai_attribute_t list[2]; | ||
|
|
||
| list[0].id = SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID; | ||
| list[0].value.oid = bp_id ? bp_id->value.oid : SAI_NULL_OBJECT_ID; | ||
|
|
||
| list[1].id = SAI_FDB_ENTRY_ATTR_TYPE; | ||
| list[1].value.s32 = et ? et->value.s32 : SAI_FDB_FLUSH_ENTRY_TYPE_ALL; | ||
|
|
||
| data.event_type = SAI_FDB_EVENT_FLUSHED; | ||
| data.fdb_entry.switch_id = switch_id; | ||
| data.fdb_entry.bv_id = (bv_id) ? bv_id->value.oid : SAI_NULL_OBJECT_ID; | ||
| data.attr_count = 2; | ||
| data.attr = list; | ||
|
|
||
| meta_sai_on_fdb_flush_event_consolidated(data); | ||
| } | ||
|
|
||
| return status; | ||
|
|
@@ -6954,7 +6976,8 @@ void Meta::meta_sai_on_fdb_flush_event_consolidated( | |
| continue; | ||
| } | ||
|
|
||
| if (fdbTypeAttr->getSaiAttr()->value.s32 != type->value.s32) | ||
| if ((type->value.s32 != SAI_FDB_FLUSH_ENTRY_TYPE_ALL) && | ||
|
||
| (fdbTypeAttr->getSaiAttr()->value.s32 != type->value.s32)) | ||
kcudnik marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| // entry type is not matching on this fdb entry | ||
| continue; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have fdb_flush_entry as well in sai_fdb_event_notification_data_t and use it when event is SAI_FDB_EVENT_FLUSHED. Otherwise, we are converting FDB_FLUSH_ENTRY attributes to FDB_ENTRY attributes and in-fact if you look at the second attribute here, attribute type is SAI_FDB_ENTRY_ATTR_TYPE and value is SAI_FDB_FLUSH_ENTRY_TYPE_ALL. what do you say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, already addressed in below commit