DISPatch

BCM Dispatch control.

DISPatch

Shortest form: disp.

Low-level control of the BCM API dispatch layer, the layer that routes API calls to a unit’s driver, plus a few API test helpers. With no argument it runs show. Sub-commands must be spelt out in full (any case). Numbers accept the shell’s formats (0x, 0, 0b prefixes).

The built-in help is out of date: attreg, attunreg and cparse are listed but not available (they return the usage), while maxframe, jam, pause_addr, custom_reg, custom_stat, custom_stattime and stattime work but are not listed.

show and find are read-only, and so are maxframe, jam and pause_addr without a value. Everything else changes BCM state behind the SAI’s back; attach and detach replace or remove the unit.

Hardware-validated

drivshell> dispatch
unit 0: dispatch esw, - unit 0 chip 14e4.b870.1 caps 0x100d
dispatch show

One line per BCM unit: dispatch type, subtype, remote unit, chip vendor/device/revision and capability flags. Read-only.

Hardware-validated

drivshell> dispatch show
unit 0: dispatch esw, - unit 0 chip 14e4.b870.1 caps 0x100d
dispatch attach <unit> <type> <dunit> [<subtype>]

Attach a BCM unit of the given dispatch type (for example esw). <unit> -1 picks a free unit number and prints [unit N attached].

Unvalidated

drivshell> dispatch attach -1 esw 0
dispatch detach <unit>

Detach a BCM unit. Detaching unit 0 under SONiC breaks syncd.

Unvalidated

drivshell> dispatch detach 1
dispatch find <type> <dunit> [<subtype>]

Print [unit N found] for the BCM unit with this dispatch type and remote unit. Read-only.

Hardware-validated

drivshell> dispatch find esw 0
[unit 0 found]
dispatch init_check <unit>

Check whether the unit is initialised. The result is thrown away: the command prints nothing and always succeeds, so it tells you nothing.

Hardware-validated

drivshell> dispatch init_check 0
dispatch vcreate <unit> <vid>

Create a VLAN directly through the BCM API. vdestroy <unit> <vid> destroys one. vtime <count> <unit> <vid> repeats the create <count> times and prints <n> api calls in <us> usec (<us> usec/call). The SAI does not know about VLANs made this way.

Unvalidated

drivshell> dispatch vcreate 0 4000
dispatch linkreg <unit>

Register a callback that prints every link change on the console; linkunreg removes it. l2reg/l2unreg do the same for L2 address changes, which can be very chatty on a busy switch.

Unvalidated

drivshell> dispatch linkreg 0
dispatch maxframe <unit> <port> [<size>]

Without <size>, print the port’s maximum frame size; with it, set the size. Not in the built-in help. The other unlisted helpers are jam <unit> <port> [<enable>], pause_addr <unit> <port> [<mac>], custom_reg <unit>, custom_stat <unit> <port>, custom_stattime <count> <unit> <port> and stattime <count> <unit> <port>.

Unvalidated

drivshell> dispatch maxframe 0 1

Built-in help

dispatch show: list attached bcm units
dispatch attach unit type unit: attach bcm unit
dispatch detach unit: detach bcm unit
dispatch find type unit [subtype]: find matching bcm unit
dispatch vcreate unit vid: bcm_vlan_create(unit, vid)
dispatch vdestroy unit vid: bcm_vlan_destroy(unit, vid)
dispatch vtime count unit vid: time count calls to vcreate
dispatch linkreg unit: register for link changes
dispatch linkunreg unit: unregister for link changes
dispatch l2reg unit: register for l2 changes
dispatch l2unreg unit: unregister for l2 changes
dispatch init_check: check if device was initialized

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), BCM_SDK命令, 交换芯片Helix4 L2 L3功能验证.