| rte_thash.h(3) | Library Functions Manual | rte_thash.h(3) |
rte_thash.h
#include <stdint.h>
#include <rte_byteorder.h>
#include <rte_ip.h>
#include <rte_common.h>
#include <rte_thash_gfni.h>
struct rte_ipv4_tuple
struct rte_ipv6_tuple
#define RTE_THASH_V4_L3_LEN
#define RTE_THASH_V4_L4_LEN ((sizeof(struct rte_ipv4_tuple)) /
4)
#define RTE_THASH_V6_L3_LEN
#define RTE_THASH_V6_L4_LEN ((sizeof(struct rte_ipv6_tuple)) /
4)
#define RTE_THASH_IGNORE_PERIOD_OVERFLOW 0x1
#define RTE_THASH_MINIMAL_SEQ 0x2
typedef int(* rte_thash_check_tuple_t) (void
*userdata, uint8_t *tuple)
static void rte_convert_rss_key (const uint32_t *orig,
uint32_t *targ, int len)
static void rte_thash_load_v6_addrs (const struct rte_ipv6_hdr *orig,
union rte_thash_tuple *targ)
static uint32_t rte_softrss (uint32_t *input_tuple, uint32_t input_len,
const uint8_t *rss_key)
static uint32_t rte_softrss_be (uint32_t *input_tuple, uint32_t
input_len, const uint8_t *rss_key)
int rte_thash_gfni_supported (void)
void rte_thash_complete_matrix (uint64_t *matrixes, const uint8_t
*rss_key, int size)
struct rte_thash_ctx * rte_thash_init_ctx (const char *name, uint32_t
key_len, uint32_t reta_sz, uint8_t *key, uint32_t flags)
struct rte_thash_ctx * rte_thash_find_existing (const char *name)
void rte_thash_free_ctx (struct rte_thash_ctx *ctx)
int rte_thash_add_helper (struct rte_thash_ctx *ctx, const char *name,
uint32_t len, uint32_t offset)
struct rte_thash_subtuple_helper * rte_thash_get_helper (struct
rte_thash_ctx *ctx, const char *name)
uint32_t rte_thash_get_complement (struct rte_thash_subtuple_helper *h,
uint32_t hash, uint32_t desired_hash)
const uint8_t * rte_thash_get_key (struct rte_thash_ctx *ctx)
const uint64_t * rte_thash_get_gfni_matrices (struct rte_thash_ctx
*ctx)
int rte_thash_adjust_tuple (struct rte_thash_ctx *ctx, struct
rte_thash_subtuple_helper *h, uint8_t *tuple, unsigned int tuple_len,
uint32_t desired_value, unsigned int attempts,
rte_thash_check_tuple_t fn, void *userdata)
__rte_experimental int rte_thash_gen_key (uint8_t *key, size_t key_len,
size_t reta_sz_log, uint32_t entropy_start, size_t entropy_sz)
Software implementation of the Toeplitz hash function used by RSS. Can be used either for packet distribution on single queue NIC or for simulating of RSS computation on specific NIC (for example after GRE header decapsulating)
Definition in file rte_thash.h.
Value:.PP
((sizeof(struct rte_ipv4_tuple) - \
sizeof(((struct rte_ipv4_tuple *)0)->sctp_tag)) / 4)
length in dwords of input tuple to calculate hash of ipv4 header only
Definition at line 45 of file rte_thash.h.
length in dwords of input tuple to calculate hash of ipv4 header + transport header
Definition at line 53 of file rte_thash.h.
Value:.PP
((sizeof(struct rte_ipv6_tuple) - \
sizeof(((struct rte_ipv6_tuple *)0)->sctp_tag)) / 4)
length in dwords of input tuple to calculate hash of ipv6 header only
Definition at line 59 of file rte_thash.h.
length in dwords of input tuple to calculate hash of ipv6 header + transport header
Definition at line 67 of file rte_thash.h.
LFSR will ignore if generated m-sequence has more than 2^n -1 bits, where n is the logarithm of the RSS ReTa size.
Definition at line 269 of file rte_thash.h.
Generate minimal required bit (equal to ReTa LSB) sequence into the hash_key
Definition at line 274 of file rte_thash.h.
Function prototype for the rte_thash_adjust_tuple to check if adjusted tuple could be used. Generally it is some kind of lookup function to check if adjusted tuple is already in use.
Parameters
Returns
Definition at line 428 of file rte_thash.h.
Prepare special converted key to use with rte_softrss_be()
Parameters
Definition at line 134 of file rte_thash.h.
Prepare and load IPv6 addresses (src and dst) into target tuple
Parameters
Definition at line 151 of file rte_thash.h.
Generic implementation. Can be used with original rss_key
Parameters
Returns
Definition at line 189 of file rte_thash.h.
Optimized implementation. If you want the calculated hash value matches NIC RSS value you have to use special converted key with rte_convert_rss_key() fn.
Parameters
Returns
Definition at line 219 of file rte_thash.h.
Indicates if GFNI implementations of the Toeplitz hash are supported.
Returns
Converts Toeplitz hash key (RSS key) into matrixes required for GFNI implementation
Parameters
Create a new thash context.
Parameters
Returns
Find an existing thash context and return a pointer to it.
Parameters
Returns
Free a thash context object
Parameters
Add a special properties to the toeplitz hash key inside a thash context. Creates an internal helper struct which has a complementary table to calculate toeplitz hash collisions. This function is not multi-thread safe.
Parameters
Returns
Find a helper in the context by the given name
Parameters
Returns
Get a complementary value for the subtuple to produce a partial toeplitz hash collision. It must be XOR'ed with the subtuple to produce the hash value with the desired hash LSB's This function is multi-thread safe.
Parameters
Returns
Get a pointer to the toeplitz hash contained in the context. It changes after each addition of a helper. It should be installed to the NIC.
Parameters
Returns
Get a pointer to the toeplitz hash matrices contained in the context. These matrices could be used with fast toeplitz hash implementation if CPU supports GFNI. Matrices changes after each addition of a helper.
Parameters
Returns
Adjusts tuple in the way to make Toeplitz hash has desired least significant bits. This function is multi-thread safe.
Parameters
Returns
Warning
Modify RSS hash key such that subtuple bits corresponding to entropy_sz bits starting from entropy_start will have the most even distribution with this key with a given ReTa size.
Parameters
Returns
Generated automatically by Doxygen for DPDK from the source code.
| Version 24.11.3 | DPDK |