Skip to content

Commit b68516b

Browse files
stephenxsmssonicbld
authored andcommitted
Support new field "supporting_bulk_counter_groups" in DEVICE_METADATA|localhost for Mellanox-SN5600-V256 (sonic-net#20548)
Why I did it Support new field "supporting_bulk_counter_groups" in DEVICE_METADATA|localhost for Mellanox-SN5600-V256
1 parent a3608dc commit b68516b

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
@@ -436,6 +436,10 @@ start() {
436436
if [ -f "$CREATE_ONLY_CONFIG_DB_BUFFERS_JSON" ]; then
437437
$SONIC_DB_CLI CONFIG_DB HSET 'DEVICE_METADATA|localhost' create_only_config_db_buffers true
438438
fi
439+
SUPPORTING_BULK_COUNTER_GROUPS="$HWSKU_FOLDER/supporting_bulk_counter_groups"
440+
if [ -f "$SUPPORTING_BULK_COUNTER_GROUPS" ]; then
441+
$SONIC_DB_CLI CONFIG_DB HSET 'DEVICE_METADATA|localhost' supporting_bulk_counter_groups@ $(cat $SUPPORTING_BULK_COUNTER_GROUPS)
442+
fi
439443
fi
440444
{%- endif %}
441445

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
@@ -162,6 +162,9 @@
162162
"desc": "Verifying invalid create_only_config_db_buffers value",
163163
"eStrKey": "InvalidValue"
164164
},
165+
"DEVICE_METADATA_VALID_SUPPORTING_BULK_COUNTER_GROUPS": {
166+
"desc": "Verifying the supporting_bulk_counter_groups value"
167+
},
165168
"DEVICE_METADATA_VALID_BGP_ROUTER_ID": {
166169
"desc": "Verifying bgp_router_id configuration."
167170
},

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

+9
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,15 @@
442442
}
443443
}
444444
},
445+
"DEVICE_METADATA_VALID_SUPPORTING_BULK_COUNTER_GROUPS": {
446+
"sonic-device_metadata:sonic-device_metadata": {
447+
"sonic-device_metadata:DEVICE_METADATA": {
448+
"sonic-device_metadata:localhost": {
449+
"supporting_bulk_counter_groups": ["QUEUE_WATERMARK_STAT_COUNTER","PG_WATERMARK_STAT_COUNTER"]
450+
}
451+
}
452+
}
453+
},
445454
"DEVICE_METADATA_VALID_BGP_ROUTER_ID": {
446455
"sonic-device_metadata:sonic-device_metadata": {
447456
"sonic-device_metadata:DEVICE_METADATA": {

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

+5
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ module sonic-device_metadata {
238238
created, regardless of the CONFIG_DB buffers configuration.";
239239
}
240240

241+
leaf-list supporting_bulk_counter_groups {
242+
type string;
243+
description "This field contains a list of counter groups that support bulk operation.";
244+
}
245+
241246
leaf bgp_router_id {
242247
type inet:ipv4-address;
243248
description "BGP Router identifier";

0 commit comments

Comments
 (0)