Skip to content

Commit

Permalink
revert unnecessary changes
Browse files Browse the repository at this point in the history
Signed-off-by: richardyu-ms <richard.yu@microsoft.com>
  • Loading branch information
richardyu-ms committed Apr 8, 2022
1 parent bfaaa0e commit 74ae97b
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 11 deletions.
86 changes: 77 additions & 9 deletions inc/saiswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2427,6 +2427,16 @@ typedef enum _sai_switch_attr_t
*/
SAI_SWITCH_ATTR_SUPPORTED_FAILOVER_MODE,

/**
* @brief Switch scoped Tunnel objects
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_SWITCH_TUNNEL
* @default empty
*/
SAI_SWITCH_ATTR_TUNNEL_OBJECTS_LIST,

/**
* @brief Packet action when a packet ingress and gets routed back to same tunnel
*
Expand Down Expand Up @@ -2860,20 +2870,78 @@ typedef sai_status_t (*sai_clear_switch_stats_fn)(
_In_ uint32_t number_of_counters,
_In_ const sai_stat_id_t *counter_ids);

/**
* @brief Create switch scoped tunnel
*
* @param[out] switch_tunnel_id The Switch Tunnel Object ID
* @param[in] switch_id Switch id
* @param[in] attr_count Number of attributes
* @param[in] attr_list Array of attributes
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_create_switch_tunnel_fn)(
_Out_ sai_object_id_t *switch_tunnel_id,
_In_ sai_object_id_t switch_id,
_In_ uint32_t attr_count,
_In_ const sai_attribute_t *attr_list);

/**
* @brief Remove/disconnect Switch scope tunnel
*
* Release all resources associated with currently opened switch
*
* @param[in] switch_tunnel_id The Switch Tunnel id
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_remove_switch_tunnel_fn)(
_In_ sai_object_id_t switch_tunnel_id);

/**
* @brief Set switch scoped tunnel attribute value
*
* @param[in] switch_tunnel_id Switch Tunnel id
* @param[in] attr Switch tunnel attribute
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_set_switch_tunnel_attribute_fn)(
_In_ sai_object_id_t switch_tunnel_id,
_In_ const sai_attribute_t *attr);

/**
* @brief Get switch scoped tunnel attribute value
*
* @param[in] switch_tunnel_id Switch Tunnel id
* @param[in] attr_count Number of attributes
* @param[inout] attr_list Array of switch tunnel attributes
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_get_switch_tunnel_attribute_fn)(
_In_ sai_object_id_t switch_tunnel_id,
_In_ uint32_t attr_count,
_Inout_ sai_attribute_t *attr_list);

/**
* @brief Switch method table retrieved with sai_api_query()
*/
typedef struct _sai_switch_api_t
{
sai_create_switch_fn create_switch;
sai_remove_switch_fn remove_switch;
sai_set_switch_attribute_fn set_switch_attribute;
sai_get_switch_attribute_fn get_switch_attribute;
sai_get_switch_stats_fn get_switch_stats;
sai_get_switch_stats_ext_fn get_switch_stats_ext;
sai_clear_switch_stats_fn clear_switch_stats;
sai_switch_mdio_read_fn switch_mdio_read;
sai_switch_mdio_write_fn switch_mdio_write;
sai_create_switch_fn create_switch;
sai_remove_switch_fn remove_switch;
sai_set_switch_attribute_fn set_switch_attribute;
sai_get_switch_attribute_fn get_switch_attribute;
sai_get_switch_stats_fn get_switch_stats;
sai_get_switch_stats_ext_fn get_switch_stats_ext;
sai_clear_switch_stats_fn clear_switch_stats;
sai_switch_mdio_read_fn switch_mdio_read;
sai_switch_mdio_write_fn switch_mdio_write;
sai_create_switch_tunnel_fn create_switch_tunnel;
sai_remove_switch_tunnel_fn remove_switch_tunnel;
sai_set_switch_tunnel_attribute_fn set_switch_tunnel_attribute;
sai_get_switch_tunnel_attribute_fn get_switch_tunnel_attribute;

} sai_switch_api_t;

Expand Down
24 changes: 22 additions & 2 deletions inc/saitunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,30 @@ typedef enum _sai_tunnel_type_t

SAI_TUNNEL_TYPE_MPLS,

SAI_TUNNEL_TYPE_IPINIP_ESP,

SAI_TUNNEL_TYPE_IPINIP_UDP_ESP,

SAI_TUNNEL_TYPE_VXLAN_UDP_ESP,

} sai_tunnel_type_t;

/**
* @brief Defines VXLAN tunnel UDP source port mode
*/
typedef enum _sai_tunnel_vxlan_udp_sport_mode_t
{
/**
* @brief User define value
*/
SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_USER_DEFINED,

/**
* @brief RFC6335 Computed hash value in range 49152-65535
*/
SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_EPHEMERAL,
} sai_tunnel_vxlan_udp_sport_mode_t;

/**
* @brief Defines tunnel TTL mode
*/
Expand Down Expand Up @@ -1149,8 +1171,6 @@ typedef struct _sai_tunnel_api_t
sai_remove_tunnel_map_entry_fn remove_tunnel_map_entry;
sai_set_tunnel_map_entry_attribute_fn set_tunnel_map_entry_attribute;
sai_get_tunnel_map_entry_attribute_fn get_tunnel_map_entry_attribute;
sai_bulk_object_get_attribute_fn get_tunnels_attribute;
sai_bulk_object_set_attribute_fn set_tunnels_attribute;

} sai_tunnel_api_t;

Expand Down
1 change: 1 addition & 0 deletions inc/saitypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ typedef enum _sai_object_type_t
SAI_OBJECT_TYPE_MACSEC_SA = 92,
SAI_OBJECT_TYPE_SYSTEM_PORT = 93,
SAI_OBJECT_TYPE_FINE_GRAINED_HASH_FIELD = 94,
SAI_OBJECT_TYPE_SWITCH_TUNNEL = 95,
SAI_OBJECT_TYPE_MAX, /* Must remain in last position */
} sai_object_type_t;

Expand Down

0 comments on commit 74ae97b

Please sign in to comment.