Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
true
7 changes: 7 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,13 @@ start() {
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

ENABLE_PER_PORT_COUNTER_DISCOVERY="$HWSKU_FOLDER/enable_per_port_counter_discovery"
if [ -f "$ENABLE_PER_PORT_COUNTER_DISCOVERY" ]; then
$SONIC_DB_CLI CONFIG_DB HSET 'DEVICE_METADATA|localhost' enable_per_port_counter_discovery $(cat $ENABLE_PER_PORT_COUNTER_DISCOVERY)
else
$SONIC_DB_CLI CONFIG_DB HDEL 'DEVICE_METADATA|localhost' enable_per_port_counter_discovery
fi
fi

if [ "$CREATE_ONLY_CONFIG_DB_BUFFERS_JSON_FOUND" = true ]; then
Expand Down
2 changes: 2 additions & 0 deletions files/build_templates/swss_vars.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
{%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 -%}
"enable_per_port_counter_discovery": {% if DEVICE_METADATA.localhost.enable_per_port_counter_discovery|string|lower == "true" %}"true"{% else %}"false"{% endif %},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing if statement

{% 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 %},
"swss_zmq": {% if SYSTEM_DEFAULTS is defined and SYSTEM_DEFAULTS.swss_zmq is defined and SYSTEM_DEFAULTS.swss_zmq.status == "enabled" %}"true"{% else %}"false"{% endif %},
Expand Down
1 change: 1 addition & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,7 @@ instance is supported in SONiC.
"hwsku": "Force10-S6100",
"default_bgp_status": "up",
"docker_routing_config_mode": "unified",
"enable_per_port_counter_discovery": "false",
"hostname": "sonic-s6100-01",
"platform": "x86_64-dell_s6100_c2538-r0",
"mac": "4c:76:25:f4:70:82",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@
"DEVICE_METADATA_VALID_SUPPORTING_BULK_COUNTER_GROUPS": {
"desc": "Verifying the supporting_bulk_counter_groups value"
},
"DEVICE_METADATA_VALID_ENABLE_PER_PORT_COUNTER_DISCOVERY": {
"desc": "Verifying valid enable_per_port_counter_discovery value"
},
"DEVICE_METADATA_INVALID_ENABLE_PER_PORT_COUNTER_DISCOVERY": {
"desc": "Verifying invalid enable_per_port_counter_discovery value",
"eStrKey": "InvalidValue"
},
"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 @@ -739,6 +739,24 @@
}
}
},
"DEVICE_METADATA_VALID_ENABLE_PER_PORT_COUNTER_DISCOVERY": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"enable_per_port_counter_discovery": "true"
}
}
}
},
"DEVICE_METADATA_INVALID_ENABLE_PER_PORT_COUNTER_DISCOVERY": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"enable_per_port_counter_discovery": "invalid"
}
}
}
},
"DEVICE_METADATA_VALID_BGP_ROUTER_ID": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ module sonic-device_metadata {
description "This field contains a list of counter groups that support bulk operation.";
}

leaf enable_per_port_counter_discovery {
type boolean;
description "Enable per-port counter discovery with counter groups.";
}

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