SAI Metadata
Loading...
Searching...
No Matches
SAI - FDB specific API definitions

Classes

struct  _sai_fdb_entry_t
 FDB entry key. More...
 
struct  _sai_fdb_event_notification_data_t
 Notification data format received from SAI FDB callback. More...
 
struct  _sai_fdb_api_t
 FDB method table retrieved with sai_api_query() More...
 

Typedefs

typedef enum _sai_fdb_entry_type_t sai_fdb_entry_type_t
 FDB entry type.
 
typedef struct _sai_fdb_entry_t sai_fdb_entry_t
 FDB entry key.
 
typedef enum _sai_fdb_event_t sai_fdb_event_t
 FDB event type.
 
typedef enum _sai_fdb_entry_attr_t sai_fdb_entry_attr_t
 Attribute Id for FDB entry.
 
typedef enum _sai_fdb_flush_entry_type_t sai_fdb_flush_entry_type_t
 FDB Flush entry type.
 
typedef enum _sai_fdb_flush_attr_t sai_fdb_flush_attr_t
 Attribute for FDB flush API to specify the type of FDB entries being flushed.
 
typedef struct _sai_fdb_event_notification_data_t sai_fdb_event_notification_data_t
 Notification data format received from SAI FDB callback.
 
typedef sai_status_t(* sai_create_fdb_entry_fn) (_In_ const sai_fdb_entry_t *fdb_entry, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list)
 Create FDB entry.
 
typedef sai_status_t(* sai_remove_fdb_entry_fn) (_In_ const sai_fdb_entry_t *fdb_entry)
 Remove FDB entry.
 
typedef sai_status_t(* sai_set_fdb_entry_attribute_fn) (_In_ const sai_fdb_entry_t *fdb_entry, _In_ const sai_attribute_t *attr)
 Set FDB entry attribute value.
 
typedef sai_status_t(* sai_get_fdb_entry_attribute_fn) (_In_ const sai_fdb_entry_t *fdb_entry, _In_ uint32_t attr_count, _Inout_ sai_attribute_t *attr_list)
 Get FDB entry attribute value.
 
typedef sai_status_t(* sai_flush_fdb_entries_fn) (_In_ sai_object_id_t switch_id, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list)
 Remove all FDB entries by attribute set in sai_fdb_flush_attr.
 
typedef void(* sai_fdb_event_notification_fn) (_In_ uint32_t count, _In_ const sai_fdb_event_notification_data_t *data)
 FDB notifications.
 
typedef sai_status_t(* sai_bulk_create_fdb_entry_fn) (_In_ uint32_t object_count, _In_ const sai_fdb_entry_t *fdb_entry, _In_ const uint32_t *attr_count, _In_ const sai_attribute_t **attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)
 Bulk create FDB entry.
 
typedef sai_status_t(* sai_bulk_remove_fdb_entry_fn) (_In_ uint32_t object_count, _In_ const sai_fdb_entry_t *fdb_entry, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)
 Bulk remove FDB entry.
 
typedef sai_status_t(* sai_bulk_set_fdb_entry_attribute_fn) (_In_ uint32_t object_count, _In_ const sai_fdb_entry_t *fdb_entry, _In_ const sai_attribute_t *attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)
 Bulk set attribute on FDB entry.
 
typedef sai_status_t(* sai_bulk_get_fdb_entry_attribute_fn) (_In_ uint32_t object_count, _In_ const sai_fdb_entry_t *fdb_entry, _In_ const uint32_t *attr_count, _Inout_ sai_attribute_t **attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)
 Bulk get attribute on FDB entry.
 
typedef struct _sai_fdb_api_t sai_fdb_api_t
 FDB method table retrieved with sai_api_query()
 

Enumerations

enum  _sai_fdb_entry_type_t { SAI_FDB_ENTRY_TYPE_DYNAMIC , SAI_FDB_ENTRY_TYPE_STATIC }
 FDB entry type. More...
 
enum  _sai_fdb_event_t { SAI_FDB_EVENT_LEARNED , SAI_FDB_EVENT_AGED , SAI_FDB_EVENT_MOVE , SAI_FDB_EVENT_FLUSHED }
 FDB event type. More...
 
enum  _sai_fdb_entry_attr_t {
  SAI_FDB_ENTRY_ATTR_START , SAI_FDB_ENTRY_ATTR_TYPE = SAI_FDB_ENTRY_ATTR_START , SAI_FDB_ENTRY_ATTR_PACKET_ACTION , SAI_FDB_ENTRY_ATTR_USER_TRAP_ID ,
  SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID , SAI_FDB_ENTRY_ATTR_META_DATA , SAI_FDB_ENTRY_ATTR_ENDPOINT_IP , SAI_FDB_ENTRY_ATTR_COUNTER_ID ,
  SAI_FDB_ENTRY_ATTR_ALLOW_MAC_MOVE , SAI_FDB_ENTRY_ATTR_END , SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000 , SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_END
}
 Attribute Id for FDB entry. More...
 
enum  _sai_fdb_flush_entry_type_t { SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC , SAI_FDB_FLUSH_ENTRY_TYPE_STATIC , SAI_FDB_FLUSH_ENTRY_TYPE_ALL }
 FDB Flush entry type. More...
 
enum  _sai_fdb_flush_attr_t {
  SAI_FDB_FLUSH_ATTR_START , SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID = SAI_FDB_FLUSH_ATTR_START , SAI_FDB_FLUSH_ATTR_BV_ID , SAI_FDB_FLUSH_ATTR_ENTRY_TYPE ,
  SAI_FDB_FLUSH_ATTR_END , SAI_FDB_FLUSH_ATTR_CUSTOM_RANGE_START = 0x10000000 , SAI_FDB_FLUSH_ATTR_CUSTOM_RANGE_END
}
 Attribute for FDB flush API to specify the type of FDB entries being flushed. More...
 

Detailed Description

Typedef Documentation

◆ sai_bulk_create_fdb_entry_fn

typedef sai_status_t(* sai_bulk_create_fdb_entry_fn) (_In_ uint32_t object_count, _In_ const sai_fdb_entry_t *fdb_entry, _In_ const uint32_t *attr_count, _In_ const sai_attribute_t **attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)

Bulk create FDB entry.

Parameters
[in]object_countNumber of objects to create
[in]fdb_entryList of object to create
[in]attr_countList of attr_count. Caller passes the number of attribute for each object to create.
[in]attr_listList of attributes for every object.
[in]modeBulk operation error handling mode.
[out]object_statusesList of status for every object. Caller needs to allocate the buffer
Returns
SAI_STATUS_SUCCESS on success when all objects are created or SAI_STATUS_FAILURE when any of the objects fails to create. When there is failure, Caller is expected to go through the list of returned statuses to find out which fails and which succeeds.

Definition at line 441 of file saifdb.h.

◆ sai_bulk_get_fdb_entry_attribute_fn

typedef sai_status_t(* sai_bulk_get_fdb_entry_attribute_fn) (_In_ uint32_t object_count, _In_ const sai_fdb_entry_t *fdb_entry, _In_ const uint32_t *attr_count, _Inout_ sai_attribute_t **attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)

Bulk get attribute on FDB entry.

Parameters
[in]object_countNumber of objects to get attribute
[in]fdb_entryList of objects to get attribute
[in]attr_countList of attr_count. Caller passes the number of attribute for each object to get
[in,out]attr_listList of attributes to get on objects, one attribute per object
[in]modeBulk operation error handling mode
[out]object_statusesList of status for every object. Caller needs to allocate the buffer
Returns
SAI_STATUS_SUCCESS on success when all objects are get or SAI_STATUS_FAILURE when any of the objects fails to get. When there is failure, Caller is expected to go through the list of returned statuses to find out which fails and which succeeds.

Definition at line 508 of file saifdb.h.

◆ sai_bulk_remove_fdb_entry_fn

typedef sai_status_t(* sai_bulk_remove_fdb_entry_fn) (_In_ uint32_t object_count, _In_ const sai_fdb_entry_t *fdb_entry, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)

Bulk remove FDB entry.

Parameters
[in]object_countNumber of objects to remove
[in]fdb_entryList of objects to remove
[in]modeBulk operation error handling mode.
[out]object_statusesList of status for every object. Caller needs to allocate the buffer
Returns
SAI_STATUS_SUCCESS on success when all objects are removed or SAI_STATUS_FAILURE when any of the objects fails to remove. When there is failure, Caller is expected to go through the list of returned statuses to find out which fails and which succeeds.

Definition at line 463 of file saifdb.h.

◆ sai_bulk_set_fdb_entry_attribute_fn

typedef sai_status_t(* sai_bulk_set_fdb_entry_attribute_fn) (_In_ uint32_t object_count, _In_ const sai_fdb_entry_t *fdb_entry, _In_ const sai_attribute_t *attr_list, _In_ sai_bulk_op_error_mode_t mode, _Out_ sai_status_t *object_statuses)

Bulk set attribute on FDB entry.

Parameters
[in]object_countNumber of objects to set attribute
[in]fdb_entryList of objects to set attribute
[in]attr_listList of attributes to set on objects, one attribute per object
[in]modeBulk operation error handling mode.
[out]object_statusesList of status for every object. Caller needs to allocate the buffer
Returns
SAI_STATUS_SUCCESS on success when all objects are set or SAI_STATUS_FAILURE when any of the objects fails to set. When there is failure, Caller is expected to go through the list of returned statuses to find out which fails and which succeeds.

Definition at line 484 of file saifdb.h.

◆ sai_create_fdb_entry_fn

typedef sai_status_t(* sai_create_fdb_entry_fn) (_In_ const sai_fdb_entry_t *fdb_entry, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list)

Create FDB entry.

Parameters
[in]fdb_entryFDB entry
[in]attr_countNumber of attributes
[in]attr_listArray of attributes
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 357 of file saifdb.h.

◆ sai_fdb_event_notification_data_t

Notification data format received from SAI FDB callback.

When FDB flush API is called (for example with no parameters) and switch learned a lot of MAC addresses, then calling this API can cause to generate a lot of notifications.

Vendor can decide whether in that case send notifications 1 by 1 and populating all the data for sai_fdb_event_notification_data_t or to send consolidated event notification which will indicate that FDB flush operation was performed.

Consolidated flush event will:

Set data.fdb_entry.mac_address to 00:00:00:00:00:00.

Set data.fdb_event to SAI_FDB_EVENT_FLUSHED.

Add SAI_FDB_ENTRY_ATTR_TYPE to data.attr list and value set to SAI_FDB_FLUSH_ATTR_ENTRY_TYPE, if SAI_FDB_FLUSH_ATTR_ENTRY_TYPE was not provided to flush API, then 2 notifications will be sent (or 1 notification with 2 data entries) where data.attr will contain SAI_FDB_ENTRY_ATTR_TYPE set accordingly for specific entry types.

Set data.fdb_entry.bv_id to SAI_FDB_FLUSH_ATTR_BV_ID value if attribute was provided to flush API.

Add SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID to data.attr list and value set to SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID if that attribute was provided to flush API.

All other attributes in consolidated FDB event notification are irrelevant and should be zero.

Count:
attr[attr_count]

◆ sai_fdb_event_notification_fn

typedef void(* sai_fdb_event_notification_fn) (_In_ uint32_t count, _In_ const sai_fdb_event_notification_data_t *data)

FDB notifications.

Count:
data[count]
Parameters
[in]countNumber of notifications
[in]dataPointer to FDB event notification data array

Definition at line 420 of file saifdb.h.

◆ sai_fdb_flush_attr_t

Attribute for FDB flush API to specify the type of FDB entries being flushed.

For example, if you want to flush all static entries, set SAI_FDB_FLUSH_ATTR_ENTRY_TYPE = SAI_FDB_FLUSH_ENTRY_TYPE_STATIC. If you want to flush both static and dynamic entries, then set SAI_FDB_FLUSH_ATTR_ENTRY_TYPE = SAI_FDB_FLUSH_ENTRY_TYPE_ALL. The API uses AND operation when multiple attributes are specified.

For example:

1) Flush all dynamic entries in FDB table - Do not specify any attribute 2) Flush dynamic entries by bridge port - Set SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID 3) Flush dynamic entries by VLAN - Set SAI_FDB_FLUSH_ATTR_BV_ID with object id as vlan object 3) Flush dynamic entries by bridge - Set SAI_FDB_FLUSH_ATTR_BV_ID with object id as bridge object 4) Flush dynamic entries by bridge port and VLAN - Set SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID and SAI_FDB_FLUSH_ATTR_BV_ID 5) Flush all static entries by bridge port and VLAN - Set SAI_FDB_FLUSH_ATTR_ENTRY_TYPE, SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID, and SAI_FDB_FLUSH_ATTR_BV_ID

◆ sai_flush_fdb_entries_fn

typedef sai_status_t(* sai_flush_fdb_entries_fn) (_In_ sai_object_id_t switch_id, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list)

Remove all FDB entries by attribute set in sai_fdb_flush_attr.

Parameters
[in]switch_idSwitch object id
[in]attr_countNumber of attributes
[in]attr_listArray of attributes
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 407 of file saifdb.h.

◆ sai_get_fdb_entry_attribute_fn

typedef sai_status_t(* sai_get_fdb_entry_attribute_fn) (_In_ const sai_fdb_entry_t *fdb_entry, _In_ uint32_t attr_count, _Inout_ sai_attribute_t *attr_list)

Get FDB entry attribute value.

Parameters
[in]fdb_entryFDB entry
[in]attr_countNumber of attributes
[in,out]attr_listArray of attributes
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 393 of file saifdb.h.

◆ sai_remove_fdb_entry_fn

typedef sai_status_t(* sai_remove_fdb_entry_fn) (_In_ const sai_fdb_entry_t *fdb_entry)

Remove FDB entry.

Parameters
[in]fdb_entryFDB entry
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 369 of file saifdb.h.

◆ sai_set_fdb_entry_attribute_fn

typedef sai_status_t(* sai_set_fdb_entry_attribute_fn) (_In_ const sai_fdb_entry_t *fdb_entry, _In_ const sai_attribute_t *attr)

Set FDB entry attribute value.

Parameters
[in]fdb_entryFDB entry
[in]attrAttribute
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 380 of file saifdb.h.

Enumeration Type Documentation

◆ _sai_fdb_entry_attr_t

Attribute Id for FDB entry.

Enumerator
SAI_FDB_ENTRY_ATTR_START 

Start of attributes.

SAI_FDB_ENTRY_ATTR_TYPE 

FDB entry type.

Value Type:
sai_fdb_entry_type_t
Flags:
MANDATORY_ON_CREATE | CREATE_AND_SET
SAI_FDB_ENTRY_ATTR_PACKET_ACTION 

FDB entry packet action.

Value Type:
sai_packet_action_t
Flags:
CREATE_AND_SET
Default value:
SAI_PACKET_ACTION_FORWARD
SAI_FDB_ENTRY_ATTR_USER_TRAP_ID 

Generate User Defined Trap ID for trap/log actions.

When it is SAI_NULL_OBJECT_ID, then packet will not be trapped.

Value Type:
sai_object_id_t
Flags:
CREATE_AND_SET
Allowed object types
SAI_OBJECT_TYPE_HOSTIF_USER_DEFINED_TRAP
Allows NULL object ID
true
Default value:
SAI_NULL_OBJECT_ID
SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID 

FDB entry bridge port id.

The port id is only effective when the packet action is one of the following: FORWARD, COPY, LOG, TRANSIT

When it is SAI_NULL_OBJECT_ID, then packet will be dropped.

Value Type:
sai_object_id_t
Flags:
CREATE_AND_SET
Allowed object types
SAI_OBJECT_TYPE_BRIDGE_PORT
Allows NULL object ID
true
Default value:
SAI_NULL_OBJECT_ID
SAI_FDB_ENTRY_ATTR_META_DATA 

User based Meta Data.

Value Range SAI_SWITCH_ATTR_FDB_DST_USER_META_DATA_RANGE

Value Type:
sai_uint32_t
Flags:
CREATE_AND_SET
Default value:
0
SAI_FDB_ENTRY_ATTR_ENDPOINT_IP 

Tunnel Endpoint IP. valid for SAI_BRIDGE_PORT_TYPE_TUNNEL.

Value Type:
sai_ip_address_t
Flags:
CREATE_AND_SET
Default value:
0.0.0.0
SAI_FDB_ENTRY_ATTR_COUNTER_ID 

Attach a counter.

When it is empty, then packet hits won't be counted

Value Type:
sai_object_id_t
Flags:
CREATE_AND_SET
Allowed object types
SAI_OBJECT_TYPE_COUNTER
Allows NULL object ID
true
Default value:
SAI_NULL_OBJECT_ID
SAI_FDB_ENTRY_ATTR_ALLOW_MAC_MOVE 

Specifies whether a MAC move is allowed When MAC_MOVE is explicitly disabled for a static MAC entry via this attribute, the trap introduced in #696 would also not be generated.

Value Type:
bool
Flags:
CREATE_AND_SET
Default value:
false
Valid only when:
SAI_FDB_ENTRY_ATTR_TYPE == SAI_FDB_ENTRY_TYPE_STATIC
SAI_FDB_ENTRY_ATTR_END 

End of attributes.

SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_START 

Start of custom range base value

SAI_FDB_ENTRY_ATTR_CUSTOM_RANGE_END 

End of custom range

Definition at line 95 of file saifdb.h.

◆ _sai_fdb_entry_type_t

FDB entry type.

Enumerator
SAI_FDB_ENTRY_TYPE_DYNAMIC 

Dynamic FDB Entry

SAI_FDB_ENTRY_TYPE_STATIC 

Static FDB Entry

Definition at line 39 of file saifdb.h.

◆ _sai_fdb_event_t

FDB event type.

Enumerator
SAI_FDB_EVENT_LEARNED 

New FDB entry learned

SAI_FDB_EVENT_AGED 

FDB entry aged

SAI_FDB_EVENT_MOVE 

FDB entry move

SAI_FDB_EVENT_FLUSHED 

FDB entry flushed

Definition at line 76 of file saifdb.h.

◆ _sai_fdb_flush_attr_t

Attribute for FDB flush API to specify the type of FDB entries being flushed.

For example, if you want to flush all static entries, set SAI_FDB_FLUSH_ATTR_ENTRY_TYPE = SAI_FDB_FLUSH_ENTRY_TYPE_STATIC. If you want to flush both static and dynamic entries, then set SAI_FDB_FLUSH_ATTR_ENTRY_TYPE = SAI_FDB_FLUSH_ENTRY_TYPE_ALL. The API uses AND operation when multiple attributes are specified.

For example:

1) Flush all dynamic entries in FDB table - Do not specify any attribute 2) Flush dynamic entries by bridge port - Set SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID 3) Flush dynamic entries by VLAN - Set SAI_FDB_FLUSH_ATTR_BV_ID with object id as vlan object 3) Flush dynamic entries by bridge - Set SAI_FDB_FLUSH_ATTR_BV_ID with object id as bridge object 4) Flush dynamic entries by bridge port and VLAN - Set SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID and SAI_FDB_FLUSH_ATTR_BV_ID 5) Flush all static entries by bridge port and VLAN - Set SAI_FDB_FLUSH_ATTR_ENTRY_TYPE, SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID, and SAI_FDB_FLUSH_ATTR_BV_ID

Enumerator
SAI_FDB_FLUSH_ATTR_START 

Start of attributes.

SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID 

Flush based on bridge port.

Value Type:
sai_object_id_t
Flags:
CREATE_ONLY
Allowed object types
SAI_OBJECT_TYPE_BRIDGE_PORT
Allows NULL object ID
true
Default value:
SAI_NULL_OBJECT_ID
SAI_FDB_FLUSH_ATTR_BV_ID 

Flush based on VLAN or Bridge.

Value Type:
sai_object_id_t
Flags:
CREATE_ONLY
Allowed object types
SAI_OBJECT_TYPE_BRIDGE, SAI_OBJECT_TYPE_VLAN
Allows NULL object ID
true
Default value:
SAI_NULL_OBJECT_ID
SAI_FDB_FLUSH_ATTR_ENTRY_TYPE 

Flush based on entry type.

Value Type:
sai_fdb_flush_entry_type_t
Flags:
CREATE_ONLY
Default value:
SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC
SAI_FDB_FLUSH_ATTR_END 

End of attributes.

SAI_FDB_FLUSH_ATTR_CUSTOM_RANGE_START 

Custom range base value

SAI_FDB_FLUSH_ATTR_CUSTOM_RANGE_END 

End of custom range base

Definition at line 241 of file saifdb.h.

◆ _sai_fdb_flush_entry_type_t

FDB Flush entry type.

Enumerator
SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC 

Flush dynamic FDB entries

SAI_FDB_FLUSH_ENTRY_TYPE_STATIC 

Flush static FDB entries

SAI_FDB_FLUSH_ENTRY_TYPE_ALL 

Flush static and dynamic FDB entries

Definition at line 209 of file saifdb.h.