From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id D0D4741C99;
	Tue, 14 Feb 2023 23:49:51 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 3745643042;
	Tue, 14 Feb 2023 23:48:19 +0100 (CET)
Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com
 [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 7497C43017
 for <dev@dpdk.org>; Tue, 14 Feb 2023 23:48:08 +0100 (CET)
Received: by mail-pj1-f44.google.com with SMTP id
 w20-20020a17090a8a1400b00233d7314c1cso238800pjn.5
 for <dev@dpdk.org>; Tue, 14 Feb 2023 14:48:08 -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=d4mpg7EHU1GKkOQjzVZUElKNmEdc7NTwiOoyGC3ebHU=;
 b=Y4M5VPxuc8sYPH7uPNfQYt+VTf6rnhVHp+vpb4cN+LEyPtIkMJJjC9A3jS/eQA3fVk
 dKPXmbSnW50/6mi+ZmdrbUmfAaatusrgnJXnn7ekIURyXWU6maQGw5W53w7cU10apAq3
 XfQQWJx1ojkvJcGPN7Idq9iR98bU6E79IiUuRVichxVisrmEfdoG4QRTgjaguRnKIkXw
 lmBGYwZCnt655WrTiD2XXOjbDW0OI6x6+6U1nMpDzrLxJjKWArfr86tyfx5LRPCI+0kE
 0dT9OCEQmi2IghyvxELLkupviTTU+7gB9RzTZ/nphRh5BvsYzEYwR24ZjHWdTHL7iuFA
 yiAQ==
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=d4mpg7EHU1GKkOQjzVZUElKNmEdc7NTwiOoyGC3ebHU=;
 b=K2JjEBCQNxvKAINIGHfKQAMe2Q2CP++1C1EwkW6py4kkTYy0VvWh7xpqucJaYWRdfK
 0/PGnURnhCEOwEoYn/+T1vSpuRLCbR0YvJWLa4cash/uZSdnwjI5CxrckGRMUpwA36HT
 Ay+vkeej9Dkz71gAaVMHm5pXQOlVlS01oQ6c4+Boq4SEcDtlm5E/bwC4QqUA2+K0CRj3
 vvD1Jtelstd0qZc+T0i/WY2hRuNfTYpRqlmeETEP3uT4Jp/u7YpzbY8VgxnK3DS3EPw8
 JKYgdFMb/6b/UjPH3XY+2QCec0sbyK9Ua1+x86pyiAeUrgVfc5tys7l7zkO2L+j6I0vG
 LNjQ==
X-Gm-Message-State: AO0yUKX6/B4h3L4+d/fd3Vf/iixpeit7xQ68bRDr6GPmlEBwp/nemhRL
 1DfrRfD154YNY6xPnQLX0AyOJeTYaFMHHQICZHk=
X-Google-Smtp-Source: AK7set9cFYlHkWSIqFyVZtMyC6HL7sc0m5B5kDYKg0ukP/nJv+nUikcHhpsdymZNi6+c9amb0rsc7A==
X-Received: by 2002:a17:902:f9c5:b0:19a:6acc:1de1 with SMTP id
 kz5-20020a170902f9c500b0019a6acc1de1mr275009plb.4.1676414887531; 
 Tue, 14 Feb 2023 14:48:07 -0800 (PST)
Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])
 by smtp.gmail.com with ESMTPSA id
 u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 14 Feb 2023 14:48:07 -0800 (PST)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
 Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [PATCH v6 18/22] app/test: remove use of RTE_LOGTYPE_PIPELINE
Date: Tue, 14 Feb 2023 14:47:31 -0800
Message-Id: <20230214224735.1404326-19-stephen@networkplumber.org>
X-Mailer: git-send-email 2.39.1
In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org>
References: <20230207204151.1503491-1-stephen@networkplumber.org>
 <20230214224735.1404326-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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.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.1