opencomputeproject / SAI

Switch Abstraction Interface
Other
471 stars 473 forks source link

Question: Expected usage of sai_fdb_event_notification_fn #1353

Open mdivyamohan opened 2 years ago

mdivyamohan commented 2 years ago

Hello,

When static FDB entries are added by user (using Adapter Host, eg: SONiC), is the SAI adapter expected to invoke the fdb event notification function? Or is event notification to be used only for dynamically learned fdb entries?

I'll try to summarize the use case here -

1. User (add static fdb entry) --> Adapter Host
2. Adapter Host (sai_create_fdb_entry_fn) --> ASIC vendor's SAI Adapter
3. SAI Adapter (add static fdb entry) --> ASIC

Now, after step 3 depending on vendor, ASIC might or might not generate a notification for static fdb entry addition. I am dealing with ASIC that does generate notification.

What is the intended design? Is it -

Option-1:

4. ASIC (notification) --> SAI Adapter
5. SAI Adapter (sai_fdb_event_notification_fn, with data containing fdb entry with event=SAI_FDB_EVENT_LEARNED, type=SAI_FDB_ENTRY_TYPE_STATIC) --> Adapter Host
6. Adapter Host is expected to handle this event notification

Or, Option-2:

4. ASIC (notification) --> SAI Adapter
5. SAI Adapter (Ignore ASIC notifications for static fdb entries. Inform Adapter Host only for dynamically learned fdb entries)
kcudnik commented 2 years ago

It seems redundant to send notification when user creates explicitly static entries, compared to dynamic entries when they can be created/remove at any time by device learning, hence notification is required. This approach seems logical to me, and so far platforms that im aware like mlnx or brcm, follow the same (correct me if i'm wrong here) (although i don't remember if sonic is creating any static entries, or just deal with dynamic ones)

inspurSDN commented 11 months ago

What is the result of your discussion?