[04/18] efd: convert RTE_LOGTYPE_EFD to dynamic type

Message ID 20231205021330.260017-5-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series Convert static log types in libraries to dynamic |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Dec. 5, 2023, 2:09 a.m. UTC
  Replace all uses of the global logtype with a dynamic log type.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/efd/rte_efd.c | 4 ++++
 lib/log/log.c     | 1 -
 lib/log/rte_log.h | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
index dad962ce29bf..78fb9250ef87 100644
--- a/lib/efd/rte_efd.c
+++ b/lib/efd/rte_efd.c
@@ -9,6 +9,7 @@ 
 #include <errno.h>
 #include <sys/queue.h>
 
+#include <rte_cpuflags.h>
 #include <rte_string_fns.h>
 #include <rte_log.h>
 #include <rte_eal_memconfig.h>
@@ -28,6 +29,9 @@ 
 #include "rte_efd_arm64.h"
 #endif
 
+RTE_LOG_REGISTER_DEFAULT(efd_logtype, INFO);
+#define RTE_LOGTYPE_EFD	efd_logtype
+
 #define EFD_KEY(key_idx, table) (table->keys + ((key_idx) * table->key_len))
 /** Hash function used to determine chunk_id and bin_id for a group */
 #define EFD_HASH(key, table) \
diff --git a/lib/log/log.c b/lib/log/log.c
index c05a7cf5a2dd..c256709b8586 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -367,7 +367,6 @@  static const struct logtype logtype_strings[] = {
 	{RTE_LOGTYPE_PIPELINE,   "lib.pipeline"},
 	{RTE_LOGTYPE_MBUF,       "lib.mbuf"},
 	{RTE_LOGTYPE_CRYPTODEV,  "lib.cryptodev"},
-	{RTE_LOGTYPE_EFD,        "lib.efd"},
 	{RTE_LOGTYPE_EVENTDEV,   "lib.eventdev"},
 	{RTE_LOGTYPE_USER1,      "user1"},
 	{RTE_LOGTYPE_USER2,      "user2"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index fe8188302125..c6594e0509a5 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -44,7 +44,7 @@  extern "C" {
 #define RTE_LOGTYPE_PIPELINE  15 /**< Log related to pipeline. */
 #define RTE_LOGTYPE_MBUF      16 /**< Log related to mbuf. */
 #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */
-#define RTE_LOGTYPE_EFD       18 /**< Log related to EFD. */
+				 /* was RTE_LOGTYPE_EFD */
 #define RTE_LOGTYPE_EVENTDEV  19 /**< Log related to eventdev. */
 				 /* was RTE_LOGTYPE_GSO */