[v2,2/3] crypto/armv8: use dedicated log type
Checks
Commit Message
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 <david.marchand@redhat.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
drivers/crypto/armv8/armv8_pmd_private.h | 23 ++++++++++++++---------
drivers/crypto/armv8/rte_armv8_pmd.c | 2 ++
2 files changed, 16 insertions(+), 9 deletions(-)
Comments
> 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 <david.marchand@redhat.com>
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
@@ -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) \
@@ -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,