__rte_experimentaluint64_trte_swx_table_learner_footprint_get(structrte_swx_table_learner_params*params)
Learner table memory footprint get
Parametersparams Table create parameters.
Returns
Table memory footprint in bytes.
__rte_experimentaluint64_trte_swx_table_learner_mailbox_size_get(void)
Learner table mailbox size get
The mailbox is used to store the context of a lookup operation that is in progress and it is passed as a
parameter to the lookup operation. This allows for multiple concurrent lookup operations into the same
table.
Returns
Table mailbox footprint in bytes.
__rte_experimentalvoid*rte_swx_table_learner_create(structrte_swx_table_learner_params*params,intnuma_node)
Learner table create
Parametersparams Table creation parameters.
numa_node Non-Uniform Memory Access (NUMA) node.
Returns
Table handle, on success, or NULL, on error.
__rte_experimentalintrte_swx_table_learner_timeout_update(void*table,uint32_tkey_timeout_id,uint32_tkey_timeout)
Learner table key timeout update
Parameterstable Table handle.
key_timeout_id Key timeout ID. Must be less than the configured n_key_timeouts value.
key_timeout Key timeout value measured in seconds.
Returns
0 on success or the following error codes otherwise: -EINVAL: Invalid argument(s).
__rte_experimentalintrte_swx_table_learner_lookup(void*table,void*mailbox,uint64_ttime,uint8_t**key,uint64_t*action_id,uint8_t**action_data,size_t*entry_id,int*hit)
Learner table key lookup
The table lookup operation searches a given key in the table and upon its completion it returns an
indication of whether the key is found in the table (lookup hit) or not (lookup miss). In case of lookup
hit, the action_id and the action_data associated with the key are also returned.
Multiple invocations of this function may be required in order to complete a single table lookup
operation for a given table and a given lookup key. The completion of the table lookup operation is
flagged by a return value of 1; in case of a return value of 0, the function must be invoked again with
exactly the same arguments.
The mailbox argument is used to store the context of an on-going table key lookup operation, and possibly
an associated key add operation. The mailbox mechanism allows for multiple concurrent table key lookup
and add operations into the same table.
The table entry consists of the action ID and the action data. Each table entry is unique, even though
different table entries can have identical content, i.e. same values for the action ID and the action
data. The table entry ID is also returned by the table lookup operation. It can be used to index into an
external array of resources such as counters, registers or meters to identify the resource directly
associated with the current table entry with no need to store the corresponding index into the table
entry. The index of the external resource is thus auto-generated instead of being stored in the table
entry.
Parameterstable Table handle.
mailbox Mailbox for the current table lookup operation.
time Current time measured in CPU clock cycles.
key Lookup key. Its size must be equal to the table key_size.
action_id ID of the action associated with the key. Must point to a valid 64-bit variable. Only valid
when the function returns 1 and hit is set to true.
action_data Action data for the action_id action. Must point to a valid array of table
action_data_size bytes. Only valid when the function returns 1 and hit is set to true.
entry_id Table entry unique ID. Must point to a valid 32-bit variable. Only valid when the function
returns 1 and hit is set to true.
hit Only valid when the function returns 1. Set to non-zero (true) on table lookup hit and to zero
(false) on table lookup miss.
Returns
0 when the table lookup operation is not yet completed, and 1 when the table lookup operation is
completed. No other return values are allowed.
__rte_experimentaluint32_trte_swx_table_learner_add(void*table,void*mailbox,uint64_ttime,uint64_taction_id,uint8_t*action_data,uint32_tkey_timeout_id)
Learner table key add
This operation takes the latest key that was looked up in the table and adds it to the table with the
given action ID and action data. Typically, this operation is only invoked when the latest lookup
operation in the current table resulted in lookup miss.
Parameterstable Table handle.
mailbox Mailbox for the current operation.
time Current time measured in CPU clock cycles.
action_id ID of the action associated with the key.
action_data Action data for the action_id action.
key_timeout_id Key timeout ID.
Returns
0 on success, 1 or error (table full).
__rte_experimentalvoidrte_swx_table_learner_rearm(void*table,void*mailbox,uint64_ttime)
Learner table key rearm with same timeout value
This operation takes the latest key that was looked up in the table and, in case of lookup hit, it rearms
its expiration timer using the same timeout value currently associated with the key.
Parameterstable Table handle.
mailbox Mailbox for the current operation.
time Current time measured in CPU clock cycles.
__rte_experimentalvoidrte_swx_table_learner_rearm_new(void*table,void*mailbox,uint64_ttime,uint32_tkey_timeout_id)
Learner table key rearm with given timeout value
This operation takes the latest key that was looked up in the table and, in case of lookup hit, it rearms
its expiration timer using the given timeout value.
Parameterstable Table handle.
mailbox Mailbox for the current operation.
time Current time measured in CPU clock cycles.
key_timeout_id Key timeout ID.
__rte_experimentalvoidrte_swx_table_learner_delete(void*table,void*mailbox)
Learner table key delete
This operation takes the latest key that was looked up in the table and deletes it from the table.
Typically, this operation is only invoked to force the deletion of the key before the key expires on
timeout due to inactivity.
Parameterstable Table handle.
mailbox Mailbox for the current operation.
__rte_experimentalvoidrte_swx_table_learner_free(void*table)
Learner table free
Parameterstable Table handle.