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 653B641C50; Fri, 10 Feb 2023 18:16:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB91B42D2D; Fri, 10 Feb 2023 18:15:52 +0100 (CET) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id 21C5842C54 for ; Fri, 10 Feb 2023 18:15:50 +0100 (CET) Received: by mail-pj1-f46.google.com with SMTP id rm7-20020a17090b3ec700b0022c05558d22so6099034pjb.5 for ; Fri, 10 Feb 2023 09:15:50 -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=MRiPVq9FaxsoKnPUMAHJZ7565AdlCI68XNyPkdmvQNo=; b=uj3D09lgS8ue7oRI/ffMpYKIFVNyRK3Cmgd/qeV70igLHDSQlz72f8t1gr6jOgGrqU OfN1TObgV8XmDsVbzR+iblFJRot1l0jXMqKB0DcXoh3r1aSbKXJl9/kOGrvUkespJ7wp BvrSlfCB47GAKEEME8PeecA8inYbT4ts/kCbd0GgO4oQ5x7eqMnydIo7HmCnIchD6M7Q SQRCnO1ftZ/HN5BV2ynPC+8fN5qfhQnuNPtdx2NdfwuntsqHcjpaGx6XNjsym+QS+020 ifirsXSnt4j8PvYrM2jivTMRvuRBjIcisNReMJziQAQVyVKHIBYWgNAdcILHUDGXAwH0 RZEg== 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=MRiPVq9FaxsoKnPUMAHJZ7565AdlCI68XNyPkdmvQNo=; b=ok9bZ6VFgStXR4PWQ2kNCNw8HGsJv/siO04lFPXFJNXkp3sVfnSs3V74INWmpoZ7xE 0tbUzUA8Oupu2+erpjx69dxNR6DCW678a3HFYaYNpOtw6oQJwOBS1ja8M8SX2ffwInEw P5T3/54OrpqrI7DIZN9vf2/x4hjNyhkiVXfEOfdJFe2+vIiRo1Fnfu3qIhDhB77fdCpE f6VYF01zQREEcAHxs6vP2eowtaIJRh7lsEq8zXGAXgb+GsMdtmyDrfzWbW8yaMZOdn17 8Kg7Sj0jva7G4ZEMECY6WoQAye8T7lHHQT7DZmwBSOmlqURDzaDRWWpVi+7p1XC3NnQz DarA== X-Gm-Message-State: AO0yUKUHWMngv6wy2By8EWVzOReh1Ds8tXFSGOLcwcog9Z2ysaV7tFmg /f7ADUx05WXOi0r+5iTAuyi4JWv2NI7Ppuo85Ys= X-Google-Smtp-Source: AK7set9OtSMLV6tlX7RLUWSXJJ9ROlnIbL01EgRmsjdEOJg/7chR4mqy5tecRVLgcDwb78A5yPcaUg== X-Received: by 2002:a17:902:e411:b0:19a:7548:da22 with SMTP id m17-20020a170902e41100b0019a7548da22mr1869570ple.50.1676049349085; Fri, 10 Feb 2023 09:15:49 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id c1-20020a170902b68100b0019a6e8ceb49sm1955669pls.259.2023.02.10.09.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 09:15:48 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Chenbo Xia , Maxime Coquelin Subject: [PATCH v4 4/5] vhost: use logtype instead of RTE_LOGTYPE_USER1 Date: Fri, 10 Feb 2023 09:15:41 -0800 Message-Id: <20230210171542.115434-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210171542.115434-1-stephen@networkplumber.org> References: <20230208044825.1682620-1-stephen@networkplumber.org> <20230210171542.115434-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 Reviewed-by: Maxime Coquelin 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