Write

Write entry(s) into a table

Write

Shortest form: w.

Write one or more table entries by index.

Warning

This writes the hardware behind SONiC’s back; the SDK and SAI do not see the change. Writing a hashed table such as L2X at an index bypasses the hash: the entry may never be found, or may hide another one. Use Insert for hashed tables.

Grammar:

write [idx_phy] [nocache] [pipe0|pipe1] [nocheck_mem_mode]
      [<VIEW>:]<TABLE>[.<COPY>] <INDEX> <COUNT> { <DW0> .. <DWn> | <FIELD>=<VALUE>[,...] }

The leading keywords must be typed in full, in this order. <COUNT> is required: the same entry is written to <COUNT> consecutive indices. With fields, the entry starts from zero, so every field you do not name is cleared; use MODify to change single fields. With raw words, give as many as the entry has (listmem shows the size). nocache writes only the hardware, not the SDK’s cached copy; pipe0/pipe1 write one pipeline’s copy. Read-only tables are refused (Error: Table <t> is read-only). The built-in help mentions only nocheck_mem_mode of the leading keywords.

Unvalidated — Overwrite one entry (all other fields become 0): invalidates VLAN 4094’s egress entry

drivshell> write EGR_VLAN 4094 1 VALID=0

Unvalidated — Raw words to one pipeline’s copy, bypassing the software cache

drivshell> write nocache pipe0 IFP_TCAM_WIDE 0 1 <DW0> <DW1> ...

Built-in help

Parameters: <TABLE>[.<COPY>] <ENTRY> <ENTRYCOUNT>
            { <DW0> .. <DWN> | <FIELD>=<VALUE>[,...] }
    If nocheck_mem_mode is specified, checking of unique_global mode, slice_mode will be skipped
    Number of <DW> must be a multiple of table entry size.
    Writes entry(s) into table index(es).

Further reading

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命令的使用.pdf, bcm cmd.