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 2935541C56;
	Fri, 10 Feb 2023 01:22:52 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id CE24C42D2D;
	Fri, 10 Feb 2023 01:22:34 +0100 (CET)
Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com
 [209.85.215.173])
 by mails.dpdk.org (Postfix) with ESMTP id 8955B42BC9
 for <dev@dpdk.org>; Fri, 10 Feb 2023 01:22:30 +0100 (CET)
Received: by mail-pg1-f173.google.com with SMTP id u75so2674959pgc.10
 for <dev@dpdk.org>; Thu, 09 Feb 2023 16:22:30 -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=pzbVpFyp0lPmiM1bVIT351NHQTAvRw8JlayunUmnas4=;
 b=WV9UYTjyl0Vq0pC6A2lS8oECDYXvwmsnK63LtWAH8gYIXL6Tr6DIihMbB0LBh/xJYQ
 t5U1aLjhP7xRnHNq2k3ePcuXvZi7WiVwWbkPwgGNOk3otuq3RNbWH41CRgOcC0XDiZTv
 OD15e33ajR/p/SpKJEdZ44qWGsdVRxkE4f4qFhjjhXvMcferFFeL8UFkWOLhPfdafx3r
 /Y24yYXpqHgTwgc1sbJFum7ksBwHKz+W7Ai2AfAL8KmZh4OQLVuVHCL6+SzSrbKp0hr6
 ZlXALrhv7RGfx5iyAaJzOsT6HrFKjdQo8NAbKx/Bzzrz7Y1xNtUbiLEz5lvKCkCW65Nn
 W4Jw==
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=pzbVpFyp0lPmiM1bVIT351NHQTAvRw8JlayunUmnas4=;
 b=r73PhQRf3KZXtlqdxUaPturLUDEAbJhtNaPRVd4UtVP5ZvR5p0QqxgCytPftzSQHtq
 VgyKnmKFwKUI1BbQNRzJmc7/a29YtOibHHwK7AjBiIF9bz3u31QN4oXGoTtDxtEUTFS7
 BDcv4D880giFZBPdWlijo+qWdsZxyAA20fUCBaz+R4vdYTdCXLcK7R6s05AliIG7FayS
 YfeYZTsH2eqi5vg+jq6v6KEbb7yIO5Wokjz9zAWmsnpDJz0CtnzNdIkTjUN11kXwk5pd
 NJBMHFX7yjq8OHG/BFyUEz0yUgeetr+Hd9WsO1voBngclwe672ILd05DFTIpAMtHhgRx
 UJ1w==
X-Gm-Message-State: AO0yUKXycgHsQsVla70x3xMVLNRBaO+JCzZ7NZnWCDFDUcqIU4yKCd1/
 4Fn0x0KpTa9UZgBe7rBRJjcs3PZ0Occd6e4iNWE=
X-Google-Smtp-Source: AK7set+RekjL5Iej0KAcEsNjpeHJKntm/bLgMTDcYeYEcf7evGT8F4u7aAuwUmrBqdI2GVRVw5gnKw==
X-Received: by 2002:aa7:978d:0:b0:5a8:4e15:9fd0 with SMTP id
 o13-20020aa7978d000000b005a84e159fd0mr5565298pfp.3.1675988549869; 
 Thu, 09 Feb 2023 16:22:29 -0800 (PST)
Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])
 by smtp.gmail.com with ESMTPSA id
 g9-20020aa78749000000b005907664a3eesm1986639pfo.125.2023.02.09.16.22.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Feb 2023 16:22:29 -0800 (PST)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
 Chenbo Xia <chenbo.xia@intel.com>,
 Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [PATCH v3 4/5] vhost: use logtype instead of RTE_LOGTYPE_USER1
Date: Thu,  9 Feb 2023 16:22:21 -0800
Message-Id: <20230210002222.812379-5-stephen@networkplumber.org>
X-Mailer: git-send-email 2.39.1
In-Reply-To: <20230210002222.812379-1-stephen@networkplumber.org>
References: <20230208044825.1682620-1-stephen@networkplumber.org>
 <20230210002222.812379-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

Fix instances of USER1 logtype in fdset and crypto
sections.

Acked-by: Chenbo Xia <chenbo.xia@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/vhost/fd_man.c       | 16 +++++++++-------
 lib/vhost/vhost_crypto.c | 25 +++++++++++--------------
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c
index 1876fada3354..172f7dc03ab2 100644
--- a/lib/vhost/fd_man.c
+++ b/lib/vhost/fd_man.c
@@ -10,8 +10,10 @@
 
 #include "fd_man.h"
 
-
-#define RTE_LOGTYPE_VHOST_FDMAN RTE_LOGTYPE_USER1
+RTE_LOG_REGISTER_SUFFIX(vhost_fdset_logtype, fdset, INFO);
+#define FDSET_LOG(level, fmt, args...)		\
+	rte_log(RTE_LOG_ ## level, vhost_fdset_logtype,	\
+		"%s(): " fmt "\n", __func__, ## args)
 
 #define FDPOLLERR (POLLERR | POLLHUP | POLLNVAL)
 
@@ -334,8 +336,8 @@ fdset_pipe_init(struct fdset *fdset)
 	int ret;
 
 	if (pipe(fdset->u.pipefd) < 0) {
-		RTE_LOG(ERR, VHOST_FDMAN,
-			"failed to create pipe for vhost fdset\n");
+		FDSET_LOG(ERR,
+			"failed to create pipe for vhost fdset");
 		return -1;
 	}
 
@@ -343,9 +345,9 @@ fdset_pipe_init(struct fdset *fdset)
 			fdset_pipe_read_cb, NULL, NULL);
 
 	if (ret < 0) {
-		RTE_LOG(ERR, VHOST_FDMAN,
-			"failed to add pipe readfd %d into vhost server fdset\n",
-			fdset->u.readfd);
+		FDSET_LOG(ERR,
+			  "failed to add pipe readfd %d into vhost server fdset",
+			  fdset->u.readfd);
 
 		fdset_pipe_uninit(fdset);
 		return -1;
diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c
index f02bf865c349..3be46614c22a 100644
--- a/lib/vhost/vhost_crypto.c
+++ b/lib/vhost/vhost_crypto.c
@@ -4,6 +4,7 @@
 #include <rte_malloc.h>
 #include <rte_hash.h>
 #include <rte_jhash.h>
+#include <rte_log.h>
 #include <rte_mbuf.h>
 #include <rte_cryptodev.h>
 
@@ -16,22 +17,18 @@
 #define IV_OFFSET		(sizeof(struct rte_crypto_op) + \
 				sizeof(struct rte_crypto_sym_op))
 
+RTE_LOG_REGISTER_SUFFIX(vhost_crypto_logtype, crypto, INFO);
+
+#define VC_LOG(level, fmt, args...)				\
+	rte_log(RTE_LOG_ ## level, vhost_crypto_logtype,	\
+		"%s():%u: " fmt "\n", __func__, __LINE__, ## args)
+
+#define VC_LOG_ERR(fmt, args...)	VC_LOG(ERR, fmt, ## args)
+#define VC_LOG_INFO(fmt, args...)	VC_LOG(INFO, fmt, ## args)
+
 #ifdef RTE_LIBRTE_VHOST_DEBUG
-#define VC_LOG_ERR(fmt, args...)				\
-	RTE_LOG(ERR, USER1, "[%s] %s() line %u: " fmt "\n",	\
-		"Vhost-Crypto",	__func__, __LINE__, ## args)
-#define VC_LOG_INFO(fmt, args...)				\
-	RTE_LOG(INFO, USER1, "[%s] %s() line %u: " fmt "\n",	\
-		"Vhost-Crypto",	__func__, __LINE__, ## args)
-
-#define VC_LOG_DBG(fmt, args...)				\
-	RTE_LOG(DEBUG, USER1, "[%s] %s() line %u: " fmt "\n",	\
-		"Vhost-Crypto",	__func__, __LINE__, ## args)
+#define VC_LOG_DBG(fmt, args...)	VC_LOG(DEBUG, fmt, ## args)
 #else
-#define VC_LOG_ERR(fmt, args...)				\
-	RTE_LOG(ERR, USER1, "[VHOST-Crypto]: " fmt "\n", ## args)
-#define VC_LOG_INFO(fmt, args...)				\
-	RTE_LOG(INFO, USER1, "[VHOST-Crypto]: " fmt "\n", ## args)
 #define VC_LOG_DBG(fmt, args...)
 #endif
 
-- 
2.39.1