Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk chunk size per counter prefix #172

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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 @@
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 @@ -7,6 +7,14 @@
"eStrKey": "Range",
"eStr": "100..4294967295"
},
"FLEX_COUNTER_TABLE_WITH_VALID_BULK_CHUNK_SIZE": {
"desc": "FLEX_COUNTER_TABLE_WITH_VALID_BULK_CHUNK_SIZE no failure."
},
"FLEX_COUNTER_TABLE_WITH_INVALID_BULK_CHUNK_SIZE": {
"desc": "Out of range bulk chunk size.",
"eStrKey": "Range",
"eStr": "1..4294967295"
},
"FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_VRF": {
"desc": "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_VRF no failure."
},
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
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,151 @@
}
}
},
"FLEX_COUNTER_TABLE_WITH_VALID_BULK_CHUNK_SIZE": {
"sonic-flex_counter:sonic-flex_counter": {
"sonic-flex_counter:FLEX_COUNTER_TABLE": {
"BUFFER_POOL_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"DEBUG_COUNTER": {
"FLEX_COUNTER_STATUS": "enable"
},
"PFCWD": {
"FLEX_COUNTER_STATUS": "enable"
},
"PG_DROP": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 100,
"POLL_INTERVAL": 10000
},
"PG_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 100,
"POLL_INTERVAL": 10000
},
"PORT": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 100,
"BULK_CHUNK_SIZE_PER_PREFIX": "SAI_PORT_STAT_IF_OUT_QLEN:0;SAI_PORT_STAT_IF_IN_FEC:32",
"POLL_INTERVAL": 1000
},
"PORT_BUFFER_DROP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 60000
},
"PORT_RATES": {
"FLEX_COUNTER_STATUS": "enable"
},
"QUEUE": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 100,
"POLL_INTERVAL": 10000
},
"QUEUE_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 100,
"POLL_INTERVAL": 10000
},
"ACL": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"TUNNEL": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"FLOW_CNT_TRAP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"FLOW_CNT_ROUTE": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"WRED_ECN_QUEUE": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"WRED_ECN_PORT": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 1000
}
}
}
},
"FLEX_COUNTER_TABLE_WITH_INVALID_BULK_CHUNK_SIZE": {
"sonic-flex_counter:sonic-flex_counter": {
"sonic-flex_counter:FLEX_COUNTER_TABLE": {
"BUFFER_POOL_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"DEBUG_COUNTER": {
"FLEX_COUNTER_STATUS": "enable"
},
"PFCWD": {
"FLEX_COUNTER_STATUS": "enable"
},
"PG_DROP": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 0,
"POLL_INTERVAL": 10000
},
"PG_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 0,
"POLL_INTERVAL": 10000
},
"PORT": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 0,
"POLL_INTERVAL": 1000
},
"PORT_BUFFER_DROP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 60000
},
"PORT_RATES": {
"FLEX_COUNTER_STATUS": "enable"
},
"QUEUE": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 0,
"POLL_INTERVAL": 10000
},
"QUEUE_WATERMARK": {
"FLEX_COUNTER_STATUS": "enable",
"BULK_CHUNK_SIZE": 0,
"POLL_INTERVAL": 10000
},
"ACL": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"TUNNEL": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"FLOW_CNT_TRAP": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"FLOW_CNT_ROUTE": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"WRED_ECN_QUEUE": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"WRED_ECN_PORT": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 1000
}
}
}
},
"FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_VRF": {
"sonic-vrf:sonic-vrf":{
"sonic-vrf:VRF": {
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
47 changes: 47 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-flex_counter.yang
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ module sonic-flex_counter {
}
}

typedef bulk_chunk_size {
type uint32 {
range 1..4294967295;
}
}

typedef bulk_chunk_size_per_prefix {
type string;
description "Bulk chunk size per counter name prefix";
}

description "FLEX_COUNTER_TABLE part of config_db.json";

/* below are in alphabetical order */
Expand Down Expand Up @@ -102,6 +113,12 @@ module sonic-flex_counter {
leaf POLL_INTERVAL {
type poll_interval;
}
leaf BULK_CHUNK_SIZE {
type bulk_chunk_size;
}
leaf BULK_CHUNK_SIZE_PER_PREFIX {
type bulk_chunk_size_per_prefix;
}
}

container PG_WATERMARK {
Expand All @@ -115,6 +132,12 @@ module sonic-flex_counter {
leaf POLL_INTERVAL {
type poll_interval;
}
leaf BULK_CHUNK_SIZE {
type bulk_chunk_size;
}
leaf BULK_CHUNK_SIZE_PER_PREFIX {
type bulk_chunk_size_per_prefix;
}
}

container PORT {
Expand All @@ -128,6 +151,12 @@ module sonic-flex_counter {
leaf POLL_INTERVAL {
type poll_interval;
}
leaf BULK_CHUNK_SIZE {
type bulk_chunk_size;
}
leaf BULK_CHUNK_SIZE_PER_PREFIX {
type bulk_chunk_size_per_prefix;
}
}

container PORT_RATES {
Expand All @@ -151,6 +180,12 @@ module sonic-flex_counter {
leaf POLL_INTERVAL {
type poll_interval;
}
leaf BULK_CHUNK_SIZE {
type bulk_chunk_size;
}
leaf BULK_CHUNK_SIZE_PER_PREFIX {
type bulk_chunk_size_per_prefix;
}
}

container QUEUE {
Expand All @@ -164,6 +199,12 @@ module sonic-flex_counter {
leaf POLL_INTERVAL {
type poll_interval;
}
leaf BULK_CHUNK_SIZE {
type bulk_chunk_size;
}
leaf BULK_CHUNK_SIZE_PER_PREFIX {
type bulk_chunk_size_per_prefix;
}
}

container QUEUE_WATERMARK {
Expand All @@ -177,6 +218,12 @@ module sonic-flex_counter {
leaf POLL_INTERVAL {
type poll_interval;
}
leaf BULK_CHUNK_SIZE {
type bulk_chunk_size;
}
leaf BULK_CHUNK_SIZE_PER_PREFIX {
type bulk_chunk_size_per_prefix;
}
}

container RIF {
Expand Down