Modreg
Read/modify/write register
- Modreg
Shortest form:
m.Change fields of a register: read it, set the named fields, write it back. Fields you do not name keep their value.
Warning
This writes the hardware behind SONiC’s back (see
Setreg).Grammar:
modreg [nocache] <REGISTER> <FIELD>=<VALUE>[,<FIELD>=<VALUE>...]
Only internal (
SOC) registers can be modified; a register type is not accepted, and a plain number instead ofFIELD=VALUEshows the usage.nocachewrites only the hardware, not the SDK’s register cache.Unvalidated — Stop one port’s MAC from receiving (the link stays up)
drivshell> modreg CLMAC_CTRL.ce0 RX_EN=0Unvalidated
drivshell> modreg nocache CLMAC_CTRL.ce0 RX_EN=1Built-in help
Parameters: [nocache] <REGISTER> <FIELD>=<VALUE>[,...] [nocache] if nocache is specified, just update H/W data, skip cache. <REGISTER> is SOC register symbolic name. <FIELD>=<VALUE>[,...] is a list of fields to affect, for example: L3_ENA=0,CPU_PRI=1. Fields not specified in the list are left unaffected. For a list of register types, use "dump".Further reading