Remove last library static logtypes
cover Remove last library static logtypes
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
Signature · 1 line
2.43.0
PATCH 1/3 port: convert to dynamic log type
Replace static RTE_LOGTYPE_PORT with dynamic type. Since there are several types of port do initialization in a short standalone file.
--- 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(-)
lib/log/log.c +0 -1
@@ -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" },
lib/log/rte_log.h +1 -1
@@ -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 */
lib/port/meson.build +1 -0
@@ -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',
lib/port/port_log.h +3 -1
@@ -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__) -
Signature · 1 line
2.43.0
PATCH 2/3 table: convert to dynamic logtype
In reply to Stephen HemmingerReplace static RTE_LOGTYPE_TABLE with dynamic type.
--- 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
lib/log/log.c +0 -1
@@ -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" },
lib/log/rte_log.h +1 -1
@@ -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 */
lib/port/port_log.c new file +7 -0
@@ -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 );
lib/table/meson.build +2 -0
@@ -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',
lib/table/table_log.c new file +7 -0
@@ -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 );
lib/table/table_log.h +3 -1
@@ -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__) -
Signature · 1 line
2.43.0
PATCH 3/3 pipeline: convert to a dynamic logtype
In reply to Stephen HemmingerReplace RTE_LOGTYPE_PIPELINE static type with a dynamic one.
--- lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- lib/pipeline/rte_pipeline.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-)
lib/log/log.c +0 -1
@@ -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" },
lib/log/rte_log.h +1 -1
@@ -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 */
lib/pipeline/rte_pipeline.c +3 -0
@@ -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__)
Signature · 1 line
2.43.0
David Marchand
AppliedQuoted 8 lines · 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
Quoted 12 lines
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.
Signature · 1 line
David Marchand