Skip to content

Commit

Permalink
Support new field "supporting_bulk_counter_groups" in DEVICE_METADATA…
Browse files Browse the repository at this point in the history
…|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
  • Loading branch information
stephenxs authored and VladimirKuk committed Jan 21, 2025
1 parent 1d2bb1c commit 23d8861
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
QUEUE_WATERMARK_STAT_COUNTER,PG_WATERMARK_STAT_COUNTER,PFC_WD
4 changes: 4 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ start() {
if [ -f "$CREATE_ONLY_CONFIG_DB_BUFFERS_JSON" ]; then
$SONIC_DB_CLI CONFIG_DB HSET 'DEVICE_METADATA|localhost' create_only_config_db_buffers true
fi
SUPPORTING_BULK_COUNTER_GROUPS="$HWSKU_FOLDER/supporting_bulk_counter_groups"
if [ -f "$SUPPORTING_BULK_COUNTER_GROUPS" ]; then
$SONIC_DB_CLI CONFIG_DB HSET 'DEVICE_METADATA|localhost' supporting_bulk_counter_groups@ $(cat $SUPPORTING_BULK_COUNTER_GROUPS)
fi
fi
{%- endif %}

Expand Down
3 changes: 3 additions & 0 deletions files/build_templates/swss_vars.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"mac": "{{ DEVICE_METADATA.localhost.mac }}",
"resource_type": "{{ DEVICE_METADATA.localhost.resource_type }}",
"synchronous_mode": {% if DEVICE_METADATA.localhost.synchronous_mode == "disable" %}"disable"{% else %}"enable"{% endif %},
{%if DEVICE_METADATA.localhost.supporting_bulk_counter_groups is defined and DEVICE_METADATA.localhost.supporting_bulk_counter_groups != '' -%}
"supporting_bulk_counter_groups": "{{ DEVICE_METADATA.localhost.supporting_bulk_counter_groups|join(',') }}",
{% endif -%}
"dual_tor": {% if DEVICE_METADATA.localhost.type == "ToRRouter" and DEVICE_METADATA.localhost.subtype == "DualToR" %}"enable"{% else %}"disable"{% endif %},
"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 %}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@
"desc": "Verifying invalid create_only_config_db_buffers value",
"eStrKey": "InvalidValue"
},
"DEVICE_METADATA_VALID_SUPPORTING_BULK_COUNTER_GROUPS": {
"desc": "Verifying the supporting_bulk_counter_groups value"
},
"DEVICE_METADATA_VALID_BGP_ROUTER_ID": {
"desc": "Verifying bgp_router_id configuration."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,15 @@
}
}
},
"DEVICE_METADATA_VALID_SUPPORTING_BULK_COUNTER_GROUPS": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"supporting_bulk_counter_groups": ["QUEUE_WATERMARK_STAT_COUNTER","PG_WATERMARK_STAT_COUNTER"]
}
}
}
},
"DEVICE_METADATA_VALID_BGP_ROUTER_ID": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
Expand Down
5 changes: 5 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-device_metadata.yang
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ module sonic-device_metadata {
created, regardless of the CONFIG_DB buffers configuration.";
}

leaf-list supporting_bulk_counter_groups {
type string;
description "This field contains a list of counter groups that support bulk operation.";
}

leaf bgp_router_id {
type inet:ipv4-address;
description "BGP Router identifier";
Expand Down

0 comments on commit 23d8861

Please sign in to comment.