#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.
toeplitz hash functions.
Definition in file cne_thash.h.
◆ CNE_THASH_V4_L3_LEN
length in dwords of input tuple to calculate hash of ipv4 header only
Definition at line 40 of file cne_thash.h.
◆ CNE_THASH_V4_L4_LEN
length in dwords of input tuple to calculate hash of ipv4 header + transport header
Definition at line 48 of file cne_thash.h.
◆ CNE_THASH_V6_L3_LEN
length in dwords of input tuple to calculate hash of ipv6 header only
Definition at line 54 of file cne_thash.h.
◆ CNE_THASH_V6_L4_LEN
length in dwords of input tuple to calculate hash of ipv6 header + transport header
Definition at line 62 of file cne_thash.h.
◆ cne_convert_rss_key()
static void cne_convert_rss_key |
( |
const uint32_t * |
orig, |
|
|
uint32_t * |
targ, |
|
|
int |
len |
|
) |
| |
|
inlinestatic |
Prepare special converted key to use with cne_softrss_be()
- Parameters
-
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.
◆ cne_thash_load_v6_addrs()
static void cne_thash_load_v6_addrs |
( |
const struct cne_ipv6_hdr * |
orig, |
|
|
union cne_thash_tuple * |
targ |
|
) |
| |
|
inlinestatic |
Prepare and load IPv6 addresses (src and dst) into target tuple
- Parameters
-
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.
◆ cne_softrss()
static uint32_t cne_softrss |
( |
uint32_t * |
input_tuple, |
|
|
uint32_t |
input_len, |
|
|
const uint8_t * |
rss_key |
|
) |
| |
|
inlinestatic |
Generic implementation. Can be used with original rss_key
- Parameters
-
input_tuple | Pointer to input tuple |
input_len | Length of input_tuple in 4-bytes chunks |
rss_key | Pointer to RSS hash key. |
- Returns
- Calculated hash value.
Definition at line 151 of file cne_thash.h.
◆ cne_softrss_be()
static uint32_t cne_softrss_be |
( |
uint32_t * |
input_tuple, |
|
|
uint32_t |
input_len, |
|
|
const uint8_t * |
rss_key |
|
) |
| |
|
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.
- Parameters
-
input_tuple | Pointer to input tuple |
input_len | Length of input_tuple in 4-bytes chunks |
*rss_key | Pointer to RSS hash key. |
- Returns
- Calculated hash value.
Definition at line 179 of file cne_thash.h.
◆ cne_thash_ipv6_bswap_mask
const __m128i cne_thash_ipv6_bswap_mask = {0x0405060700010203ULL, 0x0C0D0E0F08090A0BULL} |
|
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.