From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [PATCH v13 20/21] app/test: remove use of RTE_LOGTYPE_PIPELINE
Date: Mon, 21 Aug 2023 09:09:20 -0700 [thread overview]
Message-ID: <20230821160921.383832-21-stephen@networkplumber.org> (raw)
In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org>
Instead of using static type PIPELINE for logging in test application
use stderr instead. If not testing RTE_LOG() better to not use
it since log also goes to syslog.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_table_acl.c | 50 ++++++++++++++++------------------
app/test/test_table_pipeline.c | 40 +++++++++++++--------------
2 files changed, 43 insertions(+), 47 deletions(-)
diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c
index e66f06b84d0a..dff9bddfb948 100644
--- a/app/test/test_table_acl.c
+++ b/app/test/test_table_acl.c
@@ -165,7 +165,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v)
&v->field_value[SRC_FIELD_IPV4].value.u32,
&v->field_value[SRC_FIELD_IPV4].mask_range.u32);
if (rc != 0) {
- RTE_LOG(ERR, PIPELINE, "failed to read src address/mask: %s\n",
+ fprintf(stderr, "failed to read src address/mask: %s\n",
in[CB_FLD_SRC_ADDR]);
return rc;
}
@@ -178,7 +178,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v)
&v->field_value[DST_FIELD_IPV4].value.u32,
&v->field_value[DST_FIELD_IPV4].mask_range.u32);
if (rc != 0) {
- RTE_LOG(ERR, PIPELINE, "failed to read dest address/mask: %s\n",
+ fprintf(stderr, "failed to read dest address/mask: %s\n",
in[CB_FLD_DST_ADDR]);
return rc;
}
@@ -190,7 +190,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v)
&v->field_value[SRCP_FIELD_IPV4].value.u16,
&v->field_value[SRCP_FIELD_IPV4].mask_range.u16);
if (rc != 0) {
- RTE_LOG(ERR, PIPELINE, "failed to read source port range: %s\n",
+ fprintf(stderr, "failed to read source port range: %s\n",
in[CB_FLD_SRC_PORT_RANGE]);
return rc;
}
@@ -202,7 +202,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v)
&v->field_value[DSTP_FIELD_IPV4].value.u16,
&v->field_value[DSTP_FIELD_IPV4].mask_range.u16);
if (rc != 0) {
- RTE_LOG(ERR, PIPELINE, "failed to read dest port range: %s\n",
+ fprintf(stderr, "failed to read dest port range: %s\n",
in[CB_FLD_DST_PORT_RANGE]);
return rc;
}
@@ -254,7 +254,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v)
&v->field_value[SRC_FIELD_IPV4].value.u32,
&v->field_value[SRC_FIELD_IPV4].mask_range.u32);
if (rc != 0) {
- RTE_LOG(ERR, PIPELINE, "failed to read src address/mask: %s\n",
+ fprintf(stderr, "failed to read src address/mask: %s\n",
in[CB_FLD_SRC_ADDR]);
return rc;
}
@@ -267,7 +267,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v)
&v->field_value[DST_FIELD_IPV4].value.u32,
&v->field_value[DST_FIELD_IPV4].mask_range.u32);
if (rc != 0) {
- RTE_LOG(ERR, PIPELINE, "failed to read dest address/mask: %s\n",
+ fprintf(stderr, "failed to read dest address/mask: %s\n",
in[CB_FLD_DST_ADDR]);
return rc;
}
@@ -279,7 +279,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v)
&v->field_value[SRCP_FIELD_IPV4].value.u16,
&v->field_value[SRCP_FIELD_IPV4].mask_range.u16);
if (rc != 0) {
- RTE_LOG(ERR, PIPELINE, "failed to read source port range: %s\n",
+ fprintf(stderr, "failed to read source port range: %s\n",
in[CB_FLD_SRC_PORT_RANGE]);
return rc;
}
@@ -291,7 +291,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v)
&v->field_value[DSTP_FIELD_IPV4].value.u16,
&v->field_value[DSTP_FIELD_IPV4].mask_range.u16);
if (rc != 0) {
- RTE_LOG(ERR, PIPELINE, "failed to read dest port range: %s\n",
+ fprintf(stderr, "failed to read dest port range: %s\n",
in[CB_FLD_DST_PORT_RANGE]);
return rc;
}
@@ -346,7 +346,7 @@ setup_acl_pipeline(void)
/* Pipeline configuration */
p = rte_pipeline_create(&pipeline_params);
if (p == NULL) {
- RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n",
+ fprintf(stderr, "%s: Failed to configure pipeline\n",
__func__);
goto fail;
}
@@ -410,7 +410,7 @@ setup_acl_pipeline(void)
table_params.f_action_miss = NULL;
table_params.action_data_size = 0;
- RTE_LOG(INFO, PIPELINE, "miss_action=%x\n",
+ printf("miss_action=%x\n",
table_entry_miss_action);
printf("RTE_ACL_RULE_SZ(%zu) = %zu\n", DIM(ipv4_defs),
@@ -471,9 +471,8 @@ setup_acl_pipeline(void)
ret = parser(line, &keys[n]);
if (ret != 0) {
- RTE_LOG(ERR, PIPELINE,
- "line %u: parse_cb_ipv4vlan_rule"
- " failed, error code: %d (%s)\n",
+ fprintf(stderr,
+ "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n",
n, ret, strerror(-ret));
return ret;
}
@@ -513,9 +512,8 @@ setup_acl_pipeline(void)
ret = parse_cb_ipv4_rule_del(line, &keys[n]);
if (ret != 0) {
- RTE_LOG(ERR, PIPELINE,
- "line %u: parse_cb_ipv4vlan_rule"
- " failed, error code: %d (%s)\n",
+ fprintf(stderr,
+ "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n",
n, ret, strerror(-ret));
return ret;
}
@@ -549,9 +547,8 @@ setup_acl_pipeline(void)
ret = parser(line, &rule_params);
if (ret != 0) {
- RTE_LOG(ERR, PIPELINE,
- "line %u: parse_cb_ipv4vlan_rule"
- " failed, error code: %d (%s)\n",
+ fprintf(stderr,
+ "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n",
n, ret, strerror(-ret));
return ret;
}
@@ -575,8 +572,8 @@ setup_acl_pipeline(void)
ret = parser(line, &rule_params);
if (ret != 0) {
- RTE_LOG(ERR, PIPELINE, "line %u: parse rule "
- " failed, error code: %d (%s)\n",
+ fprintf(stderr,
+ "line %u: parse rule failed, error code: %d (%s)\n",
n, ret, strerror(-ret));
return ret;
}
@@ -602,8 +599,8 @@ setup_acl_pipeline(void)
ret = parser(line, &rule_params);
if (ret != 0) {
- RTE_LOG(ERR, PIPELINE, "line %u: parse rule"
- " failed, error code: %d (%s)\n",
+ fprintf(stderr,
+ "line %u: parse rule failed, error code: %d (%s)\n",
n, ret, strerror(-ret));
return ret;
}
@@ -667,7 +664,7 @@ test_pipeline_single_filter(int expected_count)
memcpy(rte_pktmbuf_mtod(mbuf, char *), &five_tuple,
sizeof(struct ipv4_5tuple));
- RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n",
+ printf("%s: Enqueue onto ring %d\n",
__func__, i);
rte_ring_enqueue(rings_rx[i], mbuf);
}
@@ -702,9 +699,8 @@ test_pipeline_single_filter(int expected_count)
}
if (tx_count != expected_count) {
- RTE_LOG(INFO, PIPELINE,
- "%s: Unexpected packets for ACL test, "
- "expected %d, got %d\n",
+ fprintf(stderr,
+ "%s: Unexpected packets for ACL test, expected %d, got %d\n",
__func__, expected_count, tx_count);
goto fail;
}
diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c
index 7adbbffbf55d..960f730cf20d 100644
--- a/app/test/test_table_pipeline.c
+++ b/app/test/test_table_pipeline.c
@@ -6,7 +6,6 @@
#include <string.h>
#include <rte_pipeline.h>
-#include <rte_log.h>
#include <inttypes.h>
#include <rte_hexdump.h>
#include "test_table.h"
@@ -173,30 +172,31 @@ check_pipeline_invalid_params(void)
p = rte_pipeline_create(NULL);
if (p != NULL) {
- RTE_LOG(INFO, PIPELINE,
+ fprintf(stderr,
"%s: configured pipeline with null params\n",
__func__);
goto fail;
}
p = rte_pipeline_create(&pipeline_params_1);
if (p != NULL) {
- RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with NULL "
- "name\n", __func__);
+ fprintf(stderr,
+ "%s: Configure pipeline with NULL name\n", __func__);
goto fail;
}
p = rte_pipeline_create(&pipeline_params_2);
if (p != NULL) {
- RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with invalid "
- "socket\n", __func__);
+ fprintf(stderr,
+ "%s: Configure pipeline with invalid socket\n", __func__);
goto fail;
}
if (rte_eal_has_hugepages()) {
p = rte_pipeline_create(&pipeline_params_3);
if (p != NULL) {
- RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with "
- "invalid socket\n", __func__);
+ fprintf(stderr,
+ "%s: Configure pipeline with invalid socket\n",
+ __func__);
goto fail;
}
}
@@ -224,20 +224,20 @@ setup_pipeline(int test_type)
.socket_id = 0,
};
- RTE_LOG(INFO, PIPELINE, "%s: **** Setting up %s test\n",
+ fprintf(stderr, "%s: **** Setting up %s test\n",
__func__, pipeline_test_names[test_type]);
/* Pipeline configuration */
p = rte_pipeline_create(&pipeline_params);
if (p == NULL) {
- RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n",
+ fprintf(stderr, "%s: Failed to configure pipeline\n",
__func__);
goto fail;
}
ret = rte_pipeline_free(p);
if (ret != 0) {
- RTE_LOG(INFO, PIPELINE, "%s: Failed to free pipeline\n",
+ fprintf(stderr, "%s: Failed to free pipeline\n",
__func__);
goto fail;
}
@@ -245,7 +245,7 @@ setup_pipeline(int test_type)
/* Pipeline configuration */
p = rte_pipeline_create(&pipeline_params);
if (p == NULL) {
- RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n",
+ fprintf(stderr, "%s: Failed to configure pipeline\n",
__func__);
goto fail;
}
@@ -411,7 +411,7 @@ test_pipeline_single_filter(int test_type, int expected_count)
int ret;
int tx_count;
- RTE_LOG(INFO, PIPELINE, "%s: **** Running %s test\n",
+ fprintf(stderr, "%s: **** Running %s test\n",
__func__, pipeline_test_names[test_type]);
/* Run pipeline once */
for (i = 0; i < N_PORTS; i++)
@@ -420,7 +420,7 @@ test_pipeline_single_filter(int test_type, int expected_count)
ret = rte_pipeline_flush(NULL);
if (ret != -EINVAL) {
- RTE_LOG(INFO, PIPELINE,
+ fprintf(stderr,
"%s: No pipeline flush error NULL pipeline (%d)\n",
__func__, ret);
goto fail;
@@ -445,7 +445,7 @@ test_pipeline_single_filter(int test_type, int expected_count)
k32 = (uint32_t *) key;
k32[0] = 0xadadadad >> (j % 2);
- RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n",
+ fprintf(stderr, "%s: Enqueue onto ring %d\n",
__func__, i);
rte_ring_enqueue(rings_rx[i], m);
}
@@ -487,9 +487,9 @@ test_pipeline_single_filter(int test_type, int expected_count)
}
if (tx_count != expected_count) {
- RTE_LOG(INFO, PIPELINE,
- "%s: Unexpected packets out for %s test, expected %d, "
- "got %d\n", __func__, pipeline_test_names[test_type],
+ fprintf(stderr,
+ "%s: Unexpected packets out for %s test, expected %d, got %d\n",
+ __func__, pipeline_test_names[test_type],
expected_count, tx_count);
goto fail;
}
@@ -564,8 +564,8 @@ test_table_pipeline(void)
connect_miss_action_to_table = 0;
if (check_pipeline_invalid_params()) {
- RTE_LOG(INFO, PIPELINE, "%s: Check pipeline invalid params "
- "failed.\n", __func__);
+ fprintf(stderr, "%s: Check pipeline invalid params failed.\n",
+ __func__);
return -1;
}
--
2.39.2
next prev parent reply other threads:[~2023-08-21 16:12 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 23:40 [PATCH v12 00/22] Covert static log types in libraries to dynamic Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 01/22] gso: don't log message on non TCP/UDP Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 02/22] eal: drop no longer used GSO logtype Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 03/22] log: drop unused RTE_LOGTYPE_TIMER Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 04/22] efd: convert RTE_LOGTYPE_EFD to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 05/22] mbuf: convert RTE_LOGTYPE_MBUF " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 06/22] acl: convert RTE_LOGTYPE_ACL " Stephen Hemminger
2023-06-05 13:40 ` Константин Ананьев
2023-03-29 23:40 ` [PATCH v12 07/22] examples/power: replace use of RTE_LOGTYPE_POWER Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 08/22] examples/l3fwd-power: " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 09/22] power: convert RTE_LOGTYPE_POWER to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 10/22] ring: convert RTE_LOGTYPE_RING " Stephen Hemminger
2023-06-05 13:41 ` Константин Ананьев
2023-03-29 23:40 ` [PATCH v12 11/22] mempool: convert RTE_LOGTYPE_MEMPOOL " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 12/22] lpm: convert RTE_LOGTYPE_LPM to dynamic types Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 13/22] kni: convert RTE_LOGTYPE_KNI to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 14/22] sched: convert RTE_LOGTYPE_SCHED " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 15/22] examples/ipsec-secgw: replace RTE_LOGTYPE_PORT Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 16/22] port: convert RTE_LOGTYPE_PORT to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 17/22] hash: move rte_thash_gfni stubs out of header file Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 18/22] hash: move rte_hash_set_alg out header Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 19/22] hash: convert RTE_LOGTYPE_HASH to dynamic type Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 20/22] table: convert RTE_LOGTYPE_TABLE " Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 21/22] app/test: remove use of RTE_LOGTYPE_PIPELINE Stephen Hemminger
2023-03-29 23:40 ` [PATCH v12 22/22] pipeline: convert RTE_LOGTYPE_PIPELINE to dynamic type Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 00/21] Convert static log types in libraries to dynamic types Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 01/21] gso: don't log message on non TCP/UDP Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 02/21] eal: drop no longer used GSO logtype Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 03/21] log: drop unused RTE_LOGTYPE_TIMER Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 04/21] efd: convert RTE_LOGTYPE_EFD to dynamic type Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 05/21] mbuf: convert RTE_LOGTYPE_MBUF " Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 06/21] acl: convert RTE_LOGTYPE_ACL " Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 07/21] examples/power: replace use of RTE_LOGTYPE_POWER Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 08/21] examples/l3fwd-power: " Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 09/21] power: convert RTE_LOGTYPE_POWER to dynamic type Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 10/21] ring: convert RTE_LOGTYPE_RING " Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 11/21] mempool: convert RTE_LOGTYPE_MEMPOOL " Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 12/21] lpm: convert RTE_LOGTYPE_LPM to dynamic types Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 13/21] sched: convert RTE_LOGTYPE_SCHED to dynamic type Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 14/21] examples/ipsec-secgw: replace RTE_LOGTYPE_PORT Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 15/21] port: convert RTE_LOGTYPE_PORT to dynamic type Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 16/21] hash: move rte_thash_gfni stubs out of header file Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 17/21] hash: move rte_hash_set_alg out header Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 18/21] hash: convert RTE_LOGTYPE_HASH to dynamic type Stephen Hemminger
2023-08-21 16:09 ` [PATCH v13 19/21] table: convert RTE_LOGTYPE_TABLE " Stephen Hemminger
2023-08-21 16:09 ` Stephen Hemminger [this message]
2023-08-21 16:09 ` [PATCH v13 21/21] pipeline: convert RTE_LOGTYPE_PIPELINE " Stephen Hemminger
2023-12-04 12:32 ` [PATCH v13 00/21] Convert static log types in libraries to dynamic types David Marchand
2023-12-05 2:09 ` [PATCH 00/18] Convert static log types in libraries to dynamic Stephen Hemminger
2023-12-05 2:09 ` [PATCH 01/18] gso: don't log message on non TCP/UDP Stephen Hemminger
2023-12-05 2:09 ` [PATCH 02/18] eal: drop no longer used GSO logtype Stephen Hemminger
2023-12-05 2:09 ` [PATCH 03/18] log: drop unused RTE_LOGTYPE_TIMER Stephen Hemminger
2023-12-05 2:09 ` [PATCH 04/18] efd: convert RTE_LOGTYPE_EFD to dynamic type Stephen Hemminger
2023-12-05 2:09 ` [PATCH 05/18] mbuf: convert RTE_LOGTYPE_MBUF " Stephen Hemminger
2023-12-05 2:09 ` [PATCH 06/18] acl: convert RTE_LOGTYPE_ACL " Stephen Hemminger
2023-12-05 2:09 ` [PATCH 07/18] examples/power: replace use of RTE_LOGTYPE_POWER Stephen Hemminger
2023-12-05 2:09 ` [PATCH 08/18] examples/l3fwd-power: " Stephen Hemminger
2023-12-05 2:09 ` [PATCH 09/18] power: convert RTE_LOGTYPE_POWER to dynamic type Stephen Hemminger
2023-12-05 2:09 ` [PATCH 10/18] ring: convert RTE_LOGTYPE_RING " Stephen Hemminger
2023-12-05 2:09 ` [PATCH 11/18] mempool: convert RTE_LOGTYPE_MEMPOOL " Stephen Hemminger
2023-12-05 2:09 ` [PATCH 12/18] lpm: convert RTE_LOGTYPE_LPM to dynamic types Stephen Hemminger
2023-12-05 2:09 ` [PATCH 13/18] sched: convert RTE_LOGTYPE_SCHED to dynamic type Stephen Hemminger
2023-12-05 2:09 ` [PATCH 14/18] examples/ipsec-secgw: replace RTE_LOGTYPE_PORT Stephen Hemminger
2023-12-05 2:09 ` [PATCH 15/18] app/test: remove use of RTE_LOGTYPE_PIPELINE Stephen Hemminger
2023-12-05 2:09 ` [PATCH 16/18] hash: mover rte_thash_gfni stubs out of header file Stephen Hemminger
2023-12-05 2:09 ` [PATCH 17/18] hash: move rte_hash_set_alg " Stephen Hemminger
2023-12-05 2:09 ` [PATCH 18/18] hash: convert RTE_LOGTYPE_HASH to dynamic type Stephen Hemminger
2023-12-06 10:08 ` [PATCH 00/18] Convert static log types in libraries to dynamic David Marchand
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=20230821160921.383832-21-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
/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).