lt

A command of the separate bcma command line; see Commands for other chip families.

Logical table access.

lt list [<opt>] [<lt-match-string> ...]
traverse [<attrlist>] [<opt>] [<lt-match-string> ...]
[<cmd-params>] <table-op> [<table-op> ...]

Built-in help

<table-op> := <lt-name> [<attrlist>] [<env-var-list>] [<trvs-cfg>]
                        <entry-op> [<entry-op> ...]
<entry-op> := <op> [<opt>] [<field>=<val> ...]

The <table-op> performs logical table operation(s) through an entry
in the given logical table <lt-name>.
The asterisk (*) can be used to set the specified field to
its default value.
The minus sign (-) can be used to unset the specified field.

<cmd-params> := <param>=<val> [<param>=<val> ...] | =
  The <cmd-params> is used to configure the commit parameters for
  the logical table operations. Default is to commit the logical
  table operations in synchronous entry mode.
Current available parameters are:
  TRans=0|1: Commit in entry or transaction mode.
  TransType=Atomic|Batch: Transaction type.
                          Valid in transaction mode.
  Async=0|1: Commit in synchronous mode or asynchronous mode.
  PRIority=Normal|High: Priority level used in asynchronous mode.
  NoTiFy=Commit|Hw|All|None: Notification option in asynchronous mode.
  ScalarDisplayMode=Hex|Dec|HexDec: Display mode for scalar field.
  ArrayDisplayMode=Hex|Dec|HexDec: Display mode for array field.
  ArrayDelimiter=Comma|Newline|Space: Display style for arrays.
  FieldDelimiter=Comma|Newline|Space: Display style for fields.
  Verbose=0|1: Whether to run the command in verbose mode.
  Quiet=0|1: Set to 1 to suppress normal command output.
  ContCmdMode=0|1: Valid in transaction mode only and default value is
                   always 0. Identify multiple transaction commands in
                   continuous command mode that starts from 1 and ends
                   with 0.
  CacheBypass=0|1: Obtain entry data directly from hardware if set
                   to 1. Default value is 0.
  DEFault=0|1: Whether to save the current parameters to default.
The current command parameters can be shown and modified by using
the '=' syntax as well.


<attrlist>: attr=<attr>[,<attr>...]
  Currently the supported <attr>s are CACHE_BYPASS, FILTER_DFLT,
  FILTER_OUTPUT, FILTER_PERF, LPM_LOOKUP, TRVS_SNAPSHOT,
  and TRVS_DONE.

<env-var-list>: EnvVar=<str>[,<str>...]
  Applicable to LOOKUP, index-with-allocate INSERT operation or
  TRAVERSE operation with -l option (LOOKUP while traversing) to set
  result for the fields name containing <str> to CLI local variables.
  Use '*' to set all fields for LOOKUP operation and key fields for
  index-with-allocate INSERT operation.
  For array field, each element n will be expanded to variable name
  <field_name>__n associate with the element value. Token matching for
  specific index m or indices range m to n of array field can be
  specified as <str>[m] or <str>[m-n].
  For TRAVERSE operation with no options specified, each key field
  value of the traversed entry will be concatenated with commas and
  set to CLI local variables.
  The variables will be automatically cleared at the next LT operation.

<trvs-cfg>: MaxTrvsNum=<val>
  Applicable to TRAVERSE operation to limit the number of traversing
  entries listed in the CLI output. The <val> should be positive to
  take effect.

The valid <op>s in table <entry-op> are:
  insert, delete, update, lookup and traverse.
Field qualifier is supported for the traverse opcode to filter
unwanted entries from the traverse result. The supported field
qualifiers are ==, !=, >=, <=, > and <.
The number of (qualified) entries traversed will also be saved in the
local environment variable "$0", which can be useful for scripting.

<opt>: A dash followed by one or more letters.
lt <table-op>
  -a: Auto-fill default values for any unspecified key fields.
      Applicable to insert/update/lookup/delete operations.
  -i: Automatically attempt an insert operation if an update
      operation returns entry-not-found.
  -f: Force all unspecified fields to reset to their default values.
      Applicable to update operation.
  -l: Applicable to traverse operation to perform lookup in traverse.
  -u: Applicable to traverse operation to perform update in traverse.
  -d: Applicable to traverse operation to perform delete in traverse.
  -r: List all returned fields for insert and update operations.
lt list
  -l: Use long output format when listing table information.
  -b: Use brief output format when listing table information.
  -d: Display table documentation.
  -m: Display physical table mapping information.
lt traverse
  -l: List all entry fields instead of key fields only.
      LTs with no entries will be silently ignored.
  -v: List the traverse result in verbose mode. All matching LTs
      will be displayed regardless of the number of entries.

The 'lt list' and 'lt traverse' commands can operate on multiple
LTs depending on the specified lt-match-string(s).
The number of tables listed or traversed will also be saved in the
local environment variable "$0", which can be useful for scripting.

Built-in examples

list -b
list -l ^TABLE
list -m TABLE
list -d CTR_MAC
list -ld @CTR_MAC
CTR_CONTROL update COLLECTION_ENABLE=1 INTERVAL=2000000\
PORT_ID[1-3]=1,PORT_ID[5]=1,PORT_ID[7]=1
CTR_MAC insert PORT_ID=2 TX_PKT=100 RX_PKT=90
CTR_MAC lookup PORT_ID=2
CTR_MAC attr=CACHE_BYPASS lookup PORT_ID=2
CTR_MAC update -i PORT_ID=3 TX_PKT=200
CTR_MAC traverse
CTR_MAC traverse -u TX_PKT=0 RX_PKT=0
CTR_MAC traverse -l OPERATIONAL_STATE==VALID TX_BYTES>0
CTR_MAC mtn=1 traverse
traverse -v CTR_MAC
CTR_CONTROL update INTERVAL=* PORT_ID[5]=0
CTR_CONTROL EnvVar=MULTIPLIER,PORT_ID[0],id[3-5] lookup