structrte_efd_table*rte_efd_create(constchar*name,uint32_tmax_num_rules,uint32_tkey_len,uint64_tonline_cpu_socket_bitmask,uint8_toffline_cpu_socket)
Creates an EFD table with a single offline region and multiple per-socket internally-managed copies of
the online table used for lookups
Parametersname EFD table name
max_num_rules Minimum number of rules the table should be sized to hold. Will be rounded up to the
next smallest valid table size
key_len Length of the key
online_cpu_socket_bitmask Bitmask specifying which sockets should get a copy of the online table. LSB
= socket 0, etc.
offline_cpu_socket Identifies the socket where the offline table will be allocated (and most
efficiently accessed in the case of updates/insertions)
Returns
EFD table, or NULL if table allocation failed or the bitmask is invalid
voidrte_efd_free(structrte_efd_table*table)
Releases the resources from an EFD table
Parameterstable Pointer to table allocated with rte_efd_create(). If table is NULL, no operation is performed.
structrte_efd_table*rte_efd_find_existing(constchar*name)
Find an existing EFD table object and return a pointer to it.
Parametersname Name of the EFD table as passed to rte_efd_create()Returns
Pointer to EFD table or NULL if object not found with rte_errno set appropriately. Possible rte_errno
values include:
• ENOENT - value not available for return
intrte_efd_update(structrte_efd_table*table,unsignedintsocket_id,constvoid*key,efd_value_tvalue)
Computes an updated table entry for the supplied key/value pair. The update is then immediately applied
to the provided table and all socket-local copies of the chunks are updated. This operation is not multi-
thread safe and should only be called one from thread.
Parameterstable EFD table to reference
socket_id Socket ID to use to lookup existing value (ideally caller's socket id)
key EFD table key to modify
value Value to associate with the key
Returns
RTE_EFD_UPDATE_WARN_GROUP_FULL Operation is insert, and the last available space in the key's group
was just used Future inserts may fail as groups fill up This operation was still successful, and
entry contains a valid update RTE_EFD_UPDATE_FAILED Either the EFD failed to find a suitable perfect
hash or the group was full This is a fatal error, and the table is now in an indeterminate state
RTE_EFD_UPDATE_NO_CHANGE Operation resulted in no change to the table (same value already exists) 0 -
success
intrte_efd_delete(structrte_efd_table*table,unsignedintsocket_id,constvoid*key,efd_value_t*prev_value)
Removes any value currently associated with the specified key from the table This operation is not multi-
thread safe and should only be called from one thread.
Parameterstable EFD table to reference
socket_id Socket ID to use to lookup existing value (ideally caller's socket id)
key EFD table key to delete
prev_value If not NULL, will store the previous value here before deleting it
Returns
0 - successfully found and deleted the key nonzero otherwise
efd_value_trte_efd_lookup(conststructrte_efd_table*table,unsignedintsocket_id,constvoid*key)
Looks up the value associated with a key This operation is multi-thread safe.
NOTE: Lookups will always succeed - this is a property of using a perfect hash table. If the specified
key was never inserted, a pseudorandom answer will be returned. There is no way to know based on the
lookup if the key was ever inserted originally, so this must be tracked elsewhere.
Parameterstable EFD table to reference
socket_id Socket ID to use to lookup existing value (ideally caller's socket id)
key EFD table key to look up
Returns
Value associated with the key, or random junk if they key was never inserted
voidrte_efd_lookup_bulk(conststructrte_efd_table*table,unsignedintsocket_id,intnum_keys,constvoid**key_list,efd_value_t*value_list)
Looks up the value associated with several keys. This operation is multi-thread safe.
NOTE: Lookups will always succeed - this is a property of using a perfect hash table. If the specified
key was never inserted, a pseudorandom answer will be returned. There is no way to know based on the
lookup if the key was ever inserted originally, so this must be tracked elsewhere.
Parameterstable EFD table to reference
socket_id Socket ID to use to lookup existing value (ideally caller's socket id)
num_keys Number of keys in the key_list array, must be less than RTE_EFD_BURST_MAX
key_list Array of num_keys pointers which point to keys to look up
value_list Array of size num_keys where lookup values will be stored