Skip to content

Commit 15a59c9

Browse files
vdahiya12isabelmsft
authored andcommitted
[show][muxcable] add some new commands health, reset-cause, queue_info support for muxcable (sonic-net#2414)
This PR adds the support for adding some utility commands for muxacble This includes commands for health, operationtime, queueinfo, resetcause vdahiya@sonic:~$ show mux health Ethernet4 PORT ATTR HEALTH --------- --------------- -------- Ethernet4 health_check Ok vdahiya@sonic:~$ show mux health Ethernet4 --json { "health_check": "Ok" } vdahiya@sonic:~$ show mux operation Ethernet4 --json { "operation_time": "22:22" } vdahiya@sonic:~$ show mux operation Ethernet4 PORT ATTR OPERATION_TIME --------- -------------- ---------------- Ethernet4 operation_time 22:22 vdahiya@sonic:~$ vdahiya@sonic:~$ show mux resetcause Ethernet4 PORT ATTR RESETCAUSE --------- ----------- ------------ Ethernet4 reset_cause 0 vdahiya@sonic:~$ show mux resetcause Ethernet4 --json { "reset_cause": "0" } vdahiya@sonic:~$ show mux queueinfo Ethernet4 --json { "Remote": "{'VSC': {'r_ptr': 0, 'w_ptr': 0, 'total_count': 0, 'free_count': 0, 'buff_addr': 0, 'node_size': 0}, 'UART1': {'r_ptr': 0, 'w_ptr': 0, 'total_count': 0, 'free_count': 0, 'buff_addr': 209870, 'node_size': 1682183}, 'UART2': {'r_ptr': 13262, 'w_ptr': 3, 'total_count': 0, 'free_count': 0, 'buff_addr': 12, 'node_size': 0}}", "Local": "{'VSC': {'r_ptr': 0, 'w_ptr': 0, 'total_count': 0, 'free_count': 0, 'buff_addr': 0, 'node_size': 0}, 'UART1': {'r_ptr': 0, 'w_ptr': 0, 'total_count': 0, 'free_count': 0, 'buff_addr': 209870, 'node_size': 1682183}, 'UART2': {'r_ptr': 13262, 'w_ptr': 3, 'total_count': 0, 'free_count': 0, 'buff_addr': 12, 'node_size': 0}}" }
1 parent 07675fe commit 15a59c9

3 files changed

Lines changed: 503 additions & 14 deletions

File tree

doc/Command-Reference.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6126,6 +6126,154 @@ This command displays the eye info in mv(milli volts) of the port user provides
61266126
632 622
61276127
```
61286128
6129+
6130+
**show muxcable health <port>**
6131+
6132+
This command displays the hardware health of the Y-cable which are connected to muxcable. The resultant table or json output will show the current hadrware health of the cable as Ok, Not Ok, Unknown.
6133+
6134+
- Usage:
6135+
```
6136+
show muxcable health [OPTIONS] [PORT]
6137+
```
6138+
6139+
While displaying the muxcable health, users need to provide the following fields
6140+
6141+
- PORT required - Port name should be a valid port
6142+
- --json optional - -- option to display the result in json format. By default output will be in tabular format.
6143+
6144+
-Ok means the cable is healthy
6145+
6146+
in order to detemine whether the health of the cable is Ok
6147+
the following are checked
6148+
- the vendor name is correct able to be read
6149+
- the FW is correctly loaded for SerDes by reading the appropriate register val
6150+
- the Counters for UART are displaying healthy status
6151+
i.e Error Counters , retry Counters for UART or internal xfer protocols are below a threshold
6152+
6153+
6154+
- Example:
6155+
```
6156+
admin@sonic:~$ show muxcable health Ethernet4
6157+
PORT ATTR HEALTH
6158+
--------- ------ --------
6159+
Ethernet4 health Ok
6160+
```
6161+
```
6162+
admin@sonic:~$ show muxcable health Ethernet4 --json
6163+
```
6164+
```json
6165+
{
6166+
"health": "Ok"
6167+
}
6168+
6169+
```
6170+
6171+
6172+
**show muxcable queueinfo <port>**
6173+
6174+
This command displays the queue info of the Y-cable which are connected to muxcable. The resultant table or json output will show the queue info in terms transactions for the UART stats in particular currently relevant to the MCU of the cable.
6175+
6176+
- Usage:
6177+
```
6178+
show muxcable queueinfo [OPTIONS] [PORT]
6179+
```
6180+
6181+
While displaying the muxcable queueinfo, users need to provide the following fields
6182+
6183+
- PORT required - Port name should be a valid port
6184+
- --json optional - -- option to display the result in json format. By default output will be in tabular format.
6185+
6186+
the result will be displayed like this, each item in the dictionary shows the health of the attribute in the queue
6187+
```
6188+
"{'VSC': {'r_ptr': 0, 'w_ptr': 0, 'total_count': 0, 'free_count': 0, 'buff_addr': 0, 'node_size': 0}, 'UART1': {'r_ptr': 0, 'w_ptr': 0, 'total_count': 0, 'free_count': 0, 'buff_addr': 209870, 'node_size': 1682183}, 'UART2': {'r_ptr': 13262, 'w_ptr': 3, 'total_count': 0, 'free_count': 0, 'buff_addr': 12, 'node_size': 0}
6189+
```
6190+
6191+
- Example:
6192+
```
6193+
admin@sonic:~$ show muxcable queueinfo Ethernet0
6194+
PORT ATTR VALUE
6195+
--------- ---------- -------
6196+
Ethernet0 uart_stat1 2
6197+
Ethernet0 uart_stat2 1
6198+
```
6199+
```
6200+
admin@sonic:~$ show muxcable queueinfo Ethernet4 --json
6201+
```
6202+
```json
6203+
{
6204+
"uart_stat1": "2",
6205+
"uart_stat2": "1",
6206+
6207+
}
6208+
```
6209+
6210+
**show muxcable operationtime <port>**
6211+
6212+
This command displays the operationtime of the Y-cable which are connected to muxcable. The resultant table or json output will show the current operation time of the cable as `hh:mm:ss` format. Operation time means the time since the last time the reseated/reset of the cable is done, and the time would be in the format specified
6213+
6214+
- Usage:
6215+
```
6216+
show muxcable operationtime [OPTIONS] [PORT]
6217+
```
6218+
6219+
While displaying the muxcable operationtime, users need to provide the following fields
6220+
6221+
- PORT required - Port name should be a valid port
6222+
- --json optional - -- option to display the result in json format. By default output will be in tabular format.
6223+
6224+
6225+
- Example:
6226+
```
6227+
admin@sonic:~$ show muxcable operationtime Ethernet4
6228+
PORT ATTR OPERATION_TIME
6229+
--------- -------------- ----------------
6230+
Ethernet4 operation_time 00:22:22
6231+
```
6232+
```
6233+
admin@sonic:~$ show muxcable operationtime Ethernet4 --json
6234+
```
6235+
```json
6236+
{
6237+
"operation_time": "00:22:22"
6238+
}
6239+
```
6240+
6241+
**show muxcable resetcause <port>**
6242+
6243+
This command displays the resetcause of the Y-cable which are connected to muxcable. The resultant table or json output will show the most recent reset cause of the cable as string format.
6244+
6245+
- Usage:
6246+
```
6247+
show muxcable resetcause [OPTIONS] [PORT]
6248+
```
6249+
6250+
While displaying the muxcable resetcause, users need to provide the following fields
6251+
6252+
- PORT required - Port name should be a valid port
6253+
- --json optional - -- option to display the result in json format. By default output will be in tabular format.
6254+
6255+
the reset cause only records NIC MCU reset status. The NIC MCU will automatically broadcast the reset cause status to each TORs, corresponding values returned
6256+
display cold reset if the last reset is cold reset (ex. HW/SW reset, power reset the cable, or reboot the NIC server)
6257+
display warm reset if the last reset is warm reset (ex. sudo config mux firmware activate....)
6258+
the value is persistent, no clear on read
6259+
6260+
- Example:
6261+
```
6262+
admin@sonic:~$ show muxcable resetcause Ethernet4
6263+
PORT ATTR RESETCAUSE
6264+
--------- ----------- ------------
6265+
Ethernet4 reset_cause warm reset
6266+
```
6267+
```
6268+
admin@sonic:~$ show muxcable resetcause Ethernet4 --json
6269+
```
6270+
```json
6271+
{
6272+
"reset_cause": "warm reset"
6273+
}
6274+
```
6275+
6276+
61296277
### Muxcable Config commands
61306278
61316279

0 commit comments

Comments
 (0)