Skip to content

Commit d90568e

Browse files
authored
Adding DASH SAI APIs for load balancer fast path scenario. (#1966)
This change adds the SAI API changes for enabling the load balancer fast path scenario. DASH load balancer fast path HLD: https://github.com/sonic-net/DASH/blob/main/documentation/load-bal-service/fast-path-icmp-flow-redirection.md Change that used to generate the headers: [dash-p4] Update DASH BM P4 code for fast path SAI API generation sonic-net/DASH#517 Signed-off-by: r12f <[email protected]>
1 parent e432fab commit d90568e

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

experimental/saiexperimentaldasheni.h

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,15 @@ typedef enum _sai_eni_attr_t
430430
*/
431431
SAI_ENI_ATTR_OUTBOUND_V6_STAGE5_DASH_ACL_GROUP_ID,
432432

433+
/**
434+
* @brief Action set_eni_attrs parameter DISABLE_FAST_PATH_ICMP_FLOW_REDIRECTION
435+
*
436+
* @type bool
437+
* @flags CREATE_AND_SET
438+
* @default false
439+
*/
440+
SAI_ENI_ATTR_DISABLE_FAST_PATH_ICMP_FLOW_REDIRECTION,
441+
433442
/**
434443
* @brief End of attributes
435444
*/
@@ -443,6 +452,19 @@ typedef enum _sai_eni_attr_t
443452

444453
} sai_eni_attr_t;
445454

455+
/**
456+
* @brief Counter IDs for eni in sai_get_eni_stats() call
457+
*/
458+
typedef enum _sai_eni_stat_t
459+
{
460+
/** DASH eni LB_FAST_PATH_ICMP_IN_BYTES stat count */
461+
SAI_ENI_STAT_LB_FAST_PATH_ICMP_IN_BYTES,
462+
463+
/** DASH eni LB_FAST_PATH_ICMP_IN_PACKETS stat count */
464+
SAI_ENI_STAT_LB_FAST_PATH_ICMP_IN_PACKETS,
465+
466+
} sai_eni_stat_t;
467+
446468
/**
447469
* @brief Create dash_eni_eni_ether_address_map_entry
448470
*
@@ -590,6 +612,54 @@ typedef sai_status_t (*sai_get_eni_attribute_fn)(
590612
_In_ uint32_t attr_count,
591613
_Inout_ sai_attribute_t *attr_list);
592614

615+
/**
616+
* @brief Get eni statistics counters. Deprecated for backward compatibility.
617+
*
618+
* @param[in] eni_id Entry id
619+
* @param[in] number_of_counters Number of counters in the array
620+
* @param[in] counter_ids Specifies the array of counter ids
621+
* @param[out] counters Array of resulting counter values.
622+
*
623+
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
624+
*/
625+
typedef sai_status_t (*sai_get_eni_stats_fn)(
626+
_In_ sai_object_id_t eni_id,
627+
_In_ uint32_t number_of_counters,
628+
_In_ const sai_stat_id_t *counter_ids,
629+
_Out_ uint64_t *counters);
630+
631+
/**
632+
* @brief Get eni statistics counters extended.
633+
*
634+
* @param[in] eni_id Entry id
635+
* @param[in] number_of_counters Number of counters in the array
636+
* @param[in] counter_ids Specifies the array of counter ids
637+
* @param[in] mode Statistics mode
638+
* @param[out] counters Array of resulting counter values.
639+
*
640+
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
641+
*/
642+
typedef sai_status_t (*sai_get_eni_stats_ext_fn)(
643+
_In_ sai_object_id_t eni_id,
644+
_In_ uint32_t number_of_counters,
645+
_In_ const sai_stat_id_t *counter_ids,
646+
_In_ sai_stats_mode_t mode,
647+
_Out_ uint64_t *counters);
648+
649+
/**
650+
* @brief Clear eni statistics counters.
651+
*
652+
* @param[in] eni_id Entry id
653+
* @param[in] number_of_counters Number of counters in the array
654+
* @param[in] counter_ids Specifies the array of counter ids
655+
*
656+
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
657+
*/
658+
typedef sai_status_t (*sai_clear_eni_stats_fn)(
659+
_In_ sai_object_id_t eni_id,
660+
_In_ uint32_t number_of_counters,
661+
_In_ const sai_stat_id_t *counter_ids);
662+
593663
typedef struct _sai_dash_eni_api_t
594664
{
595665
sai_create_eni_ether_address_map_entry_fn create_eni_ether_address_map_entry;
@@ -603,6 +673,9 @@ typedef struct _sai_dash_eni_api_t
603673
sai_remove_eni_fn remove_eni;
604674
sai_set_eni_attribute_fn set_eni_attribute;
605675
sai_get_eni_attribute_fn get_eni_attribute;
676+
sai_get_eni_stats_fn get_eni_stats;
677+
sai_get_eni_stats_ext_fn get_eni_stats_ext;
678+
sai_clear_eni_stats_fn clear_eni_stats;
606679
sai_bulk_object_create_fn create_enis;
607680
sai_bulk_object_remove_fn remove_enis;
608681

experimental/saiportextensions.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ typedef enum _sai_port_stat_extensions_t
5252
{
5353
SAI_PORT_STAT_EXTENSIONS_RANGE_START = SAI_PORT_STAT_END,
5454

55+
/** DASH port LB_FAST_PATH_ICMP_IN_BYTES stat count */
56+
SAI_PORT_STAT_LB_FAST_PATH_ICMP_IN_BYTES = SAI_PORT_STAT_EXTENSIONS_RANGE_START,
57+
58+
/** DASH port LB_FAST_PATH_ICMP_IN_PACKETS stat count */
59+
SAI_PORT_STAT_LB_FAST_PATH_ICMP_IN_PACKETS,
60+
61+
/** DASH port LB_FAST_PATH_ENI_MISS_BYTES stat count */
62+
SAI_PORT_STAT_LB_FAST_PATH_ENI_MISS_BYTES,
63+
64+
/** DASH port LB_FAST_PATH_ENI_MISS_PACKETS stat count */
65+
SAI_PORT_STAT_LB_FAST_PATH_ENI_MISS_PACKETS,
66+
5567
/* Add new experimental port stats above this line */
5668

5769
SAI_PORT_STAT_EXTENSIONS_RANGE_END

0 commit comments

Comments
 (0)