rte_hash(3)

πŸ’– rte_hash(3) πŸ’–

okay bestie, pull up a chair because we're doing rte_hash(3) today β€” it's a manual page from the DPDK Library Functions Manual, and it's literally the struct that runs the whole hash table show. no cap. πŸŽ€


✨ NAME ✨

rte_hash β€” the main character of this whole page, periodt. πŸ‘‘


🌸 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 πŸ’«

it's giving a hash table structure. that's the whole vibe. 🫢

ngl, the actual definition lives at line 149 of the file rte_cuckoo_hash.h. iconic placement.


πŸ”₯ Field Documentation πŸ”₯

char name[RTE_HASH_NAMESIZE]

the name of the hash. yes bestie, it has a name. slay.

Definition at line 150 of file rte_cuckoo_hash.h.

uint32_t entries

total table entries. the whole headcount fr fr.

Definition at line 151 of file rte_cuckoo_hash.h.

uint32_t num_buckets

how many buckets are chillin' in the table. πŸͺ£

Definition at line 152 of file rte_cuckoo_hash.h.

struct rte_ring* free_slots

the ring that stores all indexes of the free slots in the key table. it's the little waiting room of unused spots. ✨

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. each core gets its own stash, no sharing drama. 🧚

Definition at line 157 of file rte_cuckoo_hash.h.

struct rte_hash_rcu_config* hash_rcu_cfg

the HASH RCU QSBR configuration structure. very serious, very structured. πŸ’…

Definition at line 161 of file rte_cuckoo_hash.h.

struct rte_rcu_qsbr_dq* dq

RCU QSBR defer queue. that's it, that's the description. πŸ’€

Definition at line 163 of file rte_cuckoo_hash.h.

uint32_t key_len

length of the hash key. size does matter here bestie.

Definition at line 167 of file rte_cuckoo_hash.h.

uint8_t hw_trans_mem_support

if hardware transactional memory is used. fancy hardware stuff, iykyk.

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. growth mindset, literally.

Definition at line 177 of file rte_cuckoo_hash.h.

uint8_t no_free_on_del

if the 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.

lowkey important: set this and you're on the hook for calling rte_hash_free_key_with_position yourself. don't forget bestie. 🫢
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. lock-free, no cap.

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

the function used to calculate hash. math but make it fashion.

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. build your own comparator, main character energy. ✨

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. the whole storage situation. πŸ“

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. keeping the threads from fighting. 🫢

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. the vibe check counter, basically. πŸ‘‘

Definition at line 215 of file rte_cuckoo_hash.h.

🌈 Author 🌈

generated automatically by Doxygen for DPDK from the source code. not a human, not a bestie, just doxygen doing its thing. πŸ’…


and that's the page babes β€” this little gem came to you straight from DPDK, Version 25.11.3, and it's rte_hash(3) forever. go forth and hash responsibly, mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from