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 7CE6C41C37; Wed, 8 Feb 2023 05:48:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BF2842D20; Wed, 8 Feb 2023 05:48:37 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 6F625427F2 for ; Wed, 8 Feb 2023 05:48:33 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id k13so18054551plg.0 for ; Tue, 07 Feb 2023 20:48:33 -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=iLq+4yoNWpoOuLhX0xPMubdWpZScfJzXSj59opOg/8g=; b=be8VG2GOUKV5B4r3orz+E7/DV2+kbrmk2hkEhcCUgMMOxsmp1KtsMoss5O1JbsOER3 jLtB+ATpmKWHimrwCaPAgnzWhDoPbUUMXanhtl0Yahp3EEdvNT0KRCUy9pbWSEyVpDFt Xh8D4U+A2woJKW+UA9lYUVqO14SW6VmodgOxVwBr0Jr4BwHrGE95BIlW+x31zV0DiE3g m4U6SUKMnYAb7tpF2S83BZ0ihLVB1vwp1AF1m6GzdSFqg9jtdIu0BsjaRt3434KF4AR2 vflmIB2f3Y9lowmd1s+o+t1+vJb1W50+NdNqxvyqXDjKzZ5wxm0/B1khrGrH64P392hn 3kwg== 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=iLq+4yoNWpoOuLhX0xPMubdWpZScfJzXSj59opOg/8g=; b=p8hxbw4bWZ/XVISqAg5k9TinQBGBRYKwhbXZvthgtBbBHxxF0beaIKSSYpYxLZJ48o 3W2Pi1iX8Oj0JdFKiedORrrQQUYHDXs2Af/8Z2xh7cVn3+ha5vQLSaRKmyDq1kmoXCyP PWQ/9c1MiupUV+BLeM59ovEgPbAPTmZ6gmBSLNOrDpkx3kLk9pShAj4q72P06PwihRmz RXkBsBbxIb1egG0uHXTt0OfaVLPuqBMoTZF5VSJ+36EJq3Tze8kciSIlu4nkj3bFpYs7 a/pxjOYkq6VrYOhKKC2Glx0SnEwQzmJfnafpssMTdWIo6sPkykxvowLx+ygPDUAI7sJt Cnqw== X-Gm-Message-State: AO0yUKUFysB5b6VWAPmj18YNjLEgYqMvUxYzY6quTqeKZIm6ourI0cJ0 gq/hX2sVmM37BjczBJMOCOVJ3SuKlfb657icG8I= X-Google-Smtp-Source: AK7set/pMqtmdA+vfPDP7mvYDW3xTo5r+xfgFsf7qr1ST4mS7idLn7Jf8yhf4CUm7YYbvUyPv13qCg== X-Received: by 2002:a17:902:e544:b0:198:e056:4d78 with SMTP id n4-20020a170902e54400b00198e0564d78mr6752387plf.23.1675831712380; Tue, 07 Feb 2023 20:48:32 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id bu14-20020a63294e000000b004dff15fc121sm8838641pgb.36.2023.02.07.20.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 20:48:32 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Maxime Coquelin , Chenbo Xia Subject: [PATCH 4/5] vhost: use logtype instead of RTE_LOGTYPE_USER1 Date: Tue, 7 Feb 2023 20:48:24 -0800 Message-Id: <20230208044825.1682620-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208044825.1682620-1-stephen@networkplumber.org> References: <20230208044825.1682620-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. Signed-off-by: Stephen Hemminger --- lib/vhost/fd_man.c | 16 +++++++++------- lib/vhost/vhost_crypto.c | 24 ++++++++++-------------- 2 files changed, 19 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 b448b6685dd2..923c7c0e10d2 100644 --- a/lib/vhost/vhost_crypto.c +++ b/lib/vhost/vhost_crypto.c @@ -16,22 +16,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__, ## 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