From 28b0514504cf0f71f822f0aed5aacc83eb8ada12 Mon Sep 17 00:00:00 2001 From: Ruifeng Wang Date: Tue, 28 Jul 2020 17:24:05 +0800 Subject: [PATCH] crypto/armv8: use dedicated log type armv8 crypto PMD used CRYPTODEV general log type. Create a dedicated log type for the PMD to not pollute CRYPTODEV log type. Typo in crypto dev name macro caused unexpected device name in log. Fixed the typo to log with correct device name. Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors") Cc: stable@dpdk.org Suggested-by: David Marchand Signed-off-by: Ruifeng Wang Acked-by: Akhil Goyal --- drivers/crypto/armv8/armv8_pmd_private.h | 23 ++++++++++++++--------- drivers/crypto/armv8/rte_armv8_pmd.c | 2 ++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/armv8/armv8_pmd_private.h b/drivers/crypto/armv8/armv8_pmd_private.h index 19940809bc..709b3d5360 100644 --- a/drivers/crypto/armv8/armv8_pmd_private.h +++ b/drivers/crypto/armv8/armv8_pmd_private.h @@ -10,19 +10,24 @@ #define CRYPTODEV_NAME_ARMV8_PMD crypto_armv8 /**< ARMv8 Crypto PMD device name */ -#define ARMV8_CRYPTO_LOG_ERR(fmt, args...) \ - RTE_LOG(ERR, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \ - RTE_STR(CRYPTODEV_NAME_ARMV8_CRYPTO_PMD), \ +extern int crypto_armv8_log_type; + +#define ARMV8_CRYPTO_LOG_ERR(fmt, args...) \ + rte_log(RTE_LOG_ERR, crypto_armv8_log_type, \ + "[%s] %s() line %u: " fmt "\n", \ + RTE_STR(CRYPTODEV_NAME_ARMV8_PMD), \ __func__, __LINE__, ## args) -#define ARMV8_CRYPTO_LOG_INFO(fmt, args...) \ - RTE_LOG(INFO, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \ - RTE_STR(CRYPTODEV_NAME_ARMV8_CRYPTO_PMD), \ +#define ARMV8_CRYPTO_LOG_INFO(fmt, args...) \ + rte_log(RTE_LOG_INFO, crypto_armv8_log_type, \ + "[%s] %s() line %u: " fmt "\n", \ + RTE_STR(CRYPTODEV_NAME_ARMV8_PMD), \ __func__, __LINE__, ## args) -#define ARMV8_CRYPTO_LOG_DBG(fmt, args...) \ - RTE_LOG(DEBUG, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \ - RTE_STR(CRYPTODEV_NAME_ARMV8_CRYPTO_PMD), \ +#define ARMV8_CRYPTO_LOG_DBG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, crypto_armv8_log_type, \ + "[%s] %s() line %u: " fmt "\n", \ + RTE_STR(CRYPTODEV_NAME_ARMV8_PMD), \ __func__, __LINE__, ## args) #define ARMV8_CRYPTO_ASSERT(con) \ diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c index 8b212772fa..a2b08d8180 100644 --- a/drivers/crypto/armv8/rte_armv8_pmd.c +++ b/drivers/crypto/armv8/rte_armv8_pmd.c @@ -861,6 +861,8 @@ static struct rte_vdev_driver armv8_crypto_pmd_drv = { static struct cryptodev_driver armv8_crypto_drv; +RTE_LOG_REGISTER(crypto_armv8_log_type, pmd.crypto.armv8, ERR); + RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_ARMV8_PMD, armv8_crypto_pmd_drv); RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_ARMV8_PMD, cryptodev_armv8_pmd); RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_ARMV8_PMD, -- 2.20.1