|
CNDP 22.08.0
|
#include <stdint.h>#include <cne_byteorder.h>#include <cne_common.h>#include <cne_vect.h>#include <net/cne_ip.h>Go to the source code of this file.
Data Structures | |
| struct | cne_ipv4_tuple |
| struct | cne_ipv6_tuple |
Macros | |
| #define | CNE_THASH_V4_L3_LEN ((sizeof(struct cne_ipv4_tuple) - sizeof(((struct cne_ipv4_tuple *)0)->sctp_tag)) / 4) |
| #define | CNE_THASH_V4_L4_LEN ((sizeof(struct cne_ipv4_tuple)) / 4) |
| #define | CNE_THASH_V6_L3_LEN ((sizeof(struct cne_ipv6_tuple) - sizeof(((struct cne_ipv6_tuple *)0)->sctp_tag)) / 4) |
| #define | CNE_THASH_V6_L4_LEN ((sizeof(struct cne_ipv6_tuple)) / 4) |
Functions | |
| static void | cne_convert_rss_key (const uint32_t *orig, uint32_t *targ, int len) |
| static void | cne_thash_load_v6_addrs (const struct cne_ipv6_hdr *orig, union cne_thash_tuple *targ) |
| static uint32_t | cne_softrss (uint32_t *input_tuple, uint32_t input_len, const uint8_t *rss_key) |
| static uint32_t | cne_softrss_be (uint32_t *input_tuple, uint32_t input_len, const uint8_t *rss_key) |
Variables | |
| static const __m128i | cne_thash_ipv6_bswap_mask = {0x0405060700010203ULL, 0x0C0D0E0F08090A0BULL} |
toeplitz hash functions.
Definition in file cne_thash.h.
| #define CNE_THASH_V4_L3_LEN ((sizeof(struct cne_ipv4_tuple) - sizeof(((struct cne_ipv4_tuple *)0)->sctp_tag)) / 4) |
length in dwords of input tuple to calculate hash of ipv4 header only
Definition at line 40 of file cne_thash.h.
| #define CNE_THASH_V4_L4_LEN ((sizeof(struct cne_ipv4_tuple)) / 4) |
length in dwords of input tuple to calculate hash of ipv4 header + transport header
Definition at line 48 of file cne_thash.h.
| #define CNE_THASH_V6_L3_LEN ((sizeof(struct cne_ipv6_tuple) - sizeof(((struct cne_ipv6_tuple *)0)->sctp_tag)) / 4) |
length in dwords of input tuple to calculate hash of ipv6 header only
Definition at line 54 of file cne_thash.h.
| #define CNE_THASH_V6_L4_LEN ((sizeof(struct cne_ipv6_tuple)) / 4) |
length in dwords of input tuple to calculate hash of ipv6 header + transport header
Definition at line 62 of file cne_thash.h.
|
inlinestatic |
Prepare special converted key to use with cne_softrss_be()
| orig | pointer to original RSS key |
| targ | pointer to target RSS key |
| len | RSS key length |
Definition at line 114 of file cne_thash.h.
|
inlinestatic |
Prepare and load IPv6 addresses (src and dst) into target tuple
| orig | Pointer to ipv6 header of the original packet |
| targ | Pointer to cne_ipv6_tuple structure |
Definition at line 131 of file cne_thash.h.
|
inlinestatic |
Generic implementation. Can be used with original rss_key
| input_tuple | Pointer to input tuple |
| input_len | Length of input_tuple in 4-bytes chunks |
| rss_key | Pointer to RSS hash key. |
Definition at line 151 of file cne_thash.h.
|
inlinestatic |
Optimized implementation. If you want the calculated hash value matches NIC RSS value you have to use special converted key with cne_convert_rss_key() fn.
| input_tuple | Pointer to input tuple |
| input_len | Length of input_tuple in 4-bytes chunks |
| *rss_key | Pointer to RSS hash key. |
Definition at line 179 of file cne_thash.h.
|
static |
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 at line 34 of file cne_thash.h.