cryptodev: convert to dynamic logtype
PATCH 1/1 cryptodev: convert to dynamic logtype
The cryptodev logs are all referenced via rte_crytpodev.h so make it dynamic there.
--- lib/cryptodev/rte_cryptodev.c | 2 ++ lib/cryptodev/rte_cryptodev.h | 2 ++ lib/cryptodev/version.map | 1 + lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-)
lib/cryptodev/rte_cryptodev.c +2 -0
@@ -49,6 +49,8 @@ struct rte_crypto_fp_ops rte_crypto_fp_ops[RTE_CRYPTO_MAX_DEVS];/* spinlock for crypto device callbacks */ static rte_spinlock_t rte_cryptodev_cb_lock =RTE_SPINLOCK_INITIALIZER ; +RTE_LOG_REGISTER_DEFAULT (rte_cryptodev_logtype,INFO ); +/** * The user application callback description. *
lib/cryptodev/rte_cryptodev.h +2 -0
@@ -29,6 +29,8 @@ extern "C" {extern const char **rte_cyptodev_names;/* Logging Macros */ +extern int rte_cryptodev_logtype; +#define RTE_LOGTYPE_CRYPTODEV rte_cryptodev_logtype#define CDEV_LOG_ERR (...) \ RTE_LOG(ERR, CRYPTODEV, \
lib/cryptodev/version.map +1 -0
@@ -44,6 +44,7 @@ DPDK_24 { rte_cryptodev_get_sec_ctx; rte_cryptodev_info_get; rte_cryptodev_is_valid_dev; + rte_cryptodev_logtype; rte_cryptodev_name_get; rte_cryptodev_queue_pair_count; rte_cryptodev_queue_pair_setup;
lib/log/log.c +0 -1
@@ -356,7 +356,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, - {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"},
lib/log/rte_log.h +1 -1
@@ -43,7 +43,7 @@ extern "C" {#define RTE_LOGTYPE_TABLE 14/**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15/**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ -#define RTE_LOGTYPE_CRYPTODEV 17/**< Log related to cryptodev. */ +/* was RTE_LOGTYPE_CRYPTODEV */ /* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19/**< Log related to eventdev. */ /* was RTE_LOGTYPE_GSO */
Signature · 1 line
2.42.0
Quoted 2 lines · Stephen Hemminger
The cryptodev logs are all referenced via
rte_crytpodev.h
crypto*
Quoted 3 lines
so make it dynamic there.
Signed-off-by Stephen Hemminger <[email protected]>
I would add a comment in the header that this exported logtype variable is for internal use.
Otherwise it lgtm.
Akhil, do you mind if I take this directly in main?
Signature · 1 line
David Marchand
Akhil Goyal
Acked-byQuoted 9 lines
Quoted 2 lines · Stephen Hemminger
The cryptodev logs are all referenced via
rte_crytpodev.hcrypto*
Quoted 2 lines
so make it dynamic there.
Quoted 7 lines
Quoted 1 line
Signed-off-by Stephen Hemminger <[email protected]>I would add a comment in the header that this exported logtype variable is for internal use.
Otherwise it lgtm.Akhil, do you mind if I take this directly in main?
No issues, you can take it directly in main.
David Marchand
AppliedQuoted 5 lines · Stephen Hemminger
The cryptodev logs are all referenced via
rte_crytpodev.hso make it dynamic there.Signed-off-by Stephen Hemminger <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand