From e7f91d82fb3bcca99d9db2c4775951a32cd7608f Mon Sep 17 00:00:00 2001 From: Jai Kumar Date: Wed, 4 Nov 2020 10:15:08 -0700 Subject: [PATCH 1/5] Switch attribute for tunnel ECN mode Signed-off-by: Jai Kumar --- inc/saiswitch.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/inc/saiswitch.h b/inc/saiswitch.h index fb05e0ef2..99e31abd9 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -325,6 +325,29 @@ typedef enum _sai_switch_failover_config_mode_t } sai_switch_failover_config_mode_t; +/** + * @brief Defines tunnel ECN mode + */ +typedef enum _sai_switch_tunnel_ecn_mode_t +{ + /** + * @brief Normal mode behavior defined in RFC 6040 + * section 4.1 copy from inner + */ + SAI_SWITCH_TUNNEL_ECN_MODE_STANDARD, + + /** + * @brief Copy from outer ECN + */ + SAI_SWITCH_TUNNEL_ECN_MODE_COPY_FROM_OUTER, + + /** + * @brief User defined behavior + */ + SAI_SWITCH_TUNNEL_ECN_MODE_USER_DEFINED + +} sai_switch_tunnel_ecn_mode_t; + /** * @brief Attribute Id in sai_set_switch_attribute() and * sai_get_switch_attribute() calls From 18ff185ab8f8d6eceea4ad76b2142be15ca855da Mon Sep 17 00:00:00 2001 From: Jai Kumar Date: Wed, 4 Nov 2020 12:25:08 -0500 Subject: [PATCH 2/5] Switch attributes for tunnel ECN mode Signed-off-by: Jai Kumar --- inc/saiswitch.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/inc/saiswitch.h b/inc/saiswitch.h index 99e31abd9..be6e1d142 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -2279,6 +2279,25 @@ typedef enum _sai_switch_attr_t */ SAI_SWITCH_ATTR_SUPPORTED_FAILOVER_MODE, + /** + * @brief Tunnel mappers + * + * @type sai_object_list_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_TUNNEL_MAP + * @default empty + */ + SAI_SWITCH_ATTR_TUNNEL_MAPPERS, + + /** + * @brief Tunnel ECN Mode load method + * + * @type sai_switch_tunnel_ecn_mode_t + * @flags CREATE_AND_SET + * @default SAI_SWITCH_TUNNEL_ECN_MODE_STANDARD + */ + SAI_SWITCH_ATTR_TUNNEL_ECN_MODE, + /** * @brief End of attributes */ From ff0c3aa8c1d06a0f526d6e1ed268874999e594fd Mon Sep 17 00:00:00 2001 From: Jai Kumar Date: Wed, 4 Nov 2020 16:00:35 -0500 Subject: [PATCH 3/5] Switch attributes for tunnel ECN mode Signed-off-by: Jai Kumar --- inc/saiswitch.h | 61 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/inc/saiswitch.h b/inc/saiswitch.h index be6e1d142..480e4ac3a 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -326,27 +326,45 @@ typedef enum _sai_switch_failover_config_mode_t } sai_switch_failover_config_mode_t; /** - * @brief Defines tunnel ECN mode + * @brief Defines tunnel encap ECN mode */ -typedef enum _sai_switch_tunnel_ecn_mode_t +typedef enum _sai_switch_tunnel_encap_ecn_mode_t { /** * @brief Normal mode behavior defined in RFC 6040 * section 4.1 copy from inner */ - SAI_SWITCH_TUNNEL_ECN_MODE_STANDARD, + SAI_SWITCH_TUNNEL_ENCAP_ECN_MODE_STANDARD, + + /** + * @brief User defined behavior + */ + SAI_SWITCH_TUNNEL_ENCAP_ECN_MODE_USER_DEFINED + +} sai_switch_tunnel_encap_ecn_mode_t; + +/** + * @brief Defines tunnel decap ECN mode + */ +typedef enum _sai_switch_tunnel_decap_ecn_mode_t +{ + /** + * @brief Normal mode behavior defined in RFC 6040 + * section 4.1 copy from inner + */ + SAI_SWITCH_TUNNEL_DECAP_ECN_MODE_STANDARD, /** * @brief Copy from outer ECN */ - SAI_SWITCH_TUNNEL_ECN_MODE_COPY_FROM_OUTER, + SAI_SWITCH_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER, /** * @brief User defined behavior */ - SAI_SWITCH_TUNNEL_ECN_MODE_USER_DEFINED + SAI_SWITCH_TUNNEL_DECAP_ECN_MODE_USER_DEFINED -} sai_switch_tunnel_ecn_mode_t; +} sai_switch_tunnel_decap_ecn_mode_t; /** * @brief Attribute Id in sai_set_switch_attribute() and @@ -2280,23 +2298,42 @@ typedef enum _sai_switch_attr_t SAI_SWITCH_ATTR_SUPPORTED_FAILOVER_MODE, /** - * @brief Tunnel mappers + * @brief Tunnel mappers for encap + * + * @type sai_object_list_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_TUNNEL_MAP + * @default empty + */ + SAI_SWITCH_ATTR_TUNNEL_ENCAP_ECN_MAPPERS, + + /** + * @brief Tunnel encap ECN Mode load method + * + * @type sai_switch_tunnel_encap_ecn_mode_t + * @flags CREATE_AND_SET + * @default SAI_SWITCH_TUNNEL_ENCAP_ECN_MODE_STANDARD + */ + SAI_SWITCH_ATTR_TUNNEL_ENCAP_ECN_MODE, + + /** + * @brief Tunnel mappers for decap * * @type sai_object_list_t * @flags CREATE_AND_SET * @objects SAI_OBJECT_TYPE_TUNNEL_MAP * @default empty */ - SAI_SWITCH_ATTR_TUNNEL_MAPPERS, + SAI_SWITCH_ATTR_TUNNEL_DECAP_ECN_MAPPERS, /** - * @brief Tunnel ECN Mode load method + * @brief Tunnel decap ECN Mode load method * - * @type sai_switch_tunnel_ecn_mode_t + * @type sai_switch_tunnel_decap_ecn_mode_t * @flags CREATE_AND_SET - * @default SAI_SWITCH_TUNNEL_ECN_MODE_STANDARD + * @default SAI_SWITCH_TUNNEL_DECAP_ECN_MODE_STANDARD */ - SAI_SWITCH_ATTR_TUNNEL_ECN_MODE, + SAI_SWITCH_ATTR_TUNNEL_DECAP_ECN_MODE, /** * @brief End of attributes From f09a8fd1a14890e9d7ae126b47d171c8091fc2d9 Mon Sep 17 00:00:00 2001 From: Jai Kumar Date: Wed, 4 Nov 2020 17:44:52 -0500 Subject: [PATCH 4/5] Switch attributes for tunnel ECN mode Signed-off-by: Jai Kumar --- inc/saiswitch.h | 35 +++++++++++++++++++---------------- inc/saitunnel.h | 44 -------------------------------------------- 2 files changed, 19 insertions(+), 60 deletions(-) diff --git a/inc/saiswitch.h b/inc/saiswitch.h index 480e4ac3a..22a962e82 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -328,43 +328,46 @@ typedef enum _sai_switch_failover_config_mode_t /** * @brief Defines tunnel encap ECN mode */ -typedef enum _sai_switch_tunnel_encap_ecn_mode_t +typedef enum _sai_tunnel_encap_ecn_mode_t { /** * @brief Normal mode behavior defined in RFC 6040 * section 4.1 copy from inner */ - SAI_SWITCH_TUNNEL_ENCAP_ECN_MODE_STANDARD, + SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD, /** - * @brief User defined behavior + * @brief User defined behavior. + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN in #SAI_TUNNEL_ATTR_ENCAP_MAPPERS. */ - SAI_SWITCH_TUNNEL_ENCAP_ECN_MODE_USER_DEFINED + SAI_TUNNEL_ENCAP_ECN_MODE_USER_DEFINED -} sai_switch_tunnel_encap_ecn_mode_t; +} sai_tunnel_encap_ecn_mode_t; /** * @brief Defines tunnel decap ECN mode */ -typedef enum _sai_switch_tunnel_decap_ecn_mode_t +typedef enum _sai_tunnel_decap_ecn_mode_t { /** - * @brief Normal mode behavior defined in RFC 6040 - * section 4.1 copy from inner + * @brief Behavior defined in RFC 6040 section 4.2 */ - SAI_SWITCH_TUNNEL_DECAP_ECN_MODE_STANDARD, + SAI_TUNNEL_DECAP_ECN_MODE_STANDARD, /** * @brief Copy from outer ECN */ - SAI_SWITCH_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER, + SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER, /** * @brief User defined behavior + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_UECN_OECN_TO_OECN in #SAI_TUNNEL_ATTR_DECAP_MAPPERS */ - SAI_SWITCH_TUNNEL_DECAP_ECN_MODE_USER_DEFINED + SAI_TUNNEL_DECAP_ECN_MODE_USER_DEFINED -} sai_switch_tunnel_decap_ecn_mode_t; +} sai_tunnel_decap_ecn_mode_t; /** * @brief Attribute Id in sai_set_switch_attribute() and @@ -2310,9 +2313,9 @@ typedef enum _sai_switch_attr_t /** * @brief Tunnel encap ECN Mode load method * - * @type sai_switch_tunnel_encap_ecn_mode_t + * @type sai_tunnel_encap_ecn_mode_t * @flags CREATE_AND_SET - * @default SAI_SWITCH_TUNNEL_ENCAP_ECN_MODE_STANDARD + * @default SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD */ SAI_SWITCH_ATTR_TUNNEL_ENCAP_ECN_MODE, @@ -2329,9 +2332,9 @@ typedef enum _sai_switch_attr_t /** * @brief Tunnel decap ECN Mode load method * - * @type sai_switch_tunnel_decap_ecn_mode_t + * @type sai_tunnel_decap_ecn_mode_t * @flags CREATE_AND_SET - * @default SAI_SWITCH_TUNNEL_DECAP_ECN_MODE_STANDARD + * @default SAI_TUNNEL_DECAP_ECN_MODE_STANDARD */ SAI_SWITCH_ATTR_TUNNEL_DECAP_ECN_MODE, diff --git a/inc/saitunnel.h b/inc/saitunnel.h index 73be14eb7..96d6660de 100644 --- a/inc/saitunnel.h +++ b/inc/saitunnel.h @@ -385,50 +385,6 @@ typedef enum _sai_tunnel_dscp_mode_t } sai_tunnel_dscp_mode_t; -/** - * @brief Defines tunnel encap ECN mode - */ -typedef enum _sai_tunnel_encap_ecn_mode_t -{ - /** - * @brief Normal mode behavior defined in RFC 6040 - * section 4.1 copy from inner - */ - SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD, - - /** - * @brief User defined behavior. - * - * Need to provide #SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN in #SAI_TUNNEL_ATTR_ENCAP_MAPPERS. - */ - SAI_TUNNEL_ENCAP_ECN_MODE_USER_DEFINED - -} sai_tunnel_encap_ecn_mode_t; - -/** - * @brief Defines tunnel decap ECN mode - */ -typedef enum _sai_tunnel_decap_ecn_mode_t -{ - /** - * @brief Behavior defined in RFC 6040 section 4.2 - */ - SAI_TUNNEL_DECAP_ECN_MODE_STANDARD, - - /** - * @brief Copy from outer ECN - */ - SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER, - - /** - * @brief User defined behavior - * - * Need to provide #SAI_TUNNEL_MAP_TYPE_UECN_OECN_TO_OECN in #SAI_TUNNEL_ATTR_DECAP_MAPPERS - */ - SAI_TUNNEL_DECAP_ECN_MODE_USER_DEFINED - -} sai_tunnel_decap_ecn_mode_t; - /** * @brief Defines tunnel peer mode */ From 7347e0b87b95f283d4e1d0311ffbc934a298de6c Mon Sep 17 00:00:00 2001 From: Jai Kumar Date: Wed, 18 Nov 2020 17:23:08 -0500 Subject: [PATCH 5/5] Per tunnel type ecn mode and mappers Signed-off-by: Jai Kumar --- inc/saiswitch.h | 282 +++++++++++++++++++++++++++++++++++++++--- inc/saitunnel.h | 44 +++++++ meta/saisanitycheck.c | 2 +- 3 files changed, 309 insertions(+), 19 deletions(-) diff --git a/inc/saiswitch.h b/inc/saiswitch.h index 22a962e82..a18d68d4e 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -328,46 +328,178 @@ typedef enum _sai_switch_failover_config_mode_t /** * @brief Defines tunnel encap ECN mode */ -typedef enum _sai_tunnel_encap_ecn_mode_t +typedef enum _sai_tunnel_ipinip_encap_ecn_mode_t { /** * @brief Normal mode behavior defined in RFC 6040 * section 4.1 copy from inner */ - SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD, + SAI_TUNNEL_IPINIP_ENCAP_ECN_MODE_STANDARD, /** * @brief User defined behavior. * * Need to provide #SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN in #SAI_TUNNEL_ATTR_ENCAP_MAPPERS. */ - SAI_TUNNEL_ENCAP_ECN_MODE_USER_DEFINED + SAI_TUNNEL_IPINIP_ENCAP_ECN_MODE_USER_DEFINED -} sai_tunnel_encap_ecn_mode_t; +} sai_tunnel_ipinip_encap_ecn_mode_t; + +/** + * @brief Defines GRE tunnel encap ECN mode + */ +typedef enum _sai_tunnel_ipinip_gre_encap_ecn_mode_t +{ + /** + * @brief Normal mode behavior defined in RFC 6040 + * section 4.1 copy from inner + */ + SAI_TUNNEL_IPINIP_GRE_ENCAP_ECN_MODE_STANDARD, + + /** + * @brief User defined behavior. + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN in #SAI_TUNNEL_ATTR_ENCAP_MAPPERS. + */ + SAI_TUNNEL_IPINIP_GRE_ENCAP_ECN_MODE_USER_DEFINED + +} sai_tunnel_ipinip_gre_encap_ecn_mode_t; + +/** + * @brief Defines VXLAN tunnel encap ECN mode + */ +typedef enum _sai_tunnel_vxlan_encap_ecn_mode_t +{ + /** + * @brief Normal mode behavior defined in RFC 6040 + * section 4.1 copy from inner + */ + SAI_TUNNEL_VXLAN_ENCAP_ECN_MODE_STANDARD, + + /** + * @brief User defined behavior. + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN in #SAI_TUNNEL_ATTR_ENCAP_MAPPERS. + */ + SAI_TUNNEL_VXLAN_ENCAP_ECN_MODE_USER_DEFINED + +} sai_tunnel_vxlan_encap_ecn_mode_t; + +/** + * @brief Defines MPLS tunnel encap ECN mode + */ +typedef enum _sai_tunnel_mpls_encap_ecn_mode_t +{ + /** + * @brief Normal mode behavior defined in RFC 6040 + * section 4.1 copy from inner + */ + SAI_TUNNEL_MPLS_ENCAP_ECN_MODE_STANDARD, + + /** + * @brief User defined behavior. + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN in #SAI_TUNNEL_ATTR_ENCAP_MAPPERS. + */ + SAI_TUNNEL_MPLS_ENCAP_ECN_MODE_USER_DEFINED + +} sai_tunnel_mpls_encap_ecn_mode_t; /** * @brief Defines tunnel decap ECN mode */ -typedef enum _sai_tunnel_decap_ecn_mode_t +typedef enum _sai_tunnel_ipinip_decap_ecn_mode_t { /** * @brief Behavior defined in RFC 6040 section 4.2 */ - SAI_TUNNEL_DECAP_ECN_MODE_STANDARD, + SAI_TUNNEL_IPINIP_DECAP_ECN_MODE_STANDARD, /** * @brief Copy from outer ECN */ - SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER, + SAI_TUNNEL_IPINIP_DECAP_ECN_MODE_COPY_FROM_OUTER, /** * @brief User defined behavior * * Need to provide #SAI_TUNNEL_MAP_TYPE_UECN_OECN_TO_OECN in #SAI_TUNNEL_ATTR_DECAP_MAPPERS */ - SAI_TUNNEL_DECAP_ECN_MODE_USER_DEFINED + SAI_TUNNEL_IPINIP_DECAP_ECN_MODE_USER_DEFINED -} sai_tunnel_decap_ecn_mode_t; +} sai_tunnel_ipinip_decap_ecn_mode_t; + +/** + * @brief Defines GRE tunnel decap ECN mode + */ +typedef enum _sai_tunnel_ipinip_gre_decap_ecn_mode_t +{ + /** + * @brief Behavior defined in RFC 6040 section 4.2 + */ + SAI_TUNNEL_IPINIP_GRE_DECAP_ECN_MODE_STANDARD, + + /** + * @brief Copy from outer ECN + */ + SAI_TUNNEL_IPINIP_GRE_DECAP_ECN_MODE_COPY_FROM_OUTER, + + /** + * @brief User defined behavior + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_UECN_OECN_TO_OECN in #SAI_TUNNEL_ATTR_DECAP_MAPPERS + */ + SAI_TUNNEL_IPINIP_GRE_DECAP_ECN_MODE_USER_DEFINED + +} sai_tunnel_ipinip_gre_decap_ecn_mode_t; + +/** + * @brief Defines VXLAN tunnel decap ECN mode + */ +typedef enum _sai_tunnel_vxlan_decap_ecn_mode_t +{ + /** + * @brief Behavior defined in RFC 6040 section 4.2 + */ + SAI_TUNNEL_VXLAN_DECAP_ECN_MODE_STANDARD, + + /** + * @brief Copy from outer ECN + */ + SAI_TUNNEL_VXLAN_DECAP_ECN_MODE_COPY_FROM_OUTER, + + /** + * @brief User defined behavior + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_UECN_OECN_TO_OECN in #SAI_TUNNEL_ATTR_DECAP_MAPPERS + */ + SAI_TUNNEL_VXLAN_DECAP_ECN_MODE_USER_DEFINED + +} sai_tunnel_vxlan_decap_ecn_mode_t; + +/** + * @brief Defines MPLS tunnel decap ECN mode + */ +typedef enum _sai_tunnel_mpls_decap_ecn_mode_t +{ + /** + * @brief Behavior defined in RFC 6040 section 4.2 + */ + SAI_TUNNEL_MPLS_DECAP_ECN_MODE_STANDARD, + + /** + * @brief Copy from outer ECN + */ + SAI_TUNNEL_MPLS_DECAP_ECN_MODE_COPY_FROM_OUTER, + + /** + * @brief User defined behavior + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_UECN_OECN_TO_OECN in #SAI_TUNNEL_ATTR_DECAP_MAPPERS + */ + SAI_TUNNEL_MPLS_DECAP_ECN_MODE_USER_DEFINED + +} sai_tunnel_mpls_decap_ecn_mode_t; /** * @brief Attribute Id in sai_set_switch_attribute() and @@ -2308,16 +2440,37 @@ typedef enum _sai_switch_attr_t * @objects SAI_OBJECT_TYPE_TUNNEL_MAP * @default empty */ - SAI_SWITCH_ATTR_TUNNEL_ENCAP_ECN_MAPPERS, + SAI_SWITCH_ATTR_TUNNEL_IPINIP_ENCAP_ECN_MAPPERS, /** - * @brief Tunnel encap ECN Mode load method + * @brief VXLAN Tunnel mappers for encap * - * @type sai_tunnel_encap_ecn_mode_t + * @type sai_object_list_t * @flags CREATE_AND_SET - * @default SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD + * @objects SAI_OBJECT_TYPE_TUNNEL_MAP + * @default empty */ - SAI_SWITCH_ATTR_TUNNEL_ENCAP_ECN_MODE, + SAI_SWITCH_ATTR_TUNNEL_VXLAN_ENCAP_ECN_MAPPERS, + + /** + * @brief GRE Tunnel mappers for encap + * + * @type sai_object_list_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_TUNNEL_MAP + * @default empty + */ + SAI_SWITCH_ATTR_TUNNEL_IPINIP_GRE_ENCAP_ECN_MAPPERS, + + /** + * @brief MPLS Tunnel mappers for encap + * + * @type sai_object_list_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_TUNNEL_MAP + * @default empty + */ + SAI_SWITCH_ATTR_TUNNEL_MPLS_ENCAP_ECN_MAPPERS, /** * @brief Tunnel mappers for decap @@ -2327,16 +2480,109 @@ typedef enum _sai_switch_attr_t * @objects SAI_OBJECT_TYPE_TUNNEL_MAP * @default empty */ - SAI_SWITCH_ATTR_TUNNEL_DECAP_ECN_MAPPERS, + SAI_SWITCH_ATTR_TUNNEL_IPINIP_DECAP_ECN_MAPPERS, + + /** + * @brief VXLAN Tunnel mappers for decap + * + * @type sai_object_list_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_TUNNEL_MAP + * @default empty + */ + SAI_SWITCH_ATTR_TUNNEL_VXLAN_DECAP_ECN_MAPPERS, + + /** + * @brief GRE Tunnel mappers for decap + * + * @type sai_object_list_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_TUNNEL_MAP + * @default empty + */ + SAI_SWITCH_ATTR_TUNNEL_IPINIP_GRE_DECAP_ECN_MAPPERS, + + /** + * @brief MPLS Tunnel mappers for decap + * + * @type sai_object_list_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_TUNNEL_MAP + * @default empty + */ + SAI_SWITCH_ATTR_TUNNEL_MPLS_DECAP_ECN_MAPPERS, + + /** + * @brief Tunnel encap ECN Mode load method + * + * @type sai_tunnel_ipinip_encap_ecn_mode_t + * @flags CREATE_AND_SET + * @default SAI_TUNNEL_IPINIP_ENCAP_ECN_MODE_STANDARD + */ + SAI_SWITCH_ATTR_TUNNEL_IPINIP_ENCAP_ECN_MODE, + + /** + * @brief GRE Tunnel encap ECN Mode load method + * + * @type sai_tunnel_ipinip_gre_encap_ecn_mode_t + * @flags CREATE_AND_SET + * @default SAI_TUNNEL_IPINIP_GRE_ENCAP_ECN_MODE_STANDARD + */ + SAI_SWITCH_ATTR_TUNNEL_IPINIP_GRE_ENCAP_ECN_MODE, + + /** + * @brief VXLAN Tunnel encap ECN Mode load method + * + * @type sai_tunnel_vxlan_encap_ecn_mode_t + * @flags CREATE_AND_SET + * @default SAI_TUNNEL_VXLAN_ENCAP_ECN_MODE_STANDARD + */ + SAI_SWITCH_ATTR_TUNNEL_VXLAN_ENCAP_ECN_MODE, + + /** + * @brief MPLS Tunnel encap ECN Mode load method + * + * @type sai_tunnel_mpls_encap_ecn_mode_t + * @flags CREATE_AND_SET + * @default SAI_TUNNEL_MPLS_ENCAP_ECN_MODE_STANDARD + */ + SAI_SWITCH_ATTR_TUNNEL_MPLS_ENCAP_ECN_MODE, /** * @brief Tunnel decap ECN Mode load method * - * @type sai_tunnel_decap_ecn_mode_t + * @type sai_tunnel_ipinip_decap_ecn_mode_t + * @flags CREATE_AND_SET + * @default SAI_TUNNEL_IPINIP_DECAP_ECN_MODE_STANDARD + */ + SAI_SWITCH_ATTR_TUNNEL_IPINIP_DECAP_ECN_MODE, + + /** + * @brief GRE Tunnel decap ECN Mode load method + * + * @type sai_tunnel_ipinip_gre_decap_ecn_mode_t + * @flags CREATE_AND_SET + * @default SAI_TUNNEL_IPINIP_GRE_DECAP_ECN_MODE_STANDARD + */ + SAI_SWITCH_ATTR_TUNNEL_IPINIP_GRE_DECAP_ECN_MODE, + + /** + * @brief VXLAN Tunnel decap ECN Mode load method + * + * @type sai_tunnel_vxlan_decap_ecn_mode_t + * @flags CREATE_AND_SET + * @default SAI_TUNNEL_VXLAN_DECAP_ECN_MODE_STANDARD + */ + SAI_SWITCH_ATTR_TUNNEL_VXLAN_DECAP_ECN_MODE, + + /** + * @brief MPLS Tunnel decap ECN Mode load method + * + * @type sai_tunnel_mpls_decap_ecn_mode_t * @flags CREATE_AND_SET - * @default SAI_TUNNEL_DECAP_ECN_MODE_STANDARD + * @default SAI_TUNNEL_MPLS_DECAP_ECN_MODE_STANDARD */ - SAI_SWITCH_ATTR_TUNNEL_DECAP_ECN_MODE, + SAI_SWITCH_ATTR_TUNNEL_MPLS_DECAP_ECN_MODE, /** * @brief End of attributes diff --git a/inc/saitunnel.h b/inc/saitunnel.h index 96d6660de..73be14eb7 100644 --- a/inc/saitunnel.h +++ b/inc/saitunnel.h @@ -385,6 +385,50 @@ typedef enum _sai_tunnel_dscp_mode_t } sai_tunnel_dscp_mode_t; +/** + * @brief Defines tunnel encap ECN mode + */ +typedef enum _sai_tunnel_encap_ecn_mode_t +{ + /** + * @brief Normal mode behavior defined in RFC 6040 + * section 4.1 copy from inner + */ + SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD, + + /** + * @brief User defined behavior. + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN in #SAI_TUNNEL_ATTR_ENCAP_MAPPERS. + */ + SAI_TUNNEL_ENCAP_ECN_MODE_USER_DEFINED + +} sai_tunnel_encap_ecn_mode_t; + +/** + * @brief Defines tunnel decap ECN mode + */ +typedef enum _sai_tunnel_decap_ecn_mode_t +{ + /** + * @brief Behavior defined in RFC 6040 section 4.2 + */ + SAI_TUNNEL_DECAP_ECN_MODE_STANDARD, + + /** + * @brief Copy from outer ECN + */ + SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER, + + /** + * @brief User defined behavior + * + * Need to provide #SAI_TUNNEL_MAP_TYPE_UECN_OECN_TO_OECN in #SAI_TUNNEL_ATTR_DECAP_MAPPERS + */ + SAI_TUNNEL_DECAP_ECN_MODE_USER_DEFINED + +} sai_tunnel_decap_ecn_mode_t; + /** * @brief Defines tunnel peer mode */ diff --git a/meta/saisanitycheck.c b/meta/saisanitycheck.c index a0118f395..b850b83c0 100644 --- a/meta/saisanitycheck.c +++ b/meta/saisanitycheck.c @@ -372,7 +372,7 @@ void check_attr_by_object_type() sai_object_type_t current = ot[index]->objecttype; META_ASSERT_TRUE(current == i, "object type must be equal on object type list"); - META_ASSERT_TRUE(index < 200, "object defines > 200 attributes, metadata bug?"); + META_ASSERT_TRUE(index < 300, "object defines > 300 attributes, metadata bug?"); META_ASSERT_TRUE(current > SAI_OBJECT_TYPE_NULL, "object type must be > NULL"); META_ASSERT_TRUE(current < SAI_OBJECT_TYPE_EXTENSIONS_MAX, "object type must be < MAX");