diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/create_only_config_db_buffers.json new file mode 100644 index 0000000000..8bea3894c0 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/create_only_config_db_buffers.json new file mode 100644 index 0000000000..8bea3894c0 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/create_only_config_db_buffers.json new file mode 100644 index 0000000000..8bea3894c0 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/create_only_config_db_buffers.json new file mode 100644 index 0000000000..8bea3894c0 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/create_only_config_db_buffers.json b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/create_only_config_db_buffers.json b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/ACS-SN4800/create_only_config_db_buffers.json b/device/mellanox/x86_64-nvidia_sn4800-r0/ACS-SN4800/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn4800-r0/ACS-SN4800/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/create_only_config_db_buffers.json b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/create_only_config_db_buffers.json b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/create_only_config_db_buffers.json new file mode 100644 index 0000000000..6feb156714 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 5336568fda..3b6f93d327 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -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" %} 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 262f123e5b..d2779804d5 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 5298b389e7..21cf3808a6 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 99fb4ef715..83e113cff3 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 */ }