* [PATCH 0/3] Remove last library static logtypes
@ 2023-12-22 17:44 Stephen Hemminger
2023-12-22 17:44 ` [PATCH 1/3] port: convert to dynamic log type Stephen Hemminger
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:44 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
These three libraries were depending on static logtypes.
Stephen Hemminger (3):
port: convert to dynamic log type
table: convert to dynamic logtype
pipeline: convert to a dynamic logtype
lib/log/log.c | 3 ---
lib/log/rte_log.h | 6 +++---
lib/pipeline/rte_pipeline.c | 3 +++
lib/port/meson.build | 1 +
lib/port/port_log.c | 7 +++++++
lib/port/port_log.h | 4 +++-
lib/table/meson.build | 2 ++
lib/table/table_log.c | 7 +++++++
lib/table/table_log.h | 4 +++-
9 files changed, 29 insertions(+), 8 deletions(-)
create mode 100644 lib/port/port_log.c
create mode 100644 lib/table/table_log.c
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] port: convert to dynamic log type
2023-12-22 17:44 [PATCH 0/3] Remove last library static logtypes Stephen Hemminger
@ 2023-12-22 17:44 ` Stephen Hemminger
2023-12-22 17:44 ` [PATCH 2/3] table: convert to dynamic logtype Stephen Hemminger
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:44 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu
Replace static RTE_LOGTYPE_PORT with dynamic type.
Since there are several types of port do initialization
in a short standalone file.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/log/log.c | 1 -
lib/log/rte_log.h | 2 +-
lib/port/meson.build | 1 +
lib/port/port_log.h | 4 +++-
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/log/log.c b/lib/log/log.c
index ab06132a98a1..853acaf07eb2 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -353,7 +353,6 @@ struct logtype {
static const struct logtype logtype_strings[] = {
{RTE_LOGTYPE_EAL, "lib.eal"},
{RTE_LOGTYPE_PMD, "pmd"},
- {RTE_LOGTYPE_PORT, "lib.port"},
{RTE_LOGTYPE_TABLE, "lib.table"},
{RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
{RTE_LOGTYPE_EVENTDEV, "lib.eventdev"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 5ba198ba2484..5c73e689e8aa 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -40,7 +40,7 @@ extern "C" {
/* was RTE_LOGTYPE_POWER */
/* was RTE_LOGTYPE_METER */
/* was RTE_LOGTYPE_SCHED */
-#define RTE_LOGTYPE_PORT 13 /**< Log related to port. */
+ /* was RTE_LOGTYPE_PORT */
#define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */
#define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */
/* was RTE_LOGTYPE_MBUF */
diff --git a/lib/port/meson.build b/lib/port/meson.build
index b0af2b185b39..b5977728723a 100644
--- a/lib/port/meson.build
+++ b/lib/port/meson.build
@@ -8,6 +8,7 @@ if is_windows
endif
sources = files(
+ 'port_log.c',
'rte_port_ethdev.c',
'rte_port_fd.c',
'rte_port_frag.c',
diff --git a/lib/port/port_log.h b/lib/port/port_log.h
index 99332a380323..28d75ee48b3b 100644
--- a/lib/port/port_log.h
+++ b/lib/port/port_log.h
@@ -4,6 +4,8 @@
#include <rte_log.h>
+extern int port_logtype;
+#define RTE_LOGTYPE_PORT port_logtype
+
#define PORT_LOG(level, ...) \
RTE_LOG_LINE(level, PORT, "" __VA_ARGS__)
-
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] table: convert to dynamic logtype
2023-12-22 17:44 [PATCH 0/3] Remove last library static logtypes Stephen Hemminger
2023-12-22 17:44 ` [PATCH 1/3] port: convert to dynamic log type Stephen Hemminger
@ 2023-12-22 17:44 ` Stephen Hemminger
2023-12-22 17:44 ` [PATCH 3/3] pipeline: convert to a " Stephen Hemminger
2024-01-12 11:03 ` [PATCH 0/3] Remove last library static logtypes David Marchand
3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:44 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu
Replace static RTE_LOGTYPE_TABLE with dynamic type.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/log/log.c | 1 -
lib/log/rte_log.h | 2 +-
lib/port/port_log.c | 7 +++++++
lib/table/meson.build | 2 ++
lib/table/table_log.c | 7 +++++++
lib/table/table_log.h | 4 +++-
6 files changed, 20 insertions(+), 3 deletions(-)
create mode 100644 lib/port/port_log.c
create mode 100644 lib/table/table_log.c
diff --git a/lib/log/log.c b/lib/log/log.c
index 853acaf07eb2..7ae798493e51 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -353,7 +353,6 @@ struct logtype {
static const struct logtype logtype_strings[] = {
{RTE_LOGTYPE_EAL, "lib.eal"},
{RTE_LOGTYPE_PMD, "pmd"},
- {RTE_LOGTYPE_TABLE, "lib.table"},
{RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
{RTE_LOGTYPE_EVENTDEV, "lib.eventdev"},
{RTE_LOGTYPE_USER1, "user1"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 5c73e689e8aa..6bfa66dc8986 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -41,7 +41,7 @@ extern "C" {
/* was RTE_LOGTYPE_METER */
/* was RTE_LOGTYPE_SCHED */
/* was RTE_LOGTYPE_PORT */
-#define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */
+ /* was RTE_LOGTYPE_TABLE */
#define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */
/* was RTE_LOGTYPE_MBUF */
/* was RTE_LOGTYPE_CRYPTODEV */
diff --git a/lib/port/port_log.c b/lib/port/port_log.c
new file mode 100644
index 000000000000..1984b17bc4f7
--- /dev/null
+++ b/lib/port/port_log.c
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Red Hat, Inc.
+ */
+
+#include <rte_log.h>
+
+RTE_LOG_REGISTER_DEFAULT(port_logtype, INFO);
diff --git a/lib/table/meson.build b/lib/table/meson.build
index f8cef24b5918..9b3d9ac759eb 100644
--- a/lib/table/meson.build
+++ b/lib/table/meson.build
@@ -18,7 +18,9 @@ sources = files(
'rte_table_lpm.c',
'rte_table_lpm_ipv6.c',
'rte_table_stub.c',
+ 'table_log.c',
)
+
headers = files(
'rte_lru.h',
'rte_swx_hash_func.h',
diff --git a/lib/table/table_log.c b/lib/table/table_log.c
new file mode 100644
index 000000000000..8c84ed84671c
--- /dev/null
+++ b/lib/table/table_log.c
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Red Hat, Inc.
+ */
+
+#include <rte_log.h>
+
+RTE_LOG_REGISTER_DEFAULT(table_logtype, INFO);
diff --git a/lib/table/table_log.h b/lib/table/table_log.h
index 0330f89d4192..b24b8614c227 100644
--- a/lib/table/table_log.h
+++ b/lib/table/table_log.h
@@ -4,6 +4,8 @@
#include <rte_log.h>
+extern int table_logtype;
+#define RTE_LOGTYPE_TABLE table_logtype
+
#define TABLE_LOG(level, ...) \
RTE_LOG_LINE(level, TABLE, "" __VA_ARGS__)
-
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] pipeline: convert to a dynamic logtype
2023-12-22 17:44 [PATCH 0/3] Remove last library static logtypes Stephen Hemminger
2023-12-22 17:44 ` [PATCH 1/3] port: convert to dynamic log type Stephen Hemminger
2023-12-22 17:44 ` [PATCH 2/3] table: convert to dynamic logtype Stephen Hemminger
@ 2023-12-22 17:44 ` Stephen Hemminger
2024-01-12 11:03 ` [PATCH 0/3] Remove last library static logtypes David Marchand
3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2023-12-22 17:44 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu
Replace RTE_LOGTYPE_PIPELINE static type with a dynamic one.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/log/log.c | 1 -
lib/log/rte_log.h | 2 +-
lib/pipeline/rte_pipeline.c | 3 +++
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/log/log.c b/lib/log/log.c
index 7ae798493e51..123510616455 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -353,7 +353,6 @@ struct logtype {
static const struct logtype logtype_strings[] = {
{RTE_LOGTYPE_EAL, "lib.eal"},
{RTE_LOGTYPE_PMD, "pmd"},
- {RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
{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 6bfa66dc8986..5f28c3832de9 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -42,7 +42,7 @@ extern "C" {
/* was RTE_LOGTYPE_SCHED */
/* was RTE_LOGTYPE_PORT */
/* was RTE_LOGTYPE_TABLE */
-#define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */
+ /* was RTE_LOGTYPE_PIPELINE */
/* was RTE_LOGTYPE_MBUF */
/* was RTE_LOGTYPE_CRYPTODEV */
/* was RTE_LOGTYPE_EFD */
diff --git a/lib/pipeline/rte_pipeline.c b/lib/pipeline/rte_pipeline.c
index b0aea4596daa..c9ed903d716b 100644
--- a/lib/pipeline/rte_pipeline.c
+++ b/lib/pipeline/rte_pipeline.c
@@ -12,6 +12,9 @@
#include "rte_pipeline.h"
+RTE_LOG_REGISTER_DEFAULT(pipeline_logtype, INFO);
+#define RTE_LOGTYPE_PIPELINE pipeline_logtype
+
#define PIPELINE_LOG(level, ...) \
RTE_LOG_LINE(level, PIPELINE, "" __VA_ARGS__)
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] Remove last library static logtypes
2023-12-22 17:44 [PATCH 0/3] Remove last library static logtypes Stephen Hemminger
` (2 preceding siblings ...)
2023-12-22 17:44 ` [PATCH 3/3] pipeline: convert to a " Stephen Hemminger
@ 2024-01-12 11:03 ` David Marchand
3 siblings, 0 replies; 5+ messages in thread
From: David Marchand @ 2024-01-12 11:03 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
On Fri, Dec 22, 2023 at 6:46 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> These three libraries were depending on static logtypes.
>
> Stephen Hemminger (3):
> port: convert to dynamic log type
> table: convert to dynamic logtype
> pipeline: convert to a dynamic logtype
>
> lib/log/log.c | 3 ---
> lib/log/rte_log.h | 6 +++---
> lib/pipeline/rte_pipeline.c | 3 +++
> lib/port/meson.build | 1 +
> lib/port/port_log.c | 7 +++++++
> lib/port/port_log.h | 4 +++-
> lib/table/meson.build | 2 ++
> lib/table/table_log.c | 7 +++++++
> lib/table/table_log.h | 4 +++-
> 9 files changed, 29 insertions(+), 8 deletions(-)
> create mode 100644 lib/port/port_log.c
> create mode 100644 lib/table/table_log.c
I fixed patch 1 which was missing some bits added in patch 2.
I also fixed the copyright notices.
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-01-12 11:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-22 17:44 [PATCH 0/3] Remove last library static logtypes Stephen Hemminger
2023-12-22 17:44 ` [PATCH 1/3] port: convert to dynamic log type Stephen Hemminger
2023-12-22 17:44 ` [PATCH 2/3] table: convert to dynamic logtype Stephen Hemminger
2023-12-22 17:44 ` [PATCH 3/3] pipeline: convert to a " Stephen Hemminger
2024-01-12 11:03 ` [PATCH 0/3] Remove last library static logtypes David Marchand
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).