LINKscan
Configure/Display link scanning
- LINKscan
Shortest form:
link.Show or configure link scanning: which ports have their link state polled by software, which by hardware, and the software polling interval. When linkscan sees a link change it updates the MAC (speed, duplex, pause) and notifies the SDK’s link callbacks. On SONiC this is how
syncdlearns that a port went up or down, so changing linkscan from the shell changes what SONiC sees.With no argument,
linkscanprints the current state:Linkscan enabled, the software polling interval in microseconds, and the software, hardware and disabled port bitmaps; orLinkscan disabled.Otherwise it takes these keys and at most one bare word:
SwPortBitMap=<pbmp>: ports scanned by software;HwPortBitMap=<pbmp>: ports scanned by hardware;Force=<pbmp>: make linkscan process these ports once, even if their state did not change;Interval=<usec>: software polling interval; 0 turns linkscan off;on,enableoryes;off,disableorno; or a plain number, taken as the interval.
Port bitmaps are described in Ports and port bitmaps. The current software and hardware sets are the defaults, so giving only
SwPortBitMapkeeps the hardware set. Ports in neither set are not scanned. A port in both sets is an error (Same port can't use both software and hardware linkscan). The default interval is thebcm_linkscan_intervalconfiguration variable, 250000 µs if unset.onrestores the interval used before the lastoff.On Trident 3, hardware linkscan runs as firmware on the switch’s built-in M0 microcontroller, which also drives the front-panel LEDs.
linkscan onstarts that firmware;linkscan offon its own stops it.SONiC uses software linkscan. On a SONiC switch the state shows
Linkscan enabled, an interval of 250000 µs, everyceandxeport in the software bitmap andnonein the hardware and disabled bitmaps. Each bitmap is printed as a long hexadecimal number followed by the port types it contains (: ce,xeor: none).The built-in help shows
FORCE=; the shell actually acceptsForce=abbreviated tof=. The help does not mention theenable/yes,disable/nosynonyms or the plain-number interval. PRBS testing on Broadcom (SONiC) — prbs_broadcom.md + README turns linkscan off around PRBS tests on another Broadcom SONiC switch.Showing the state is safe. Everything else changes linkscan behind SONiC’s back.
Warning
With linkscan off, or a port removed from both sets, SONiC no longer learns about link changes on those ports and its interface status goes stale.
linkscan offalso stops the M0 firmware, so the front-panel LEDs may stop updating. Restore the previous settings afterwards.Hardware-validated — Show the linkscan state
drivshell> linkscan LINKscan: Linkscan enabled LINKscan: Software polling interval: 250000 usec LINKscan: Software Port BitMap 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000888888888888888c2222222222223e22: ce,xe LINKscan: Hardware Port BitMap 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000: none LINKscan: Disabled Port BitMap 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000: none
Unvalidated — Software linkscan on two ports every 100 ms, hardware linkscan on none
drivshell> linkscan SwPortBitMap=ce0,ce1 HwPortBitMap=none Interval=100000- LINKscan on
Turn linkscan on with the interval used before the last
off(or the default).enableandyesdo the same; all three must be typed in full. On Trident 3 this also starts the M0 linkscan/LED firmware. If the interval would be 0 it printsWARNING: Cannot enable Linkscan if the polling interval is zero.Unvalidated
drivshell> linkscan on
- LINKscan off
Turn linkscan off and remember the interval for a later
on.disableandnodo the same. Whenoffis the only word, it also stops the M0 firmware.Warning
SONiC stops receiving link changes for every port until linkscan is turned back on.
Unvalidated
drivshell> linkscan off
Built-in help
Parameters: [SwPortBitMap=<pbmp>] [HwPortBitMap=<pbmp>] [Interval=<usec>] [FORCE=<pbmp>] [on] [off] With no arguments, displays the linkscan status for all ports. Enables software linkscan on ports specified by SwPortBitMap. Enables hardware linkscan on ports specified by HwPortBitMap. Disables linkscan on all other ports. Interval specifies non-default linkscan interval for software. Note: With linkscan disabled, autonegotiated ports will NOT have the MACs updated with speed/duplex.. FORCE=<pbmp> requests linkscan to update ports once even if link status did not change.Further reading
SDK-6.5.20 HSDK Getting Started Guide (GS-SDK6520-R), plus SDK-6.5.20/21/22 Release Notes (RN-SDK65xx-R), OpenBCM sdk-6.5.27/rc: rc.soc, config.bcm, td3_sanity.soc, cmd_td3_tr514_lr.soc, tr51/tr517_bcm56870_a0.soc, bcm_diag_info.soc …, BCM_SDK命令, PRBS testing on Broadcom (SONiC) — prbs_broadcom.md + README.