You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/cpu_queues_stats.md
+78-9Lines changed: 78 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Network switches and routers typically have one port connected to the CPU (where
4
4
5
5
The knowledge of various queue statistics help us identify the current health and reason for any packet drops. SONiC already has commands to examine port and queue statistics associated with front panel ports. The same is extended to examine the CPU queue stats. The watermark commands can also be extended to display the buffer utilization associated with these CPU queues (not included in this HLD).
6
6
7
-
For example the command *show queue counters <port-name>*which displays the below given statistics starts to display CPU queue statistics as well.
7
+
The command *show queue counters <port-name>* displays the below given statistics for a given front panel port.
8
8
9
9
```
10
10
root@sonic:/home/admin# show queue counters Ethernet0
@@ -39,7 +39,7 @@ root@sonic:/home/admin# show queue counters CPU
39
39
Port doesn't exist! CPU
40
40
```
41
41
42
-
The proposed changes make the command return the actual supported CPU queues and its stats.
42
+
The proposed changes make the command *show queue counters CPU*return the actual supported CPU queues and its stats.
43
43
44
44
```
45
45
root@L15:/home/admin# show queue counters CPU
@@ -96,24 +96,93 @@ root@L15:/home/admin# show queue counters CPU
96
96
```
97
97
98
98
99
-
The following COUNTER_DB maps include details for the CPU port and queues.
99
+
SONiC DB changes:
100
+
The following COUNTER_DB maps are changed to include details for the CPU port and its queues.
101
+
```
100
102
COUNTERS_PORT_NAME_MAP
101
103
COUNTERS_QUEUE_NAME_MAP
102
104
COUNTERS_QUEUE_PORT_MAP
103
105
COUNTERS_QUEUE_TYPE_MAP
104
106
COUNTERS_QUEUE_INDEX_MAP
107
+
```
105
108
106
109
Port and queue counters:
107
-
COUNTERS:oid:<port-oid>
108
-
COUNTERS:oid:<queue-oid>
110
+
```
111
+
COUNTERS:oid:<portOid>
112
+
COUNTERS:oid:<queueOid>
113
+
```
109
114
115
+
Code changes:
116
+
Minor code changes are made on *sonic-swss* repo to fetch the supported queues on CPU port and update the flex counters-db maps to include CPU port and its queues.
117
+
Single line changes are made to *sonic-py-swsssdk*, *sonic-snmpagent* and *sonic-utilities* repos to ignore the newly added CPU port while iterating over the front panel ports(*COUNTERS_PORT_NAME_MAP*).
118
+
*sonic-sairedis* repo changes are made to enable cpu queues on vslib.
110
119
120
+
SAI calls:
121
+
SAI API *get_port_attribute()* with attribute *SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES* is called to fetch the number of CPU queues supported by switch.
122
+
SAI API *get_port_attribute()* with attribute *SAI_PORT_ATTR_QOS_QUEUE_LIST* to fetch the CPU queue list.
111
123
112
-
Minor code changes are made on *sonic-swss* repo to fetch the supported queues on CPU port and update the flex counters-db maps to include CPU port and its queues. Single line changes were made to *sonic-py-swsssdk*, *sonic-snmpagent* and *sonic-utilities* repos to ignore the newly added CPU port while iterating over the front panel ports. *sonic-sairedis* repo changes are made to enable cpu queues on vslib.
113
-
Syncd periodically fetches the CPU port stats, CPU queues stats along with other flex counter stats and updates the counters-DB.
124
+
Flex counters:
125
+
Along with other flex counter stats, Syncd periodically fetches the CPU port and queue stats to update the counters-DB.
114
126
115
-
SAI calls:
116
-
get_port_attribute() API with attribute *SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES* to fetch the number of CPU queues supported by switch and *SAI_PORT_ATTR_QOS_QUEUE_LIST* to fetch the list of CPU queues.
0 commit comments