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

* [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-03 18:35:57 +03:00 committed by GitHub
parent 273a283d7e
commit 3bd396043e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 164 additions and 0 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

@ -387,6 +387,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

@ -149,5 +149,12 @@
"DEVICE_METADATA_INVALID_TIMEZONE": {
"desc": "Verifying invalid timezone value",
"eStrKey": "Range"
},
"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

@ -398,5 +398,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

@ -234,6 +234,14 @@ module sonic-device_metadata {
description "The TZ database name to use for the system, such as 'Europe/Stockholm'.";
reference "IANA Time Zone Database http://www.iana.org/time-zones";
}
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 */
}