]> git.droids-corp.org - dpdk.git/commitdiff
crypto/armv8: use dedicated log type
authorRuifeng Wang <ruifeng.wang@arm.com>
Tue, 28 Jul 2020 09:24:05 +0000 (17:24 +0800)
committerAkhil Goyal <akhil.goyal@nxp.com>
Tue, 28 Jul 2020 20:09:22 +0000 (22:09 +0200)
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>
drivers/crypto/armv8/armv8_pmd_private.h
drivers/crypto/armv8/rte_armv8_pmd.c

index 19940809bc72ab0147c532317ad41f2b6625708b..709b3d53605ca8800f8c106efa34c00eee4d98cf 100644 (file)
 #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)                               \
index 8b212772faa607afc4e4f8e131792a7dda9ce27a..a2b08d81801c8fa6cb775de0130bf063ef74bef2 100644 (file)
@@ -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,