Skip to content

[meta] Flush fdb entries after flush api success#581

Merged
qiluo-msft merged 3 commits intosonic-net:masterfrom
kcudnik:fdbflushfix
Apr 1, 2020
Merged

[meta] Flush fdb entries after flush api success#581
qiluo-msft merged 3 commits intosonic-net:masterfrom
kcudnik:fdbflushfix

Conversation

@kcudnik
Copy link
Collaborator

@kcudnik kcudnik commented Mar 25, 2020

No description provided.

qiluo-msft
qiluo-msft previously approved these changes Mar 25, 2020
meta/Meta.cpp Outdated
}

if (fdbTypeAttr->getSaiAttr()->value.s32 != type->value.s32)
if ((type->value.s32 != SAI_FDB_FLUSH_ENTRY_TYPE_ALL) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

How about this?

if (type->value.s32 == SAI_FDB_FLUSH_ENTRY_TYPE_ALL) {
    // add fdb to remove vector and continue;
}

// check type match
// check bridge_port_id matches
// check vlan ID matches

If you dont like this, then when someone specified type == SAI_FDB_FLUSH_ENTRY_TYPE_ALL, and also provides vlan_id or bridge_port_id or both, we are NOT going to flush all. Is that the expected behavior? Or we should honor the type attribute?

Copy link
Contributor

@vasant17 vasant17 Mar 26, 2020

Choose a reason for hiding this comment

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

Also, what do we print on line number 6963 when value is SAI_FDB_FLUSH_ENTRY_TYPE_ALL? Because we care casting from FLUSH_ENTRY_TYPE to FDB_ENTRY_TYPE enum

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cant be like that , since if it's ALL (static and dynamic, other attributes also needs to be checked, like vlan id, or bridge port, ALL here appllies only to static or dynamic

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. SAI_FDB_FLUSH_ENTRY_TYPE_ALL means BOTH(STATIC and DYNAMIC) type! NOT really ALL FDB entries!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there are no other entries except static and dynamic, so ALL means static and dynamic together

meta/Meta.cpp Outdated
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;
Copy link
Contributor

@vasant17 vasant17 Mar 26, 2020

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?

Copy link
Collaborator Author

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

auto *et = sai_metadata_get_attr_by_id(SAI_FDB_FLUSH_ATTR_ENTRY_TYPE, attr_count, attr_list);

sai_attribute_t list[2];
if (et)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is someone specifies the type but sets it to TYPE_ALL?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

already fixed in my next commit

@qiluo-msft qiluo-msft merged commit d13521e into sonic-net:master Apr 1, 2020
@zhenggen-xu
Copy link

@kcudnik Can we backport this to 201911 branch?

vasant17 pushed a commit to vasant17/sonic-sairedis that referenced this pull request Apr 1, 2020
* [meta] Flush fdb entries after flush api success
* [meta] Use correct fdb entry type
* [meta] Use correct enum values for fdb entry
@vasant17
Copy link
Contributor

vasant17 commented Apr 1, 2020

@kcudnik Can we backport this to 201911 branch?

I did it. @kcudnik or @qiluo-msft could you please approve and merge.
#585

vasant17 pushed a commit to vasant17/sonic-sairedis that referenced this pull request Apr 1, 2020
* [meta] Flush fdb entries after flush api success
* [meta] Use correct fdb entry type
* [meta] Use correct enum values for fdb entry
@kcudnik kcudnik deleted the fdbflushfix branch April 1, 2020 06:22
kcudnik added a commit that referenced this pull request Apr 1, 2020
* [meta] Flush fdb entries after flush api success
* [meta] Use correct fdb entry type
* [meta] Use correct enum values for fdb entry

Co-authored-by: Kamil Cudnik <[email protected]>
vasant17 added a commit to vasant17/sonic-sairedis that referenced this pull request Apr 3, 2020
…ic-net#585)

* [meta] Flush fdb entries after flush api success
* [meta] Use correct fdb entry type
* [meta] Use correct enum values for fdb entry

Co-authored-by: Kamil Cudnik <[email protected]>
zhenggen-xu pushed a commit to zhenggen-xu/sonic-sairedis that referenced this pull request Apr 4, 2020
…ic-net#585) (#5)

* [meta] Flush fdb entries after flush api success
* [meta] Use correct fdb entry type
* [meta] Use correct enum values for fdb entry

Co-authored-by: Kamil Cudnik <[email protected]>

Co-authored-by: Kamil Cudnik <[email protected]>
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
* [meta] Flush fdb entries after flush api success
* [meta] Use correct fdb entry type
* [meta] Use correct enum values for fdb entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants