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

Flush all FDB entries if no attributes specified #1918

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

andriy-kokhan
Copy link
Contributor

As per enum sai_fdb_flush_attr_t description:

 * For example:
 *
 * 1) Flush all entries in FDB table - Do not specify any attribute
   . . . . .

Also, it's logically to flush all types of FDB entries in case either no attributes specified or just BV_ID or BRIDGE_PORT_ID.

Signed-off-by: Andriy Kokhan <andriy.kokhan@plvision.eu>
@kcudnik
Copy link
Collaborator

kcudnik commented Nov 1, 2023

This is breaking change and I this was done on purpose, since probably you don't want to flush entries you created statically, let say your network hosts, but flush dynamic by default of all learned entries + @lguohan, let's discuss this on SAI community meeting

@andriy-kokhan
Copy link
Contributor Author

This is breaking change and I this was done on purpose, since probably you don't want to flush entries you created statically, let say your network hosts, but flush dynamic by default of all learned entries + @lguohan, let's discuss this on SAI community meeting

Yeh, you are right. But anyway we should either fix a default value or enum description. At this point, they are contradictory. I'm fine with both ways.

@kcudnik
Copy link
Collaborator

kcudnik commented Nov 1, 2023

This is breaking change and I this was done on purpose, since probably you don't want to flush entries you created statically, let say your network hosts, but flush dynamic by default of all learned entries + @lguohan, let's discuss this on SAI community meeting

Yeh, you are right. But anyway we should either fix a default value or enum description. At this point, they are contradictory. I'm fine with both ways.

ahh i see your point now, ok, in the syncd we just forward call to vendor: https://github.com/sonic-net/sonic-sairedis/blob/master/syncd/Syncd.cpp#L598 and then we process it https://github.com/sonic-net/sonic-sairedis/blob/master/syncd/Syncd.cpp#L639 based on attributes https://github.com/sonic-net/sonic-sairedis/blob/master/syncd/RedisClient.cpp#L877 and default type is obtained here:
https://github.com/sonic-net/sonic-sairedis/blob/master/syncd/Syncd.cpp#L609 which is encoded, and set as SAI says, but this should be obtained from sai metadata to be more correct, based on that , the description should be changed, and in flush default value should be obtained if not attribute is specified, which in this case should be DYNAMIC
and description here should be fixed

@andriy-kokhan
Copy link
Contributor Author

This is breaking change and I this was done on purpose, since probably you don't want to flush entries you created statically, let say your network hosts, but flush dynamic by default of all learned entries + @lguohan, let's discuss this on SAI community meeting

Yeh, you are right. But anyway we should either fix a default value or enum description. At this point, they are contradictory. I'm fine with both ways.

ahh i see your point now, ok, in the syncd we just forward call to vendor: https://github.com/sonic-net/sonic-sairedis/blob/master/syncd/Syncd.cpp#L598 and then we process it https://github.com/sonic-net/sonic-sairedis/blob/master/syncd/Syncd.cpp#L639 based on attributes https://github.com/sonic-net/sonic-sairedis/blob/master/syncd/RedisClient.cpp#L877 and default type is obtained here: https://github.com/sonic-net/sonic-sairedis/blob/master/syncd/Syncd.cpp#L609 which is encoded, and set as SAI says, but this should be obtained from sai metadata to be more correct, based on that , the description should be changed, and in flush default value should be obtained if not attribute is specified, which in this case should be DYNAMIC and description here should be fixed

I'd expect that in case no attributes specified then SAI library implementation should take the default values based on SAI headers (or meta). I mean it's not mandatory for the application (syncd in our case) to obtain the default values and provide them explicitly to SAI library.

Also, I've just check Linux bridge command description (skipping not relevant parameters):

bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ] [ [no]permanent | [no]static | [no]dynamic ]

Looks like bridge fdb flush dev DEV should flush all FDB entries.
So, I still tending to change the default to _ALL for SAI as well.

@lguohan , your input will be greatly appreciated. Thanks

@kcudnik
Copy link
Collaborator

kcudnik commented Nov 3, 2023

added fix in syncd sonic-net/sonic-sairedis#1317 to get that value form SAI metadata

@kcudnik
Copy link
Collaborator

kcudnik commented Nov 4, 2023

bridge fdb flush dev DEV [ brport DEV ] [ vlan VID ] [ [no]permanent | [no]static | [no]dynamic ]


Looks like `bridge fdb flush dev DEV` should flush all FDB entries. So, I still tending to change the default to `_ALL` for SAI as well.

thats a point to discuss whether we should behave like linux bridge command

@kcudnik
Copy link
Collaborator

kcudnik commented Nov 30, 2023

Instead of chainging default value can you update description?

Signed-off-by: Andriy Kokhan <andriy.kokhan@plvision.eu>
@andriy-kokhan
Copy link
Contributor Author

Instead of chainging default value can you update description?

done

inc/saifdb.h Show resolved Hide resolved
Copy link
Contributor

@rck-innovium rck-innovium left a comment

Choose a reason for hiding this comment

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

Looks good.

@kcudnik kcudnik merged commit 70ae04f into opencomputeproject:master Nov 30, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants