DPDK: Data Plane Development Kit

18.02.0-rc0
rte_hash_crc.h File Reference
#include <stdint.h>
#include <rte_cpuflags.h>
#include <rte_branch_prediction.h>
#include <rte_common.h>

Go to the source code of this file.

Functions

static void rte_hash_crc_set_alg (uint8_t alg)
static uint32_t rte_hash_crc_1byte (uint8_t data, uint32_t init_val)
static uint32_t rte_hash_crc_2byte (uint16_t data, uint32_t init_val)
static uint32_t rte_hash_crc_4byte (uint32_t data, uint32_t init_val)
static uint32_t rte_hash_crc_8byte (uint64_t data, uint32_t init_val)
static uint32_t rte_hash_crc (const void *data, uint32_t data_len, uint32_t init_val)

Detailed Description

RTE CRC Hash

Definition in file rte_hash_crc.h.

Function Documentation

static void rte_hash_crc_set_alg ( uint8_t  alg)
inlinestatic

Allow or disallow use of SSE4.2 instrinsics for CRC32 hash calculation.

Parameters
algAn OR of following flags:
  • (CRC32_SW) Don't use SSE4.2 intrinsics
  • (CRC32_SSE42) Use SSE4.2 intrinsics if available
  • (CRC32_SSE42_x64) Use 64-bit SSE4.2 intrinsic if available (default)

Definition at line 472 of file rte_hash_crc.h.

static uint32_t rte_hash_crc_1byte ( uint8_t  data,
uint32_t  init_val 
)
inlinestatic

Use single crc32 instruction to perform a hash on a byte value. Fall back to software crc32 implementation in case SSE4.2 is not supported

Parameters
dataData to perform hash on.
init_valValue to initialise hash generator.
Returns
32bit calculated hash value.

Definition at line 501 of file rte_hash_crc.h.

static uint32_t rte_hash_crc_2byte ( uint16_t  data,
uint32_t  init_val 
)
inlinestatic

Use single crc32 instruction to perform a hash on a 2 bytes value. Fall back to software crc32 implementation in case SSE4.2 is not supported

Parameters
dataData to perform hash on.
init_valValue to initialise hash generator.
Returns
32bit calculated hash value.

Definition at line 524 of file rte_hash_crc.h.

static uint32_t rte_hash_crc_4byte ( uint32_t  data,
uint32_t  init_val 
)
inlinestatic

Use single crc32 instruction to perform a hash on a 4 byte value. Fall back to software crc32 implementation in case SSE4.2 is not supported

Parameters
dataData to perform hash on.
init_valValue to initialise hash generator.
Returns
32bit calculated hash value.

Definition at line 547 of file rte_hash_crc.h.

static uint32_t rte_hash_crc_8byte ( uint64_t  data,
uint32_t  init_val 
)
inlinestatic

Use single crc32 instruction to perform a hash on a 8 byte value. Fall back to software crc32 implementation in case SSE4.2 is not supported

Parameters
dataData to perform hash on.
init_valValue to initialise hash generator.
Returns
32bit calculated hash value.

Definition at line 570 of file rte_hash_crc.h.

static uint32_t rte_hash_crc ( const void *  data,
uint32_t  data_len,
uint32_t  init_val 
)
inlinestatic

Calculate CRC32 hash on user-supplied byte array.

Parameters
dataData to perform hash on.
data_lenHow many bytes to use to calculate hash value.
init_valValue to initialise hash generator.
Returns
32bit calculated hash value.
Examples:
examples/tep_termination/vxlan.c.

Definition at line 600 of file rte_hash_crc.h.