Create a private header file, internal to the library, to hold function prototypes and other content that is not to be exposed to applications. This is better than having the content marked as internal in public headers.
Signed-off-by: Bruce Richardson <[email protected]> --- lib/hash/rte_thash.c | 2 ++ lib/hash/rte_thash.h | 13 ------------- lib/hash/rte_thash_gf2_poly_math.c | 4 ++-- lib/hash/thash_private.h | 16 ++++++++++++++++ 4 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 lib/hash/thash_private.h diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c index fcd41248b9..dfbcb931d9 100644 --- a/lib/hash/rte_thash.c +++ b/lib/hash/rte_thash.c @@ -16,6 +16,8 @@ #include <rte_malloc.h> #include <rte_cpuflags.h> +#include "thash_private.h" + RTE_LOG_REGISTER_SUFFIX(thash_logtype, thash, INFO); #define RTE_LOGTYPE_HASH thash_logtype #define HASH_LOG(level, ...) \ diff --git a/lib/hash/rte_thash.h b/lib/hash/rte_thash.h index 8bca430663..98115081b1 100644 --- a/lib/hash/rte_thash.h +++ b/lib/hash/rte_thash.h @@ -100,19 +100,6 @@ union rte_thash_tuple { struct rte_ipv6_tuple v6; }; -/** @internal - * @brief Generates a random polynomial - * - * @param poly_degree - * degree of the polynomial - * - * @return - * random polynomial - */ -__rte_internal -uint32_t -thash_get_rand_poly(uint32_t poly_degree); - /** * Longest RSS hash key currently supported */ diff --git a/lib/hash/rte_thash_gf2_poly_math.c b/lib/hash/rte_thash_gf2_poly_math.c index ddf4dd863b..286797a8d4 100644 --- a/lib/hash/rte_thash_gf2_poly_math.c +++ b/lib/hash/rte_thash_gf2_poly_math.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2024 Intel Corporation */ -#include <eal_export.h> #include <rte_random.h> #include <rte_common.h> #include <rte_bitops.h> @@ -9,6 +8,8 @@ #include <rte_thash.h> #include <rte_log.h> +#include "thash_private.h" + #define MAX_POLY_DEGREE 32 #define MAX_TOEPLITZ_KEY_LENGTH 64 RTE_LOG_REGISTER_SUFFIX(thash_poly_logtype, thash_poly, INFO); @@ -242,7 +243,6 @@ thash_test_poly_order(uint32_t poly, int degree) return 0; } -RTE_EXPORT_INTERNAL_SYMBOL(thash_get_rand_poly) uint32_t thash_get_rand_poly(uint32_t poly_degree) { diff --git a/lib/hash/thash_private.h b/lib/hash/thash_private.h new file mode 100644 index 0000000000..ed13b605a3 --- /dev/null +++ b/lib/hash/thash_private.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2026 Intel Corporation + */ + +#ifndef THASH_PRIVATE_H +#define THASH_PRIVATE_H + +#include <stdint.h> + +/** + * Get a random polynomial of the specified degree. + */ +uint32_t +thash_get_rand_poly(uint32_t poly_degree); + +#endif /* THASH_PRIVATE_H */ -- 2.55.0

