diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 262f123e5b14..d2779804d594 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -120,6 +120,12 @@ "DEVICE_METADATA_INVALID_RACK_MGMT_MAP": { "desc": "Verifying invalid rack_mgmt_map configuration.", "eStr": "Invalid length for the rack mgmt map." + }, + "DEVICE_METADATA_VALID_CREATE_ONLY_CONFIG_DB_BUFFERS": { + "desc": "Verifying the create_only_config_db_buffers value" + }, + "DEVICE_METADATA_INVALID_CREATE_ONLY_CONFIG_DB_BUFFERS": { + "desc": "Verifying invalid create_only_config_db_buffers value", + "eStrKey": "InvalidValue" } - } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index 5298b389e7e5..21cf3808a636 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -329,5 +329,23 @@ } } } + }, + "DEVICE_METADATA_VALID_CREATE_ONLY_CONFIG_DB_BUFFERS": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "create_only_config_db_buffers": "true" + } + } + } + }, + "DEVICE_METADATA_INVALID_CREATE_ONLY_CONFIG_DB_BUFFERS": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "create_only_config_db_buffers": "invalid" + } + } + } } } 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 99fb4ef715bc..83e113cff3ae 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -202,6 +202,14 @@ module sonic-device_metadata { } description "Information of rack mgmt map."; } + + leaf create_only_config_db_buffers { + type boolean; + description "If this attribute exists and is equal to true - the buffers will be created + according to the config_db configuration (for example BUFFER_QUEUE|* table), + otherwise the maximum available buffers (which are read from SAI) will be + created, regardless of the CONFIG_DB buffers configuration."; + } } /* end of container localhost */ }