1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 HUAWEI TECHNOLOGIES CO., LTD.
5 #ifndef _VIRTIO_LOGS_H_
6 #define _VIRTIO_LOGS_H_
10 extern int virtio_crypto_logtype_init;
12 #define PMD_INIT_LOG(level, fmt, args...) \
13 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_init, \
14 "PMD: %s(): " fmt "\n", __func__, ##args)
16 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
18 extern int virtio_crypto_logtype_init;
20 #define VIRTIO_CRYPTO_INIT_LOG_IMPL(level, fmt, args...) \
21 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_init, \
22 "INIT: %s(): " fmt "\n", __func__, ##args)
24 #define VIRTIO_CRYPTO_INIT_LOG_INFO(fmt, args...) \
25 VIRTIO_CRYPTO_INIT_LOG_IMPL(INFO, fmt, ## args)
27 #define VIRTIO_CRYPTO_INIT_LOG_DBG(fmt, args...) \
28 VIRTIO_CRYPTO_INIT_LOG_IMPL(DEBUG, fmt, ## args)
30 #define VIRTIO_CRYPTO_INIT_LOG_ERR(fmt, args...) \
31 VIRTIO_CRYPTO_INIT_LOG_IMPL(ERR, fmt, ## args)
33 extern int virtio_crypto_logtype_session;
35 #define VIRTIO_CRYPTO_SESSION_LOG_IMPL(level, fmt, args...) \
36 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_session, \
37 "SESSION: %s(): " fmt "\n", __func__, ##args)
39 #define VIRTIO_CRYPTO_SESSION_LOG_INFO(fmt, args...) \
40 VIRTIO_CRYPTO_SESSION_LOG_IMPL(INFO, fmt, ## args)
42 #define VIRTIO_CRYPTO_SESSION_LOG_DBG(fmt, args...) \
43 VIRTIO_CRYPTO_SESSION_LOG_IMPL(DEBUG, fmt, ## args)
45 #define VIRTIO_CRYPTO_SESSION_LOG_ERR(fmt, args...) \
46 VIRTIO_CRYPTO_SESSION_LOG_IMPL(ERR, fmt, ## args)
48 extern int virtio_crypto_logtype_rx;
50 #define VIRTIO_CRYPTO_RX_LOG_IMPL(level, fmt, args...) \
51 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_rx, \
52 "RX: %s(): " fmt "\n", __func__, ##args)
54 #define VIRTIO_CRYPTO_RX_LOG_INFO(fmt, args...) \
55 VIRTIO_CRYPTO_RX_LOG_IMPL(INFO, fmt, ## args)
57 #define VIRTIO_CRYPTO_RX_LOG_DBG(fmt, args...) \
58 VIRTIO_CRYPTO_RX_LOG_IMPL(DEBUG, fmt, ## args)
60 #define VIRTIO_CRYPTO_RX_LOG_ERR(fmt, args...) \
61 VIRTIO_CRYPTO_RX_LOG_IMPL(ERR, fmt, ## args)
63 extern int virtio_crypto_logtype_tx;
65 #define VIRTIO_CRYPTO_TX_LOG_IMPL(level, fmt, args...) \
66 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_tx, \
67 "TX: %s(): " fmt "\n", __func__, ##args)
69 #define VIRTIO_CRYPTO_TX_LOG_INFO(fmt, args...) \
70 VIRTIO_CRYPTO_TX_LOG_IMPL(INFO, fmt, ## args)
72 #define VIRTIO_CRYPTO_TX_LOG_DBG(fmt, args...) \
73 VIRTIO_CRYPTO_TX_LOG_IMPL(DEBUG, fmt, ## args)
75 #define VIRTIO_CRYPTO_TX_LOG_ERR(fmt, args...) \
76 VIRTIO_CRYPTO_TX_LOG_IMPL(ERR, fmt, ## args)
78 extern int virtio_crypto_logtype_driver;
80 #define VIRTIO_CRYPTO_DRV_LOG_IMPL(level, fmt, args...) \
81 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_driver, \
82 "DRIVER: %s(): " fmt "\n", __func__, ##args)
84 #define VIRTIO_CRYPTO_DRV_LOG_INFO(fmt, args...) \
85 VIRTIO_CRYPTO_DRV_LOG_IMPL(INFO, fmt, ## args)
87 #define VIRTIO_CRYPTO_DRV_LOG_DBG(fmt, args...) \
88 VIRTIO_CRYPTO_DRV_LOG_IMPL(DEBUG, fmt, ## args)
90 #define VIRTIO_CRYPTO_DRV_LOG_ERR(fmt, args...) \
91 VIRTIO_CRYPTO_DRV_LOG_IMPL(ERR, fmt, ## args)
93 #endif /* _VIRTIO_LOGS_H_ */