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 #define PMD_INIT_LOG(level, fmt, args...) \
11 rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, \
12 "PMD: %s(): " fmt "\n", __func__, ##args)
14 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
16 extern int virtio_crypto_logtype_init;
18 #define VIRTIO_CRYPTO_INIT_LOG_IMPL(level, fmt, args...) \
19 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_init, \
20 "INIT: %s(): " fmt "\n", __func__, ##args)
22 #define VIRTIO_CRYPTO_INIT_LOG_INFO(fmt, args...) \
23 VIRTIO_CRYPTO_INIT_LOG_IMPL(INFO, fmt, ## args)
25 #define VIRTIO_CRYPTO_INIT_LOG_DBG(fmt, args...) \
26 VIRTIO_CRYPTO_INIT_LOG_IMPL(DEBUG, fmt, ## args)
28 #define VIRTIO_CRYPTO_INIT_LOG_ERR(fmt, args...) \
29 VIRTIO_CRYPTO_INIT_LOG_IMPL(ERR, fmt, ## args)
31 extern int virtio_crypto_logtype_session;
33 #define VIRTIO_CRYPTO_SESSION_LOG_IMPL(level, fmt, args...) \
34 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_session, \
35 "SESSION: %s(): " fmt "\n", __func__, ##args)
37 #define VIRTIO_CRYPTO_SESSION_LOG_INFO(fmt, args...) \
38 VIRTIO_CRYPTO_SESSION_LOG_IMPL(INFO, fmt, ## args)
40 #define VIRTIO_CRYPTO_SESSION_LOG_DBG(fmt, args...) \
41 VIRTIO_CRYPTO_SESSION_LOG_IMPL(DEBUG, fmt, ## args)
43 #define VIRTIO_CRYPTO_SESSION_LOG_ERR(fmt, args...) \
44 VIRTIO_CRYPTO_SESSION_LOG_IMPL(ERR, fmt, ## args)
46 extern int virtio_crypto_logtype_rx;
48 #define VIRTIO_CRYPTO_RX_LOG_IMPL(level, fmt, args...) \
49 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_rx, \
50 "RX: %s(): " fmt "\n", __func__, ##args)
52 #define VIRTIO_CRYPTO_RX_LOG_INFO(fmt, args...) \
53 VIRTIO_CRYPTO_RX_LOG_IMPL(INFO, fmt, ## args)
55 #define VIRTIO_CRYPTO_RX_LOG_DBG(fmt, args...) \
56 VIRTIO_CRYPTO_RX_LOG_IMPL(DEBUG, fmt, ## args)
58 #define VIRTIO_CRYPTO_RX_LOG_ERR(fmt, args...) \
59 VIRTIO_CRYPTO_RX_LOG_IMPL(ERR, fmt, ## args)
61 extern int virtio_crypto_logtype_tx;
63 #define VIRTIO_CRYPTO_TX_LOG_IMPL(level, fmt, args...) \
64 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_tx, \
65 "TX: %s(): " fmt "\n", __func__, ##args)
67 #define VIRTIO_CRYPTO_TX_LOG_INFO(fmt, args...) \
68 VIRTIO_CRYPTO_TX_LOG_IMPL(INFO, fmt, ## args)
70 #define VIRTIO_CRYPTO_TX_LOG_DBG(fmt, args...) \
71 VIRTIO_CRYPTO_TX_LOG_IMPL(DEBUG, fmt, ## args)
73 #define VIRTIO_CRYPTO_TX_LOG_ERR(fmt, args...) \
74 VIRTIO_CRYPTO_TX_LOG_IMPL(ERR, fmt, ## args)
76 extern int virtio_crypto_logtype_driver;
78 #define VIRTIO_CRYPTO_DRV_LOG_IMPL(level, fmt, args...) \
79 rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_driver, \
80 "DRIVER: %s(): " fmt "\n", __func__, ##args)
82 #define VIRTIO_CRYPTO_DRV_LOG_INFO(fmt, args...) \
83 VIRTIO_CRYPTO_DRV_LOG_IMPL(INFO, fmt, ## args)
85 #define VIRTIO_CRYPTO_DRV_LOG_DBG(fmt, args...) \
86 VIRTIO_CRYPTO_DRV_LOG_IMPL(DEBUG, fmt, ## args)
88 #define VIRTIO_CRYPTO_DRV_LOG_ERR(fmt, args...) \
89 VIRTIO_CRYPTO_DRV_LOG_IMPL(ERR, fmt, ## args)
91 #endif /* _VIRTIO_LOGS_H_ */