[PATCH v3 16/16] pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic log type

Stephen Hemminger stephen at networkplumber.org
Fri Feb 10 02:07:24 CET 2023


Split the static global PIPELINE log type into multiple suffix
log types (by stage).

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/eal/common/eal_common_log.c |   1 -
 lib/eal/include/rte_log.h       |   2 +-
 lib/pipeline/rte_pipeline.c     | 242 ++++++++++++--------------------
 3 files changed, 87 insertions(+), 158 deletions(-)

diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c
index a4e718e51d12..e4a4f7812bde 100644
--- a/lib/eal/common/eal_common_log.c
+++ b/lib/eal/common/eal_common_log.c
@@ -350,7 +350,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_CRYPTODEV,  "lib.cryptodev"},
 	{RTE_LOGTYPE_EVENTDEV,   "lib.eventdev"},
 
diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h
index af87eb42ddb3..e2c11ad45c7f 100644
--- a/lib/eal/include/rte_log.h
+++ b/lib/eal/include/rte_log.h
@@ -41,7 +41,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 */
 #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */
 				 /* was RTE_LOGTYPE_EFD */
diff --git a/lib/pipeline/rte_pipeline.c b/lib/pipeline/rte_pipeline.c
index ff86c7cf96bf..19597d4e0f1e 100644
--- a/lib/pipeline/rte_pipeline.c
+++ b/lib/pipeline/rte_pipeline.c
@@ -12,6 +12,12 @@
 
 #include "rte_pipeline.h"
 
+RTE_LOG_REGISTER_DEFAULT(pipeline_logtype, INFO);
+
+#define PIPELINE_LOG(level, fmt, args...)		\
+	rte_log(RTE_LOG_ ## level, pipeline_logtype,	\
+		"%s(): " fmt "\n", __func__, ## args)
+
 #define RTE_TABLE_INVALID                                 UINT32_MAX
 
 #ifdef RTE_PIPELINE_STATS_COLLECT
@@ -161,23 +167,19 @@ static int
 rte_pipeline_check_params(struct rte_pipeline_params *params)
 {
 	if (params == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Incorrect value for parameter params\n", __func__);
+		PIPELINE_LOG(ERR, "Incorrect value for parameter params");
 		return -EINVAL;
 	}
 
 	/* name */
 	if (params->name == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Incorrect value for parameter name\n", __func__);
+		PIPELINE_LOG(ERR, "Incorrect value for parameter name");
 		return -EINVAL;
 	}
 
 	/* socket */
 	if (params->socket_id < 0) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Incorrect value for parameter socket_id\n",
-			__func__);
+		PIPELINE_LOG(ERR, "Incorrect value for parameter socket_id");
 		return -EINVAL;
 	}
 
@@ -193,9 +195,8 @@ rte_pipeline_create(struct rte_pipeline_params *params)
 	/* Check input parameters */
 	status = rte_pipeline_check_params(params);
 	if (status != 0) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Pipeline params check failed (%d)\n",
-			__func__, status);
+		PIPELINE_LOG(ERR, "Pipeline params check failed (%d)",
+			     status);
 		return NULL;
 	}
 
@@ -204,8 +205,7 @@ rte_pipeline_create(struct rte_pipeline_params *params)
 			RTE_CACHE_LINE_SIZE, params->socket_id);
 
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Pipeline memory allocation failed\n", __func__);
+		PIPELINE_LOG(ERR, "Pipeline memory allocation failed");
 		return NULL;
 	}
 
@@ -233,8 +233,7 @@ rte_pipeline_free(struct rte_pipeline *p)
 
 	/* Check input parameters */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: rte_pipeline parameter is NULL\n", __func__);
+		PIPELINE_LOG(ERR, "rte_pipeline parameter is NULL");
 		return -EINVAL;
 	}
 
@@ -275,45 +274,37 @@ rte_table_check_params(struct rte_pipeline *p,
 		uint32_t *table_id)
 {
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter is NULL");
 		return -EINVAL;
 	}
 	if (params == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: params parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "params parameter is NULL");
 		return -EINVAL;
 	}
 	if (table_id == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: table_id parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "table_id parameter is NULL");
 		return -EINVAL;
 	}
 
 	/* ops */
 	if (params->ops == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: params->ops is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "params->ops is NULL");
 		return -EINVAL;
 	}
 
 	if (params->ops->f_create == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: f_create function pointer is NULL\n", __func__);
+		PIPELINE_LOG(ERR, "f_create function pointer is NULL");
 		return -EINVAL;
 	}
 
 	if (params->ops->f_lookup == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: f_lookup function pointer is NULL\n", __func__);
+		PIPELINE_LOG(ERR, "f_lookup function pointer is NULL");
 		return -EINVAL;
 	}
 
 	/* De we have room for one more table? */
 	if (p->num_tables == RTE_PIPELINE_TABLE_MAX) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Incorrect value for num_tables parameter\n",
-			__func__);
+		PIPELINE_LOG(ERR, "Incorrect value for num_tables parameter");
 		return -EINVAL;
 	}
 
@@ -345,8 +336,7 @@ rte_pipeline_table_create(struct rte_pipeline *p,
 	default_entry = rte_zmalloc_socket(
 		"PIPELINE", entry_size, RTE_CACHE_LINE_SIZE, p->socket_id);
 	if (default_entry == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Failed to allocate default entry\n", __func__);
+		PIPELINE_LOG(ERR, "Failed to allocate default entry");
 		return -EINVAL;
 	}
 
@@ -355,7 +345,7 @@ rte_pipeline_table_create(struct rte_pipeline *p,
 		entry_size);
 	if (h_table == NULL) {
 		rte_free(default_entry);
-		RTE_LOG(ERR, PIPELINE, "%s: Table creation failed\n", __func__);
+		PIPELINE_LOG(ERR, "Table creation failed");
 		return -EINVAL;
 	}
 
@@ -401,20 +391,17 @@ rte_pipeline_table_default_entry_add(struct rte_pipeline *p,
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (default_entry == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: default_entry parameter is NULL\n", __func__);
+		PIPELINE_LOG(ERR, "default_entry parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (table_id >= p->num_tables) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: table_id %d out of range\n", __func__, table_id);
+		PIPELINE_LOG(ERR, "table_id %d out of range", table_id);
 		return -EINVAL;
 	}
 
@@ -423,8 +410,7 @@ rte_pipeline_table_default_entry_add(struct rte_pipeline *p,
 	if ((default_entry->action == RTE_PIPELINE_ACTION_TABLE) &&
 		table->table_next_id_valid &&
 		(default_entry->table_id != table->table_next_id)) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Tree-like topologies not allowed\n", __func__);
+		PIPELINE_LOG(ERR, "Tree-like topologies not allowed");
 		return -EINVAL;
 	}
 
@@ -450,14 +436,12 @@ rte_pipeline_table_default_entry_delete(struct rte_pipeline *p,
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: pipeline parameter is NULL\n", __func__);
+		PIPELINE_LOG(ERR, "pipeline parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (table_id >= p->num_tables) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: table_id %d out of range\n", __func__, table_id);
+		PIPELINE_LOG(ERR, "table_id %d out of range", table_id);
 		return -EINVAL;
 	}
 
@@ -486,41 +470,36 @@ rte_pipeline_table_entry_add(struct rte_pipeline *p,
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (key == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: key parameter is NULL\n", __func__);
+		PIPELINE_LOG(ERR, "key parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (entry == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: entry parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "entry parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (table_id >= p->num_tables) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: table_id %d out of range\n", __func__, table_id);
+		PIPELINE_LOG(ERR, "table_id %d out of range", table_id);
 		return -EINVAL;
 	}
 
 	table = &p->tables[table_id];
 
 	if (table->ops.f_add == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: f_add function pointer NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "f_add function pointer NULL");
 		return -EINVAL;
 	}
 
 	if ((entry->action == RTE_PIPELINE_ACTION_TABLE) &&
 		table->table_next_id_valid &&
 		(entry->table_id != table->table_next_id)) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Tree-like topologies not allowed\n", __func__);
+		PIPELINE_LOG(ERR, "Tree-like topologies not allowed");
 		return -EINVAL;
 	}
 
@@ -546,28 +525,24 @@ rte_pipeline_table_entry_delete(struct rte_pipeline *p,
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	if (key == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: key parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "key parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (table_id >= p->num_tables) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: table_id %d out of range\n", __func__, table_id);
+		PIPELINE_LOG(ERR, "table_id %d out of range", table_id);
 		return -EINVAL;
 	}
 
 	table = &p->tables[table_id];
 
 	if (table->ops.f_delete == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: f_delete function pointer NULL\n", __func__);
+		PIPELINE_LOG(ERR, "f_delete function pointer NULL");
 		return -EINVAL;
 	}
 
@@ -587,33 +562,29 @@ int rte_pipeline_table_entry_add_bulk(struct rte_pipeline *p,
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (keys == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: keys parameter is NULL\n", __func__);
+		PIPELINE_LOG(ERR, "keys parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (entries == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: entries parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "entries parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (table_id >= p->num_tables) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: table_id %d out of range\n", __func__, table_id);
+		PIPELINE_LOG(ERR, "table_id %d out of range", table_id);
 		return -EINVAL;
 	}
 
 	table = &p->tables[table_id];
 
 	if (table->ops.f_add_bulk == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: f_add_bulk function pointer NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "f_add_bulk function pointer NULL");
 		return -EINVAL;
 	}
 
@@ -621,8 +592,7 @@ int rte_pipeline_table_entry_add_bulk(struct rte_pipeline *p,
 		if ((entries[i]->action == RTE_PIPELINE_ACTION_TABLE) &&
 			table->table_next_id_valid &&
 			(entries[i]->table_id != table->table_next_id)) {
-			RTE_LOG(ERR, PIPELINE,
-				"%s: Tree-like topologies not allowed\n", __func__);
+			PIPELINE_LOG(ERR, "Tree-like topologies not allowed");
 			return -EINVAL;
 		}
 	}
@@ -651,28 +621,24 @@ int rte_pipeline_table_entry_delete_bulk(struct rte_pipeline *p,
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	if (keys == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: key parameter is NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "key parameter is NULL");
 		return -EINVAL;
 	}
 
 	if (table_id >= p->num_tables) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: table_id %d out of range\n", __func__, table_id);
+		PIPELINE_LOG(ERR, "table_id %d out of range", table_id);
 		return -EINVAL;
 	}
 
 	table = &p->tables[table_id];
 
 	if (table->ops.f_delete_bulk == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: f_delete function pointer NULL\n", __func__);
+		PIPELINE_LOG(ERR, "f_delete function pointer NULL");
 		return -EINVAL;
 	}
 
@@ -690,51 +656,44 @@ rte_pipeline_port_in_check_params(struct rte_pipeline *p,
 		uint32_t *port_id)
 {
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 	if (params == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: params parameter NULL\n", __func__);
+		PIPELINE_LOG(ERR, "params parameter NULL");
 		return -EINVAL;
 	}
 	if (port_id == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: port_id parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "port_id parameter NULL");
 		return -EINVAL;
 	}
 
 	/* ops */
 	if (params->ops == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: params->ops parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "params->ops parameter NULL");
 		return -EINVAL;
 	}
 
 	if (params->ops->f_create == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: f_create function pointer NULL\n", __func__);
+		PIPELINE_LOG(ERR, "f_create function pointer NULL");
 		return -EINVAL;
 	}
 
 	if (params->ops->f_rx == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: f_rx function pointer NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "f_rx function pointer NULL");
 		return -EINVAL;
 	}
 
 	/* burst_size */
 	if ((params->burst_size == 0) ||
 		(params->burst_size > RTE_PORT_IN_BURST_SIZE_MAX)) {
-		RTE_LOG(ERR, PIPELINE, "%s: invalid value for burst_size\n",
-			__func__);
+		PIPELINE_LOG(ERR, "invalid value for burst_size");
 		return -EINVAL;
 	}
 
 	/* Do we have room for one more port? */
 	if (p->num_ports_in == RTE_PIPELINE_PORT_IN_MAX) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: invalid value for num_ports_in\n", __func__);
+		PIPELINE_LOG(ERR, "invalid value for num_ports_in");
 		return -EINVAL;
 	}
 
@@ -747,51 +706,44 @@ rte_pipeline_port_out_check_params(struct rte_pipeline *p,
 		uint32_t *port_id)
 {
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	if (params == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: params parameter NULL\n", __func__);
+		PIPELINE_LOG(ERR, "params parameter NULL");
 		return -EINVAL;
 	}
 
 	if (port_id == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: port_id parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "port_id parameter NULL");
 		return -EINVAL;
 	}
 
 	/* ops */
 	if (params->ops == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: params->ops parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "params->ops parameter NULL");
 		return -EINVAL;
 	}
 
 	if (params->ops->f_create == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: f_create function pointer NULL\n", __func__);
+		PIPELINE_LOG(ERR, "f_create function pointer NULL");
 		return -EINVAL;
 	}
 
 	if (params->ops->f_tx == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: f_tx function pointer NULL\n", __func__);
+		PIPELINE_LOG(ERR, "f_tx function pointer NULL");
 		return -EINVAL;
 	}
 
 	if (params->ops->f_tx_bulk == NULL) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: f_tx_bulk function pointer NULL\n", __func__);
+		PIPELINE_LOG(ERR, "f_tx_bulk function pointer NULL");
 		return -EINVAL;
 	}
 
 	/* Do we have room for one more port? */
 	if (p->num_ports_out == RTE_PIPELINE_PORT_OUT_MAX) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: invalid value for num_ports_out\n", __func__);
+		PIPELINE_LOG(ERR, "invalid value for num_ports_out");
 		return -EINVAL;
 	}
 
@@ -819,7 +771,7 @@ rte_pipeline_port_in_create(struct rte_pipeline *p,
 	/* Create the port */
 	h_port = params->ops->f_create(params->arg_create, p->socket_id);
 	if (h_port == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: Port creation failed\n", __func__);
+		PIPELINE_LOG(ERR, "Port creation failed");
 		return -EINVAL;
 	}
 
@@ -869,7 +821,7 @@ rte_pipeline_port_out_create(struct rte_pipeline *p,
 	/* Create the port */
 	h_port = params->ops->f_create(params->arg_create, p->socket_id);
 	if (h_port == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: Port creation failed\n", __func__);
+		PIPELINE_LOG(ERR, "Port creation failed");
 		return -EINVAL;
 	}
 
@@ -904,22 +856,17 @@ rte_pipeline_port_in_connect_to_table(struct rte_pipeline *p,
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	if (port_id >= p->num_ports_in) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: port IN ID %u is out of range\n",
-			__func__, port_id);
+		PIPELINE_LOG(ERR, "port IN ID %u is out of range", port_id);
 		return -EINVAL;
 	}
 
 	if (table_id >= p->num_tables) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: Table ID %u is out of range\n",
-			__func__, table_id);
+		PIPELINE_LOG(ERR, "Table ID %u is out of range", table_id);
 		return -EINVAL;
 	}
 
@@ -938,15 +885,12 @@ rte_pipeline_port_in_enable(struct rte_pipeline *p, uint32_t port_id)
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	if (port_id >= p->num_ports_in) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: port IN ID %u is out of range\n",
-			__func__, port_id);
+		PIPELINE_LOG(ERR, "port IN ID %u is out of range", port_id);
 		return -EINVAL;
 	}
 
@@ -985,14 +929,12 @@ rte_pipeline_port_in_disable(struct rte_pipeline *p, uint32_t port_id)
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-		__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	if (port_id >= p->num_ports_in) {
-		RTE_LOG(ERR, PIPELINE, "%s: port IN ID %u is out of range\n",
-			__func__, port_id);
+		PIPELINE_LOG(ERR, "port IN ID %u is out of range", port_id);
 		return -EINVAL;
 	}
 
@@ -1039,26 +981,22 @@ rte_pipeline_check(struct rte_pipeline *p)
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	/* Check that pipeline has at least one input port, one table and one
 	output port */
 	if (p->num_ports_in == 0) {
-		RTE_LOG(ERR, PIPELINE, "%s: must have at least 1 input port\n",
-			__func__);
+		PIPELINE_LOG(ERR, "must have at least 1 input port");
 		return -EINVAL;
 	}
 	if (p->num_tables == 0) {
-		RTE_LOG(ERR, PIPELINE, "%s: must have at least 1 table\n",
-			__func__);
+		PIPELINE_LOG(ERR, "must have at least 1 table");
 		return -EINVAL;
 	}
 	if (p->num_ports_out == 0) {
-		RTE_LOG(ERR, PIPELINE, "%s: must have at least 1 output port\n",
-			__func__);
+		PIPELINE_LOG(ERR, "must have at least 1 output port");
 		return -EINVAL;
 	}
 
@@ -1067,9 +1005,8 @@ rte_pipeline_check(struct rte_pipeline *p)
 		struct rte_port_in *port_in = &p->ports_in[port_in_id];
 
 		if (port_in->table_id == RTE_TABLE_INVALID) {
-			RTE_LOG(ERR, PIPELINE,
-				"%s: Port IN ID %u is not connected\n",
-				__func__, port_in_id);
+			PIPELINE_LOG(ERR, "Port IN ID %u is not connected",
+				     port_in_id);
 			return -EINVAL;
 		}
 	}
@@ -1451,8 +1388,7 @@ rte_pipeline_flush(struct rte_pipeline *p)
 
 	/* Check input arguments */
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
@@ -1504,15 +1440,12 @@ int rte_pipeline_port_in_stats_read(struct rte_pipeline *p, uint32_t port_id,
 	int retval;
 
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	if (port_id >= p->num_ports_in) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: port IN ID %u is out of range\n",
-			__func__, port_id);
+		PIPELINE_LOG(ERR, "port IN ID %u is out of range", port_id);
 		return -EINVAL;
 	}
 
@@ -1541,13 +1474,12 @@ int rte_pipeline_port_out_stats_read(struct rte_pipeline *p, uint32_t port_id,
 	int retval;
 
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n", __func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	if (port_id >= p->num_ports_out) {
-		RTE_LOG(ERR, PIPELINE,
-			"%s: port OUT ID %u is out of range\n", __func__, port_id);
+		PIPELINE_LOG(ERR, "port OUT ID %u is out of range", port_id);
 		return -EINVAL;
 	}
 
@@ -1575,14 +1507,12 @@ int rte_pipeline_table_stats_read(struct rte_pipeline *p, uint32_t table_id,
 	int retval;
 
 	if (p == NULL) {
-		RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n",
-			__func__);
+		PIPELINE_LOG(ERR, "pipeline parameter NULL");
 		return -EINVAL;
 	}
 
 	if (table_id >= p->num_tables) {
-		RTE_LOG(ERR, PIPELINE,
-				"%s: table %u is out of range\n", __func__, table_id);
+		PIPELINE_LOG(ERR, "table %u is out of range\n", table_id);
 		return -EINVAL;
 	}
 
-- 
2.39.1



More information about the dev mailing list