Skip to content

Commit

Permalink
[saineighbor] Bulk API support for Neighbor entries (#1504)
Browse files Browse the repository at this point in the history
* Bulk support for Neighbor entries
  • Loading branch information
prsunny authored Jun 22, 2022
1 parent 3128743 commit 36206ac
Showing 1 changed file with 102 additions and 5 deletions.
107 changes: 102 additions & 5 deletions inc/saineighbor.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,113 @@ typedef sai_status_t (*sai_get_neighbor_entry_attribute_fn)(
typedef sai_status_t (*sai_remove_all_neighbor_entries_fn)(
_In_ sai_object_id_t switch_id);

/**
* @brief Bulk create Neighbor entry
*
* @param[in] object_count Number of objects to create
* @param[in] neighbor_entry List of object to create
* @param[in] attr_count List of attr_count. Caller passes the number
* of attribute for each object to create.
* @param[in] attr_list List of attributes for every object.
* @param[in] mode Bulk operation error handling mode.
* @param[out] object_statuses List of status for every object. Caller needs to
* allocate the buffer
*
* @return #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.
*/
typedef sai_status_t (*sai_bulk_create_neighbor_entry_fn)(
_In_ uint32_t object_count,
_In_ const sai_neighbor_entry_t *neighbor_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);

/**
* @brief Bulk remove Neighbor entry
*
* @param[in] object_count Number of objects to remove
* @param[in] neighbor_entry List of objects to remove
* @param[in] mode Bulk operation error handling mode.
* @param[out] object_statuses List of status for every object. Caller needs to
* allocate the buffer
*
* @return #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.
*/
typedef sai_status_t (*sai_bulk_remove_neighbor_entry_fn)(
_In_ uint32_t object_count,
_In_ const sai_neighbor_entry_t *neighbor_entry,
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses);

/**
* @brief Bulk set attribute on Neighbor entry
*
* @param[in] object_count Number of objects to set attribute
* @param[in] neighbor_entry List of objects to set attribute
* @param[in] attr_list List of attributes to set on objects, one attribute per object
* @param[in] mode Bulk operation error handling mode.
* @param[out] object_statuses List of status for every object. Caller needs to
* allocate the buffer
*
* @return #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.
*/
typedef sai_status_t (*sai_bulk_set_neighbor_entry_attribute_fn)(
_In_ uint32_t object_count,
_In_ const sai_neighbor_entry_t *neighbor_entry,
_In_ const sai_attribute_t *attr_list,
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses);

/**
* @brief Bulk get attribute on Neighbor entry
*
* @param[in] object_count Number of objects to get attribute
* @param[in] neighbor_entry List of objects to get attribute
* @param[in] attr_count List of attr_count. Caller passes the number
* of attribute for each object to get
* @param[inout] attr_list List of attributes to get on objects, one attribute per object
* @param[in] mode Bulk operation error handling mode
* @param[out] object_statuses List of status for every object. Caller needs to
* allocate the buffer
*
* @return #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.
*/
typedef sai_status_t (*sai_bulk_get_neighbor_entry_attribute_fn)(
_In_ uint32_t object_count,
_In_ const sai_neighbor_entry_t *neighbor_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);

/**
* @brief Neighbor table methods, retrieved via sai_api_query()
*/
typedef struct _sai_neighbor_api_t
{
sai_create_neighbor_entry_fn create_neighbor_entry;
sai_remove_neighbor_entry_fn remove_neighbor_entry;
sai_set_neighbor_entry_attribute_fn set_neighbor_entry_attribute;
sai_get_neighbor_entry_attribute_fn get_neighbor_entry_attribute;
sai_remove_all_neighbor_entries_fn remove_all_neighbor_entries;
sai_create_neighbor_entry_fn create_neighbor_entry;
sai_remove_neighbor_entry_fn remove_neighbor_entry;
sai_set_neighbor_entry_attribute_fn set_neighbor_entry_attribute;
sai_get_neighbor_entry_attribute_fn get_neighbor_entry_attribute;
sai_remove_all_neighbor_entries_fn remove_all_neighbor_entries;

sai_bulk_create_neighbor_entry_fn create_neighbor_entries;
sai_bulk_remove_neighbor_entry_fn remove_neighbor_entries;
sai_bulk_set_neighbor_entry_attribute_fn set_neighbor_entries_attribute;
sai_bulk_get_neighbor_entry_attribute_fn get_neighbor_entries_attribute;

} sai_neighbor_api_t;

Expand Down

0 comments on commit 36206ac

Please sign in to comment.