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 E71A441C54; Thu, 9 Feb 2023 18:12:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68DE642D0E; Thu, 9 Feb 2023 18:11:52 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id A07A742B8E for ; Thu, 9 Feb 2023 18:11:49 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id f6so3505148pln.12 for ; Thu, 09 Feb 2023 09:11:49 -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=ShiHcdgSdniYLAHCNCXrTrjhoY1rdjNWn1Cgau19c3rYecebgN+0ItfJgElpBOjBr8 q3QQ9XfagrPZzz/DfDTnNI+22Cg4dMSvWV88FGHqnzN2ZeFf1r8xfWM57IPptQ+vlc1v q7EKucYLddp8j9gxqOkZ6si1mIMukD/ljnsKZpFd1C+KLBI1h7Qtivcqel1dfrN8BDol UdXGGPmcWT2GxGBiLfH09zvPD3bzwaMgbepJy5hRrv9N3R+DLB16g5tvhPn8FRBuiAUU /3qgxbrdAtUW1TE4JEC6KWUZlm+UngfkX1UOb8+ed8bZM7LyvcDdLyrBamIFzi141/BI O+lQ== 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=wnIIEFR0NCRjNGcM4ik8cxEYJ1ZNj/VQ2Qmy8t9EvDXwI4KHgppBdwvfucic0lG69w W5aZSJNDuUayRsfCxpafq6KP0BSH1KDXemGYE8tYgQfa7vf+FKg+9iwDOvgl227Jo3Wg mCuwcU83c7eYUIUpmlicaY4KKsHMLgF3FcGxGdix9ijkA5t/v4gzY/IAJ0H3bHRZs4pm ppq53KD6b+S4AHltT5IW8zFan5AsEpjtuDfAZsZhkMZPuWWDdRB+NnFTB6eWPHeIyNUT iY+Xf4DXB//yrF7PkBe0cSg9gRwlCUYG0ABm9N93Lyz/4ENxX8bcVI+K/UwDpZYwHfGs 03nQ== X-Gm-Message-State: AO0yUKXUuEo6mgBn+kDIm0oULZRnOP2JNWP+29G3k2Wzw6GUM1sB9KCB f+rGd691P3RHza6lB8yJtcxkxL3JS80BL2Qu6k4= X-Google-Smtp-Source: AK7set+/cFVCfwvuUQdabxHzZBeX8v5rFM8LHaosyYcHnF8L+6aYPM8zdtQeDc2w79NZVKiTiinxOw== X-Received: by 2002:a17:903:1386:b0:198:a715:d26e with SMTP id jx6-20020a170903138600b00198a715d26emr8408487plb.36.1675962708635; Thu, 09 Feb 2023 09:11:48 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id l5-20020a170902d34500b00188fc6766d6sm1732649plk.219.2023.02.09.09.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 09:11:48 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Chenbo Xia , Maxime Coquelin Subject: [PATCH v2 4/5] vhost: use logtype instead of RTE_LOGTYPE_USER1 Date: Thu, 9 Feb 2023 09:11:41 -0800 Message-Id: <20230209171142.94938-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230209171142.94938-1-stephen@networkplumber.org> References: <[200~https://inbox.dpdk.org/dev/20230208044825.1682620-1-stephen@networkplumber.org> <20230209171142.94938-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 Fix instances of USER1 logtype in fdset and crypto sections. Acked-by: Chenbo Xia Signed-off-by: Stephen Hemminger --- 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 #include #include +#include #include #include @@ -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