[202205][buffers] Add 'create_only_config_db_buffers.json' file for the Mellanox devices (not MSFT SKU) (#16232)

* [buffers] Add create_only_config_db_buffers.json for MLNX devices (not MSFT SKU), inject it at the start of the swss docker

Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>

* [buffers] Align the sonic-device_metadata.yang

Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>

---------

Signed-off-by: vadymhlushko-mlnx <vadymh@nvidia.com>
This commit is contained in:
Vadym Hlushko 2023-10-10 19:28:00 +03:00 committed by GitHub
parent 827eb3dc3d
commit 3ac09d544a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 164 additions and 1 deletions

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -0,0 +1,7 @@
{
"DEVICE_METADATA": {
"localhost": {
"create_only_config_db_buffers": "true"
}
}
}

View File

@ -353,6 +353,18 @@ start() {
MOUNTPATH="$MOUNTPATH/$DEV"
fi
{%- endif %}
{%- if docker_container_name == "swss" %}
# Insert "create_only_config_db_buffers" attribute
HWSKU_FOLDER="/usr/share/sonic/device/$PLATFORM/$HWSKU"
if [ -d "$HWSKU_FOLDER" ]; then
CREATE_ONLY_CONFIG_DB_BUFFERS_JSON="$HWSKU_FOLDER/create_only_config_db_buffers.json"
if [ -f "$CREATE_ONLY_CONFIG_DB_BUFFERS_JSON" ]; then
$SONIC_CFGGEN -j $CREATE_ONLY_CONFIG_DB_BUFFERS_JSON --write-to-db
fi
fi
{%- endif %}
DOCKERCHECK=`docker inspect --type container ${DOCKERNAME} 2>/dev/null`
if [ "$?" -eq "0" ]; then
{%- if docker_container_name == "database" %}

View File

@ -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"
}
}

View File

@ -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"
}
}
}
}
}

View File

@ -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 */
}