xmem

xmem r addr: read 4 bytes from address xmem w addr data: write 4 bytes data to address

xmem

Added to the shell at runtime rather than built in.

Read or write 4 bytes at an address in the syncd process’s own virtual memory. This is not device memory.

xmem r <addr> prints 0x<addr>: <8 hex digits>. xmem w <addr> <data> stores <data>. Numbers use the shell’s usual integer syntax. The address is used as a 32-bit pointer, so only the low 4 GiB of the 64-bit syncd process can be reached. Any other first word prints the usage and fails.

Warning

Reading or writing an unmapped address crashes syncd, and a write can corrupt it silently. Do not use xmem on a production switch.

On SONiC, xmem is most likely not available at all: typing it should give Unknown command: xmem. It is registered only when the classic SDK shell starts, and SONiC starts the SAI’s drivshell> front-end instead (see Accessing the shell).

Unvalidated

drivshell> xmem r <addr>

Built-in help

xmem r addr: read 4 bytes from address
xmem w addr data: write 4 bytes data to address

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).