Skip to content

Commit 1307952

Browse files
authored
Support new field "supporting_bulk_counter_groups" in DEVICE_METADATA|localhost for Mellanox-SN5600-V256 (#20548)
Why I did it Support new field "supporting_bulk_counter_groups" in DEVICE_METADATA|localhost for Mellanox-SN5600-V256
1 parent ca4ed25 commit 1307952

File tree

6 files changed

+25
-0
lines changed

6 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
QUEUE_WATERMARK_STAT_COUNTER,PG_WATERMARK_STAT_COUNTER,PFC_WD

files/build_templates/docker_image_ctl.j2

+4
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,10 @@ start() {
444444
if [ -f "$CREATE_ONLY_CONFIG_DB_BUFFERS_JSON" ]; then
445445
$SONIC_DB_CLI CONFIG_DB HSET 'DEVICE_METADATA|localhost' create_only_config_db_buffers true
446446
fi
447+
SUPPORTING_BULK_COUNTER_GROUPS="$HWSKU_FOLDER/supporting_bulk_counter_groups"
448+
if [ -f "$SUPPORTING_BULK_COUNTER_GROUPS" ]; then
449+
$SONIC_DB_CLI CONFIG_DB HSET 'DEVICE_METADATA|localhost' supporting_bulk_counter_groups@ $(cat $SUPPORTING_BULK_COUNTER_GROUPS)
450+
fi
447451
fi
448452
{%- endif %}
449453

files/build_templates/swss_vars.j2

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"mac": "{{ DEVICE_METADATA.localhost.mac }}",
88
"resource_type": "{{ DEVICE_METADATA.localhost.resource_type }}",
99
"synchronous_mode": {% if DEVICE_METADATA.localhost.synchronous_mode == "disable" %}"disable"{% else %}"enable"{% endif %},
10+
{%if DEVICE_METADATA.localhost.supporting_bulk_counter_groups is defined and DEVICE_METADATA.localhost.supporting_bulk_counter_groups != '' -%}
11+
"supporting_bulk_counter_groups": "{{ DEVICE_METADATA.localhost.supporting_bulk_counter_groups|join(',') }}",
12+
{% endif -%}
1013
"dual_tor": {% if DEVICE_METADATA.localhost.type == "ToRRouter" and DEVICE_METADATA.localhost.subtype == "DualToR" %}"enable"{% else %}"disable"{% endif %},
1114
"dscp_remapping": {% if SYSTEM_DEFAULTS is defined and SYSTEM_DEFAULTS.tunnel_qos_remap is defined and SYSTEM_DEFAULTS.tunnel_qos_remap.status == "enabled" %}"enable"{% else %}"disable"{% endif %}
1215
}

src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json

+3
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@
175175
"desc": "Verifying invalid create_only_config_db_buffers value",
176176
"eStrKey": "InvalidValue"
177177
},
178+
"DEVICE_METADATA_VALID_SUPPORTING_BULK_COUNTER_GROUPS": {
179+
"desc": "Verifying the supporting_bulk_counter_groups value"
180+
},
178181
"DEVICE_METADATA_VALID_BGP_ROUTER_ID": {
179182
"desc": "Verifying bgp_router_id configuration."
180183
},

src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json

+9
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,15 @@
482482
}
483483
}
484484
},
485+
"DEVICE_METADATA_VALID_SUPPORTING_BULK_COUNTER_GROUPS": {
486+
"sonic-device_metadata:sonic-device_metadata": {
487+
"sonic-device_metadata:DEVICE_METADATA": {
488+
"sonic-device_metadata:localhost": {
489+
"supporting_bulk_counter_groups": ["QUEUE_WATERMARK_STAT_COUNTER","PG_WATERMARK_STAT_COUNTER"]
490+
}
491+
}
492+
}
493+
},
485494
"DEVICE_METADATA_VALID_BGP_ROUTER_ID": {
486495
"sonic-device_metadata:sonic-device_metadata": {
487496
"sonic-device_metadata:DEVICE_METADATA": {

src/sonic-yang-models/yang-models/sonic-device_metadata.yang

+5
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ module sonic-device_metadata {
250250
created, regardless of the CONFIG_DB buffers configuration.";
251251
}
252252

253+
leaf-list supporting_bulk_counter_groups {
254+
type string;
255+
description "This field contains a list of counter groups that support bulk operation.";
256+
}
257+
253258
leaf bgp_router_id {
254259
type inet:ipv4-address;
255260
description "BGP Router identifier";

0 commit comments

Comments
 (0)