thash_get_rand_poly() is only called from rte_thash.c when
initializing an LFSR. No driver or application outside the hash
library uses it, so it does not need an internal export.

Signed-off-by: Stephen Hemminger <[email protected]>
---
 lib/hash/rte_thash.c               |  1 +
 lib/hash/rte_thash.h               | 13 -------------
 lib/hash/rte_thash_gf2_poly_math.c |  2 +-
 lib/hash/thash_private.h           | 16 ++++++++++++++++
 4 files changed, 18 insertions(+), 14 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..12f71d4cde 100644
--- a/lib/hash/rte_thash.c
+++ b/lib/hash/rte_thash.c
@@ -15,6 +15,7 @@
 #include <rte_log.h>
 #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
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..c8f610d84d 100644
--- a/lib/hash/rte_thash_gf2_poly_math.c
+++ b/lib/hash/rte_thash_gf2_poly_math.c
@@ -8,6 +8,7 @@
 #include <rte_debug.h>
 #include <rte_thash.h>
 #include <rte_log.h>
+#include "thash_private.h"
 
 #define MAX_POLY_DEGREE 32
 #define MAX_TOEPLITZ_KEY_LENGTH 64
@@ -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..ea7bc69a46
--- /dev/null
+++ b/lib/hash/thash_private.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2025 Stephen Hemminger
+ */
+
+#ifndef _THASH_PRIVATE_H_
+#define _THASH_PRIVATE_H_
+
+#include <stdint.h>
+
+/**
+ * @internal
+ * Generate a random polynomial of the given degree.
+ */
+uint32_t thash_get_rand_poly(uint32_t poly_degree);
+
+#endif /* _THASH_PRIVATE_H_ */
-- 
2.53.0

Reply via email to