DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Yipeng Wang <yipeng1.wang@intel.com>,
	Sameh Gobriel <sameh.gobriel@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Subject: [PATCH 16/18] hash: mover rte_thash_gfni stubs out of header file
Date: Mon,  4 Dec 2023 18:09:54 -0800	[thread overview]
Message-ID: <20231205021330.260017-17-stephen@networkplumber.org> (raw)
In-Reply-To: <20231205021330.260017-1-stephen@networkplumber.org>

Having stubs in header file makes it harder to update
RTE_LOG(). Also modify to only print warning once.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/hash/meson.build      |  8 ++++++-
 lib/hash/rte_thash_gfni.c | 47 +++++++++++++++++++++++++++++++++++++++
 lib/hash/rte_thash_gfni.h | 23 +++++--------------
 lib/hash/version.map      |  2 ++
 4 files changed, 61 insertions(+), 19 deletions(-)
 create mode 100644 lib/hash/rte_thash_gfni.c

diff --git a/lib/hash/meson.build b/lib/hash/meson.build
index 2f757d45f9bc..e56ee8572564 100644
--- a/lib/hash/meson.build
+++ b/lib/hash/meson.build
@@ -17,7 +17,13 @@ indirect_headers += files(
         'rte_thash_x86_gfni.h',
 )
 
-sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c')
+sources = files(
+    'rte_cuckoo_hash.c',
+    'rte_fbk_hash.c',
+    'rte_thash.c',
+    'rte_thash_gfni.c'
+)
+
 deps += ['net']
 deps += ['ring']
 deps += ['rcu']
diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c
new file mode 100644
index 000000000000..eb334185725c
--- /dev/null
+++ b/lib/hash/rte_thash_gfni.c
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2021 Intel Corporation
+ */
+
+#include <stdbool.h>
+
+#include <rte_compat.h>
+#include <rte_log.h>
+#include <rte_thash_gfni.h>
+
+#ifndef RTE_THASH_GFNI_DEFINED
+
+uint32_t
+rte_thash_gfni(const uint64_t *mtrx __rte_unused,
+	       const uint8_t *key __rte_unused, int len __rte_unused)
+{
+	static bool warned;
+
+	if (!warned) {
+		warned = true;
+		RTE_LOG(ERR, HASH,
+			"%s is undefined under given arch\n", __func__);
+	}
+
+	return 0;
+}
+
+void
+rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused,
+		    int len __rte_unused, uint8_t *tuple[] __rte_unused,
+		    uint32_t val[], uint32_t num)
+{
+	unsigned int i;
+
+	static bool warned;
+
+	if (!warned) {
+		warned = true;
+		RTE_LOG(ERR, HASH,
+			"%s is undefined under given arch\n", __func__);
+	}
+
+	for (i = 0; i < num; i++)
+		val[i] = 0;
+}
+
+#endif
diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h
index cd253459e7da..4e5388a1bf65 100644
--- a/lib/hash/rte_thash_gfni.h
+++ b/lib/hash/rte_thash_gfni.h
@@ -33,13 +33,8 @@ extern "C" {
  * @return
  *  Calculated Toeplitz hash value.
  */
-static inline uint32_t
-rte_thash_gfni(const uint64_t *mtrx __rte_unused,
-	const uint8_t *key __rte_unused, int len __rte_unused)
-{
-	RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__);
-	return 0;
-}
+uint32_t
+rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len);
 
 /**
  * Bulk implementation for Toeplitz hash.
@@ -58,17 +53,9 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused,
  * @param num
  *  Number of tuples to hash.
  */
-static inline void
-rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused,
-	int len __rte_unused, uint8_t *tuple[] __rte_unused,
-	uint32_t val[], uint32_t num)
-{
-	unsigned int i;
-
-	RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__);
-	for (i = 0; i < num; i++)
-		val[i] = 0;
-}
+void
+rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[],
+		    uint32_t val[], uint32_t num);
 
 #endif /* RTE_THASH_GFNI_DEFINED */
 
diff --git a/lib/hash/version.map b/lib/hash/version.map
index b98b64a1638a..56a0cbd4b8a5 100644
--- a/lib/hash/version.map
+++ b/lib/hash/version.map
@@ -39,6 +39,8 @@ DPDK_24 {
 	rte_thash_get_gfni_matrices;
 	rte_thash_get_helper;
 	rte_thash_get_key;
+	rte_thash_gfni;
+	rte_thash_gfni_bulk;
 	rte_thash_gfni_supported;
 	rte_thash_init_ctx;
 
-- 
2.42.0


  parent reply	other threads:[~2023-12-05  2:15 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 23:40 [PATCH v12 00/22] Covert static log types in libraries to dynamic Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 01/22] gso: don't log message on non TCP/UDP Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 02/22] eal: drop no longer used GSO logtype Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 03/22] log: drop unused RTE_LOGTYPE_TIMER Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 04/22] efd: convert RTE_LOGTYPE_EFD to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 05/22] mbuf: convert RTE_LOGTYPE_MBUF " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 06/22] acl: convert RTE_LOGTYPE_ACL " Stephen Hemminger
2023-06-05 13:40   ` Константин Ананьев
2023-03-29 23:40 ` [PATCH v12 07/22] examples/power: replace use of RTE_LOGTYPE_POWER Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 08/22] examples/l3fwd-power: " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 09/22] power: convert RTE_LOGTYPE_POWER to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 10/22] ring: convert RTE_LOGTYPE_RING " Stephen Hemminger
2023-06-05 13:41   ` Константин Ананьев
2023-03-29 23:40 ` [PATCH v12 11/22] mempool: convert RTE_LOGTYPE_MEMPOOL " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 12/22] lpm: convert RTE_LOGTYPE_LPM to dynamic types Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 13/22] kni: convert RTE_LOGTYPE_KNI to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 14/22] sched: convert RTE_LOGTYPE_SCHED " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 15/22] examples/ipsec-secgw: replace RTE_LOGTYPE_PORT Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 16/22] port: convert RTE_LOGTYPE_PORT to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 17/22] hash: move rte_thash_gfni stubs out of header file Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 18/22] hash: move rte_hash_set_alg out header Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 19/22] hash: convert RTE_LOGTYPE_HASH to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 20/22] table: convert RTE_LOGTYPE_TABLE " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 21/22] app/test: remove use of RTE_LOGTYPE_PIPELINE Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 22/22] pipeline: convert RTE_LOGTYPE_PIPELINE to dynamic type Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 00/21] Convert static log types in libraries to dynamic types Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 01/21] gso: don't log message on non TCP/UDP Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 02/21] eal: drop no longer used GSO logtype Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 03/21] log: drop unused RTE_LOGTYPE_TIMER Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 04/21] efd: convert RTE_LOGTYPE_EFD to dynamic type Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 05/21] mbuf: convert RTE_LOGTYPE_MBUF " Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 06/21] acl: convert RTE_LOGTYPE_ACL " Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 07/21] examples/power: replace use of RTE_LOGTYPE_POWER Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 08/21] examples/l3fwd-power: " Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 09/21] power: convert RTE_LOGTYPE_POWER to dynamic type Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 10/21] ring: convert RTE_LOGTYPE_RING " Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 11/21] mempool: convert RTE_LOGTYPE_MEMPOOL " Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 12/21] lpm: convert RTE_LOGTYPE_LPM to dynamic types Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 13/21] sched: convert RTE_LOGTYPE_SCHED to dynamic type Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 14/21] examples/ipsec-secgw: replace RTE_LOGTYPE_PORT Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 15/21] port: convert RTE_LOGTYPE_PORT to dynamic type Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 16/21] hash: move rte_thash_gfni stubs out of header file Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 17/21] hash: move rte_hash_set_alg out header Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 18/21] hash: convert RTE_LOGTYPE_HASH to dynamic type Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 19/21] table: convert RTE_LOGTYPE_TABLE " Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 20/21] app/test: remove use of RTE_LOGTYPE_PIPELINE Stephen Hemminger
2023-08-21 16:09   ` [PATCH v13 21/21] pipeline: convert RTE_LOGTYPE_PIPELINE to dynamic type Stephen Hemminger
2023-12-04 12:32   ` [PATCH v13 00/21] Convert static log types in libraries to dynamic types David Marchand
2023-12-05  2:09 ` [PATCH 00/18] Convert static log types in libraries to dynamic Stephen Hemminger
2023-12-05  2:09   ` [PATCH 01/18] gso: don't log message on non TCP/UDP Stephen Hemminger
2023-12-05  2:09   ` [PATCH 02/18] eal: drop no longer used GSO logtype Stephen Hemminger
2023-12-05  2:09   ` [PATCH 03/18] log: drop unused RTE_LOGTYPE_TIMER Stephen Hemminger
2023-12-05  2:09   ` [PATCH 04/18] efd: convert RTE_LOGTYPE_EFD to dynamic type Stephen Hemminger
2023-12-05  2:09   ` [PATCH 05/18] mbuf: convert RTE_LOGTYPE_MBUF " Stephen Hemminger
2023-12-05  2:09   ` [PATCH 06/18] acl: convert RTE_LOGTYPE_ACL " Stephen Hemminger
2023-12-05  2:09   ` [PATCH 07/18] examples/power: replace use of RTE_LOGTYPE_POWER Stephen Hemminger
2023-12-05  2:09   ` [PATCH 08/18] examples/l3fwd-power: " Stephen Hemminger
2023-12-05  2:09   ` [PATCH 09/18] power: convert RTE_LOGTYPE_POWER to dynamic type Stephen Hemminger
2023-12-05  2:09   ` [PATCH 10/18] ring: convert RTE_LOGTYPE_RING " Stephen Hemminger
2023-12-05  2:09   ` [PATCH 11/18] mempool: convert RTE_LOGTYPE_MEMPOOL " Stephen Hemminger
2023-12-05  2:09   ` [PATCH 12/18] lpm: convert RTE_LOGTYPE_LPM to dynamic types Stephen Hemminger
2023-12-05  2:09   ` [PATCH 13/18] sched: convert RTE_LOGTYPE_SCHED to dynamic type Stephen Hemminger
2023-12-05  2:09   ` [PATCH 14/18] examples/ipsec-secgw: replace RTE_LOGTYPE_PORT Stephen Hemminger
2023-12-05  2:09   ` [PATCH 15/18] app/test: remove use of RTE_LOGTYPE_PIPELINE Stephen Hemminger
2023-12-05  2:09   ` Stephen Hemminger [this message]
2023-12-05  2:09   ` [PATCH 17/18] hash: move rte_hash_set_alg out of header file Stephen Hemminger
2023-12-05  2:09   ` [PATCH 18/18] hash: convert RTE_LOGTYPE_HASH to dynamic type Stephen Hemminger
2023-12-06 10:08   ` [PATCH 00/18] Convert static log types in libraries to dynamic David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231205021330.260017-17-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=sameh.gobriel@intel.com \
    --cc=vladimir.medvedkin@intel.com \
    --cc=yipeng1.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).