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>,
	Jerin Jacob <jerinj@marvell.com>
Subject: [PATCH v2] eventdev: replace RTE_LOGTYPE_EVENTDEV with a dynamic type
Date: Tue, 12 Dec 2023 09:02:24 -0800	[thread overview]
Message-ID: <20231212170255.173813-1-stephen@networkplumber.org> (raw)

With a little setup in eventdev_pmd.h the eventdev drivers
and API can be converted to dynamic log type.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
v2 - logtpe can be internal

 lib/eventdev/eventdev_pmd.h | 3 +++
 lib/eventdev/rte_eventdev.c | 2 ++
 lib/eventdev/version.map    | 1 +
 lib/log/log.c               | 1 -
 lib/log/rte_log.h           | 2 +-
 5 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
index 30bd90085c44..52dc1a1d79fb 100644
--- a/lib/eventdev/eventdev_pmd.h
+++ b/lib/eventdev/eventdev_pmd.h
@@ -31,6 +31,9 @@ extern "C" {
 #include "event_timer_adapter_pmd.h"
 #include "rte_eventdev.h"
 
+extern int rte_event_logtype;
+#define RTE_LOGTYPE_EVENTDEV rte_event_logtype
+
 /* Logging Macros */
 #define RTE_EDEV_LOG_ERR(...) \
 	RTE_LOG(ERR, EVENTDEV, \
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 0ca32d672175..10ea7f626e66 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -28,6 +28,8 @@
 #include "eventdev_pmd.h"
 #include "eventdev_trace.h"
 
+RTE_LOG_REGISTER_DEFAULT(rte_event_logtype, INFO);
+
 static struct rte_eventdev rte_event_devices[RTE_EVENT_MAX_DEVS];
 
 struct rte_eventdev *rte_eventdevs = rte_event_devices;
diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
index 3d5c6c2b835c..520b190bb84c 100644
--- a/lib/eventdev/version.map
+++ b/lib/eventdev/version.map
@@ -155,6 +155,7 @@ INTERNAL {
 	event_dev_fp_ops_reset;
 	event_dev_fp_ops_set;
 	event_dev_probing_finish;
+	rte_event_logtype;
 	rte_event_pmd_allocate;
 	rte_event_pmd_get_named_dev;
 	rte_event_pmd_is_valid_dev;
diff --git a/lib/log/log.c b/lib/log/log.c
index ab06132a98a1..641b4884aad2 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -356,7 +356,6 @@ static const struct logtype logtype_strings[] = {
 	{RTE_LOGTYPE_PORT,       "lib.port"},
 	{RTE_LOGTYPE_TABLE,      "lib.table"},
 	{RTE_LOGTYPE_PIPELINE,   "lib.pipeline"},
-	{RTE_LOGTYPE_EVENTDEV,   "lib.eventdev"},
 	{RTE_LOGTYPE_USER1,      "user1"},
 	{RTE_LOGTYPE_USER2,      "user2"},
 	{RTE_LOGTYPE_USER3,      "user3"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 3394746103d4..b955adff7bac 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -45,7 +45,7 @@ extern "C" {
 				 /* was RTE_LOGTYPE_MBUF */
 				 /* was RTE_LOGTYPE_CRYPTODEV */
 				 /* was RTE_LOGTYPE_EFD */
-#define RTE_LOGTYPE_EVENTDEV  19 /**< Log related to eventdev. */
+				 /* was RTE_LOGTYPE_EVENTDEV */
 				 /* was RTE_LOGTYPE_GSO */
 
 /* these log types can be used in an application */
-- 
2.42.0


                 reply	other threads:[~2023-12-12 17:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231212170255.173813-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.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).