table: add hash function prototype
Add hash function prototype to be used by the exact match and the learner table types. The hash function is not mask-based, so the table key fields have to be contiguous in memory. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
This commit is contained in:
parent
fbd59c8ecb
commit
f5fda6863a
@ -26,6 +26,7 @@ sources = files(
|
|||||||
)
|
)
|
||||||
headers = files(
|
headers = files(
|
||||||
'rte_lru.h',
|
'rte_lru.h',
|
||||||
|
'rte_swx_hash_func.h',
|
||||||
'rte_swx_table.h',
|
'rte_swx_table.h',
|
||||||
'rte_swx_table_em.h',
|
'rte_swx_table_em.h',
|
||||||
'rte_swx_table_learner.h',
|
'rte_swx_table_learner.h',
|
||||||
|
39
lib/table/rte_swx_hash_func.h
Normal file
39
lib/table/rte_swx_hash_func.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
* Copyright(c) 2022 Intel Corporation
|
||||||
|
*/
|
||||||
|
#ifndef __INCLUDE_RTE_SWX_HASH_FUNC_H__
|
||||||
|
#define __INCLUDE_RTE_SWX_HASH_FUNC_H__
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* RTE SWX Hash Function
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hash function prototype
|
||||||
|
*
|
||||||
|
* @param[in] key
|
||||||
|
* Key to hash. Must be non-NULL.
|
||||||
|
* @param[in] length
|
||||||
|
* Key length in bytes.
|
||||||
|
* @param[in] seed
|
||||||
|
* Hash seed.
|
||||||
|
* @return
|
||||||
|
* Hash value.
|
||||||
|
*/
|
||||||
|
typedef uint32_t
|
||||||
|
(*rte_swx_hash_func_t)(const void *key,
|
||||||
|
uint32_t length,
|
||||||
|
uint32_t seed);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user