---
name: "rte_efd_delete"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_efd.h"
---

# rte\_efd\_delete(3)

Part of [rte\_efd.h(3)](/rte_efd.h/3.md).

## NAME

rte\_efd.h

## SYNOPSIS

`#include <stdint.h>`\

### Macros

\#define **RTE\_EFD\_VALUE\_NUM\_BITS**   (8)\
 \#define **RTE\_EFD\_BURST\_MAX**   (32)\
 \#define **RTE\_EFD\_NAMESIZE**   32\

### Functions

struct rte\_efd\_table \* **rte\_efd\_create** (const char \*name, uint32\_t max\_num\_rules, uint32\_t key\_len, uint64\_t online\_cpu\_socket\_bitmask, uint8\_t offline\_cpu\_socket)\
 void **rte\_efd\_free** (struct rte\_efd\_table \*table)\
 struct rte\_efd\_table \* **rte\_efd\_find\_existing** (const char \*name)\
 int **rte\_efd\_update** (struct rte\_efd\_table \*table, unsigned int socket\_id, const void \*key, efd\_value\_t value)\
 int **rte\_efd\_delete** (struct rte\_efd\_table \*table, unsigned int socket\_id, const void \*key, efd\_value\_t \*prev\_value)\
 efd\_value\_t **rte\_efd\_lookup** (const struct rte\_efd\_table \*table, unsigned int socket\_id, const void \*key)\
 void **rte\_efd\_lookup\_bulk** (const struct rte\_efd\_table \*table, unsigned int socket\_id, int num\_keys, const void \*\*key\_list, efd\_value\_t \*value\_list)\

## Detailed Description

RTE EFD Table

Definition in file **rte\_efd.h**.

## Macro Definition Documentation

### #define RTE\_EFD\_VALUE\_NUM\_BITS (8)

!!! This parameter should be adjusted for your application !!!

This parameter adjusts the number of bits of value that can be stored in the table. For example, setting the number of bits to 3 will allow storing 8 values in the table (between 0 and 7).

This number directly affects the performance of both lookups and insertion. In general, performance decreases as more bits are stored in the table.

This number is directly proportional to the size of the online region used for lookups.

Note that due to the way the CPU operates on memory, best lookup performance will be achieved when RTE\_EFD\_VALUE\_NUM\_BITS is a multiple of 8. These values align the hash indexes on 16-byte boundaries. The greatest performance drop is moving from 8-\>9 bits, 16-\>17 bits, etc.

This value must be between 1 and 32

Definition at line **65** of file **rte\_efd.h**.

### #define RTE\_EFD\_BURST\_MAX (32)

Maximum number of keys that can be looked up in one call to efd\_lookup\_bulk

Definition at line **99** of file **rte\_efd.h**.

### #define RTE\_EFD\_NAMESIZE 32

Maximum number of characters in efd name.

Definition at line **103** of file **rte\_efd.h**.

## Function Documentation

### struct rte\_efd\_table \* rte\_efd\_create (const char \* name, uint32\_t max\_num\_rules, uint32\_t key\_len, uint64\_t online\_cpu\_socket\_bitmask, uint8\_t offline\_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

**Parameters**

*name* 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

### void rte\_efd\_free (struct rte\_efd\_table \* table)

Releases the resources from an EFD table

**Parameters**

*table* Pointer to table allocated with **rte\_efd\_create()**. If table is NULL, no operation is performed.

### struct rte\_efd\_table \* rte\_efd\_find\_existing (const char \* name)

Find an existing EFD table object and return a pointer to it.

**Parameters**

*name* 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

### int rte\_efd\_update (struct rte\_efd\_table \* table, unsigned int socket\_id, const void \* key, efd\_value\_t value)

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.

**Parameters**

*table* 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

### int rte\_efd\_delete (struct rte\_efd\_table \* table, unsigned int socket\_id, const void \* 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.

**Parameters**

*table* 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\_t rte\_efd\_lookup (const struct rte\_efd\_table \* table, unsigned int socket\_id, const void \* 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.

**Parameters**

*table* 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

### void rte\_efd\_lookup\_bulk (const struct rte\_efd\_table \* table, unsigned int socket\_id, int num\_keys, const void \*\* 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.

**Parameters**

*table* 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

## Author

Generated automatically by Doxygen for DPDK from the source code.
