[PATCH v8 4/6] vhost: use logtype instead of RTE_LOGTYPE_USER1
Stephen Hemminger
stephen at networkplumber.org
Mon Aug 14 18:31:23 CEST 2023
Fix instances of USER1 logtype in fdset and crypto
sections.
Acked-by: Chenbo Xia <chenbo.xia at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
lib/vhost/fd_man.c | 4 ++--
lib/vhost/vhost_crypto.c | 22 +++++++++++-----------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c
index 1876fada3354..46037d02784e 100644
--- a/lib/vhost/fd_man.c
+++ b/lib/vhost/fd_man.c
@@ -10,8 +10,8 @@
#include "fd_man.h"
-
-#define RTE_LOGTYPE_VHOST_FDMAN RTE_LOGTYPE_USER1
+RTE_LOG_REGISTER_SUFFIX(vhost_fdset_logtype, fdset, INFO);
+#define RTE_LOGTYPE_VHOST_FDMAN vhost_fdset_logtype
#define FDPOLLERR (POLLERR | POLLHUP | POLLNVAL)
diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c
index 9bf5ef67b9ad..3e1ef1ac25eb 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,21 @@
#define IV_OFFSET (sizeof(struct rte_crypto_op) + \
sizeof(struct rte_crypto_sym_op))
-#ifdef RTE_LIBRTE_VHOST_DEBUG
+RTE_LOG_REGISTER_SUFFIX(vhost_crypto_logtype, crypto, INFO);
+#define RTE_LOGTYPE_VHOST_CRYPTO vhost_crypto_logtype
+
#define VC_LOG_ERR(fmt, args...) \
- RTE_LOG(ERR, USER1, "[%s] %s() line %u: " fmt "\n", \
- "Vhost-Crypto", __func__, __LINE__, ## args)
+ RTE_LOG(ERR, VHOST_CRYPTO, "%s() line %u: " fmt "\n", \
+ __func__, __LINE__, ## args)
#define VC_LOG_INFO(fmt, args...) \
- RTE_LOG(INFO, USER1, "[%s] %s() line %u: " fmt "\n", \
- "Vhost-Crypto", __func__, __LINE__, ## args)
+ RTE_LOG(INFO, VHOST_CRYPTO, "%s() line %u: " fmt "\n", \
+ __func__, __LINE__, ## args)
+#ifdef RTE_LIBRTE_VHOST_DEBUG
#define VC_LOG_DBG(fmt, args...) \
- RTE_LOG(DEBUG, USER1, "[%s] %s() line %u: " fmt "\n", \
- "Vhost-Crypto", __func__, __LINE__, ## args)
+ RTE_LOG(DEBUG, VHOST_CRYPTO, "%s() line %u: " fmt "\n", \
+ __func__, __LINE__, ## 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.2
More information about the dev
mailing list