PortMod
Portmod Diagnostics
- PortMod
Shortest form:
pm.PortMod (port module) diagnostics for the layer that drives the MAC and SerDes of each Port Macro (PM). Use it to see how logical ports map to Port Macros, SerDes cores and physical lanes, to read link, auto-negotiation and flow-control state, and to run PRBS and eye scans on a lane.
Sub-command names must be typed in full:
portmod infoworks,portmod infdoes not. An unknown or missing sub-command prints the full usage. When a sub-command is missing required arguments it prints its own short usage (acommand:andexample:block) and fails.Arguments are
key=valuepairs.port=<n>is the logical port number, not a port name: writeport=1, notport=xe0. Useshow pmaporportmod info portto find the numbers. A number that is not a port of the unit printsERROR: Port <n> is not valid for unit <unit>.usage,info,status,fc,autoneg,core,phyandregdumponly read state. On a SONiC Trident 3 switchinfo,fcandautoneggive full answers;status,core,phyandregdumpare partly or wholly unimplemented for the Trident 3 SerDes driver (details under each sub-command).prbs setstops traffic on the port;prbs getandeyescankeep the shell busy while they run.Hardware-validated
drivshell> portmod usage PortMod Diagnostic Pack Usage: ------------------------------ command: info pm=<pm-id> -display the the detailed information of the pm-id specific PM. info pm -display the summary information of all PMs. info port=<port-id> -display the the detailed information of the port-id specific port. info port -display the summary information of all ports. example: portmod info pm=0 portmod info pm portmod info port=1 portmod info port command: status port=<port-id> -display the the detailed status of the port-id specific port. status port -display the summary status of all ports. example: portmod status port=1 portmod status port command: fc port=<port-id> example: portmod fc port=1 command: autoneg port=<port-id> example: portmod autoneg port=1 command: core port=<port-id> example: portmod core port=1 ...
- portmod usage
Print the full PortMod usage text. Read-only.
Hardware-validated
drivshell> portmod usage PortMod Diagnostic Pack Usage: ------------------------------ command: info pm=<pm-id> -display the the detailed information of the pm-id specific PM. info pm -display the summary information of all PMs. info port=<port-id> -display the the detailed information of the port-id specific port. info port -display the summary information of all ports. example: portmod info pm=0 portmod info pm portmod info port=1 portmod info port command: status port=<port-id> -display the the detailed status of the port-id specific port. status port -display the summary status of all ports. example: portmod status port=1 portmod status port command: fc port=<port-id> example: portmod fc port=1 command: autoneg port=<port-id> example: portmod autoneg port=1 command: core port=<port-id> example: portmod core port=1 ...
- portmod info pm
Show which ports are mapped to which port macros, SerDes cores and physical lanes. The table has the columns
PM id,type,physandlogic ports: one row per Port Macro with its core type, physical lane range and attached logical ports (orno port attached). Read-only.On a 32-port Trident 3 switch, PM 00 is an empty
PmNullplaceholder, PMs 01–32 are thePm4x25(Falcon) macros with one 100G port or four 10G ports each, and PM 33 is thePm4x10(Merlin) macro of the management port.Hardware-validated
drivshell> portmod info pm PM id | type | phys | logic ports ------------------------------------------------ 00 | PmNull | 01 | Pm4x25 | 001 - 004 |001 02 | Pm4x25 | 005 - 008 |005 03 | Pm4x25 | 009 - 012 |009 - 012 04 | Pm4x25 | 013 - 016 |013 05 | Pm4x25 | 017 - 020 |017 06 | Pm4x25 | 021 - 024 |021 07 | Pm4x25 | 025 - 028 |025 08 | Pm4x25 | 029 - 032 |029 09 | Pm4x25 | 033 - 036 |033 10 | Pm4x25 | 037 - 040 |037 11 | Pm4x25 | 041 - 044 |041 12 | Pm4x25 | 045 - 048 |045 13 | Pm4x25 | 049 - 052 |049 14 | Pm4x25 | 053 - 056 |053 15 | Pm4x25 | 057 - 060 |057 16 | Pm4x25 | 061 - 064 |061 17 | Pm4x25 | 065 - 068 |067 18 | Pm4x25 | 069 - 072 |071 19 | Pm4x25 | 073 - 076 |075 20 | Pm4x25 | 077 - 080 |079 21 | Pm4x25 | 081 - 084 |083 22 | Pm4x25 | 085 - 088 |087 23 | Pm4x25 | 089 - 092 |091 24 | Pm4x25 | 093 - 096 |095 25 | Pm4x25 | 097 - 100 |099 26 | Pm4x25 | 101 - 104 |103 27 | Pm4x25 | 105 - 108 |107 28 | Pm4x25 | 109 - 112 |111 29 | Pm4x25 | 113 - 116 |115 30 | Pm4x25 | 117 - 120 |119 31 | Pm4x25 | 121 - 124 |123 32 | Pm4x25 | 125 - 128 |127 33 | Pm4x10 | 129 - 130 |066
- portmod info port
Summary of every logical port, with the columns
port,alias,PM id,port type,physandmac. Read-only.Hardware-validated
drivshell> portmod info port port | alias | PM id | port type | phys | mac -------------------------------------------------- 001 | | 01 | CAUI4 | 001 - 004 | CLMAC 005 | | 02 | CAUI4 | 005 - 008 | CLMAC 009 | | 03 | XFI | 009 | CLMAC 010 | | 03 | XFI | 010 | CLMAC 011 | | 03 | XFI | 011 | CLMAC 012 | | 03 | XFI | 012 | CLMAC 013 | | 04 | CAUI4 | 013 - 016 | CLMAC 017 | | 05 | CAUI4 | 017 - 020 | CLMAC 021 | | 06 | CAUI4 | 021 - 024 | CLMAC 025 | | 07 | CAUI4 | 025 - 028 | CLMAC 029 | | 08 | CAUI4 | 029 - 032 | CLMAC 033 | | 09 | CAUI4 | 033 - 036 | CLMAC 037 | | 10 | CAUI4 | 037 - 040 | CLMAC 041 | | 11 | CAUI4 | 041 - 044 | CLMAC 045 | | 12 | CAUI4 | 045 - 048 | CLMAC 049 | | 13 | CAUI4 | 049 - 052 | CLMAC 053 | | 14 | CAUI4 | 053 - 056 | CLMAC 057 | | 15 | CAUI4 | 057 - 060 | CLMAC 061 | | 16 | CAUI4 | 061 - 064 | CLMAC 066 | | 33 | XFI | 129 | XLMAC 067 | | 17 | CAUI4 | 065 - 068 | CLMAC 071 | | 18 | CAUI4 | 069 - 072 | CLMAC 075 | | 19 | CAUI4 | 073 - 076 | CLMAC 079 | | 20 | CAUI4 | 077 - 080 | CLMAC 083 | | 21 | CAUI4 | 081 - 084 | CLMAC 087 | | 22 | CAUI4 | 085 - 088 | CLMAC 091 | | 23 | CAUI4 | 089 - 092 | CLMAC 095 | | 24 | CAUI4 | 093 - 096 | CLMAC 099 | | 25 | CAUI4 | 097 - 100 | CLMAC 103 | | 26 | CAUI4 | 101 - 104 | CLMAC 107 | | 27 | CAUI4 | 105 - 108 | CLMAC 111 | | 28 | CAUI4 | 109 - 112 | CLMAC 115 | | 29 | CAUI4 | 113 - 116 | CLMAC 119 | | 30 | CAUI4 | 117 - 120 | CLMAC 123 | | 31 | CAUI4 | 121 - 124 | CLMAC 127 | | 32 | CAUI4 | 125 - 128 | CLMAC
- portmod info [pm=<pm_id> | port=<port_id>]
Details of one Port Macro or one port. For a Port Macro:
PM ID,PM Type,Phys,Logical Ports Attachedand the TX/RX lane maps. For a port:Port,Parent PM,Phys,Mac, the TX/RX polarity, the internal and external PHY addresses andCore Mode. If both keys are given,portis used. Read-only.pm=0is the empty placeholder macro and shows onlyPmNullwith physical lane2048and no attached ports. Ask for a real macro or a port to see the lane maps and PHY details:Hardware-validated — Details of logical port 1 (ce0)
drivshell> portmod info port=1 Port: 001 Parent PM: 001 Phys: 001 - 004 Mac: CLMAC Polarity: TX:0, RX:0 Internal PHY Address: 129 External PHY Address: Not Attached Core Mode: Single
Hardware-validated
drivshell> portmod info pm=0 PM ID: 00 PM Type: PmNull Phys: 2048 - 2048 Logical Ports Attached: no
- portmod status port
Hardware status of every port, one row each, with the columns
Port,Intf type,Speed,Encoding,LINK,AN,LT(link training),LB(loopback),EN,FaultandPhys.Encodingnames the PCS and FEC mode, for example64B66B15TRSFEC. Read-only.On a SONiC Trident 3 switch the table has no data rows: for every port the encoding lookup fails and the command prints, in place of the row,
portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable(the two messages run together on one line). Usepsfor link, speed and autonegotiation state instead.Hardware-validated
drivshell> portmod status port Port | Intf type | Speed | Encoding | LINK | AN | LT | LB | EN | Fault | Phys | --------------------------------------------------------------------------------------------- portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable portmod_port_encoding_get isn't implemented for driver typeERROR: Getting port encoding failed: Feature unavailable
- portmod status port=<port_id>
Status of one port. Read-only. On a SONiC Trident 3 switch it prints only the port number, its parent Port Macro and its physical lanes (
Port: 001,Parent PM: 001,Phys:001 - 004), without the link and encoding columns of the summary.Hardware-validated
drivshell> portmod status port=1 Port: 001 Parent PM: 001 Phys:001 - 004
- portmod fc port=<port_id>
Show the port’s flow-control settings: the PFC configuration (type, opcode, classes, destination OUI, rxpass), the PFC control (receive and transmit enable, statistics, force XON, refresh and XOFF timers) and the LLFC control (receive and transmit enable, CRC ignore, in-IPG-only). Read-only.
Hardware-validated
drivshell> portmod fc port=1 PFC config type: 34824 PFC config opcode: 257 PFC config classes: 8 PFC config da_oui: 98498 PFC config da_nonoui: 1 PFC config rxpass: 0 PFC control rx_enable: 1 PFC control tx_enable: 0 PFC control stats_en: 1 PFC control force_xon: 0 PFC control refresh_timer: 0 PFC control xoff_timer: 65535 LLFC control rx_enable: 0 LLFC control tx_enable: 0 LLFC control crc_ignore: 0 LLFC control in_ipg_only: 0
- portmod autoneg port=<port_id>
Print three blocks of auto-negotiation abilities: what the port supports, what it advertises, and what the link partner advertised. Read-only.
Hardware-validated
drivshell> portmod autoneg port=1 ********************************************************** ****Auto-negociation local port supported ability********* ********************************************************** Half Duplex Speed: | Full Duplex Speed: |50GB|53GB|40GB|42GB|100GB| Pause: |PAUSE_TX|PAUSE_RX|PAUSE_ASYMM| Interface: |XGMII| Medium: |COPPER|FIBER|BACKPLANE| Loopback: |LB_MAC|LB_PHY| Flags: |AUTONEG| EEE: | ENCAP: |IEEE|HIGIG|HIGIG2| ********************************************************** ****Auto-negociation local port advertised ability******** ********************************************************** Half Duplex Speed: | Full Duplex Speed: |40GB|100GB| Pause: |PAUSE_TX|PAUSE_RX| Interface: | Medium: |BACKPLANE| Loopback: | Flags: | EEE: | ENCAP: | ********************************************************** ****Auto-negociation received ability from partner******** ********************************************************** Half Duplex Speed: | Full Duplex Speed: | Pause: | Interface: | Medium: |BACKPLANE| Loopback: | Flags: | EEE: | ENCAP: |
- portmod core port=<port_id>
Show the SerDes core that serves the port: its temperature, PLL range, firmware version and firmware CRC, each on a line such as
Port<n>(<name>): Core temperature is <n>. Read-only. On a Trident 3 the temperature (°C) and PLL range are real, but the firmware version and CRC read-1: the Falcon driver does not report them here. The microcode version is shown bydscofphy diag(UCODE_VER).Hardware-validated
drivshell> portmod core port=1 Port 1(ce0): Core temperature is 41 Port 1(ce0): Core pll range is 159 Port 1(ce0): Core firmware version is -1 Port 1(ce0): Core firmware crc is -1
- portmod phy port=<port_id> [phychain=<n>] [lane=<n>] [if=<sys | line>]
Dump the receive and transmit diagnostics of one SerDes lane as
PHY <field>: <n>lines: signal detect, receive lock, PPM offsets, PMD and OSR mode, VGA, DFE taps, slicer offsets, the eye margins measured by the SerDes firmware, the transmit FIR taps and more.phychainselects the PHY in the chain (default: the outermost one),lanedefaults to 0, andifselects the system or line side of an external PHY; any otherifvalue printsInterFace must be sys or line.The built-in help shows onlyport; the shell actually accepts all four keys. Read-only.On a SONiC Trident 3 switch every field of the example below read
0, including the transmit taps; usephy diag <port> dscfor lane diagnostics there.Hardware-validated
drivshell> portmod phy port=1 lane=0 PHY signal_detect: 0 PHY vga_bias_reduced: 0 PHY postc_metric: 0 PHY osr_mode: 0 PHY pmd_mode: 0 PHY rx_lock: 0 PHY rx_ppm: 0 PHY tx_ppm: 0 PHY k90_offset 0 PHY clkp1_offset: 0 PHY p1_lvl: 0 PHY m1_lvl: 0 PHY dfe1_dcd: 0 PHY dfe2_dcd: 0 PHY slicer_target: 0 PHY slicer_offset.offset_pe 0 PHY slicer_offset.offset_ze 0 PHY slicer_offset.offset_me 0 PHY slicer_offset.offset_po 0 PHY slicer_offset.offset_zo 0 PHY slicer_offset.offset_mo 0 PHY eyescan.heye_left: 0 PHY eyescan.heye_right: 0 PHY eyescan.veye_upper: 0 PHY eyescan.veye_lower: 0 PHY state_machine_status: 0 PHY link_time : 0 PHY pf_main : 0 PHY pf_hiz : 0 PHY pf_bst: 0 ...
- portmod prbs set port=<port_id> [mode=<phy | mac>] [polynomial=<n>] [invert=<bool>]
Start the PRBS generator and checker on the port.
The built-in help shows
Loopback=<true|false>; the shell actually rejects it withERROR: invalid option.mode=siormode=macselects MAC/PCS PRBS. Any other value, and nomodeat all, selects SerDes PRBS.Only
polynomialvalues 0 to 6 are distinct; larger values wrap around modulo 7.
Turn linkscan off for the port first, or linkscan may re-initialise the SerDes and the checker will not lock (PRBS testing on Broadcom (SONiC) — prbs_broadcom.md + README, written for other Broadcom chips).
Warning
The port carries no traffic while PRBS runs. SONiC is not told.
Unvalidated
drivshell> portmod prbs set port=1 mode=phy
- portmod prbs get port=<port_id> [mode=<phy | mac>] [interval=<sec>]
Wait
intervalseconds (default 0), then read the checker and printPort<n>(<name>): PRBS is [not ]currently locked!,Port<n>(<name>): PRBS is [not ]unlocked since last call!andPort<n>(<name>): PRBS has <n> errors count!. Use the samemodeas forset. Read-only; the shell is busy during the wait.Unvalidated
drivshell> portmod prbs get port=1 interval=10
- portmod prbs clear port=<port_id> [mode=<phy | mac>]
Turn the PRBS generator and checker off, so the port can carry traffic again. This changes SerDes state.
Unvalidated
drivshell> portmod prbs clear port=1
- portmod eyescan port=<port> mode=<mode> lane=<lane>
Measure and print an eye diagram for one SerDes lane. The full set of options is
port,ber,vertical_max,vertical_min,vertical_step,horizontal_max,horizontal_min,horizontal_step,sample_time,lane,unit,modeandif.modeisfastorlowBER; anything else printsMode must be fast or lowBER.ifissysorline, andunitselects the PHY in the chain. The built-in help does not showunit.sys_lane_maskis refused with a message to useif=sys lane=<lane>instead. The shell is busy while the scan runs, and the scan may disturb traffic on the lane.Unvalidated — First lane of logical port 5
drivshell> portmod eyescan port=5 mode=fast lane=0
- portmod regdump port=<port_id>
Dump all SerDes registers of the port’s lanes, for the internal PHY and for an external PHY if there is one. Without
portit printsERROR: please input port ID: port=<id>. Read-only. On a SONiC Trident 3 switch it fails for the internal SerDes withERROR: phy status dump Feature unavailableandERROR: Getting phy status failed: Internal error, followed by the SAI shell’sFailed to execute the diagnostic command. Error: Operation failed.Hardware-validated
drivshell> portmod regdump port=1 ERROR: phy status dump Feature unavailable ERROR: Getting phy status failed: Internal error Failed to execute the diagnostic command. Error: Operation failed.
Built-in help
portmod <options> usage -display detailed portmod diagnostic usage info port[=port-id] -display port detailed or summary SW information info pm[=pm_id]] -display pm detailed or summary SW information status port[=port-id] -display port detailed or summary HW status fc port=<port-id> -display PFC/LLFC information of the specific port autoneg port=<port-id> -display auto-negotiation ability of the specific port core port=<port-id> -display core information which the specific port belongs to phy port=<port-id> -display phy/lane information the specific port includes prbs set port=<port-id> [mode=<phy|mac> polynomial=<value> Loopback=<true|false> Invert=<value>] -set PRBS generator on the port-id specific port prbs get port=<port-id> -get internal checker on the port-id specific port prbs clear port=<port-id> -clear internal PRBS configuration on the port-id specific port eyescan port=<port-id> [vertical_max=<value> vertical_min=<value> vertical_step=<value> horizontal_max=<value> horizontal_min=<value> horizontal_step=<value> sample_time=<value> ber=<value> lane=<value> mode=<fast/lowBER>] -run eyescan test regdump port=<port-id -dump all registers of the sepecific portFurther reading
bcmsh.md (published as https://kamelnetworks.github.io/sonic/bcmsh.html), System Monitoring Command Reference for NCS 5500/540/560 – Traffic Monitoring Commands (show controllers fia diagshell).