rte_swx_ta...ner_params(3)

✨ NAME ✨

rte_swx_table_learner_params β€” it's a struct, bestie, and it's literally the ✨learner table creation parameters✨

So like, this is a manpage from the Library Functions Manual, and it's all about one lil struct that you fill in when you want a learner table to exist. She's giving config energy. πŸŽ€


🌸 SYNOPSIS 🌸

#include <rte_swx_table_learner.h>

πŸ¦‹ Data Fields

  • uint32_t key_size
  • uint32_t key_offset
  • uint8_t * key_mask0
  • uint32_t action_data_size
  • rte_swx_hash_func_t hash_func
  • uint32_t n_keys_max
  • uint32_t * key_timeout
  • uint32_t n_key_timeouts

πŸ’… Detailed Description πŸ’…

Learner table creation parameters. That's the whole thing. She's a params struct, she knows what she is, and she's not gonna pretend otherwise. πŸ‘‘

Oh and also β€” this girl is defined at line 62 of file rte_swx_table_learner.h. Remember that, there might be a pop quiz. πŸ“


🫢 Field Documentation 🫢

🌈 uint32_t key_size

Key size, measured in bytes. And listen β€” this one must be non-zero. Zero is NOT the vibe here.

Defined at line 64 of file rte_swx_table_learner.h.


🌈 uint32_t key_offset

The offset of the first byte of the key, like, within the key buffer. Where does the key start? Right here. πŸ“

Defined at line 67 of file rte_swx_table_learner.h.


🌈 uint8_t* key_mask0

Okay so this one's a mask, and it's key_size bytes long, and it's logically laid over the bytes sitting at positions key_offset .. (key_offset + key_size - 1) of the key buffer. Her whole job? To specify which bits from the key buffer are actually part of the key and which ones are just... there. Living their lives. Not in the key.

The rules, fr fr:

  • a bit value of 1 in the key_mask0 β†’ that respective bit in the key buffer is part of the key βœ…
  • a bit value of 0 β†’ the opposite, that bit is not part of the key ❌
  • a NULL value β†’ all the bits are part of the key, i.e. key_mask0 is just an all-ones mask πŸ’―

Defined at line 76 of file rte_swx_table_learner.h.


🌈 uint32_t action_data_size

Maximum size, in bytes, of the action data. And here's the tea: the data stored in the table for each entry is equal to action_data_size plus 8 bytes, and those 8 extra bytes are used to store the action ID. So budget accordingly bestie, there's a lil surcharge. 🧾✨

Defined at line 81 of file rte_swx_table_learner.h.


🌈 rte_swx_hash_func_t hash_func

The hash function. Hashy. When it's NULL, the default hash function gets used instead. So she's optional, she's chill like that. 😌

Defined at line 85 of file rte_swx_table_learner.h.


🌈 uint32_t n_keys_max

Maximum number of keys to be stored in the table, together with their associated data. Like, the capacity, the headcount, the guest list. 🎟️

Defined at line 88 of file rte_swx_table_learner.h.


🌈 uint32_t* key_timeout

The set of all possible key timeout values, measured in seconds. Every single value in here must be non-zero β€” no zeroes allowed, that's the rule. And each table key expires and is automatically deleted from the table after this many seconds. She's got a timer and she WILL use it. πŸ’€β°

Defined at line 94 of file rte_swx_table_learner.h.


🌈 uint32_t n_key_timeouts

The number of possible key timeout values present in the key_timeout set. And it must be less than or equal to RTE_SWX_TABLE_LEARNER_N_KEY_TIMEOUTS_MAX β€” don't try to be overachieving, that's the ceiling, respect the ceiling. 🚧

Defined at line 99 of file rte_swx_table_learner.h.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for DPDK from the source code. So like, a robot wrote this, but I'm here translating it into human for you. You're welcome. 🫢


k that's the whole page bestie, no cap, every single field accounted for πŸ’– this was DPDK Version 25.11.3, go forth and configure your learner table, you're gonna slay βœ¨πŸŒˆπŸ’…

πŸ“¦ where this page comes from