From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E265041C58; Fri, 10 Feb 2023 02:09:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0725242D69; Fri, 10 Feb 2023 02:08:28 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 12D3A42D65 for ; Fri, 10 Feb 2023 02:08:21 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id v23so4911871plo.1 for ; Thu, 09 Feb 2023 17:08:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=clf/jqv8wr39P/1rDP3iaIi7ECa5RQJd5A1SPvUnlhg=; b=icDNGEu50qykOGHoPdWjo+69US1tPT2FQy6NiQN6scg5meMB1KaZKoUsXsq71S4p07 8ZAgZWg3elG18RmbBsZjbaP9PdzAOJYoOVFh3W1MQcwrx6GgYb9uKringhywsmz1fUGF orUY25LZEd311PeG+mQg39WwVR100pP/pElA5kjdyzb6d64hJuNfwKXruWBO0TfL6lrf 955oB5BmWKCtP/ln/73B9zwCdqGnocd81DghEXzVUFOzDoiJc2MeM1weCLO/5pG7Mr3X 2MDxaECdYMm6z6c0vH8EquqbdiX+IivU6sT46iYIEp5mjbUAOzUNOjzZShz5rCJPqD4f U8Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=clf/jqv8wr39P/1rDP3iaIi7ECa5RQJd5A1SPvUnlhg=; b=Va7jK/lAyixw0obr4ddjldH2wR9u8TyPr/O2XauZUDeR6RTGeqS93KOVHgjEnTMlrU L5YecCcAlLezXnDFzPaU/2cCYWxF8GG2pjTFwAaZqd/cvWhIDbtEo9CkS9kFshz98wC8 nGiz3E7T5HLJ9vBLvkj2Ih0iaDum/GzuR8CF4ZSpltKkdHd81GRwlZr1pPy5fPFXYzRZ jHC2jRHSzswuPX7xifNGe6iFS8hBxF++C6Ot7DsXDRTAEYOOd69OEdxaYNF23uuUcSvY 0oad5b6itvkhKP1JUjeK0qCOZ+9uenbiChBJSBNGetsEs3zcrw/5DVrhEV2DJWLAv/eO XKYw== X-Gm-Message-State: AO0yUKUG3e5k75FkKlj32wVHJ2UpFuf5PgXljwAJ1jEvLWAA5sdNygi/ pNEWbIChXnwpLQXu8WaUw/x8aTj6XIoRTYhhK+0= X-Google-Smtp-Source: AK7set/IE9k74+ds2/xW4FFyE1SDgppCX2pI7SVKAts6Qam6SR7W3e+uEhjc/27tC7qJLVGk9jh9fg== X-Received: by 2002:a17:902:ec90:b0:199:12d5:5b9b with SMTP id x16-20020a170902ec9000b0019912d55b9bmr15134941plg.25.1675991299739; Thu, 09 Feb 2023 17:08:19 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id jd9-20020a170903260900b0019625428cefsm2103023plb.281.2023.02.09.17.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 17:08:19 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v3 16/16] pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic log type Date: Thu, 9 Feb 2023 17:07:24 -0800 Message-Id: <20230210010724.890413-17-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210010724.890413-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230210010724.890413-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Split the static global PIPELINE log type into multiple suffix log types (by stage). Signed-off-by: Stephen Hemminger --- 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