Introduction

The diag shell is part of the Broadcom switch SDK. Its commands fall into three groups:

  • API commands — l2, l3, vlan, port, mirror, fp and others call the SDK API, the same API SONiC uses through the SAI.

  • Chip access commands — getreg, modreg, dump, listmem, write and others read and write registers and tables directly, bypassing the SDK.

  • Shell commands — help, echo, set, rcload, cint and others control the shell itself.

On SONiC, the SDK runs inside syncd, and so does the shell. The Broadcom SAI adds a few commands of its own, such as BCMSAI and bsv. Some commands that look similar belong to SONiC rather than to the shell: for example crm show resources all is run from the switch’s Linux prompt. See Accessing the shell for how to reach the shell.

Warning

The shell has unrestricted access to the ASIC. Commands that change state do so behind SONiC’s back: orchagent and syncd do not notice, and recovering may need a syncd restart or a reboot. On a production switch, stick to commands that only display information.

Terms and abbreviations used in this reference are explained in the Glossary.