L2MODE

Change ARL handling mode

L2MODE

Start, stop or re-time the SDK thread that scans the hardware L2 table and reports learned and aged MAC addresses to the rest of the software.

  • l2mode prints Current settings: and the interval in microseconds. A SONiC switch runs the scan every 3 seconds (Interval=3000000).

  • l2mode Interval=<usec> runs the scan at that interval. 0 stops it.

  • l2mode off stops the scan and remembers the interval.

  • l2mode on restarts the scan at the remembered interval.

On chips without a hashed L2 table it prints No L2X on this chip.

Warning

SONiC’s FDB (show mac) is likely fed by this thread. Stopping it may silently freeze SONiC’s MAC table while the hardware keeps learning. Restart it with l2mode on.

Public rc scripts run this command during bring-up (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 …).

Hardware-validated

drivshell> l2mode
Current settings:
     Interval=3000000

Unvalidated — Scan every 3 seconds (the value SONiC uses)

drivshell> l2mode Interval=3000000

Built-in help

Parameters: [on] [off] [Interval=<interval>]
    Starts the L2 shadow table update thread running every <interval>
    microseconds.  The task reads the entire L2 table and issues updates
    to the L2 shadow table and associated callbacks.  If <interval> is 0,
    stops the task.  If <interval> is omitted, prints current setting.

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命令, bcm cmd.