Skip to content

Commit 1a7e3c3

Browse files
committed
[trim]: Handle review comments
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
1 parent 3032d05 commit 1a7e3c3

File tree

1 file changed

+48
-7
lines changed

1 file changed

+48
-7
lines changed

doc/packet_trimming/packet-trimming-design.md

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959

6060
| Rev | Date | Author | Description |
6161
|:---:|:----------:|:--------------:|:----------------|
62-
| 0.1 | 01/11/2024 | Nazarii Hnydyn | Initial version |
63-
| 0.2 | 07/04/2025 | Nazarii Hnydyn | Asymmetric DSCP |
64-
| 0.3 | 23/06/2025 | Nazarii Hnydyn | Drop counters |
62+
| 0.1 | 11/01/2024 | Nazarii Hnydyn | Initial version |
63+
| 0.2 | 04/07/2025 | Nazarii Hnydyn | Asymmetric DSCP |
64+
| 0.3 | 06/23/2025 | Nazarii Hnydyn | Drop counters |
6565

6666
## About this manual
6767

@@ -371,9 +371,11 @@ Flex counter group `switch` will be created to handle switch related statistics:
371371
* `SAI_SWITCH_STAT_TX_TRIM_PACKETS`
372372

373373
On NVidia platform `x86_64-nvidia_sn5640-r0` calculation of `SAI_PORT_STAT_DROPPED_TRIM_PACKETS`
374-
will be done using a dedicated LUA plugin.
374+
will be done using a dedicated LUA plugin. A registration of a new LUA plugin will be done
375+
using `port` flex counter group. This technique is relevant only for NVidia platforms.
375376

376-
A registration of a new LUA plugin will be done using `port` flex counter group.
377+
For a generic use case, the stats will be fetched by flex counter infra only
378+
if the relevant capabilities are supported and exposed by a vendor.
377379

378380
## 2.6 DB schema
379381

@@ -991,7 +993,7 @@ root@sonic:/home/admin# show queue counters Ethernet0 --all
991993
Ethernet0 UC0 N/A N/A N/A N/A N/A N/A N/A
992994
Ethernet0 UC1 N/A N/A 100 6400 100 50 50
993995
Ethernet0 UC2 N/A N/A N/A N/A N/A N/A N/A
994-
Ethernet0 UC3 100 6400 N/A N/A N/A N/A N/A
996+
Ethernet0 UC3 50 3200 N/A N/A N/A N/A N/A
995997
Ethernet0 UC4 N/A N/A N/A N/A N/A N/A N/A
996998
Ethernet0 UC5 N/A N/A N/A N/A N/A N/A N/A
997999
Ethernet0 UC6 N/A N/A N/A N/A N/A N/A N/A
@@ -1003,7 +1005,7 @@ root@sonic:/home/admin# queuestat -p Ethernet0 --all
10031005
Ethernet0 UC0 N/A N/A N/A N/A N/A N/A N/A
10041006
Ethernet0 UC1 N/A N/A 100 6400 100 50 50
10051007
Ethernet0 UC2 N/A N/A N/A N/A N/A N/A N/A
1006-
Ethernet0 UC3 100 6400 N/A N/A N/A N/A N/A
1008+
Ethernet0 UC3 50 3200 N/A N/A N/A N/A N/A
10071009
Ethernet0 UC4 N/A N/A N/A N/A N/A N/A N/A
10081010
Ethernet0 UC5 N/A N/A N/A N/A N/A N/A N/A
10091011
Ethernet0 UC6 N/A N/A N/A N/A N/A N/A N/A
@@ -1041,6 +1043,45 @@ TRIM_RULE TRIM_TABLE 999 100 6400
10411043

10421044
## 2.9 YANG model
10431045

1046+
Existing YANG model `sonic-flex_counter.yang` at `sonic-buildimage/src/sonic-yang-models/yang-models`
1047+
will be extended with a new schema in order to provide support for PT.
1048+
1049+
**Skeleton code:**
1050+
```yang
1051+
module sonic-flex_counter {
1052+
1053+
...
1054+
1055+
container sonic-flex_counter {
1056+
1057+
container FLEX_COUNTER_TABLE {
1058+
1059+
...
1060+
1061+
container SWITCH {
1062+
/* SWITCH_STAT_COUNTER_FLEX_COUNTER_GROUP */
1063+
leaf FLEX_COUNTER_STATUS {
1064+
type flex_status;
1065+
}
1066+
leaf FLEX_COUNTER_DELAY_STATUS {
1067+
type flex_delay_status;
1068+
}
1069+
leaf POLL_INTERVAL {
1070+
type poll_interval;
1071+
}
1072+
}
1073+
1074+
}
1075+
/* end of container FLEX_COUNTER_TABLE */
1076+
1077+
...
1078+
1079+
}
1080+
/* end of top level container */
1081+
}
1082+
/* end of module sonic-flex_counter */
1083+
```
1084+
10441085
Existing YANG model `sonic-buffer-profile.yang` at `sonic-buildimage/src/sonic-yang-models/yang-models`
10451086
will be extended with a new schema in order to provide support for PT.
10461087

0 commit comments

Comments
 (0)