LOOKup

Look up a table entry

LOOKup

Shortest form: look.

Look up an entry in a hashed, sorted or CAM table by its key and print it with its index: Found <table>.<block>[<index>]: <entry>, or Lookup: No matching entry found. Read-only. The grammar is that of Insert, without quiet.

Hardware-validated — Find the hardware index of a MAC address in VLAN 100

drivshell> lookup L2X KEY_TYPE=0 L2:VLAN_ID=100 L2:MAC_ADDR=0x020000000022
Lookup: No matching entry found

The switch above had no VLAN 100, so the lookup found nothing. To see a hit, take the VLAN and MAC address of an existing entry from dump chg l2x (see Dump chg):

Hardware-validated — Look up the static entry that dump chg l2x shows in VLAN 1

drivshell> lookup L2X KEY_TYPE=0 L2:VLAN_ID=1 L2:MAC_ADDR=0xe039d7883b00
Found L2_ENTRY.ipipe0[11552]: <VLAN_ID=1,VFI=1,TABLE_FIELDS=0x40020000380e75e20ec00001,STATIC_BIT=1,SRC_DISCARD=0,SCP=0,RPE=0,RESERVED_KEY_PADDING=0,PRI=0,POLICY_DATA=0x40020000380e75e20ec00001,PENDING=0,MAC_BLOCK_INDEX=0,MAC_ADDR=0xe039d7883b00,LOCAL_SA=0,L2:VLAN_ID=1,L2:VFI=1,L2:STATIC_BIT=1,L2:SRC_DISCARD=0,L2:SCP=0,L2:RPE=0,L2:RESERVED_KEY_PADDING=0,L2:PRI=0,L2:PENDING=0,L2:MAC_BLOCK_INDEX=0,L2:MAC_ADDR=0xe039d7883b00,L2:KEY=0x0701cebc41d8000020,L2:HASH_LSB=0x3b00,L2:EVPN_AGE_DISABLE=0,L2:DUMMY_INDEX=0,L2:DST_DISCARD=0,L2:DESTINATION=0x20000,L2:DATA=0x0080040000,L2:CPU=0,L2:CLASS_ID=0,L2:ASSOCIATED_DATA=0x0080040000,KEY_TYPE=0,KEY=0x0701cebc41d8000020,HITSA=0,HITDA=0,HASH_LSB=0x3b00,EVPN_AGE_DISABLE=0,DUMMY_INDEX=0,DST_DISCARD=0,DESTINATION=0x20000,DATA_TYPE=0,DATA=0x0080040000,CPU=0,CLASS_ID=0,BASE_VALID=1,ASSOCIATED_DATA=0x0080040000,ACTION_PROFILE_PTR=0>

Built-in help

Parameters 1: [<COUNT>] [bank#] <TABLE> <DW0> .. <DWN>
Parameters 2: [<COUNT>] <TABLE> <FIELD>=<VALUE> ...
    Number of <DW> must be appropriate to table entry size.
    The entry is looked up by key.
    All fields other than the key field(s) are ignored.
    Some tables allow restricting the lookup to a single bank.

Further reading

BCM_SDK命令.