From 3cf50ca7fc28dcd193e93bcb10f0583c13d38f2d Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Tue, 25 Apr 2023 09:26:45 +0200 Subject: [PATCH] [DASH][CRM] Extend the CRM YANG model with DASH attributes. (#14701) - Why I did it Extend the CRM YANG model with DASH attributes. - How I did it Add new attributes to the existing CRM YANG model. Implement tests for DASH CRM attributes. - How to verify it Build sonic_yang_models packages. The tests will be run automatically. --- src/sonic-yang-models/doc/Configuration.md | 57 + .../yang_model_tests/tests/crm_dash.json | 287 ++++ .../tests_config/crm_dash.json | 1352 +++++++++++++++++ .../yang-models/sonic-crm.yang | 454 ++++++ .../yang-models/sonic-device_metadata.yang | 2 +- 5 files changed, 2151 insertions(+), 1 deletion(-) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/crm_dash.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/crm_dash.json diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 9bc32e2799..36d220a029 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -23,6 +23,7 @@ Table of Contents * [COPP_TABLE](#copp_table) * [Console](#console) * [CRM](#crm) + * [CRM DASH](#crm-dash) * [Data Plane L3 Interfaces](#data-plane-l3-interfaces) * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) * [Device Metadata](#device-metadata) @@ -785,6 +786,62 @@ It currently allows user to administratively bring down a line-card or fabric-ca ``` +### CRM DASH + +```json +{ +"CRM": { + "Config": { + "dash_vnet_threshold_type": "percentage", + "dash_vnet_low_threshold": "70", + "dash_vnet_high_threshold": "85", + "dash_eni_threshold_type": "percentage", + "dash_eni_low_threshold": "70", + "dash_eni_high_threshold": "85", + "dash_eni_ether_address_map_threshold_type": "percentage", + "dash_eni_ether_address_map_low_threshold": "70", + "dash_eni_ether_address_map_high_threshold": "85", + "dash_ipv4_inbound_routing_threshold_type": "percentage", + "dash_ipv4_inbound_routing_low_threshold": "70", + "dash_ipv4_inbound_routing_high_threshold": "85", + "dash_ipv6_inbound_routing_threshold_type": "percentage", + "dash_ipv6_inbound_routing_low_threshold": "70", + "dash_ipv6_inbound_routing_high_threshold": "85", + "dash_ipv4_outbound_routing_threshold_type": "percentage", + "dash_ipv4_outbound_routing_low_threshold": "70", + "dash_ipv4_outbound_routing_high_threshold": "85", + "dash_ipv6_outbound_routing_threshold_type": "percentage", + "dash_ipv6_outbound_routing_low_threshold": "70", + "dash_ipv6_outbound_routing_high_threshold": "85", + "dash_ipv4_pa_validation_threshold_type": "percentage", + "dash_ipv4_pa_validation_low_threshold": "70", + "dash_ipv4_pa_validation_high_threshold": "85", + "dash_ipv6_pa_validation_threshold_type": "percentage", + "dash_ipv6_pa_validation_low_threshold": "70", + "dash_ipv6_pa_validation_high_threshold": "85", + "dash_ipv4_outbound_ca_to_pa_threshold_type": "percentage", + "dash_ipv4_outbound_ca_to_pa_low_threshold": "70", + "dash_ipv4_outbound_ca_to_pa_high_threshold": "85", + "dash_ipv6_outbound_ca_to_pa_threshold_type": "percentage", + "dash_ipv6_outbound_ca_to_pa_low_threshold": "70", + "dash_ipv6_outbound_ca_to_pa_high_threshold": "85", + "dash_ipv4_acl_group_threshold_type": "percentage", + "dash_ipv4_acl_group_low_threshold": "70", + "dash_ipv4_acl_group_high_threshold": "85", + "dash_ipv6_acl_group_threshold_type": "percentage", + "dash_ipv6_acl_group_low_threshold": "70", + "dash_ipv6_acl_group_high_threshold": "85", + "dash_ipv4_acl_rule_threshold_type": "percentage", + "dash_ipv4_acl_rule_low_threshold": "70", + "dash_ipv4_acl_rule_high_threshold": "85", + "dash_ipv6_acl_rule_threshold_type": "percentage", + "dash_ipv6_acl_rule_low_threshold": "70", + "dash_ipv6_acl_rule_high_threshold": "85" + } + } +} +``` + ### Data Plane L3 Interfaces IP configuration for data plane are defined in **INTERFACE**, **VLAN_SUB_INTERFACE**, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/crm_dash.json b/src/sonic-yang-models/tests/yang_model_tests/tests/crm_dash.json new file mode 100644 index 0000000000..4c1d6818c7 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/crm_dash.json @@ -0,0 +1,287 @@ +{ + "CRM_DASH_VNET_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_VNET_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_VNET_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_VNET_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_VNET_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_VNET_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_VNET_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_VNET_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_VNET_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_VNET_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_ENI_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_ENI_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_ENI_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_ENI_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_ENI_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_ENI_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_ENI_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_ENI_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_ENI_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_ENI_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV4_PA_VALIDATION_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV4_PA_VALIDATION_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV4_PA_VALIDATION_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV4_PA_VALIDATION_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV4_PA_VALIDATION_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV6_PA_VALIDATION_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV6_PA_VALIDATION_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV6_PA_VALIDATION_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV6_PA_VALIDATION_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV6_PA_VALIDATION_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV4_ACL_GROUP_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV4_ACL_GROUP_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV4_ACL_GROUP_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV4_ACL_GROUP_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV4_ACL_GROUP_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV6_ACL_GROUP_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV6_ACL_GROUP_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV6_ACL_GROUP_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV6_ACL_GROUP_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV6_ACL_GROUP_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV4_ACL_RULE_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV4_ACL_RULE_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV4_ACL_RULE_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV4_ACL_RULE_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV4_ACL_RULE_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_CORRECT_FREE_VALUE": { + "desc": "CRM_DASH_IPV6_ACL_RULE_WITH_CORRECT_FREE_VALUE no failure." + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_CORRECT_USED_VALUE": { + "desc": "CRM_DASH_IPV6_ACL_RULE_WITH_CORRECT_USED_VALUE no failure." + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_WRONG_THRESHOLD_TYPE": { + "desc": "CRM_DASH_IPV6_ACL_RULE_WITH_WRONG_THRESHOLD_TYPE pattern failure.", + "eStrKey": "Pattern", + "eStr": ["wrong" ] + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_WRONG_PERCENTAGE": { + "desc": "CRM_DASH_IPV6_ACL_RULE_WITH_WRONG_PERCENTAGE must condition failure.", + "eStrKey": "Must" + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_HIGH_THRESHOLD_ERR": { + "desc": "CRM_DASH_IPV6_ACL_RULE_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", + "eStr": ["high_threshold should be more than low_threshold"] + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/crm_dash.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/crm_dash.json new file mode 100644 index 0000000000..b6fe928565 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/crm_dash.json @@ -0,0 +1,1352 @@ +{ + "CRM_DASH_VNET_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_vnet_high_threshold": 90, + "dash_vnet_low_threshold": 70, + "dash_vnet_threshold_type": "free" + } + } + } + }, + "CRM_DASH_VNET_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_vnet_high_threshold": 85, + "dash_vnet_low_threshold": 25, + "dash_vnet_threshold_type": "used" + } + } + } + }, + "CRM_DASH_VNET_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_vnet_high_threshold": 80, + "dash_vnet_low_threshold": 81, + "dash_vnet_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_VNET_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_vnet_high_threshold": 110, + "dash_vnet_low_threshold": 85, + "dash_vnet_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_VNET_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_vnet_high_threshold": 90, + "dash_vnet_low_threshold": 70, + "dash_vnet_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_ENI_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_high_threshold": 90, + "dash_eni_low_threshold": 70, + "dash_eni_threshold_type": "free" + } + } + } + }, + "CRM_DASH_ENI_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_high_threshold": 85, + "dash_eni_low_threshold": 25, + "dash_eni_threshold_type": "used" + } + } + } + }, + "CRM_DASH_ENI_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_high_threshold": 80, + "dash_eni_low_threshold": 81, + "dash_eni_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_ENI_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_high_threshold": 110, + "dash_eni_low_threshold": 85, + "dash_eni_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_ENI_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_high_threshold": 90, + "dash_eni_low_threshold": 70, + "dash_eni_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_ether_address_map_high_threshold": 90, + "dash_eni_ether_address_map_low_threshold": 70, + "dash_eni_ether_address_map_threshold_type": "free" + } + } + } + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_ether_address_map_high_threshold": 85, + "dash_eni_ether_address_map_low_threshold": 25, + "dash_eni_ether_address_map_threshold_type": "used" + } + } + } + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_ether_address_map_high_threshold": 80, + "dash_eni_ether_address_map_low_threshold": 81, + "dash_eni_ether_address_map_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_ether_address_map_high_threshold": 110, + "dash_eni_ether_address_map_low_threshold": 85, + "dash_eni_ether_address_map_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_ENI_ETHER_ADDRESS_MAP_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_eni_ether_address_map_high_threshold": 90, + "dash_eni_ether_address_map_low_threshold": 70, + "dash_eni_ether_address_map_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_inbound_routing_high_threshold": 90, + "dash_ipv4_inbound_routing_low_threshold": 70, + "dash_ipv4_inbound_routing_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_inbound_routing_high_threshold": 85, + "dash_ipv4_inbound_routing_low_threshold": 25, + "dash_ipv4_inbound_routing_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_inbound_routing_high_threshold": 80, + "dash_ipv4_inbound_routing_low_threshold": 81, + "dash_ipv4_inbound_routing_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_inbound_routing_high_threshold": 110, + "dash_ipv4_inbound_routing_low_threshold": 85, + "dash_ipv4_inbound_routing_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_INBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_inbound_routing_high_threshold": 90, + "dash_ipv4_inbound_routing_low_threshold": 70, + "dash_ipv4_inbound_routing_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_inbound_routing_high_threshold": 90, + "dash_ipv6_inbound_routing_low_threshold": 70, + "dash_ipv6_inbound_routing_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_inbound_routing_high_threshold": 85, + "dash_ipv6_inbound_routing_low_threshold": 25, + "dash_ipv6_inbound_routing_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_inbound_routing_high_threshold": 80, + "dash_ipv6_inbound_routing_low_threshold": 81, + "dash_ipv6_inbound_routing_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_inbound_routing_high_threshold": 110, + "dash_ipv6_inbound_routing_low_threshold": 85, + "dash_ipv6_inbound_routing_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_INBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_inbound_routing_high_threshold": 90, + "dash_ipv6_inbound_routing_low_threshold": 70, + "dash_ipv6_inbound_routing_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_routing_high_threshold": 90, + "dash_ipv4_outbound_routing_low_threshold": 70, + "dash_ipv4_outbound_routing_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_routing_high_threshold": 85, + "dash_ipv4_outbound_routing_low_threshold": 25, + "dash_ipv4_outbound_routing_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_routing_high_threshold": 80, + "dash_ipv4_outbound_routing_low_threshold": 81, + "dash_ipv4_outbound_routing_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_routing_high_threshold": 110, + "dash_ipv4_outbound_routing_low_threshold": 85, + "dash_ipv4_outbound_routing_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_routing_high_threshold": 90, + "dash_ipv4_outbound_routing_low_threshold": 70, + "dash_ipv4_outbound_routing_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_routing_high_threshold": 90, + "dash_ipv6_outbound_routing_low_threshold": 70, + "dash_ipv6_outbound_routing_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_routing_high_threshold": 85, + "dash_ipv6_outbound_routing_low_threshold": 25, + "dash_ipv6_outbound_routing_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_routing_high_threshold": 80, + "dash_ipv6_outbound_routing_low_threshold": 81, + "dash_ipv6_outbound_routing_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_routing_high_threshold": 110, + "dash_ipv6_outbound_routing_low_threshold": 85, + "dash_ipv6_outbound_routing_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_ROUTING_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_routing_high_threshold": 90, + "dash_ipv6_outbound_routing_low_threshold": 70, + "dash_ipv6_outbound_routing_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_pa_validation_high_threshold": 90, + "dash_ipv4_pa_validation_low_threshold": 70, + "dash_ipv4_pa_validation_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_pa_validation_high_threshold": 85, + "dash_ipv4_pa_validation_low_threshold": 25, + "dash_ipv4_pa_validation_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_pa_validation_high_threshold": 80, + "dash_ipv4_pa_validation_low_threshold": 81, + "dash_ipv4_pa_validation_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_pa_validation_high_threshold": 110, + "dash_ipv4_pa_validation_low_threshold": 85, + "dash_ipv4_pa_validation_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_PA_VALIDATION_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_pa_validation_high_threshold": 90, + "dash_ipv4_pa_validation_low_threshold": 70, + "dash_ipv4_pa_validation_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_pa_validation_high_threshold": 90, + "dash_ipv6_pa_validation_low_threshold": 70, + "dash_ipv6_pa_validation_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_pa_validation_high_threshold": 85, + "dash_ipv6_pa_validation_low_threshold": 25, + "dash_ipv6_pa_validation_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_pa_validation_high_threshold": 80, + "dash_ipv6_pa_validation_low_threshold": 81, + "dash_ipv6_pa_validation_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_pa_validation_high_threshold": 110, + "dash_ipv6_pa_validation_low_threshold": 85, + "dash_ipv6_pa_validation_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_PA_VALIDATION_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_pa_validation_high_threshold": 90, + "dash_ipv6_pa_validation_low_threshold": 70, + "dash_ipv6_pa_validation_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_ca_to_pa_high_threshold": 90, + "dash_ipv4_outbound_ca_to_pa_low_threshold": 70, + "dash_ipv4_outbound_ca_to_pa_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_ca_to_pa_high_threshold": 85, + "dash_ipv4_outbound_ca_to_pa_low_threshold": 25, + "dash_ipv4_outbound_ca_to_pa_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_ca_to_pa_high_threshold": 80, + "dash_ipv4_outbound_ca_to_pa_low_threshold": 81, + "dash_ipv4_outbound_ca_to_pa_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_ca_to_pa_high_threshold": 110, + "dash_ipv4_outbound_ca_to_pa_low_threshold": 85, + "dash_ipv4_outbound_ca_to_pa_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_OUTBOUND_CA_TO_PA_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_outbound_ca_to_pa_high_threshold": 90, + "dash_ipv4_outbound_ca_to_pa_low_threshold": 70, + "dash_ipv4_outbound_ca_to_pa_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_ca_to_pa_high_threshold": 90, + "dash_ipv6_outbound_ca_to_pa_low_threshold": 70, + "dash_ipv6_outbound_ca_to_pa_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_ca_to_pa_high_threshold": 85, + "dash_ipv6_outbound_ca_to_pa_low_threshold": 25, + "dash_ipv6_outbound_ca_to_pa_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_ca_to_pa_high_threshold": 80, + "dash_ipv6_outbound_ca_to_pa_low_threshold": 81, + "dash_ipv6_outbound_ca_to_pa_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_ca_to_pa_high_threshold": 110, + "dash_ipv6_outbound_ca_to_pa_low_threshold": 85, + "dash_ipv6_outbound_ca_to_pa_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_OUTBOUND_CA_TO_PA_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_outbound_ca_to_pa_high_threshold": 90, + "dash_ipv6_outbound_ca_to_pa_low_threshold": 70, + "dash_ipv6_outbound_ca_to_pa_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_group_high_threshold": 90, + "dash_ipv4_acl_group_low_threshold": 70, + "dash_ipv4_acl_group_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_group_high_threshold": 85, + "dash_ipv4_acl_group_low_threshold": 25, + "dash_ipv4_acl_group_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_group_high_threshold": 80, + "dash_ipv4_acl_group_low_threshold": 81, + "dash_ipv4_acl_group_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_group_high_threshold": 110, + "dash_ipv4_acl_group_low_threshold": 85, + "dash_ipv4_acl_group_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_ACL_GROUP_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_group_high_threshold": 90, + "dash_ipv4_acl_group_low_threshold": 70, + "dash_ipv4_acl_group_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_group_high_threshold": 90, + "dash_ipv6_acl_group_low_threshold": 70, + "dash_ipv6_acl_group_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_group_high_threshold": 85, + "dash_ipv6_acl_group_low_threshold": 25, + "dash_ipv6_acl_group_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_group_high_threshold": 80, + "dash_ipv6_acl_group_low_threshold": 81, + "dash_ipv6_acl_group_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_group_high_threshold": 110, + "dash_ipv6_acl_group_low_threshold": 85, + "dash_ipv6_acl_group_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_ACL_GROUP_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_group_high_threshold": 90, + "dash_ipv6_acl_group_low_threshold": 70, + "dash_ipv6_acl_group_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_rule_high_threshold": 90, + "dash_ipv4_acl_rule_low_threshold": 70, + "dash_ipv4_acl_rule_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_rule_high_threshold": 85, + "dash_ipv4_acl_rule_low_threshold": 25, + "dash_ipv4_acl_rule_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_rule_high_threshold": 80, + "dash_ipv4_acl_rule_low_threshold": 81, + "dash_ipv4_acl_rule_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_rule_high_threshold": 110, + "dash_ipv4_acl_rule_low_threshold": 85, + "dash_ipv4_acl_rule_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV4_ACL_RULE_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv4_acl_rule_high_threshold": 90, + "dash_ipv4_acl_rule_low_threshold": 70, + "dash_ipv4_acl_rule_threshold_type": "wrong" + } + } + } + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_CORRECT_FREE_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_rule_high_threshold": 90, + "dash_ipv6_acl_rule_low_threshold": 70, + "dash_ipv6_acl_rule_threshold_type": "free" + } + } + } + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_CORRECT_USED_VALUE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_rule_high_threshold": 85, + "dash_ipv6_acl_rule_low_threshold": 25, + "dash_ipv6_acl_rule_threshold_type": "used" + } + } + } + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_HIGH_THRESHOLD_ERR": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_rule_high_threshold": 80, + "dash_ipv6_acl_rule_low_threshold": 81, + "dash_ipv6_acl_rule_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_WRONG_PERCENTAGE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_rule_high_threshold": 110, + "dash_ipv6_acl_rule_low_threshold": 85, + "dash_ipv6_acl_rule_threshold_type": "PERCENTAGE" + } + } + } + }, + "CRM_DASH_IPV6_ACL_RULE_WITH_WRONG_THRESHOLD_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "localhost": { + "switch_type": "dpu" + } + } + }, + "sonic-crm:sonic-crm": { + "sonic-crm:CRM": { + "Config": { + "dash_ipv6_acl_rule_high_threshold": 90, + "dash_ipv6_acl_rule_low_threshold": 70, + "dash_ipv6_acl_rule_threshold_type": "wrong" + } + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-crm.yang b/src/sonic-yang-models/yang-models/sonic-crm.yang index 87b36276d6..4b66103fc1 100644 --- a/src/sonic-yang-models/yang-models/sonic-crm.yang +++ b/src/sonic-yang-models/yang-models/sonic-crm.yang @@ -9,6 +9,10 @@ module sonic-crm { prefix stypes; } + import sonic-device_metadata { + prefix dm; + } + description "CRM YANG Module for SONiC OS"; revision 2020-04-10 { @@ -456,6 +460,456 @@ module sonic-crm { type threshold; } + leaf dash_vnet_threshold_type { + description "CRM threshold support for DASH VNETs"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_vnet_high_threshold<100 and + ../dash_vnet_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_vnet_high_threshold { + description "CRM threshold support for DASH VNETs"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_vnet_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_vnet_low_threshold { + description "CRM threshold support for DASH VNETs"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_eni_threshold_type { + description "CRM threshold support for DASH ENIs"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_eni_high_threshold<100 and + ../dash_eni_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_eni_high_threshold { + description "CRM threshold support for DASH ENIs"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_eni_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_eni_low_threshold { + description "CRM threshold support for DASH ENIs"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_eni_ether_address_map_threshold_type { + description "CRM threshold support for DASH ENI ETHER address map entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_eni_ether_address_map_high_threshold<100 and + ../dash_eni_ether_address_map_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_eni_ether_address_map_high_threshold { + description "CRM threshold support for DASH ENI ETHER address map entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_eni_ether_address_map_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_eni_ether_address_map_low_threshold { + description "CRM threshold support for DASH ENI ETHER address map entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv4_inbound_routing_threshold_type { + description "CRM threshold support for DASH IPv4 inbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv4_inbound_routing_high_threshold<100 and + ../dash_ipv4_inbound_routing_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv4_inbound_routing_high_threshold { + description "CRM threshold support for DASH IPv4 inbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv4_inbound_routing_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv4_inbound_routing_low_threshold { + description "CRM threshold support for DASH IPv4 inbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv6_inbound_routing_threshold_type { + description "CRM threshold support for DASH IPv6 inbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv6_inbound_routing_high_threshold<100 and + ../dash_ipv6_inbound_routing_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv6_inbound_routing_high_threshold { + description "CRM threshold support for DASH IPv6 inbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv6_inbound_routing_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv6_inbound_routing_low_threshold { + description "CRM threshold support for DASH IPv6 inbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv4_outbound_routing_threshold_type { + description "CRM threshold support for DASH IPv4 outbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv4_outbound_routing_high_threshold<100 and + ../dash_ipv4_outbound_routing_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv4_outbound_routing_high_threshold { + description "CRM threshold support for DASH IPv4 outbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv4_outbound_routing_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv4_outbound_routing_low_threshold { + description "CRM threshold support for DASH IPv4 outbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv6_outbound_routing_threshold_type { + description "CRM threshold support for DASH IPv6 outbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv6_outbound_routing_high_threshold<100 and + ../dash_ipv6_outbound_routing_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv6_outbound_routing_high_threshold { + description "CRM threshold support for DASH IPv6 outbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv6_outbound_routing_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv6_outbound_routing_low_threshold { + description "CRM threshold support for DASH IPv6 outbound routes"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv4_pa_validation_threshold_type { + description "CRM threshold support for DASH IPv4 PA validation entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv4_pa_validation_high_threshold<100 and + ../dash_ipv4_pa_validation_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv4_pa_validation_high_threshold { + description "CRM threshold support for DASH IPv4 PA validation entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv4_pa_validation_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv4_pa_validation_low_threshold { + description "CRM threshold support for DASH IPv4 PA validation entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv6_pa_validation_threshold_type { + description "CRM threshold support for DASH IPv6 PA validation entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv6_pa_validation_high_threshold<100 and + ../dash_ipv6_pa_validation_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv6_pa_validation_high_threshold { + description "CRM threshold support for DASH IPv6 PA validation entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv6_pa_validation_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv6_pa_validation_low_threshold { + description "CRM threshold support for DASH IPv6 PA validation entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv4_outbound_ca_to_pa_threshold_type { + description "CRM threshold support for DASH IPv4 outbound CA to PA entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv4_outbound_ca_to_pa_high_threshold<100 and + ../dash_ipv4_outbound_ca_to_pa_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv4_outbound_ca_to_pa_high_threshold { + description "CRM threshold support for DASH IPv4 outbound CA to PA entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv4_outbound_ca_to_pa_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv4_outbound_ca_to_pa_low_threshold { + description "CRM threshold support for DASH IPv4 outbound CA to PA entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv6_outbound_ca_to_pa_threshold_type { + description "CRM threshold support for DASH IPv6 outbound CA to PA entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv6_outbound_ca_to_pa_high_threshold<100 and + ../dash_ipv6_outbound_ca_to_pa_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv6_outbound_ca_to_pa_high_threshold { + description "CRM threshold support for DASH IPv6 outbound CA to PA entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv6_outbound_ca_to_pa_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv6_outbound_ca_to_pa_low_threshold { + description "CRM threshold support for DASH IPv6 outbound CA to PA entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv4_acl_group_threshold_type { + description "CRM threshold support for DASH IPv4 ACL group entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv4_acl_group_high_threshold<100 and + ../dash_ipv4_acl_group_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv4_acl_group_high_threshold { + description "CRM threshold support for DASH IPv4 ACL group entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv4_acl_group_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv4_acl_group_low_threshold { + description "CRM threshold support for DASH IPv4 ACL group entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv6_acl_group_threshold_type { + description "CRM threshold support for DASH IPv6 ACL group entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv6_acl_group_high_threshold<100 and + ../dash_ipv6_acl_group_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv6_acl_group_high_threshold { + description "CRM threshold support for DASH IPv6 ACL group entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv6_acl_group_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv6_acl_group_low_threshold { + description "CRM threshold support for DASH IPv6 ACL group entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv4_acl_rule_threshold_type { + description "CRM threshold support for DASH IPv4 ACL rule entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv4_acl_rule_high_threshold<100 and + ../dash_ipv4_acl_rule_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv4_acl_rule_high_threshold { + description "CRM threshold support for DASH IPv4 ACL rule entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv4_acl_rule_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv4_acl_rule_low_threshold { + description "CRM threshold support for DASH IPv4 ACL rule entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + + leaf dash_ipv6_acl_rule_threshold_type { + description "CRM threshold support for DASH IPv6 ACL rule entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(((current()='PERCENTAGE' or current()='percentage') and + ../dash_ipv6_acl_rule_high_threshold<100 and + ../dash_ipv6_acl_rule_low_threshold<100) or + (current()!='PERCENTAGE' and current()!='percentage'))"; + type stypes:crm_threshold_type; + } + + leaf dash_ipv6_acl_rule_high_threshold { + description "CRM threshold support for DASH IPv6 ACL rule entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + must "(current() > ../dash_ipv6_acl_rule_low_threshold)" + { + error-message "high_threshold should be more than low_threshold"; + } + type threshold; + } + + leaf dash_ipv6_acl_rule_low_threshold { + description "CRM threshold support for DASH IPv6 ACL rule entries"; + + when "(/dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:switch_type = 'dpu')"; + + type threshold; + } + } /* end of Config */ } diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index f5df11de2b..f333320aff 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -182,7 +182,7 @@ module sonic-device_metadata { leaf switch_type { type string { - pattern "chassis-packet|fabric|npu|voq"; + pattern "chassis-packet|fabric|npu|voq|dpu"; } description "Type of switch. Default is NPU, on a VOQ switch voq is used for a regular switching device while fabric is used for a fabric device.