diff --git a/experimental/saiexperimentaldashdevice.h b/experimental/saiexperimentaldashdevice.h index ecf906f4b..47ea2bf54 100644 --- a/experimental/saiexperimentaldashdevice.h +++ b/experimental/saiexperimentaldashdevice.h @@ -131,25 +131,6 @@ typedef enum _sai_dash_device_attr_t } sai_dash_device_attr_t; -/** - * @brief Counter IDs in sai_get_dash_device_stats() call - */ -typedef enum _sai_dash_device_stat_t -{ - /** DASH DEVICE stat HA heartbeat messages sent */ - SAI_DASH_DEVICE_STAT_HA_HEARTBEAT_MSG_SENT, - - /** DASH DEVICE stat HA heartbeat messages received */ - SAI_DASH_DEVICE_STAT_HA_HEARTBEAT_MSG_RECEIVED, - - /** DASH DEVICE stat HA flow sync requests sent */ - SAI_DASH_DEVICE_STAT_HA_FLOW_SYNC_REQ_SENT, - - /** DASH DEVICE stat HA flow sync acknowledgements sent */ - SAI_DASH_DEVICE_STAT_HA_FLOW_SYNC_ACK_RECEIVED, - -} sai_dash_device_stat_t; - /** * @brief Create and return a DASH device object * @@ -202,74 +183,12 @@ typedef sai_status_t (*sai_get_dash_device_attribute_fn)( _In_ uint32_t attr_count, _Inout_ sai_attribute_t *attr_list); -/** - * @brief Get DASH device statistics counters. - * - * @param[in] dash_device_id Device id - * @param[in] number_of_counters Number of counters in the array - * @param[in] counter_ids Specifies the array of counter ids - * @param[out] counters Array of resulting counter values. - * - * @return #SAI_STATUS_SUCCESS on success, failure status code on error - */ -typedef sai_status_t (*sai_get_dash_device_stats_fn)( - _In_ sai_object_id_t dash_device_id, - _In_ uint32_t number_of_counters, - _In_ const sai_stat_id_t *counter_ids, - _Out_ uint64_t *counters); - -/** - * @brief Get DASH device statistics counters extended. - * - * @param[in] dash_device_id Device id - * @param[in] number_of_counters Number of counters in the array - * @param[in] counter_ids Specifies the array of counter ids - * @param[in] mode Statistics mode - * @param[out] counters Array of resulting counter values. - * - * @return #SAI_STATUS_SUCCESS on success, failure status code on error - */ -typedef sai_status_t (*sai_get_dash_device_stats_ext_fn)( - _In_ sai_object_id_t dash_device_id, - _In_ uint32_t number_of_counters, - _In_ const sai_stat_id_t *counter_ids, - _In_ sai_stats_mode_t mode, - _Out_ uint64_t *counters); - -/** - * @brief Clear DASH device statistics counters. - * - * @param[in] dash_device_id Device id - * @param[in] number_of_counters Number of counters in the array - * @param[in] counter_ids Specifies the array of counter ids - * - * @return #SAI_STATUS_SUCCESS on success, failure status code on error - */ -typedef sai_status_t (*sai_clear_dash_device_stats_fn)( - _In_ sai_object_id_t dash_device_id, - _In_ uint32_t number_of_counters, - _In_ const sai_stat_id_t *counter_ids); - -/** - * @brief Clear DASH device statistics counters. - * - * @param[in] dash_device_id Switch id - * - * @return #SAI_STATUS_SUCCESS on success, failure status code on error - */ -typedef sai_status_t (*sai_clear_dash_device_all_stats_fn)( - _In_ sai_object_id_t dash_device_id); - typedef struct _sai_dash_device_api_t { sai_create_dash_device_fn create_dash_device; sai_remove_dash_device_fn remove_dash_device; sai_set_dash_device_attribute_fn set_dash_device_attribute; sai_get_dash_device_attribute_fn get_dash_device_attribute; - sai_get_dash_device_stats_fn get_dash_device_stats; - sai_get_dash_device_stats_ext_fn get_dash_device_stats_ext; - sai_clear_dash_device_stats_fn clear_dash_device_stats; - sai_clear_dash_device_all_stats_fn clear_dash_device_all_stats; } sai_dash_device_api_t; diff --git a/experimental/saiexperimentaldashha.h b/experimental/saiexperimentaldashha.h index 2fce9a1e6..abe80713c 100644 --- a/experimental/saiexperimentaldashha.h +++ b/experimental/saiexperimentaldashha.h @@ -86,6 +86,25 @@ typedef enum _sai_dash_ha_attr_t } sai_dash_ha_attr_t; +/** + * @brief Counter IDs in sai_get_dash_ha_stats() call + */ +typedef enum _sai_dash_ha_stat_t +{ + /** DASH HA stat heartbeat messages sent */ + SAI_DASH_HA_STAT_HEARTBEAT_MSG_SENT, + + /** DASH HA stat heartbeat messages received */ + SAI_DASH_HA_STAT_HEARTBEAT_MSG_RECEIVED, + + /** DASH HA stat flow sync requests sent */ + SAI_DASH_HA_STAT_FLOW_SYNC_REQ_SENT, + + /** DASH HA stat flow sync acknowledgements sent */ + SAI_DASH_HA_STAT_FLOW_SYNC_ACK_RECEIVED, + +} sai_dash_ha_stat_t; + /** * @brief DASH HA event type */ @@ -191,6 +210,64 @@ typedef sai_status_t (*sai_flow_reconcile_dash_ha_fn)( _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list); +/** + * @brief Get DASH HA statistics counters. + * + * @param[in] switch_id Switch id + * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids + * @param[out] counters Array of resulting counter values. + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_get_dash_ha_stats_fn)( + _In_ sai_object_id_t switch_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids, + _Out_ uint64_t *counters); + +/** + * @brief Get DASH HA statistics counters extended. + * + * @param[in] switch_id Switch id + * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids + * @param[in] mode Statistics mode + * @param[out] counters Array of resulting counter values. + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_get_dash_ha_stats_ext_fn)( + _In_ sai_object_id_t switch_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids, + _In_ sai_stats_mode_t mode, + _Out_ uint64_t *counters); + +/** + * @brief Clear DASH HA statistics counters. + * + * @param[in] switch_id Switch id + * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_clear_dash_ha_stats_fn)( + _In_ sai_object_id_t switch_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids); + +/** + * @brief Clear all DASH HA statistics counters. + * + * @param[in] switch_id Switch id + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_clear_dash_ha_all_stats_fn)( + _In_ sai_object_id_t switch_id); + /** * @brief DASH HA notifications * @@ -210,6 +287,10 @@ typedef struct _sai_dash_ha_api_t sai_activate_admin_role_dash_ha_fn activate_admin_role_dash_ha; sai_initiate_switchover_dash_ha_fn initiate_switchover_dash_ha; sai_flow_reconcile_dash_ha_fn flow_reconcile_dash_ha; + sai_get_dash_ha_stats_fn get_dash_ha_stats; + sai_get_dash_ha_stats_ext_fn get_dash_ha_stats_ext; + sai_clear_dash_ha_stats_fn clear_dash_ha_stats; + sai_clear_dash_ha_all_stats_fn clear_dash_ha_all_stats; } sai_dash_ha_api_t; /** diff --git a/meta/parse.pl b/meta/parse.pl index 0b04e4cff..090ddfaf4 100755 --- a/meta/parse.pl +++ b/meta/parse.pl @@ -4295,7 +4295,7 @@ sub ExtractStatsFunctionMap # exceptions next if $fn eq "clear_port_all_stats"; - next if $fn eq "clear_dash_device_all_stats"; + next if $fn eq "clear_dash_ha_all_stats"; next if $fn eq "get_tam_snapshot_stats"; if (not $fn =~ /^(?:get|clear)_(\w+)_stats(?:_ext)?$/) diff --git a/meta/style.pm b/meta/style.pm index f0160d13b..55f421c3f 100644 --- a/meta/style.pm +++ b/meta/style.pm @@ -207,7 +207,7 @@ sub CheckStatsFunction return if $fname eq "sai_get_tam_snapshot_stats_fn"; # exception return if $fname eq "sai_bulk_object_get_stats_fn"; # exception return if $fname eq "sai_bulk_object_clear_stats_fn"; # exception - return if $fname eq "sai_clear_dash_device_all_stats_fn"; # exception + return if $fname eq "sai_clear_dash_ha_all_stats_fn"; # exception if (not $fname =~ /^sai_((get|clear)_(\w+)_stats|get_\w+_stats_ext)_fn$/) { @@ -311,7 +311,7 @@ sub CheckFunctionsParams $pattern = "${pattern}_id"; } - if (not $first =~ /^$pattern$/) + if (not $first =~ /^$pattern$/ and not $first eq "switch_id") { LogWarning "first param should be called ${pattern} but is $first in $fname: $file"; } @@ -516,7 +516,7 @@ sub CheckQuadApi $f =~ s/remove_all_neighbor_entries/X/; $f =~ s/clear_port_all_stats/X/; - $f =~ s/clear_dash_device_all_stats/X/; + $f =~ s/clear_dash_ha_all_stats/X/; $f =~ s/^create_\w+/c/; $f =~ s/^remove_\w+/r/;