Skip to content

Commit e5dc404

Browse files
shemmingerdavid-marchand
authored andcommitted
cryptodev: use a dynamic logtype
The cryptodev logs are all referenced via rte_cryptodev.h, so make it dynamic there. Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Akhil Goyal <[email protected]>
1 parent 620b269 commit e5dc404

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

lib/cryptodev/rte_cryptodev.c

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ struct rte_crypto_fp_ops rte_crypto_fp_ops[RTE_CRYPTO_MAX_DEVS];
4949
/* spinlock for crypto device callbacks */
5050
static rte_spinlock_t rte_cryptodev_cb_lock = RTE_SPINLOCK_INITIALIZER;
5151

52+
RTE_LOG_REGISTER_DEFAULT(rte_cryptodev_logtype, INFO);
53+
5254
/**
5355
* The user application callback description.
5456
*

lib/cryptodev/rte_cryptodev.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ extern "C" {
2828

2929
extern const char **rte_cyptodev_names;
3030

31-
/* Logging Macros */
31+
/**
32+
* @internal Logtype used for cryptodev related messages.
33+
*/
34+
extern int rte_cryptodev_logtype;
35+
#define RTE_LOGTYPE_CRYPTODEV rte_cryptodev_logtype
3236

37+
/* Logging Macros */
3338
#define CDEV_LOG_ERR(...) \
3439
RTE_LOG(ERR, CRYPTODEV, \
3540
RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \

lib/cryptodev/version.map

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ DPDK_24 {
4444
rte_cryptodev_get_sec_ctx;
4545
rte_cryptodev_info_get;
4646
rte_cryptodev_is_valid_dev;
47+
rte_cryptodev_logtype;
4748
rte_cryptodev_name_get;
4849
rte_cryptodev_queue_pair_count;
4950
rte_cryptodev_queue_pair_setup;

lib/log/log.c

-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ static const struct logtype logtype_strings[] = {
356356
{RTE_LOGTYPE_PORT, "lib.port"},
357357
{RTE_LOGTYPE_TABLE, "lib.table"},
358358
{RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
359-
{RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"},
360359
{RTE_LOGTYPE_EVENTDEV, "lib.eventdev"},
361360
{RTE_LOGTYPE_USER1, "user1"},
362361
{RTE_LOGTYPE_USER2, "user2"},

lib/log/rte_log.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extern "C" {
4343
#define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */
4444
#define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */
4545
/* was RTE_LOGTYPE_MBUF */
46-
#define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */
46+
/* was RTE_LOGTYPE_CRYPTODEV */
4747
/* was RTE_LOGTYPE_EFD */
4848
#define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */
4949
/* was RTE_LOGTYPE_GSO */

0 commit comments

Comments
 (0)