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

[doc]: Stream Telemetry HLD #1795

Open
wants to merge 6 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
4 changes: 4 additions & 0 deletions doc/stream-telemetry/netlink_dma_channel.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions doc/stream-telemetry/sonic-stream-telemetry.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
module sonic-stream-telemetry {
yang-version 1.1;

namespace "http://github.com/sonic-net/sonic-stream-telemetry";

prefix sonic-stream-telemetry;

import sonic-port {
prefix port;
}

import sonic-buffer-pool {
prefix bpl;
}

import sonic-buffer-pg {
prefix bpg;
}

import sonic-buffer-queue {
prefix bql;
}

container sonic-stream-telemetry {
container STREAM_TELEMETRY_PROFILE {
description "STREAM_TELEMETRY_PROFILE part of config_db.json";
list STREAM_TELEMETRY_PROFILE_LIST {

key "name";

leaf name {
type string {
length 1..128;
}
}

leaf stream_state {
mandatory true;
type string {
pattern "enabled|disabled";
}
}

leaf poll_interval {
mandatory true;
description "The interval to poll counter, unit milliseconds.";
type uint32;
}

leaf chunk_size {
type uint32 {
range "1..4294967295";
}
default 1;
}

leaf cache_size {
type uint32;
default 0;
}
}
}

container STREAM_TELEMETRY_GROUP {
description "STREAM_TELEMETRY_GROUP part of config_db.json";
list STREAM_TELEMETRY_GROUP_LIST {
key "profile_name group_name";

leaf profile_name {
type leafref {
path "/sonic-stream-telemetry:sonic-stream-telemetry/STREAM_TELEMETRY_PROFILE/STREAM_TELEMETRY_PROFILE_LIST/name";
}
}

// The table name of config db
leaf group_name {
type enumeration {
enum PORT;
enum BUFFER_POOL;
enum BUFFER_PG;
enum BUFFER_QUEUE;
}
}

leaf-list object_names {
type string;
must "( ../group_name = 'PORT' and current() = /port:sonic-port/port:PORT/port:PORT_LIST/port:name )"
+ " or ( ../group_name = 'BUFFER_POOL' and current() = /bpl:sonic-buffer-pool/bpl:BUFFER_POOL/bpl:BUFFER_POOL_LIST/bpl:name )"
+ " or ( ../group_name = 'BUFFER_PG' and substring-before(current(), '|') = /bpg:sonic-buffer-pg/bpg:BUFFER_PG/bpg:BUFFER_PG_LIST/bpg:port and re-match(substring-after(current(), '|'), '[0-9]+') )"
+ " or ( ../group_name = 'BUFFER_QUEUE' and substring-before(current(), '|') = /bql:sonic-buffer-queue/bql:BUFFER_QUEUE/bql:BUFFER_QUEUE_LIST/bql:port and re-match(substring-after(current(), '|'), '[0-9]+') )";
}

must "count(object_names) > 0";

leaf-list object_counters {
type string;
must "( ../group_name = 'PORT' and re-match(current(), 'IF_IN_OCTETS|IF_IN_UCAST_PKTS|IF_IN_DISCARDS|IF_IN_ERRORS|IN_CURR_OCCUPANCY_BYTES|IF_OUT_OCTETS|IF_OUT_DISCARDS|IF_OUT_ERRORS|IF_OUT_UCAST_PKTS|OUT_CURR_OCCUPANCY_BYTES') )"
+ " or ( ../group_name = 'BUFFER_POOL' and re-match(current(), 'PACKETS|BYTES|DROPPED_PACKETS|CURR_OCCUPANCY_BYTES|WATERMARK_BYTES|WRED_ECN_MARKED_PACKETS') )"
+ " or ( ../group_name = 'BUFFER_PG' and re-match(current(), 'PACKETS|BYTES|CURR_OCCUPANCY_BYTES|WATERMARK_BYTES|XOFF_ROOM_CURR_OCCUPANCY_BYTES|XOFF_ROOM_WATERMARK_BYTES|DROPPED_PACKETS') )"
+ " or ( ../group_name = 'BUFFER_QUEUE' and re-match(current(), 'DROPPED_PACKETS|CURR_OCCUPANCY_BYTES|WATERMARK_BYTES|CURR_OCCUPANCY_BYTES|XOFF_ROOM_WATERMARK_BYTES') )";
}

}
}
}
}
Loading