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

[DASH] Add support for ENI counters #19997

Merged
merged 4 commits into from
Sep 18, 2024
Merged
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
9 changes: 8 additions & 1 deletion dockers/docker-orchagent/enable_counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import time
from swsscommon import swsscommon
from sonic_py_common import device_info

# ALPHA defines the size of the window over which we calculate the average value. ALPHA is 2/(N+1) where N is the interval(window size)
# In this case we configure the window to be 10s. This way if we have a huge 1s spike in traffic,
Expand Down Expand Up @@ -40,11 +41,17 @@ def enable_counters():
db.connect()
default_enabled_counters = ['PORT', 'RIF', 'QUEUE', 'PFCWD', 'PG_WATERMARK', 'PG_DROP',
'QUEUE_WATERMARK', 'BUFFER_POOL_WATERMARK', 'PORT_BUFFER_DROP', 'ACL']

dpu_counters = ["ENI"]

# Enable those default counters
for key in default_enabled_counters:
enable_counter_group(db, key)

platform_info = device_info.get_platform_info(db)
if platform_info.get('switch_type') == 'dpu':
for key in dpu_counters:
enable_counter_group(db, key)

# Set FLEX_COUNTER_DELAY_STATUS to false for those non-default counters
keys = db.get_keys('FLEX_COUNTER_TABLE')
for key in keys:
Expand Down
4 changes: 4 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,10 @@
"TUNNEL": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": "10000"
},
"ENI": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": "10000"
}
},
"FLOW_COUNTER_ROUTE_PATTERN": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"DEBUG_COUNTER": {
"FLEX_COUNTER_STATUS": "enable"
},
"ENI": {
"FLEX_COUNTER_STATUS": "enable",
"POLL_INTERVAL": 10000
},
"PFCWD": {
"FLEX_COUNTER_STATUS": "enable"
},
Expand Down
13 changes: 13 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 @@ -68,6 +68,19 @@ module sonic-flex_counter {
}
}

container ENI {
/* ENI_STAT_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
leaf POLL_INTERVAL {
type poll_interval;
}
}

container PFCWD {
/* PFC_WD_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
Expand Down
Loading