---
name: "rte_hash"
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_hash"
---

# rte\_hash(3)

## NAME

rte\_hash

## SYNOPSIS

`#include <rte_cuckoo_hash.h>`

### Data Fields

char **name** \[**RTE\_HASH\_NAMESIZE**\]\
 uint32\_t **entries**\
 uint32\_t **num\_buckets**\
 struct **rte\_ring** \* **free\_slots**\
 struct lcore\_cache \* **local\_free\_slots**\
 struct **rte\_hash\_rcu\_config** \* **hash\_rcu\_cfg**\
 struct rte\_rcu\_qsbr\_dq \* **dq**\
 uint32\_t **key\_len**\
 uint8\_t **hw\_trans\_mem\_support**\
 uint8\_t **use\_local\_cache**\
 uint8\_t **readwrite\_concur\_support**\
 uint8\_t **ext\_table\_support**\
 uint8\_t **no\_free\_on\_del**\
 uint8\_t **readwrite\_concur\_lf\_support**\
 uint8\_t **writer\_takes\_lock**\
 **rte\_hash\_function** **hash\_func**\
 uint32\_t **hash\_func\_init\_val**\
 **rte\_hash\_cmp\_eq\_t** **rte\_hash\_custom\_cmp\_eq**\
 enum cmp\_jump\_table\_case **cmp\_jump\_table\_idx**\
 unsigned int **sig\_cmp\_fn**\
 uint32\_t **bucket\_bitmask**\
 uint32\_t **key\_entry\_size**\
 void \* **key\_store**\
 struct **rte\_hash\_bucket** \* **buckets**\
 rte\_rwlock\_t \* **readwrite\_lock**\
 struct **rte\_hash\_bucket** \* **buckets\_ext**\
 struct **rte\_ring** \* **free\_ext\_bkts**\
 uint32\_t \* **tbl\_chng\_cnt**\

## Detailed Description

A hash table structure.

Definition at line **149** of file **rte\_cuckoo\_hash.h**.

## Field Documentation

### char name\[RTE\_HASH\_NAMESIZE\]

Name of the hash.

Definition at line **150** of file **rte\_cuckoo\_hash.h**.

### uint32\_t entries

Total table entries.

Definition at line **151** of file **rte\_cuckoo\_hash.h**.

### uint32\_t num\_buckets

Number of buckets in table.

Definition at line **152** of file **rte\_cuckoo\_hash.h**.

### struct rte\_ring\* free\_slots

Ring that stores all indexes of the free slots in the key table

Definition at line **154** of file **rte\_cuckoo\_hash.h**.

### struct lcore\_cache\* local\_free\_slots

Local cache per lcore, storing some indexes of the free slots

Definition at line **157** of file **rte\_cuckoo\_hash.h**.

### struct rte\_hash\_rcu\_config\* hash\_rcu\_cfg

HASH RCU QSBR configuration structure

Definition at line **161** of file **rte\_cuckoo\_hash.h**.

### struct rte\_rcu\_qsbr\_dq\* dq

RCU QSBR defer queue.

Definition at line **163** of file **rte\_cuckoo\_hash.h**.

### uint32\_t key\_len

Length of hash key.

Definition at line **167** of file **rte\_cuckoo\_hash.h**.

### uint8\_t hw\_trans\_mem\_support

If hardware transactional memory is used.

Definition at line **169** of file **rte\_cuckoo\_hash.h**.

### uint8\_t use\_local\_cache

If multi-writer support is enabled, use local cache to allocate key-store slots.

Definition at line **171** of file **rte\_cuckoo\_hash.h**.

### uint8\_t readwrite\_concur\_support

If read-write concurrency support is enabled

Definition at line **175** of file **rte\_cuckoo\_hash.h**.

### uint8\_t ext\_table\_support

Enable extendable bucket table

Definition at line **177** of file **rte\_cuckoo\_hash.h**.

### uint8\_t no\_free\_on\_del

If key index should be freed on calling rte\_hash\_del\_xxx APIs. If this is set, rte\_hash\_free\_key\_with\_position must be called to free the key index associated with the deleted entry. This flag is enabled by default.

Definition at line **178** of file **rte\_cuckoo\_hash.h**.

### uint8\_t readwrite\_concur\_lf\_support

If read-write concurrency lock free support is enabled

Definition at line **184** of file **rte\_cuckoo\_hash.h**.

### uint8\_t writer\_takes\_lock

Indicates if the writer threads need to take lock

Definition at line **186** of file **rte\_cuckoo\_hash.h**.

### rte\_hash\_function hash\_func

Function used to calculate hash.

Definition at line **188** of file **rte\_cuckoo\_hash.h**.

### uint32\_t hash\_func\_init\_val

Init value used by hash\_func.

Definition at line **189** of file **rte\_cuckoo\_hash.h**.

### rte\_hash\_cmp\_eq\_t rte\_hash\_custom\_cmp\_eq

Custom function used to compare keys.

Definition at line **190** of file **rte\_cuckoo\_hash.h**.

### enum cmp\_jump\_table\_case cmp\_jump\_table\_idx

Indicates which compare function to use.

Definition at line **192** of file **rte\_cuckoo\_hash.h**.

### unsigned int sig\_cmp\_fn

Indicates which signature compare function to use.

Definition at line **194** of file **rte\_cuckoo\_hash.h**.

### uint32\_t bucket\_bitmask

Bitmask for getting bucket index from hash signature.

Definition at line **196** of file **rte\_cuckoo\_hash.h**.

### uint32\_t key\_entry\_size

Size of each key entry.

Definition at line **198** of file **rte\_cuckoo\_hash.h**.

### void\* key\_store

Table storing all keys and data

Definition at line **200** of file **rte\_cuckoo\_hash.h**.

### struct rte\_hash\_bucket\* buckets

Table with buckets storing all the hash values and key indexes to the key table.

Definition at line **201** of file **rte\_cuckoo\_hash.h**.

### rte\_rwlock\_t\* readwrite\_lock

Read-write lock thread-safety.

Definition at line **205** of file **rte\_cuckoo\_hash.h**.

### struct rte\_hash\_bucket\* buckets\_ext

Extra buckets array

Definition at line **206** of file **rte\_cuckoo\_hash.h**.

### struct rte\_ring\* free\_ext\_bkts

Ring of indexes of free buckets

Definition at line **207** of file **rte\_cuckoo\_hash.h**.

### uint32\_t\* tbl\_chng\_cnt

Indicates if the hash table changed from last read.

Definition at line **215** of file **rte\_cuckoo\_hash.h**.

## Author

Generated automatically by Doxygen for DPDK from the source code.
