@@ -53,7 +53,7 @@ print_usage () {
check_forbidden_additions() { # <patch>
res=0
- # refrain from new calls to RTE_LOG
+ # refrain from new calls to RTE_LOG in libraries
awk -v FOLDERS="lib" \
-v EXPRESSIONS="RTE_LOG\\\(" \
-v RET_ON_FAIL=1 \
@@ -61,6 +61,15 @@ check_forbidden_additions() { # <patch>
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
+ # refrain from new calls to RTE_LOG in drivers (but leave some leeway for base drivers)
+ awk -v FOLDERS="drivers" \
+ -v SKIP_FILES='osdep.h$' \
+ -v EXPRESSIONS="RTE_LOG\\\( RTE_LOG_DP\\\( rte_log\\\(" \
+ -v RET_ON_FAIL=1 \
+ -v MESSAGE='Prefer RTE_LOG_LINE/RTE_LOG_DP_LINE' \
+ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+ "$1" || res=1
+
# no output on stdout or stderr
awk -v FOLDERS="lib drivers" \
-v EXPRESSIONS="\\\<printf\\\> \\\<fprintf\\\(stdout, \\\<fprintf\\\(stderr," \
@@ -11,16 +11,14 @@
#include "acc_common.h"
/* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, acc100_logtype, fmt "\n", \
- ##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+ RTE_LOG_LINE(level, ACC100, __VA_ARGS__)
#ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
- rte_bbdev_log(DEBUG, "acc100_pmd: " fmt, \
- ##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+ rte_bbdev_log(DEBUG, __VA_ARGS__)
#else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
#endif
/* ACC100 PF and VF driver names */
@@ -151,11 +151,11 @@
#define ACC_MAX_FFT_WIN 16
extern int acc_common_logtype;
+#define RTE_LOGTYPE_ACC_COMMON acc_common_logtype
/* Helper macro for logging */
-#define rte_acc_log(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, acc_common_logtype, fmt "\n", \
- ##__VA_ARGS__)
+#define rte_acc_log(level, ...) \
+ RTE_LOG_LINE(level, ACC_COMMON, __VA_ARGS__)
/* ACC100 DMA Descriptor triplet */
struct acc_dma_triplet {
@@ -30,6 +30,7 @@ RTE_LOG_REGISTER_SUFFIX(acc100_logtype, acc100, DEBUG);
#else
RTE_LOG_REGISTER_SUFFIX(acc100_logtype, acc100, NOTICE);
#endif
+#define RTE_LOGTYPE_ACC100 acc100_logtype
/* Calculate the offset of the enqueue register */
static inline uint32_t
@@ -26,6 +26,7 @@ RTE_LOG_REGISTER_SUFFIX(vrb_logtype, vrb, DEBUG);
#else
RTE_LOG_REGISTER_SUFFIX(vrb_logtype, vrb, NOTICE);
#endif
+#define RTE_LOGTYPE_VRB vrb_logtype
/* Calculate the offset of the enqueue register. */
static inline uint32_t
@@ -13,16 +13,14 @@
#include "vrb_cfg.h"
/* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, vrb_logtype, fmt "\n", \
- ##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+ RTE_LOG_LINE(level, VRB, __VA_ARGS__)
#ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
- rte_bbdev_log(DEBUG, "vrb_pmd: " fmt, \
- ##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+ rte_bbdev_log(DEBUG, __VA_ARGS__)
#else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
#endif
/* VRB1 PF and VF driver names */
@@ -11,17 +11,18 @@
#include "agx100_pmd.h"
#include "vc_5gnr_pmd.h"
+extern int fpga_5gnr_fec_logtype;
+#define RTE_LOGTYPE_FPGA_5GNR_FEC fpga_5gnr_fec_logtype
+
/* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, fpga_5gnr_fec_logtype, fmt "\n", \
- ##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+ RTE_LOG_LINE(level, FPGA_5GNR_FEC, __VA_ARGS__)
#ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
- rte_bbdev_log(DEBUG, "fpga_5gnr_fec: " fmt, \
- ##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+ rte_bbdev_log(DEBUG, __VA_ARGS__)
#else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
#endif
/* FPGA 5GNR FEC driver names */
@@ -25,18 +25,17 @@ RTE_LOG_REGISTER_DEFAULT(fpga_lte_fec_logtype, DEBUG);
#else
RTE_LOG_REGISTER_DEFAULT(fpga_lte_fec_logtype, NOTICE);
#endif
+#define RTE_LOGTYPE_FPGA_LTE_FEC fpga_lte_fec_logtype
/* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, fpga_lte_fec_logtype, fmt "\n", \
- ##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+ RTE_LOG_LINE(level, FPGA_LTE_FEC, __VA_ARGS__)
#ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
- rte_bbdev_log(DEBUG, "fpga_lte_fec: " fmt, \
- ##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+ rte_bbdev_log(DEBUG, __VA_ARGS__)
#else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
#endif
/* FPGA LTE FEC driver names */
@@ -8,22 +8,20 @@
extern int bbdev_la12xx_logtype;
#define RTE_LOGTYPE_BBDEV_LA12XX bbdev_la12xx_logtype
-#define rte_bbdev_log(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \
- ##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+ RTE_LOG_LINE(level, BBDEV_LA12XX, __VA_ARGS__)
#ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
- rte_bbdev_log(DEBUG, "la12xx_pmd: " fmt, \
- ##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+ rte_bbdev_log(DEBUG, __VA_ARGS__)
#else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
#endif
#define PMD_INIT_FUNC_TRACE() rte_bbdev_log_debug(">>")
/* DP Logs, toggled out at compile time if level lower than current level */
-#define rte_bbdev_dp_log(level, fmt, args...) \
- RTE_LOG_DP(level, BBDEV_LA12XX, fmt, ## args)
+#define rte_bbdev_dp_log(level, ...) \
+ RTE_LOG_DP_LINE(level, BBDEV_LA12XX, __VA_ARGS__)
#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
@@ -17,10 +17,11 @@
#define DRIVER_NAME baseband_null
RTE_LOG_REGISTER_DEFAULT(bbdev_null_logtype, NOTICE);
+#define RTE_LOGTYPE_BBDEV_NULL bbdev_null_logtype
/* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, bbdev_null_logtype, fmt "\n", ##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+ RTE_LOG_LINE(level, BBDEV_NULL, __VA_ARGS__)
#define rte_bbdev_log_debug(fmt, ...) \
rte_bbdev_log(DEBUG, RTE_STR(__LINE__) ":%s() " fmt, __func__, \
@@ -37,11 +37,11 @@
#define DRIVER_NAME baseband_turbo_sw
RTE_LOG_REGISTER_DEFAULT(bbdev_turbo_sw_logtype, NOTICE);
+#define RTE_LOGTYPE_BBDEV_TURBO_SW bbdev_turbo_sw_logtype
/* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, bbdev_turbo_sw_logtype, fmt "\n", \
- ##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+ RTE_LOG_LINE(level, BBDEV_TURBO_SW, __VA_ARGS__)
#define rte_bbdev_log_debug(fmt, ...) \
rte_bbdev_log(DEBUG, RTE_STR(__LINE__) ":%s() " fmt, __func__, \
@@ -14,11 +14,10 @@
#include "bus_auxiliary_driver.h"
extern int auxiliary_bus_logtype;
+#define RTE_LOGTYPE_AUXILIARY_BUS auxiliary_bus_logtype
#define AUXILIARY_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, auxiliary_bus_logtype, \
- RTE_FMT("auxiliary bus: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+ RTE_LOG_LINE(level, AUXILIARY_BUS, ## __VA_ARGS__)
/*
* Structure describing the auxiliary bus
@@ -6,15 +6,14 @@
#define CDX_LOGS_H
extern int cdx_logtype_bus;
+#define RTE_LOGTYPE_CDX_BUS cdx_logtype_bus
#define CDX_BUS_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, cdx_logtype_bus, "cdx: " fmt "\n", \
- ##args)
+ RTE_LOG_LINE(level, CDX_BUS, fmt, ## args)
/* Debug logs with Function names */
#define CDX_BUS_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, cdx_logtype_bus, "cdx: %s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(DEBUG, CDX_BUS, "%s(): " fmt, __func__, ## args)
#define CDX_BUS_INFO(fmt, args...) \
CDX_BUS_LOG(INFO, fmt, ## args)
@@ -403,8 +403,7 @@ extern int fman_ccsr_map_fd;
#define FMAN_ERR(rc, fmt, args...) \
do { \
_errno = (rc); \
- rte_log(RTE_LOG_ERR, dpaa_logtype_bus, "dpaa: " fmt "(%d)\n", \
- ##args, errno); \
+ RTE_LOG_LINE(ERR, DPAA_BUS, fmt "(%d)", ##args, errno); \
} while (0)
#define FMAN_IP_REV_1 0xC30C4
@@ -10,9 +10,10 @@
#include <rte_log.h>
extern int dpaa_logtype_bus;
+#define RTE_LOGTYPE_DPAA_BUS dpaa_logtype_bus
#define DPAA_BUS_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "dpaa: " fmt "\n", ##args)
+ RTE_LOG_LINE(level, DPAA_BUS, fmt, ## args)
#ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
#define DPAA_BUS_HWWARN(cond, fmt, args...) \
@@ -25,8 +26,7 @@ extern int dpaa_logtype_bus;
#endif
#define DPAA_BUS_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa_logtype_bus, "dpaa: %s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(DEBUG, DPAA_BUS, "%s(): " fmt, __func__, ## args)
#define BUS_INIT_FUNC_TRACE() DPAA_BUS_DEBUG(" >>")
@@ -8,15 +8,14 @@
#define _FSLMC_LOGS_H_
extern int dpaa2_logtype_bus;
+#define RTE_LOGTYPE_DPAA2_BUS dpaa2_logtype_bus
#define DPAA2_BUS_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa2_logtype_bus, "fslmc: " fmt "\n", \
- ##args)
+ RTE_LOG_LINE(level, DPAA2_BUS, fmt, ## args)
/* Debug logs are with Function names */
#define DPAA2_BUS_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(DEBUG, DPAA2_BUS, "%s(): " fmt, __func__, ## args)
#define DPAA2_BUS_INFO(fmt, args...) \
DPAA2_BUS_LOG(INFO, fmt, ## args)
@@ -8,9 +8,10 @@
#include <rte_log.h>
extern int ifpga_bus_logtype;
+#define RTE_LOGTYPE_IFPGA_BUS ifpga_bus_logtype
#define IFPGA_BUS_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ifpga_bus_logtype, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, IFPGA_BUS, "%s(): " fmt, \
__func__, ##args)
#define IFPGA_BUS_FUNC_TRACE() IFPGA_BUS_LOG(DEBUG, ">>")
@@ -35,8 +35,7 @@ struct rte_platform_bus {
extern int platform_bus_logtype;
#define RTE_LOGTYPE_PLATFORM_BUS platform_bus_logtype
#define PLATFORM_LOG_LINE(level, ...) \
- RTE_LOG(level, PLATFORM_BUS, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+ RTE_LOG_LINE(level, PLATFORM_BUS, __VA_ARGS__)
/*
* Iterate registered platform devices and find one that matches provided string.
@@ -59,9 +59,9 @@ static const char *const uacce_params_keys[] = {
RTE_TAILQ_FOREACH(p, &uacce_bus.driver_list, next)
extern int uacce_bus_logtype;
+#define RTE_LOGTYPE_UACCE_BUS uacce_bus_logtype
#define UACCE_BUS_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, uacce_bus_logtype, "uacce: " fmt "\n", \
- ##args)
+ RTE_LOG_LINE(level, UACCE_BUS, fmt, ##args)
#define UACCE_BUS_ERR(fmt, args...) UACCE_BUS_LOG(ERR, fmt, ##args)
#define UACCE_BUS_WARN(fmt, args...) UACCE_BUS_LOG(WARNING, fmt, ##args)
#define UACCE_BUS_INFO(fmt, args...) UACCE_BUS_LOG(INFO, fmt, ##args)
@@ -8,9 +8,10 @@
#include <rte_log.h>
extern int vdev_logtype_bus;
+#define RTE_LOGTYPE_VDEV_BUS vdev_logtype_bus
#define VDEV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, vdev_logtype_bus, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, VDEV_BUS, "%s(): " fmt, \
__func__, ##args)
#endif /* _VDEV_LOGS_H_ */
@@ -34,8 +34,9 @@ extern struct rte_vmbus_bus rte_vmbus_bus;
RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.driver_list), next)
extern int vmbus_logtype_bus;
+#define RTE_LOGTYPE_VMBUS_BUS vmbus_logtype_bus
#define VMBUS_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, vmbus_logtype_bus, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, VMBUS_BUS, "%s(): " fmt, \
__func__, ##args)
struct vmbus_br {
@@ -260,27 +260,41 @@ plt_thread_is_valid(plt_thread_t thr)
/* Log */
extern int cnxk_logtype_base;
+#define RTE_LOGTYPE_base cnxk_logtype_base
extern int cnxk_logtype_mbox;
+#define RTE_LOGTYPE_mbox cnxk_logtype_mbox
extern int cnxk_logtype_cpt;
+#define RTE_LOGTYPE_cpt cnxk_logtype_cpt
extern int cnxk_logtype_ml;
+#define RTE_LOGTYPE_ml cnxk_logtype_ml
extern int cnxk_logtype_npa;
+#define RTE_LOGTYPE_npa cnxk_logtype_npa
extern int cnxk_logtype_nix;
+#define RTE_LOGTYPE_nix cnxk_logtype_nix
extern int cnxk_logtype_npc;
+#define RTE_LOGTYPE_npc cnxk_logtype_npc
extern int cnxk_logtype_sso;
+#define RTE_LOGTYPE_sso cnxk_logtype_sso
extern int cnxk_logtype_tim;
+#define RTE_LOGTYPE_tim cnxk_logtype_tim
extern int cnxk_logtype_tm;
+#define RTE_LOGTYPE_tm cnxk_logtype_tm
extern int cnxk_logtype_ree;
+#define RTE_LOGTYPE_ree cnxk_logtype_ree
extern int cnxk_logtype_dpi;
+#define RTE_LOGTYPE_dpi cnxk_logtype_dpi
extern int cnxk_logtype_rep;
+#define RTE_LOGTYPE_rep cnxk_logtype_rep
extern int cnxk_logtype_esw;
+#define RTE_LOGTYPE_esw cnxk_logtype_esw
#define RTE_LOGTYPE_CNXK cnxk_logtype_base
#define plt_err(fmt, args...) \
- RTE_LOG(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_info(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
-#define plt_warn(fmt, args...) RTE_LOG(WARNING, CNXK, fmt "\n", ##args)
-#define plt_print(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
+ RTE_LOG_LINE(ERR, CNXK, "%s():%u " fmt, __func__, __LINE__, ##args)
+#define plt_info(fmt, args...) RTE_LOG_LINE(INFO, CNXK, fmt, ##args)
+#define plt_warn(fmt, args...) RTE_LOG_LINE(WARNING, CNXK, fmt, ##args)
+#define plt_print(fmt, args...) RTE_LOG_LINE(INFO, CNXK, fmt, ##args)
#define plt_dump(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)
#define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
@@ -288,8 +302,7 @@ extern int cnxk_logtype_esw;
* Log debug message if given subsystem logging is enabled.
*/
#define plt_dbg(subsystem, fmt, args...) \
- rte_log(RTE_LOG_DEBUG, cnxk_logtype_##subsystem, \
- "[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__, \
+ RTE_LOG_LINE(DEBUG, subsystem, "%s():%u " fmt, __func__, __LINE__, \
##args)
#define plt_base_dbg(fmt, ...) plt_dbg(base, fmt, ##__VA_ARGS__)
@@ -309,11 +322,11 @@ extern int cnxk_logtype_esw;
/* Datapath logs */
#define plt_dp_err(fmt, args...) \
- RTE_LOG_DP(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+ RTE_LOG_DP_LINE(ERR, CNXK, "%s():%u " fmt, __func__, __LINE__, ##args)
#define plt_dp_info(fmt, args...) \
- RTE_LOG_DP(INFO, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+ RTE_LOG_DP_LINE(INFO, CNXK, "%s():%u " fmt, __func__, __LINE__, ##args)
#define plt_dp_dbg(fmt, args...) \
- RTE_LOG_DP(DEBUG, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+ RTE_LOG_DP_LINE(DEBUG, CNXK, "%s():%u " fmt, __func__, __LINE__, ##args)
#ifdef __cplusplus
#define CNXK_PCI_ID(subsystem_dev, dev) \
@@ -17,24 +17,23 @@
*/
#define RTE_LOGTYPE_CPT CPT_LOGTYPE
-#define CPT_PMD_DRV_LOG_RAW(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, CPT_LOGTYPE, \
- "cpt: %s(): " fmt "\n", __func__, ##args)
+#define CPT_PMD_DRV_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, CPT, "%s(): " fmt, __func__, ## args)
-#define CPT_PMD_INIT_FUNC_TRACE() CPT_PMD_DRV_LOG_RAW(DEBUG, " >>")
+#define CPT_PMD_INIT_FUNC_TRACE() CPT_PMD_DRV_LOG(DEBUG, " >>")
#define CPT_LOG_INFO(fmt, args...) \
- CPT_PMD_DRV_LOG_RAW(INFO, fmt, ## args)
+ CPT_PMD_DRV_LOG(INFO, fmt, ## args)
#define CPT_LOG_WARN(fmt, args...) \
- CPT_PMD_DRV_LOG_RAW(WARNING, fmt, ## args)
+ CPT_PMD_DRV_LOG(WARNING, fmt, ## args)
#define CPT_LOG_ERR(fmt, args...) \
- CPT_PMD_DRV_LOG_RAW(ERR, fmt, ## args)
+ CPT_PMD_DRV_LOG(ERR, fmt, ## args)
/*
* DP logs, toggled out at compile time if level lower than current level.
*/
#define CPT_LOG_DP(level, fmt, args...) \
- RTE_LOG_DP(level, CPT, fmt "\n", ## args)
+ RTE_LOG_DP_LINE(level, CPT, fmt, ## args)
#define CPT_LOG_DP_DEBUG(fmt, args...) \
CPT_LOG_DP(DEBUG, fmt, ## args)
@@ -21,13 +21,11 @@ extern int dpaax_logger;
#endif
#define DPAAX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaax_logger, "dpaax: " fmt "\n", \
- ##args)
+ RTE_LOG_LINE(level, DPAAX_LOGGER, fmt, ## args)
/* Debug logs are with Function names */
#define DPAAX_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaax_logger, "dpaax: %s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(DEBUG, DPAAX_LOGGER, "%s(): " fmt, __func__, ## args)
#define DPAAX_INFO(fmt, args...) \
DPAAX_LOG(INFO, fmt, ## args)
@@ -11,35 +11,23 @@ extern int idpf_common_logtype;
#define RTE_LOGTYPE_IDPF_COMMON idpf_common_logtype
#define DRV_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, \
- idpf_common_logtype, \
+ RTE_LOG_LINE(level, \
+ IDPF_COMMON, \
RTE_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+ RTE_FMT_HEAD(__VA_ARGS__,), \
__func__, \
RTE_FMT_TAIL(__VA_ARGS__,)))
#ifdef RTE_LIBRTE_IDPF_DEBUG_RX
-#define RX_LOG(level, ...) \
- RTE_LOG(level, \
- IDPF_COMMON, \
- RTE_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- __func__, \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+#define RX_LOG(...) DRV_LOG(__VA_ARGS__)
#else
-#define RX_LOG(level, fmt, args...) do { } while (0)
+#define RX_LOG(...) do {} while (0)
#endif
#ifdef RTE_LIBRTE_IDPF_DEBUG_TX
-#define TX_LOG(level, ...) \
- RTE_LOG(level, \
- IDPF_COMMON, \
- RTE_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- __func__, \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+#define TX_LOG(...) DRV_LOG(__VA_ARGS__)
#else
-#define TX_LOG(level, fmt, args...) do { } while (0)
+#define TX_LOG(...) do {} while (0)
#endif
#endif /* _IDPF_COMMON_LOGS_H_ */
@@ -9,8 +9,9 @@
#include <rte_log.h>
extern int nfp_logtype_common;
+#define RTE_LOGTYPE_NFP_COMMON nfp_logtype_common
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_common, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NFP_COMMON, \
+ "%s(): " fmt, __func__, ## args)
#endif/* __NFP_COMMON_LOG_H__ */
@@ -8,6 +8,6 @@
extern int nitrox_logtype;
#define RTE_LOGTYPE_NITROX nitrox_logtype
#define NITROX_LOG_LINE(level, fmt, args...) \
- RTE_LOG(level, NITROX, "%s:%d " fmt "\n", __func__, __LINE__, ## args)
+ RTE_LOG_LINE(level, NITROX, "%s:%d " fmt, __func__, __LINE__, ## args)
#endif /* _NITROX_LOGS_H_ */
@@ -18,8 +18,8 @@
#define MBOX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, octeontx_logtype_mbox,\
- "%s() line %u: " fmt "\n", __func__, __LINE__, ## args)
+ RTE_LOG_LINE(level, OCTEONTX_MBOX,\
+ "%s() line %u: " fmt, __func__, __LINE__, ## args)
#define mbox_log_info(fmt, ...) MBOX_LOG(INFO, fmt, ##__VA_ARGS__)
#define mbox_log_dbg(fmt, ...) MBOX_LOG(DEBUG, fmt, ##__VA_ARGS__)
@@ -27,6 +27,7 @@
#define mbox_func_trace mbox_log_dbg
extern int octeontx_logtype_mbox;
+#define RTE_LOGTYPE_OCTEONTX_MBOX octeontx_logtype_mbox
struct octeontx_mbox_hdr {
uint16_t vfid; /* VF index or pf resource index local to the domain */
@@ -6,15 +6,15 @@
#define _QAT_LOGS_H_
extern int qat_gen_logtype;
+#define RTE_LOGTYPE_QAT_GEN qat_gen_logtype
extern int qat_dp_logtype;
+#define RTE_LOGTYPE_QAT_DP qat_dp_logtype
#define QAT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, qat_gen_logtype, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, QAT_GEN, "%s(): " fmt, __func__, ## args)
#define QAT_DP_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, qat_dp_logtype, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, QAT_DP, "%s(): " fmt, __func__, ## args)
#define QAT_DP_HEXDUMP_LOG(level, title, buf, len) \
qat_hexdump_log(RTE_LOG_ ## level, qat_dp_logtype, title, buf, len)
@@ -12,11 +12,10 @@
/** Generic driver log type */
extern int sfc_efx_logtype;
+#define RTE_LOGTYPE_SFC_EFX sfc_efx_logtype
/** Log message, add a prefix and a line break */
#define SFC_EFX_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, sfc_efx_logtype, \
- RTE_FMT("sfc_efx: " RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
- RTE_FMT_TAIL(__VA_ARGS__ ,)))
+ RTE_LOG_LINE(level, SFC_EFX, ## __VA_ARGS__)
#endif /* _SFC_EFX_LOG_H_ */
@@ -9,8 +9,9 @@
/**< ISA-L comp PMD device name */
extern int isal_logtype_driver;
+#define RTE_LOGTYPE_ISAL_DRIVER isal_logtype_driver
#define ISAL_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, isal_logtype_driver, "%s(): "fmt "\n", \
+ RTE_LOG_LINE(level, ISAL_DRIVER, "%s(): "fmt, \
__func__, ##args)
/* private data structure for each ISA-L compression device */
@@ -18,6 +18,7 @@
#include <zip_regs.h>
extern int octtx_zip_logtype_driver;
+#define RTE_LOGTYPE_OCTTX_ZIP_DRIVER octtx_zip_logtype_driver
/* ZIP VF Control/Status registers (CSRs): */
/* VF_BAR0: */
@@ -77,9 +78,7 @@ extern int octtx_zip_logtype_driver;
#define COMPRESSDEV_NAME_ZIP_PMD compress_octeontx
#define ZIP_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, \
- octtx_zip_logtype_driver, "%s(): "fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(level, OCTTX_ZIP_DRIVER, "%s(): "fmt, __func__, ## args)
#define ZIP_PMD_INFO(fmt, args...) \
ZIP_PMD_LOG(INFO, fmt, ## args)
@@ -27,10 +27,11 @@ struct uadk_compress_xform {
};
extern int uadk_compress_logtype;
+#define RTE_LOGTYPE_UADK_COMPRESS uadk_compress_logtype
#define UADK_LOG(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, uadk_compress_logtype, \
- "%s() line %u: " fmt "\n", __func__, __LINE__, \
+ RTE_LOG_LINE(level, UADK_COMPRESS, \
+ "%s() line %u: " fmt, __func__, __LINE__, \
## __VA_ARGS__)
#endif /* _UADK_COMPRESS_PMD_PRIVATE_H_ */
@@ -15,8 +15,9 @@
#define DEF_MEM_LEVEL 8
extern int zlib_logtype_driver;
+#define RTE_LOGTYPE_ZLIB_DRIVER zlib_logtype_driver
#define ZLIB_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, zlib_logtype_driver, "%s(): "fmt "\n", \
+ RTE_LOG_LINE(level, ZLIB_DRIVER, "%s(): "fmt, \
__func__, ##args)
#define ZLIB_PMD_INFO(fmt, args...) \
@@ -11,23 +11,21 @@
/**< ARMv8 Crypto PMD device name */
extern int crypto_armv8_log_type;
+#define RTE_LOGTYPE_CRYPTO_ARMV8 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), \
+ RTE_LOG_LINE(ERR, CRYPTO_ARMV8, \
+ "%s() line %u: " fmt, \
__func__, __LINE__, ## args)
#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), \
+ RTE_LOG_LINE(INFO, CRYPTO_ARMV8, \
+ "%s() line %u: " fmt, \
__func__, __LINE__, ## args)
#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), \
+ RTE_LOG_LINE(DEBUG, CRYPTO_ARMV8, \
+ "%s() line %u: " fmt, \
__func__, __LINE__, ## args)
#define NBBY 8 /* Number of bits in a byte */
@@ -9,15 +9,17 @@
#include <rte_log.h>
extern int bcmfs_conf_logtype;
+#define RTE_LOGTYPE_BCMFS_CONF bcmfs_conf_logtype
extern int bcmfs_dp_logtype;
+#define RTE_LOGTYPE_BCMFS_DP bcmfs_dp_logtype
#define BCMFS_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, bcmfs_conf_logtype, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, BCMFS_CONF, \
+ "%s(): " fmt, __func__, ## args)
#define BCMFS_DP_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, bcmfs_dp_logtype, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, BCMFS_DP, \
+ "%s(): " fmt, __func__, ## args)
#define BCMFS_DP_HEXDUMP_LOG(level, title, buf, len) \
bcmfs_hexdump_log(RTE_LOG_ ## level, bcmfs_dp_logtype, title, buf, len)
@@ -11,12 +11,10 @@ extern int caam_jr_logtype;
#define RTE_LOGTYPE_CAAM_JR caam_jr_logtype
#define CAAM_JR_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
- fmt "\n", ##args)
+ RTE_LOG_LINE(level, CAAM_JR, fmt, ## args)
#define CAAM_JR_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, caam_jr_logtype, "caam_jr: %s(): " \
- fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(DEBUG, CAAM_JR, "%s(): " fmt, __func__, ## args)
#define PMD_INIT_FUNC_TRACE() CAAM_JR_DEBUG(" >>")
@@ -29,7 +27,7 @@ extern int caam_jr_logtype;
/* DP Logs, toggled out at compile time if level lower than current level */
#define CAAM_JR_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, CAAM_JR, fmt "\n", ## args)
+ RTE_LOG_DP_LINE(level, CAAM_JR, fmt, ## args)
#define CAAM_JR_DP_DEBUG(fmt, args...) \
CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
@@ -12,12 +12,10 @@ extern int dpaa2_logtype_sec;
#define RTE_LOGTYPE_DPAA2_SEC dpaa2_logtype_sec
#define DPAA2_SEC_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa2_logtype_sec, "dpaa2_sec: " \
- fmt "\n", ##args)
+ RTE_LOG_LINE(level, DPAA2_SEC, fmt, ## args)
#define DPAA2_SEC_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_logtype_sec, "dpaa2_sec: %s(): " \
- fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(DEBUG, DPAA2_SEC, "%s(): " fmt, __func__, ## args)
#define PMD_INIT_FUNC_TRACE() DPAA2_SEC_DEBUG(">>")
@@ -30,7 +28,7 @@ extern int dpaa2_logtype_sec;
/* DP Logs, toggled out at compile time if level lower than current level */
#define DPAA2_SEC_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, DPAA2_SEC, fmt, ## args)
+ RTE_LOG_DP_LINE(level, DPAA2_SEC, fmt, ## args)
#define DPAA2_SEC_DP_DEBUG(fmt, args...) \
DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)
@@ -12,12 +12,10 @@ extern int dpaa_logtype_sec;
#define RTE_LOGTYPE_DPAA_SEC dpaa_logtype_sec
#define DPAA_SEC_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa_logtype_sec, "dpaa_sec: " \
- fmt "\n", ##args)
+ RTE_LOG_LINE(level, DPAA_SEC, fmt, ## args)
#define DPAA_SEC_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa_logtype_sec, "dpaa_sec: %s(): " \
- fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(DEBUG, DPAA_SEC, "%s(): " fmt, __func__, ## args)
#define PMD_INIT_FUNC_TRACE() DPAA_SEC_DEBUG(" >>")
@@ -59,9 +59,10 @@ extern RTE_DEFINE_PER_LCORE(IMB_MGR *, mb_mgr);
/** PMD LOGTYPE DRIVER, common to all PMDs */
extern int ipsec_mb_logtype_driver;
+#define RTE_LOGTYPE_IPSEC_MB ipsec_mb_logtype_driver
#define IPSEC_MB_LOG(level, fmt, ...) \
- rte_log(RTE_LOG_##level, ipsec_mb_logtype_driver, \
- "%s() line %u: " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
+ RTE_LOG_LINE(level, IPSEC_MB, \
+ "%s() line %u: " fmt, __func__, __LINE__, ##__VA_ARGS__)
/** All supported device types */
enum ipsec_mb_pmd_types {
@@ -14,10 +14,11 @@
/** MRVL PMD LOGTYPE DRIVER */
extern int mrvl_logtype_driver;
+#define RTE_LOGTYPE_MRVL_DRIVER mrvl_logtype_driver
#define MRVL_LOG(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, mrvl_logtype_driver, \
- "%s() line %u: " fmt "\n", __func__, __LINE__, \
+ RTE_LOG_LINE(level, MRVL_DRIVER, \
+ "%s() line %u: " fmt, __func__, __LINE__, \
## __VA_ARGS__)
/**
@@ -9,10 +9,11 @@
/**< Null crypto PMD device name */
extern int null_logtype_driver;
+#define RTE_LOGTYPE_NULL_DRIVER null_logtype_driver
#define NULL_LOG(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, null_logtype_driver, \
- "%s() line %u: "fmt "\n", __func__, __LINE__, \
+ RTE_LOG_LINE(level, NULL_DRIVER, \
+ "%s() line %u: "fmt, __func__, __LINE__, \
## __VA_ARGS__)
@@ -23,9 +23,10 @@
/** OPENSSL PMD LOGTYPE DRIVER */
extern int openssl_logtype_driver;
+#define RTE_LOGTYPE_OPENSSL_DRIVER openssl_logtype_driver
#define OPENSSL_LOG(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, openssl_logtype_driver, \
- "%s() line %u: " fmt "\n", __func__, __LINE__, \
+ RTE_LOG_LINE(level, OPENSSL_DRIVER, \
+ "%s() line %u: " fmt, __func__, __LINE__, \
## __VA_ARGS__)
/* Maximum length for digest (SHA-512 needs 64 bytes) */
@@ -15,10 +15,11 @@
#define PER_WORKER_BUFF_SIZE (256)
extern int scheduler_logtype_driver;
+#define RTE_LOGTYPE_SCHEDULER_DRIVER scheduler_logtype_driver
#define CR_SCHED_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, scheduler_logtype_driver, \
- "%s() line %u: "fmt "\n", __func__, __LINE__, ##args)
+ RTE_LOG_LINE(level, SCHEDULER_DRIVER, \
+ "%s() line %u: "fmt, __func__, __LINE__, ##args)
struct scheduler_worker {
uint8_t dev_id;
@@ -71,10 +71,11 @@ struct __rte_cache_aligned uadk_crypto_priv {
};
extern int uadk_crypto_logtype;
+#define RTE_LOGTYPE_UADK_CRYPTO uadk_crypto_logtype
#define UADK_LOG(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, uadk_crypto_logtype, \
- "%s() line %u: " fmt "\n", __func__, __LINE__, \
+ RTE_LOG_LINE(level, UADK_CRYPTO, \
+ "%s() line %u: " fmt, __func__, __LINE__, \
## __VA_ARGS__)
#endif /* _UADK_CRYPTO_PMD_PRIVATE_H_ */
@@ -8,18 +8,20 @@
#include <rte_log.h>
extern int virtio_crypto_logtype_init;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_INIT virtio_crypto_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_init, \
- "PMD: %s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, VIRTIO_CRYPTO_INIT, \
+ "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
extern int virtio_crypto_logtype_init;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_INIT virtio_crypto_logtype_init
#define VIRTIO_CRYPTO_INIT_LOG_IMPL(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_init, \
- "INIT: %s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, VIRTIO_CRYPTO_INIT, \
+ "%s(): " fmt, __func__, ##args)
#define VIRTIO_CRYPTO_INIT_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_INIT_LOG_IMPL(INFO, fmt, ## args)
@@ -31,10 +33,11 @@ extern int virtio_crypto_logtype_init;
VIRTIO_CRYPTO_INIT_LOG_IMPL(ERR, fmt, ## args)
extern int virtio_crypto_logtype_session;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_SESSION virtio_crypto_logtype_session
#define VIRTIO_CRYPTO_SESSION_LOG_IMPL(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_session, \
- "SESSION: %s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, VIRTIO_CRYPTO_SESSION, \
+ "%s(): " fmt, __func__, ##args)
#define VIRTIO_CRYPTO_SESSION_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_SESSION_LOG_IMPL(INFO, fmt, ## args)
@@ -46,10 +49,11 @@ extern int virtio_crypto_logtype_session;
VIRTIO_CRYPTO_SESSION_LOG_IMPL(ERR, fmt, ## args)
extern int virtio_crypto_logtype_rx;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_RX virtio_crypto_logtype_rx
#define VIRTIO_CRYPTO_RX_LOG_IMPL(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_rx, \
- "RX: %s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, VIRTIO_CRYPTO_RX, \
+ "%s(): " fmt, __func__, ##args)
#define VIRTIO_CRYPTO_RX_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_RX_LOG_IMPL(INFO, fmt, ## args)
@@ -61,10 +65,11 @@ extern int virtio_crypto_logtype_rx;
VIRTIO_CRYPTO_RX_LOG_IMPL(ERR, fmt, ## args)
extern int virtio_crypto_logtype_tx;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_TX virtio_crypto_logtype_tx
#define VIRTIO_CRYPTO_TX_LOG_IMPL(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_tx, \
- "TX: %s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, VIRTIO_CRYPTO_TX, \
+ "%s(): " fmt, __func__, ##args)
#define VIRTIO_CRYPTO_TX_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_TX_LOG_IMPL(INFO, fmt, ## args)
@@ -76,10 +81,11 @@ extern int virtio_crypto_logtype_tx;
VIRTIO_CRYPTO_TX_LOG_IMPL(ERR, fmt, ## args)
extern int virtio_crypto_logtype_driver;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_DRIVER virtio_crypto_logtype_driver
#define VIRTIO_CRYPTO_DRV_LOG_IMPL(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_driver, \
- "DRIVER: %s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, VIRTIO_CRYPTO_DRIVER, \
+ "%s(): " fmt, __func__, ##args)
#define VIRTIO_CRYPTO_DRV_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_DRV_LOG_IMPL(INFO, fmt, ## args)
@@ -9,12 +9,10 @@ extern int dpaa_qdma_logtype;
#define RTE_LOGTYPE_DPAA_QDMA dpaa_qdma_logtype
#define DPAA_QDMA_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa_qdma_logtype, "dpaa_qdma: " \
- fmt "\n", ## args)
+ RTE_LOG_LINE(level, DPAA_QDMA, fmt, ## args)
#define DPAA_QDMA_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa_qdma_logtype, "dpaa_qdma: %s(): " \
- fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(DEBUG, DPAA_QDMA, "%s(): " fmt, __func__, ## args)
#define DPAA_QDMA_FUNC_TRACE() DPAA_QDMA_DEBUG(">>")
@@ -27,7 +25,7 @@ extern int dpaa_qdma_logtype;
/* DP Logs, toggled out at compile time if level lower than current level */
#define DPAA_QDMA_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, DPAA_QDMA, "dpaa_qdma: " fmt "\n", ## args)
+ RTE_LOG_DP_LINE(level, DPAA_QDMA, fmt, ## args)
#define DPAA_QDMA_DP_DEBUG(fmt, args...) \
DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
@@ -13,12 +13,12 @@ extern int dpaa2_qdma_logtype;
#define RTE_LOGTYPE_DPAA2_QDMA dpaa2_qdma_logtype
#define DPAA2_QDMA_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa2_qdma_logtype, "dpaa2_qdma: " \
- fmt "\n", ## args)
+ RTE_LOG_LINE(level, DPAA2_QDMA, \
+ fmt, ## args)
#define DPAA2_QDMA_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_qdma_logtype, "dpaa2_qdma: %s(): " \
- fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(DEBUG, DPAA2_QDMA, "%s(): " \
+ fmt, __func__, ## args)
#define DPAA2_QDMA_FUNC_TRACE() DPAA2_QDMA_DEBUG(">>")
@@ -31,7 +31,7 @@ extern int dpaa2_qdma_logtype;
/* DP Logs, toggled out at compile time if level lower than current level */
#define DPAA2_QDMA_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, DPAA2_QDMA, "dpaa2_qdma: " fmt "\n", ## args)
+ RTE_LOG_DP_LINE(level, DPAA2_QDMA, fmt, ## args)
#define DPAA2_QDMA_DP_DEBUG(fmt, args...) \
DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
@@ -18,21 +18,20 @@
#include "hisi_dmadev.h"
RTE_LOG_REGISTER_DEFAULT(hisi_dma_logtype, INFO);
+#define RTE_LOGTYPE_HISI_DMA hisi_dma_logtype
#define HISI_DMA_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hisi_dma_logtype, \
- "%s(): " fmt "\n", __func__, ##args)
-#define HISI_DMA_LOG_RAW(hw, level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hisi_dma_logtype, \
- "%s %s(): " fmt "\n", (hw)->data->dev_name, \
+ RTE_LOG_LINE(level, HISI_DMA, "%s(): " fmt, __func__, ##args)
+#define HISI_DMA_DEV_LOG(hw, level, fmt, args...) \
+ RTE_LOG_LINE(level, HISI_DMA, "%s %s(): " fmt, (hw)->data->dev_name, \
__func__, ##args)
#define HISI_DMA_DEBUG(hw, fmt, args...) \
- HISI_DMA_LOG_RAW(hw, DEBUG, fmt, ## args)
+ HISI_DMA_DEV_LOG(hw, DEBUG, fmt, ## args)
#define HISI_DMA_INFO(hw, fmt, args...) \
- HISI_DMA_LOG_RAW(hw, INFO, fmt, ## args)
+ HISI_DMA_DEV_LOG(hw, INFO, fmt, ## args)
#define HISI_DMA_WARN(hw, fmt, args...) \
- HISI_DMA_LOG_RAW(hw, WARNING, fmt, ## args)
+ HISI_DMA_DEV_LOG(hw, WARNING, fmt, ## args)
#define HISI_DMA_ERR(hw, fmt, args...) \
- HISI_DMA_LOG_RAW(hw, ERR, fmt, ## args)
+ HISI_DMA_DEV_LOG(hw, ERR, fmt, ## args)
static uint32_t
hisi_dma_queue_base(struct hisi_dma_dev *hw)
@@ -20,9 +20,10 @@
*/
extern int idxd_pmd_logtype;
+#define RTE_LOGTYPE_IDXD_PMD idxd_pmd_logtype
-#define IDXD_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
- idxd_pmd_logtype, "IDXD: %s(): " fmt "\n", __func__, ##args)
+#define IDXD_PMD_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, IDXD_PMD, "%s(): " fmt, __func__, ##args)
#define IDXD_PMD_DEBUG(fmt, args...) IDXD_PMD_LOG(DEBUG, fmt, ## args)
#define IDXD_PMD_INFO(fmt, args...) IDXD_PMD_LOG(INFO, fmt, ## args)
@@ -35,9 +35,10 @@ struct ioat_dmadev {
};
extern int ioat_pmd_logtype;
+#define RTE_LOGTYPE_IOAT_PMD ioat_pmd_logtype
-#define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
- ioat_pmd_logtype, "IOAT: %s(): " fmt "\n", __func__, ##args)
+#define IOAT_PMD_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, IOAT_PMD, "%s(): " fmt, __func__, ##args)
#define IOAT_PMD_DEBUG(fmt, args...) IOAT_PMD_LOG(DEBUG, fmt, ## args)
#define IOAT_PMD_INFO(fmt, args...) IOAT_PMD_LOG(INFO, fmt, ## args)
@@ -13,8 +13,6 @@
#include <rte_log.h>
#include <rte_memzone.h>
-extern int odm_logtype;
-
/* ODM VF register offsets from VF_BAR0 */
#define ODM_VDMA_EN(x) (0x00 | (x << 3))
#define ODM_VDMA_REQQ_CTL(x) (0x80 | (x << 3))
@@ -66,10 +64,13 @@ extern int odm_logtype;
#define odm_read64(addr) rte_read64_relaxed((volatile void *)(addr))
#define odm_write64(val, addr) rte_write64_relaxed((val), (volatile void *)(addr))
+extern int odm_logtype;
+#define RTE_LOGTYPE_ODM odm_logtype
+
#define ODM_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, odm_logtype, \
- RTE_FMT("%s(): %u" RTE_FMT_HEAD(__VA_ARGS__,) "\n", __func__, __LINE__, \
- RTE_FMT_TAIL(__VA_ARGS__, )))
+ RTE_LOG_LINE(level, ODM, \
+ RTE_FMT("%s(): %u" RTE_FMT_HEAD(__VA_ARGS__ ,), __func__, __LINE__, \
+ RTE_FMT_TAIL(__VA_ARGS__ ,)))
/*
* Structure odm_instr_hdr_s for ODM
@@ -21,8 +21,9 @@
#include "skeleton_dmadev.h"
RTE_LOG_REGISTER_DEFAULT(skeldma_logtype, INFO);
+#define RTE_LOGTYPE_SKELDMA skeldma_logtype
#define SKELDMA_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, skeldma_logtype, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, SKELDMA, "%s(): " fmt, \
__func__, ##args)
static int
@@ -48,6 +48,7 @@
* 1 Eventdev can have N Eventqueue
*/
RTE_LOG_REGISTER_DEFAULT(dpaa_logtype_eventdev, NOTICE);
+#define RTE_LOGTYPE_DPAA_EVENTDEV dpaa_logtype_eventdev
#define DISABLE_INTR_MODE "disable_intr"
@@ -78,7 +78,7 @@ struct dpaa_eventdev {
};
#define DPAA_EVENTDEV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa_logtype_eventdev, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, DPAA_EVENTDEV, "%s(): " fmt, \
__func__, ##args)
#define EVENTDEV_INIT_FUNC_TRACE() DPAA_EVENTDEV_LOG(DEBUG, " >>")
@@ -6,14 +6,13 @@
#define _DPAA2_EVENTDEV_LOGS_H_
extern int dpaa2_logtype_event;
+#define RTE_LOGTYPE_DPAA2_EVENT dpaa2_logtype_event
#define DPAA2_EVENTDEV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa2_logtype_event, "dpaa2_event: " \
- fmt "\n", ##args)
+ RTE_LOG_LINE(level, DPAA2_EVENT, fmt, ##args)
#define DPAA2_EVENTDEV_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_logtype_event, "dpaa2_event: %s(): " \
- fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(DEBUG, DPAA2_EVENT, "%s():" fmt, __func__, ##args)
#define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_DEBUG(" >>")
@@ -303,7 +303,7 @@ dsw_pmd_priv(const struct rte_eventdev *eventdev)
}
#define DSW_LOG_DP_LINE(level, fmt, args...) \
- RTE_LOG_DP(level, EVENTDEV, "[%s] %s() line %u: " fmt "\n", \
+ RTE_LOG_DP_LINE(level, EVENTDEV, "[%s] %s() line %u: " fmt, \
DSW_PMD_NAME, \
__func__, __LINE__, ## args)
@@ -20,8 +20,8 @@
#define EVENTDEV_NAME_OCTEONTX_PMD event_octeontx
#define SSOVF_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, otx_logtype_ssovf, \
- "[%s] %s() " fmt "\n", \
+ RTE_LOG_LINE(level, OTX_SSOVF, \
+ "[%s] %s() " fmt, \
RTE_STR(EVENTDEV_NAME_OCTEONTX_PMD), __func__, ## args)
#define ssovf_log_info(fmt, ...) SSOVF_LOG(INFO, fmt, ##__VA_ARGS__)
@@ -171,6 +171,7 @@ ssovf_pmd_priv(const struct rte_eventdev *eventdev)
}
extern int otx_logtype_ssovf;
+#define RTE_LOGTYPE_OTX_SSOVF otx_logtype_ssovf
uint16_t ssows_enq(void *port, const struct rte_event *ev);
uint16_t ssows_enq_burst(void *port,
@@ -27,8 +27,8 @@
#include <octeontx_fpavf.h>
#define timvf_log(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, otx_logtype_timvf, \
- "[%s] %s() " fmt "\n", \
+ RTE_LOG_LINE(level, OTX_TIMVF, \
+ "[%s] %s() " fmt, \
RTE_STR(event_timer_octeontx), __func__, ## args)
#define timvf_log_info(fmt, ...) timvf_log(INFO, fmt, ##__VA_ARGS__)
@@ -113,6 +113,7 @@
#define TIMVF_ENABLE_STATS_ARG ("timvf_stats")
extern int otx_logtype_timvf;
+#define RTE_LOGTYPE_OTX_TIMVF otx_logtype_timvf
static const uint16_t nb_chunk_slots = (TIM_CHUNK_SIZE / 16) - 1;
enum timvf_clk_src {
@@ -8,14 +8,9 @@
#include <rte_log.h>
extern int opdl_logtype_driver;
-
-#define PMD_DRV_LOG_RAW(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, opdl_logtype_driver, "%s(): " fmt, \
- __func__, ## args)
+#define RTE_LOGTYPE_OPDL opdl_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
-
-
+ RTE_LOG_LINE(level, OPDL, "%s(): " fmt, __func__, ## args)
#endif /* _OPDL_LOGS_H_ */
@@ -9,11 +9,11 @@
#include <eventdev_pmd_vdev.h>
extern int skeleton_eventdev_logtype;
+#define RTE_LOGTYPE_SKELETON_EVENTDEV skeleton_eventdev_logtype
#ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, skeleton_eventdev_logtype, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, SKELETON_EVENTDEV, "%s(): " fmt, __func__, ## args)
#define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
#else
#define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
@@ -21,8 +21,7 @@ extern int skeleton_eventdev_logtype;
#endif
#define PMD_DRV_ERR(fmt, args...) \
- rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(ERR, SKELETON_EVENTDEV, "%s(): " fmt, __func__, ## args)
struct __rte_cache_aligned skeleton_eventdev {
uintptr_t reg_base;
@@ -6,9 +6,10 @@
#define _SW_EVDEV_LOG_H_
extern int eventdev_sw_log_level;
+#define RTE_LOGTYPE_EVENTDEV_SW_LOG_LEVEL eventdev_sw_log_level
#define SW_LOG_IMPL(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, eventdev_sw_log_level, "%s" fmt "\n", \
+ RTE_LOG_LINE(level, EVENTDEV_SW_LOG_LEVEL, "%s" fmt, \
__func__, ##args)
#define SW_LOG_INFO(fmt, args...) \
@@ -13,10 +13,11 @@
#include <rte_errno.h>
extern int cuda_logtype;
+#define RTE_LOGTYPE_CUDA cuda_logtype
/* Helper macro for logging */
#define rte_cuda_log(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, cuda_logtype, fmt "\n", ##__VA_ARGS__)
+ RTE_LOG_LINE(level, CUDA, fmt, ##__VA_ARGS__)
#define rte_cuda_debug(fmt, ...) \
rte_cuda_log(DEBUG, RTE_STR(__LINE__) ":%s() " fmt, __func__, \
@@ -61,8 +61,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;
/* Mempool related logs */
#define DPAA_MEMPOOL_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa_logtype_mempool, "%s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(level, DPAA_MEMPOOL, "%s(): " fmt, __func__, ## args)
#define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
@@ -9,13 +9,11 @@ extern int dpaa2_logtype_mempool;
#define RTE_LOGTYPE_DPAA2_MEMPOOL dpaa2_logtype_mempool
#define DPAA2_MEMPOOL_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa2_logtype_mempool, \
- "mempool/dpaa2: " fmt "\n", ##args)
+ RTE_LOG_LINE(level, DPAA2_MEMPOOL, fmt, ##args)
/* Debug logs are with Function names */
#define DPAA2_MEMPOOL_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_logtype_mempool, \
- "mempool/dpaa2: %s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(DEBUG, DPAA2_MEMPOOL, "%s(): " fmt, __func__, ##args)
#define DPAA2_MEMPOOL_INFO(fmt, args...) \
DPAA2_MEMPOOL_LOG(INFO, fmt, ## args)
@@ -8,8 +8,8 @@
#include <rte_debug.h>
#define FPAVF_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, octeontx_logtype_fpavf,\
- "%s() line %u: " fmt "\n", __func__, __LINE__, ## args)
+ RTE_LOG_LINE(level, OCTEONTX_FPAVF,\
+ "%s() line %u: " fmt, __func__, __LINE__, ## args)
#define fpavf_log_info(fmt, ...) FPAVF_LOG(INFO, fmt, ##__VA_ARGS__)
#define fpavf_log_dbg(fmt, ...) FPAVF_LOG(DEBUG, fmt, ##__VA_ARGS__)
@@ -18,5 +18,6 @@
extern int octeontx_logtype_fpavf;
+#define RTE_LOGTYPE_OCTEONTX_FPAVF octeontx_logtype_fpavf
#endif /* __OCTEONTX_POOL_LOGS_H__*/
@@ -102,14 +102,15 @@ static struct rte_eth_link pmd_link = {
};
RTE_LOG_REGISTER_DEFAULT(af_packet_logtype, NOTICE);
+#define RTE_LOGTYPE_AFPACKET af_packet_logtype
#define PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, af_packet_logtype, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, AFPACKET, \
+ "%s(): " fmt, __func__, ##args)
#define PMD_LOG_ERRNO(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, af_packet_logtype, \
- "%s(): " fmt ":%s\n", __func__, ##args, strerror(errno))
+ RTE_LOG_LINE(level, AFPACKET, \
+ "%s(): " fmt ":%s", __func__, ##args, strerror(errno))
static uint16_t
eth_af_packet_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -66,7 +66,7 @@ RTE_LOG_REGISTER_DEFAULT(af_xdp_logtype, NOTICE);
#define RTE_LOGTYPE_NET_AF_XDP af_xdp_logtype
#define AF_XDP_LOG_LINE(level, fmt, args...) \
- RTE_LOG(level, NET_AF_XDP, "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, NET_AF_XDP, "%s(): " fmt, __func__, ##args)
#define ETH_AF_XDP_FRAME_SIZE 2048
#define ETH_AF_XDP_NUM_BUFFERS 4096
@@ -7,26 +7,24 @@
#include <rte_log.h>
extern int atl_logtype_init;
+#define RTE_LOGTYPE_ATL_INIT atl_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, atl_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, ATL_INIT, \
+ "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#define PMD_RX_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_DP_LINE(level, ATL_DRIVER, "%s(): " fmt, __func__, ## args)
#define PMD_TX_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_DP_LINE(level, ATL_DRIVER, "%s(): " fmt, __func__, ## args)
extern int atl_logtype_driver;
#define RTE_LOGTYPE_ATL_DRIVER atl_logtype_driver
-#define PMD_DRV_LOG_RAW(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \
- __func__, ## args)
-
#define PMD_DRV_LOG(level, fmt, args...) \
- PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+ RTE_LOG_LINE(level, ATL_DRIVER, "%s(): " fmt, \
+ __func__, ## args)
#endif
@@ -9,14 +9,14 @@
#ifdef RTE_LIBRTE_AVP_DEBUG_RX
#define PMD_RX_LOG_LINE(level, fmt, ...) \
- RTE_LOG(level, AVP_DRIVER, "%s() rx: " fmt "\n", __func__, ## __VA_ARGS__)
+ RTE_LOG_LINE(level, AVP_DRIVER, "%s() rx: " fmt, __func__, ## __VA_ARGS__)
#else
#define PMD_RX_LOG_LINE(...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_AVP_DEBUG_TX
#define PMD_TX_LOG_LINE(level, fmt, ...) \
- RTE_LOG(level, AVP_DRIVER, "%s() tx: " fmt "\n", __func__, ## __VA_ARGS__)
+ RTE_LOG_LINE(level, AVP_DRIVER, "%s() tx: " fmt, __func__, ## __VA_ARGS__)
#else
#define PMD_TX_LOG_LINE(...) do { } while (0)
#endif
@@ -25,6 +25,6 @@ extern int avp_logtype_driver;
#define RTE_LOGTYPE_AVP_DRIVER avp_logtype_driver
#define PMD_DRV_LOG_LINE(level, fmt, ...) \
- RTE_LOG(level, AVP_DRIVER, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+ RTE_LOG_LINE(level, AVP_DRIVER, "%s(): " fmt, __func__, ## __VA_ARGS__)
#endif /* _AVP_LOGS_H_ */
@@ -8,9 +8,9 @@
#include <stdio.h>
extern int axgbe_logtype_init;
+#define RTE_LOGTYPE_AXGBE_INIT axgbe_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, axgbe_logtype_init, "%s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(level, AXGBE_INIT, "%s(): " fmt, __func__, ##args)
#ifdef RTE_LIBRTE_AXGBE_PMD_DEBUG
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
@@ -21,6 +21,6 @@ extern int axgbe_logtype_init;
extern int axgbe_logtype_driver;
#define RTE_LOGTYPE_AXGBE_DRIVER axgbe_logtype_driver
#define PMD_DRV_LOG_LINE(level, fmt, ...) \
- RTE_LOG(level, AXGBE_DRIVER, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+ RTE_LOG_LINE(level, AXGBE_DRIVER, "%s(): " fmt, __func__, ## __VA_ARGS__)
#endif /* _AXGBE_LOGS_H_ */
@@ -9,41 +9,40 @@
#define _PMD_LOGS_H_
extern int bnx2x_logtype_init;
+#define RTE_LOGTYPE_BNX2X_INIT bnx2x_logtype_init
#define PMD_INIT_LOG(level, sc, fmt, args...) \
- rte_log(RTE_LOG_ ## level, bnx2x_logtype_init, \
- "[bnx2x_pmd: %s] %s() " fmt "\n", (sc)->devinfo.name, __func__, ##args)
+ RTE_LOG_LINE(level, BNX2X_INIT, \
+ "[%s] %s() " fmt, (sc)->devinfo.name, __func__, ##args)
#define PMD_INIT_FUNC_TRACE(sc) PMD_INIT_LOG(DEBUG, sc, " >>")
extern int bnx2x_logtype_driver;
-#define PMD_DRV_LOG_RAW(level, sc, fmt, args...) \
- rte_log(RTE_LOG_ ## level, bnx2x_logtype_driver, \
+#define RTE_LOGTYPE_BNX2X_DRIVER bnx2x_logtype_driver
+#define PMD_DRV_LOG(level, sc, fmt, args...) \
+ RTE_LOG_LINE(level, BNX2X_DRIVER, \
"[%s:%d(%s)] " fmt, __func__, __LINE__, \
(sc)->devinfo.name ? (sc)->devinfo.name : "", ## args)
-#define PMD_DRV_LOG(level, sc, fmt, args...) \
- PMD_DRV_LOG_RAW(level, sc, fmt "\n", ## args)
-
#ifdef RTE_LIBRTE_BNX2X_DEBUG_RX
#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, bnx2x_logtype_driver, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, BNX2X_DRIVER, \
+ "%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while(0)
#endif
#ifdef RTE_LIBRTE_BNX2X_DEBUG_TX
#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, bnx2x_logtype_driver, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, BNX2X_DRIVER, \
+ "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while(0)
#endif
#ifdef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC
#define PMD_DEBUG_PERIODIC_LOG(level, sc, fmt, args...) \
- rte_log(RTE_LOG_ ## level, bnx2x_logtype_driver, \
- "%s(%s): " fmt "\n", __func__, \
+ RTE_LOG_LINE(level, BNX2X_DRIVER, \
+ "%s(%s): " fmt, __func__, \
(sc)->devinfo.name ? (sc)->devinfo.name : "", ## args)
#else
#define PMD_DEBUG_PERIODIC_LOG(level, sc, fmt, args...) do { } while (0)
@@ -1208,7 +1208,7 @@ extern const struct rte_flow_ops bnxt_flow_meter_ops;
extern int bnxt_logtype_driver;
#define RTE_LOGTYPE_BNXT bnxt_logtype_driver
#define PMD_DRV_LOG_LINE(level, fmt, ...) \
- RTE_LOG(level, BNXT, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+ RTE_LOG_LINE(level, BNXT, "%s(): " fmt, __func__, ## __VA_ARGS__)
#define BNXT_LINK_SPEEDS_V2_OPTIONS(f) \
((f) & HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_SPEEDS2_SUPPORTED)
@@ -357,8 +357,8 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
nb_tx_pkts += txcmp->opaque;
else
- RTE_LOG_DP(ERR, BNXT,
- "Unhandled CMP type %02x\n",
+ RTE_LOG_DP_LINE(ERR, BNXT,
+ "Unhandled CMP type %02x",
CMP_TYPE(txcmp));
raw_cons = NEXT_RAW_CMP(raw_cons);
} while (nb_tx_pkts < ring_mask);
@@ -578,8 +578,8 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
nb_tx_pkts += txcmp->opaque;
else
- RTE_LOG_DP(ERR, BNXT,
- "Unhandled CMP type %02x\n",
+ RTE_LOG_DP_LINE(ERR, BNXT,
+ "Unhandled CMP type %02x",
CMP_TYPE(txcmp));
raw_cons = NEXT_RAW_CMP(raw_cons);
} while (nb_tx_pkts < ring_mask);
@@ -548,8 +548,8 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
nb_tx_pkts += opaque;
else
- RTE_LOG_DP(ERR, BNXT,
- "Unhandled CMP type %02x\n",
+ RTE_LOG_DP_LINE(ERR, BNXT,
+ "Unhandled CMP type %02x",
CMP_TYPE(txcmp));
raw_cons = NEXT_RAW_CMP(raw_cons);
} while (nb_tx_pkts < ring_mask);
@@ -8,21 +8,21 @@
#include <rte_log.h>
extern int cpfl_logtype_init;
+#define RTE_LOGTYPE_CPFL_INIT cpfl_logtype_init
extern int cpfl_logtype_driver;
+#define RTE_LOGTYPE_CPFL_DRIVER cpfl_logtype_driver
#define PMD_INIT_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, \
- cpfl_logtype_init, \
+ RTE_LOG_LINE(level, CPFL_INIT, \
RTE_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+ RTE_FMT_HEAD(__VA_ARGS__,), \
__func__, \
RTE_FMT_TAIL(__VA_ARGS__,)))
#define PMD_DRV_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, \
- cpfl_logtype_driver, \
+ RTE_LOG_LINE(level, CPFL_DRIVER, \
RTE_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+ RTE_FMT_HEAD(__VA_ARGS__,), \
__func__, \
RTE_FMT_TAIL(__VA_ARGS__,)))
@@ -217,7 +217,7 @@ extern int dpaa_logtype_pmd;
#define RTE_LOGTYPE_DPAA_PMD dpaa_logtype_pmd
#define DPAA_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa_logtype_pmd, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, DPAA_PMD, "%s(): " fmt, \
__func__, ##args)
#define PMD_INIT_FUNC_TRACE() DPAA_PMD_LOG(DEBUG, " >>")
@@ -233,6 +233,6 @@ extern int dpaa_logtype_pmd;
/* DP Logs, toggled out at compile time if level lower than current level */
#define DPAA_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, DPAA_PMD, fmt, ## args)
+ RTE_LOG_DP_LINE(level, DPAA_PMD, fmt, ## args)
#endif
@@ -6,15 +6,13 @@
#define _DPAA2_PMD_LOGS_H_
extern int dpaa2_logtype_pmd;
-#define RTE_LOGTYPE_DPAA2_PMD dpaa2_logtype_pmd
+#define RTE_LOGTYPE_DPAA2_NET dpaa2_logtype_pmd
#define DPAA2_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa2_logtype_pmd, "dpaa2_net: " \
- fmt "\n", ##args)
+ RTE_LOG_LINE(level, DPAA2_NET, fmt, ##args)
#define DPAA2_PMD_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_logtype_pmd, "dpaa2_net: %s(): "\
- fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(DEBUG, DPAA2_NET, "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() DPAA2_PMD_DEBUG(">>")
@@ -29,7 +27,7 @@ extern int dpaa2_logtype_pmd;
/* DP Logs, toggled out at compile time if level lower than current level */
#define DPAA2_PMD_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, DPAA2_PMD, fmt, ## args)
+ RTE_LOG_DP_LINE(level, DPAA2_NET, fmt, ## args)
#define DPAA2_PMD_DP_DEBUG(fmt, args...) \
DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
@@ -399,7 +399,7 @@ eth_fd_to_mbuf(const struct qbman_fd *fd,
mbuf->packet_type = dpaa2_dev_rx_parse(mbuf, hw_annot_addr);
DPAA2_PMD_DP_DEBUG("to mbuf - mbuf =%p, mbuf->buf_addr =%p, off = %d,"
- "fd_off=%d fd =%" PRIx64 ", meta = %d bpid =%d, len=%d\n",
+ "fd_off=%d fd =%" PRIx64 ", meta = %d bpid =%d, len=%d",
mbuf, mbuf->buf_addr, mbuf->data_off,
DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_ADDR(fd),
rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size,
@@ -446,7 +446,7 @@ eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
} else {
temp = rte_pktmbuf_alloc(dpaa2_tx_sg_pool);
if (temp == NULL) {
- DPAA2_PMD_DP_DEBUG("No memory to allocate S/G table\n");
+ DPAA2_PMD_DP_DEBUG("No memory to allocate S/G table");
return -ENOMEM;
}
DPAA2_SET_ONLY_FD_BPID(fd, mempool_to_bpid(dpaa2_tx_sg_pool));
@@ -543,7 +543,7 @@ eth_mbuf_to_fd(struct rte_mbuf *mbuf,
DPAA2_MBUF_TO_CONTIG_FD(mbuf, fd, bpid);
DPAA2_PMD_DP_DEBUG("mbuf =%p, mbuf->buf_addr =%p, off = %d,"
- "fd_off=%d fd =%" PRIx64 ", meta = %d bpid =%d, len=%d\n",
+ "fd_off=%d fd =%" PRIx64 ", meta = %d bpid =%d, len=%d",
mbuf, mbuf->buf_addr, mbuf->data_off,
DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_ADDR(fd),
rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size,
@@ -587,7 +587,7 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf,
if (rte_dpaa2_mbuf_alloc_bulk(
rte_dpaa2_bpid_info[bpid].bp_list->mp, &mb, 1)) {
- DPAA2_PMD_DP_DEBUG("Unable to allocated DPAA2 buffer\n");
+ DPAA2_PMD_DP_DEBUG("Unable to allocated DPAA2 buffer");
return -1;
}
m = (struct rte_mbuf *)mb;
@@ -609,7 +609,7 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf,
#endif
DPAA2_PMD_DP_DEBUG(
"mbuf: %p, BMAN buf addr: %p, fdaddr: %" PRIx64 ", bpid: %d,"
- " meta: %d, off: %d, len: %d\n",
+ " meta: %d, off: %d, len: %d",
(void *)mbuf,
mbuf->buf_addr,
DPAA2_GET_FD_ADDR(fd),
@@ -656,7 +656,7 @@ dump_err_pkts(struct dpaa2_queue *dpaa2_q)
while (1) {
if (qbman_swp_pull(swp, &pulldesc)) {
- DPAA2_PMD_DP_DEBUG("VDQ command is not issued.QBMAN is busy\n");
+ DPAA2_PMD_DP_DEBUG("VDQ command is not issued.QBMAN is busy");
/* Portal was busy, try again */
continue;
}
@@ -765,7 +765,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
while (1) {
if (qbman_swp_pull(swp, &pulldesc)) {
DPAA2_PMD_DP_DEBUG("VDQ command is not issued."
- " QBMAN is busy (1)\n");
+ " QBMAN is busy (1)");
/* Portal was busy, try again */
continue;
}
@@ -861,7 +861,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
while (1) {
if (qbman_swp_pull(swp, &pulldesc)) {
DPAA2_PMD_DP_DEBUG("VDQ command is not issued."
- "QBMAN is busy (2)\n");
+ "QBMAN is busy (2)");
continue;
}
break;
@@ -1002,7 +1002,7 @@ dpaa2_dev_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
while (1) {
if (qbman_swp_pull(swp, &pulldesc)) {
DPAA2_PMD_DP_DEBUG(
- "VDQ command is not issued.QBMAN is busy\n");
+ "VDQ command is not issued.QBMAN is busy");
/* Portal was busy, try again */
continue;
}
@@ -1126,7 +1126,7 @@ uint16_t dpaa2_dev_tx_conf(void *queue)
while (1) {
if (qbman_swp_pull(swp, &pulldesc)) {
DPAA2_PMD_DP_DEBUG("VDQ command is not issued."
- "QBMAN is busy\n");
+ "QBMAN is busy");
/* Portal was busy, try again */
continue;
}
@@ -1263,7 +1263,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
swp = DPAA2_PER_LCORE_PORTAL;
- DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d\n",
+ DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d",
eth_data, dpaa2_q->fqid);
#ifdef RTE_LIBRTE_IEEE1588
@@ -1598,7 +1598,7 @@ dpaa2_dev_tx_multi_txq_ordered(void **queue,
}
}
- DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d\n",
+ DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d",
eth_data, dpaa2_q[loop]->fqid);
/* Check if the queue is congested */
@@ -1754,7 +1754,7 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
swp = DPAA2_PER_LCORE_PORTAL;
- DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d\n",
+ DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d",
eth_data, dpaa2_q->fqid);
/* This would also handle normal and atomic queues as any type
@@ -1989,7 +1989,7 @@ dpaa2_dev_loopback_rx(void *queue,
while (1) {
if (qbman_swp_pull(swp, &pulldesc)) {
DPAA2_PMD_DP_DEBUG(
- "VDQ command not issued.QBMAN busy\n");
+ "VDQ command not issued.QBMAN busy");
/* Portal was busy, try again */
continue;
}
@@ -2071,7 +2071,7 @@ dpaa2_dev_loopback_rx(void *queue,
while (1) {
if (qbman_swp_pull(swp, &pulldesc)) {
DPAA2_PMD_DP_DEBUG("VDQ command is not issued."
- "QBMAN is busy (2)\n");
+ "QBMAN is busy (2)");
continue;
}
break;
@@ -8,27 +8,27 @@
#include <rte_log.h>
extern int e1000_logtype_init;
+#define RTE_LOGTYPE_E1000_INIT e1000_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, e1000_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, E1000_INIT, "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_ETHDEV_DEBUG_RX
extern int e1000_logtype_rx;
+#define RTE_LOGTYPE_E1000_RX e1000_logtype_rx
#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, e1000_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, E1000_RX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int e1000_logtype_tx;
+#define RTE_LOGTYPE_E1000_TX e1000_logtype_tx
#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, e1000_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, E1000_TX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
@@ -36,7 +36,7 @@ extern int e1000_logtype_tx;
extern int e1000_logtype_driver;
#define RTE_LOGTYPE_E1000_DRIVER e1000_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, E1000_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, E1000_DRIVER, "%s(): " fmt, __func__, ## args)
/* log init function shared by e1000 and igb drivers */
void e1000_igb_init_log(void);
@@ -9,13 +9,13 @@
extern int ena_logtype_init;
#define RTE_LOGTYPE_ENA_INIT ena_logtype_init
#define PMD_INIT_LOG_LINE(level, fmt, ...) \
- RTE_LOG(level, ENA_INIT, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+ RTE_LOG_LINE(level, ENA_INIT, "%s(): " fmt, __func__, ## __VA_ARGS__)
#ifdef RTE_ETHDEV_DEBUG_RX
extern int ena_logtype_rx;
#define RTE_LOGTYPE_ENA_RX ena_logtype_rx
#define PMD_RX_LOG_LINE(level, fmt, ...) \
- RTE_LOG(level, ENA_RX, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+ RTE_LOG_LINE(level, ENA_RX, "%s(): " fmt, __func__, ## __VA_ARGS__)
#else
#define PMD_RX_LOG_LINE(...) do { } while (0)
#endif
@@ -24,7 +24,7 @@ extern int ena_logtype_rx;
extern int ena_logtype_tx;
#define RTE_LOGTYPE_ENA_TX ena_logtype_tx
#define PMD_TX_LOG_LINE(level, fmt, ...) \
- RTE_LOG(level, ENA_TX, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+ RTE_LOG_LINE(level, ENA_TX, "%s(): " fmt, __func__, ## __VA_ARGS__)
#else
#define PMD_TX_LOG_LINE(...) do { } while (0)
#endif
@@ -32,6 +32,6 @@ extern int ena_logtype_tx;
extern int ena_logtype_driver;
#define RTE_LOGTYPE_ENA_DRIVER ena_logtype_driver
#define PMD_DRV_LOG_LINE(level, fmt, ...) \
- RTE_LOG(level, ENA_DRIVER, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+ RTE_LOG_LINE(level, ENA_DRIVER, "%s(): " fmt, __func__, ## __VA_ARGS__)
#endif /* _ENA_LOGS_H_ */
@@ -9,7 +9,7 @@
#define ena_assert_msg(cond, msg) \
do { \
if (unlikely(!(cond))) { \
- rte_log(RTE_LOG_ERR, ena_logtype_driver, \
+ RTE_LOG_LINE(ERR, ENA_DRIVER, \
"Assert failed on %s:%s:%d: ", \
__FILE__, __func__, __LINE__); \
rte_panic(msg); \
@@ -6,15 +6,13 @@
#define _ENETC_LOGS_H_
extern int enetc_logtype_pmd;
-#define RTE_LOGTYPE_ENETC_PMD enetc_logtype_pmd
+#define RTE_LOGTYPE_ENETC_NET enetc_logtype_pmd
#define ENETC_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, enetc_logtype_pmd, "enetc_net: " \
- fmt "\n", ##args)
+ RTE_LOG_LINE(level, ENETC_NET, fmt, ##args)
#define ENETC_PMD_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, enetc_logtype_pmd, "enetc_net: %s(): "\
- fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(DEBUG, ENETC_NET, "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() ENETC_PMD_DEBUG(">>")
@@ -31,7 +29,7 @@ extern int enetc_logtype_pmd;
/* DP Logs, toggled out at compile time if level lower than current level */
#define ENETC_PMD_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, ENETC_PMD, fmt, ## args)
+ RTE_LOG_DP_LINE(level, ENETC_NET, fmt, ## args)
#define ENETC_PMD_DP_DEBUG(fmt, args...) \
ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
@@ -8,12 +8,11 @@
#include <rte_log.h>
extern int enetfec_logtype_pmd;
-#define RTE_LOGTYPE_ENETFEC_PMD enetfec_logtype_pmd
+#define RTE_LOGTYPE_ENETFEC_NET enetfec_logtype_pmd
/* PMD related logs */
#define ENETFEC_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, enetfec_logtype_pmd, "\nfec_net: %s()" \
- fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, ENETFEC_NET, "%s()" fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() ENET_PMD_LOG(DEBUG, " >>")
@@ -29,6 +28,6 @@ extern int enetfec_logtype_pmd;
/* DP Logs, toggled out at compile time if level lower than current level */
#define ENETFEC_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, ENETFEC_PMD, fmt, ## args)
+ RTE_LOG_DP_LINE(level, ENETFEC_NET, fmt, ## args)
#endif /* _ENETFEC_LOGS_H_ */
@@ -26,6 +26,7 @@
#define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask))
extern int enic_pmd_logtype;
+#define RTE_LOGTYPE_ENIC_PMD enic_pmd_logtype
#define dev_printk(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, enic_pmd_logtype, \
@@ -37,8 +38,8 @@ extern int enic_pmd_logtype;
#define dev_debug(x, args...) dev_printk(DEBUG, args)
#define ENICPMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, enic_pmd_logtype, \
- "%s " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, ENIC_PMD, \
+ "%s " fmt, __func__, ##args)
#define ENICPMD_FUNC_TRACE() ENICPMD_LOG(DEBUG, ">>")
typedef unsigned long long dma_addr_t;
@@ -357,12 +357,9 @@ extern int failsafe_mac_from_arg;
#endif
extern int failsafe_logtype;
+#define RTE_LOGTYPE_NET_FAILSAFE failsafe_logtype
-#define LOG__(l, m, ...) \
- rte_log(RTE_LOG_ ## l, failsafe_logtype, \
- "net_failsafe: " m "%c", __VA_ARGS__)
-
-#define LOG_(level, ...) LOG__(level, __VA_ARGS__, '\n')
+#define LOG_(l, ...) RTE_LOG_LINE(l, NET_FAILSAFE, __VA_ARGS__)
#define DEBUG(...) LOG_(DEBUG, __VA_ARGS__)
#define INFO(...) LOG_(INFO, __VA_ARGS__)
#define WARN(...) LOG_(WARNING, __VA_ARGS__)
@@ -8,26 +8,26 @@
#include <rte_log.h>
extern int fm10k_logtype_init;
+#define RTE_LOGTYPE_FM10K_INIT fm10k_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, fm10k_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, FM10K_INIT, "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_ETHDEV_DEBUG_RX
extern int fm10k_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, fm10k_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_FM10K_RX fm10k_logtype_rx
+#define PMD_RX_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, FM10K_RX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int fm10k_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, fm10k_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_FM10K_TX fm10k_logtype_tx
+#define PMD_TX_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, FM10K_TX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
@@ -35,6 +35,6 @@ extern int fm10k_logtype_tx;
extern int fm10k_logtype_driver;
#define RTE_LOGTYPE_FM10K_DRIVER fm10k_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, FM10K_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, FM10K_DRIVER, "%s(): " fmt, __func__, ## args)
#endif /* _FM10K_LOGS_H_ */
@@ -6,9 +6,9 @@
#define _GVE_LOGS_H_
extern int gve_logtype_driver;
+#define RTE_LOGTYPE_GVE_DRIVER gve_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, gve_logtype_driver, "%s(): " fmt "\n", \
- __func__, ## args)
+ RTE_LOG_LINE(level, GVE_DRIVER, "%s(): " fmt, __func__, ## args)
#endif
@@ -84,10 +84,11 @@ typedef uint64_t dma_addr_t;
#define HINIC_DRIVER_NAME "net_hinic"
extern int hinic_logtype;
+#define RTE_LOGTYPE_HINIC hinic_logtype
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hinic_logtype, \
- HINIC_DRIVER_NAME": " fmt "\n", ##args)
+ RTE_LOG_LINE(level, HINIC, \
+ HINIC_DRIVER_NAME": " fmt, ##args)
/* common definition */
#ifndef ETH_ALEN
@@ -6,35 +6,37 @@
#define HNS3_LOGS_H
extern int hns3_logtype_init;
+#define RTE_LOGTYPE_HNS3_INIT hns3_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hns3_logtype_init, "%s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(level, HNS3_INIT, "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
extern int hns3_logtype_driver;
-#define PMD_DRV_LOG_RAW(hw, level, fmt, args...) \
- rte_log(level, hns3_logtype_driver, "%s %s(): " fmt, \
+#define RTE_LOGTYPE_HNS3_DRIVER hns3_logtype_driver
+#define PMD_DRV_LOG(hw, level, fmt, args...) \
+ RTE_LOG_LINE(level, HNS3_DRIVER, "%s %s(): " fmt, \
(hw)->data->name, __func__, ## args)
#define hns3_err(hw, fmt, args...) \
- PMD_DRV_LOG_RAW(hw, RTE_LOG_ERR, fmt "\n", ## args)
+ PMD_DRV_LOG(hw, ERR, fmt, ## args)
#define hns3_warn(hw, fmt, args...) \
- PMD_DRV_LOG_RAW(hw, RTE_LOG_WARNING, fmt "\n", ## args)
+ PMD_DRV_LOG(hw, WARNING, fmt, ## args)
#define hns3_notice(hw, fmt, args...) \
- PMD_DRV_LOG_RAW(hw, RTE_LOG_NOTICE, fmt "\n", ## args)
+ PMD_DRV_LOG(hw, NOTICE, fmt, ## args)
#define hns3_info(hw, fmt, args...) \
- PMD_DRV_LOG_RAW(hw, RTE_LOG_INFO, fmt "\n", ## args)
+ PMD_DRV_LOG(hw, INFO, fmt, ## args)
#define hns3_dbg(hw, fmt, args...) \
- PMD_DRV_LOG_RAW(hw, RTE_LOG_DEBUG, fmt "\n", ## args)
+ PMD_DRV_LOG(hw, DEBUG, fmt, ## args)
#ifdef RTE_ETHDEV_DEBUG_RX
extern int hns3_logtype_rx;
+#define RTE_LOGTYPE_HNS3_RX hns3_logtype_rx
#define PMD_RX_LOG(hw, level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hns3_logtype_rx, "%s %s(): " fmt "\n", \
+ RTE_LOG_LINE(level, HNS3_RX, "%s %s(): " fmt, \
(hw)->data->name, __func__, ## args)
#else
#define PMD_RX_LOG(hw, level, fmt, args...) do { } while (0)
@@ -42,8 +44,9 @@ extern int hns3_logtype_rx;
#ifdef RTE_ETHDEV_DEBUG_TX
extern int hns3_logtype_tx;
+#define RTE_LOGTYPE_HNS3_TX hns3_logtype_tx
#define PMD_TX_LOG(hw, level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hns3_logtype_tx, "%s %s(): " fmt "\n", \
+ RTE_LOG_LINE(level, HNS3_TX, "%s %s(): " fmt, \
(hw)->data->name, __func__, ## args)
#else
#define PMD_TX_LOG(hw, level, fmt, args...) do { } while (0)
@@ -6,25 +6,25 @@
#define _I40E_LOGS_H_
extern int i40e_logtype_init;
+#define RTE_LOGTYPE_I40E_INIT i40e_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, i40e_logtype_init, "%s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(level, I40E_INIT, "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_ETHDEV_DEBUG_RX
extern int i40e_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, i40e_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_I40E_RX i40e_logtype_rx
+#define PMD_RX_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, I40E_RX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int i40e_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, i40e_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_I40E_TX i40e_logtype_tx
+#define PMD_TX_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, I40E_TX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
@@ -32,6 +32,6 @@ extern int i40e_logtype_tx;
extern int i40e_logtype_driver;
#define RTE_LOGTYPE_I40E_DRIVER i40e_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, I40E_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, I40E_DRIVER, "%s(): " fmt, __func__, ## args)
#endif /* _I40E_LOGS_H_ */
@@ -6,35 +6,36 @@
#define _IAVF_LOG_H_
extern int iavf_logtype_init;
+#define RTE_LOGTYPE_IAVF_INIT iavf_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, iavf_logtype_init, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, IAVF_INIT, "%s(): " fmt, \
__func__, ## args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
extern int iavf_logtype_driver;
-#define PMD_DRV_LOG_RAW(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, iavf_logtype_driver, "%s(): " fmt, \
- __func__, ## args)
-
+#define RTE_LOGTYPE_IAVF_DRIVER iavf_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+ RTE_LOG_LINE(level, IAVF_DRIVER, "%s(): " fmt, \
+ __func__, ## args)
#define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
#ifdef RTE_ETHDEV_DEBUG_RX
extern int iavf_logtype_rx;
+#define RTE_LOGTYPE_IAVF_RX iavf_logtype_rx
#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, iavf_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, IAVF_RX, \
+ "%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int iavf_logtype_tx;
+#define RTE_LOGTYPE_IAVF_TX iavf_logtype_tx
#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, iavf_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, IAVF_TX, \
+ "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
@@ -6,34 +6,34 @@
#define _ICE_LOGS_H_
extern int ice_logtype_init;
+#define RTE_LOGTYPE_ICE_INIT ice_logtype_init
extern int ice_logtype_driver;
#define RTE_LOGTYPE_ICE_DRIVER ice_logtype_driver
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ice_logtype_init, "%s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(level, ICE_INIT, "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_ETHDEV_DEBUG_RX
extern int ice_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ice_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_ICE_RX ice_logtype_rx
+#define PMD_RX_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, ICE_RX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int ice_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ice_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_ICE_TX ice_logtype_tx
+#define PMD_TX_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, ICE_TX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, ICE_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, ICE_DRIVER, "%s(): " fmt, __func__, ## args)
#endif /* _ICE_LOGS_H_ */
@@ -8,25 +8,22 @@
#include <rte_log.h>
extern int idpf_logtype_init;
+#define RTE_LOGTYPE_IDPF_INIT idpf_logtype_init
extern int idpf_logtype_driver;
+#define RTE_LOGTYPE_IDPF_DRIVER idpf_logtype_driver
#define PMD_INIT_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, \
- idpf_logtype_init, \
+ RTE_LOG_LINE(level, IDPF_INIT, \
RTE_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+ RTE_FMT_HEAD(__VA_ARGS__,), \
__func__, \
RTE_FMT_TAIL(__VA_ARGS__,)))
-#define PMD_DRV_LOG_RAW(level, ...) \
- rte_log(RTE_LOG_ ## level, \
- idpf_logtype_driver, \
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE(level, IDPF_DRIVER, \
RTE_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+ RTE_FMT_HEAD(__VA_ARGS__,), \
__func__, \
RTE_FMT_TAIL(__VA_ARGS__,)))
-#define PMD_DRV_LOG(level, fmt, args...) \
- PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
-
#endif /* _IDPF_LOGS_H_ */
@@ -12,31 +12,29 @@ extern "C" {
#endif
extern int igc_logtype_init;
+#define RTE_LOGTYPE_IGC_INIT igc_logtype_init
extern int igc_logtype_driver;
#define RTE_LOGTYPE_IGC_DRIVER igc_logtype_driver
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, igc_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, IGC_INIT, "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_ETHDEV_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
- RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_RX_LOG(...) PMD_DRV_LOG(__VA_ARGS__)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
- RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_TX_LOG(...) PMD_DRV_LOG(__VA_ARGS__)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, IGC_DRIVER, "%s(): " fmt, __func__, ## args)
#ifdef __cplusplus
}
@@ -8,10 +8,10 @@
#include <rte_log.h>
extern int ipn3ke_afu_logtype;
+#define RTE_LOGTYPE_IPN3KE_AFU ipn3ke_afu_logtype
#define IPN3KE_AFU_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ipn3ke_afu_logtype, "%s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(level, IPN3KE_AFU, "%s(): " fmt, __func__, ##args)
#define IPN3KE_AFU_PMD_FUNC_TRACE() IPN3KE_AFU_PMD_LOG(DEBUG, ">>")
@@ -6,26 +6,26 @@
#define _IXGBE_LOGS_H_
extern int ixgbe_logtype_init;
+#define RTE_LOGTYPE_IXGBE_INIT ixgbe_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ixgbe_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, IXGBE_INIT, "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_ETHDEV_DEBUG_RX
extern int ixgbe_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_IXGBE_RX ixgbe_logtype_rx
+#define PMD_RX_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, IXGBE_RX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int ixgbe_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_IXGBE_TX ixgbe_logtype_tx
+#define PMD_TX_LOG(level, fmt, args...) \
+ RTE_LOG_LINE(level, IXGBE_TX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
@@ -33,6 +33,6 @@ extern int ixgbe_logtype_tx;
extern int ixgbe_logtype_driver;
#define RTE_LOGTYPE_IXGBE_DRIVER ixgbe_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, IXGBE_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, IXGBE_DRIVER, "%s(): " fmt, __func__, ## args)
#endif /* _IXGBE_LOGS_H_ */
@@ -466,16 +466,17 @@ struct mana_rxq {
extern int mana_logtype_driver;
#define RTE_LOGTYPE_MANA_DRIVER mana_logtype_driver
extern int mana_logtype_init;
+#define RTE_LOGTYPE_MANA_INIT mana_logtype_init
#define DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, mana_logtype_driver, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, MANA_DRIVER, "%s(): " fmt, \
__func__, ## args)
#define DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, MANA_DRIVER, fmt "\n", ## args)
+ RTE_LOG_DP_LINE(level, MANA_DRIVER, fmt, ## args)
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
+ RTE_LOG_LINE(level, MANA_INIT, "%s(): " fmt,\
__func__, ## args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
@@ -28,10 +28,11 @@
#define MAX_PKT_BURST 32
extern int memif_logtype;
+#define RTE_LOGTYPE_MEMIF memif_logtype
#define MIF_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, memif_logtype, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, MEMIF, \
+ "%s(): " fmt, __func__, ##args)
enum memif_role_t {
MEMIF_ROLE_SERVER,
@@ -25,6 +25,7 @@
#endif
extern int mlx4_logtype;
+#define RTE_LOGTYPE_MLX4 mlx4_logtype
#ifdef RTE_LIBRTE_MLX4_DEBUG
@@ -46,8 +47,8 @@ pmd_drv_log_basename(const char *s)
}
#define PMD_DRV_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, mlx4_logtype, \
- RTE_FMT("%s:%u: %s(): " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+ RTE_LOG_LINE(level, MLX4, \
+ RTE_FMT("%s:%u: %s(): " RTE_FMT_HEAD(__VA_ARGS__,), \
pmd_drv_log_basename(__FILE__), \
__LINE__, \
__func__, \
@@ -63,9 +64,9 @@ pmd_drv_log_basename(const char *s)
*/
#define PMD_DRV_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, mlx4_logtype, \
+ RTE_LOG_LINE(level, MLX4, \
RTE_FMT(MLX4_DRIVER_NAME ": " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+ RTE_FMT_HEAD(__VA_ARGS__,), \
RTE_FMT_TAIL(__VA_ARGS__,)))
#define MLX4_ASSERT(exp) RTE_ASSERT(exp)
#define claim_zero(...) (__VA_ARGS__)
@@ -83,9 +83,9 @@ struct mvneta_priv {
/** Current log type. */
extern int mvneta_logtype;
+#define RTE_LOGTYPE_MVNETA mvneta_logtype
#define MVNETA_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, mvneta_logtype, "%s(): " fmt "\n", \
- __func__, ##args)
+ RTE_LOG_LINE(level, MVNETA, "%s(): " fmt, __func__, ##args)
#endif /* _MVNETA_ETHDEV_H_ */
@@ -200,9 +200,10 @@ extern const struct rte_tm_ops mrvl_tm_ops;
/** Current log type. */
extern int mrvl_logtype;
+#define RTE_LOGTYPE_MRVL mrvl_logtype
#define MRVL_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, mrvl_logtype, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, MRVL, "%s(): " fmt, \
__func__, ##args)
extern struct pp2_bpool *dummy_pool[PP2_NUM_PKT_PROC];
@@ -6,31 +6,29 @@
#include <rte_log.h>
extern int hn_logtype_init;
+#define RTE_LOGTYPE_HN_INIT hn_logtype_init
extern int hn_logtype_driver;
+#define RTE_LOGTYPE_HN_DRIVER hn_logtype_driver
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hn_logtype_init, "%s(): " fmt "\n",\
- __func__, ## args)
+ RTE_LOG_LINE(level, HN_INIT, "%s(): " fmt, __func__, ## args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_LIBRTE_NETVSC_DEBUG_RX
#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hn_logtype_driver, \
- "%s() rx: " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, HN_DRIVER, "%s() rx: " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_NETVSC_DEBUG_TX
#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hn_logtype_driver, \
- "%s() tx: " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, HN_DRIVER, "%s() tx: " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hn_logtype_driver, "%s(): " fmt "\n", \
- __func__, ## args)
+ RTE_LOG_LINE(level, HN_DRIVER, "%s(): " fmt, __func__, ## args)
#endif /* _HN_LOGS_H_ */
@@ -95,8 +95,8 @@ void hn_rndis_dump(const void *buf)
const struct rndis_pktinfo *ppi;
unsigned int ppi_len;
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_MSG_PACKET (len %u, data %u:%u, # oob %u %u:%u, pkt %u:%u)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_MSG_PACKET (len %u, data %u:%u, # oob %u %u:%u, pkt %u:%u)",
rndis_msg->pkt.len,
rndis_msg->pkt.dataoffset,
rndis_msg->pkt.datalen,
@@ -116,8 +116,8 @@ void hn_rndis_dump(const void *buf)
ppi_data = ppi->data;
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- " PPI (size %u, type %u, offs %u data %#x)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ " PPI (size %u, type %u, offs %u data %#x)",
ppi->size, ppi->type, ppi->offset,
*(const uint32_t *)ppi_data);
if (ppi->size == 0)
@@ -129,8 +129,8 @@ void hn_rndis_dump(const void *buf)
break;
}
case RNDIS_INITIALIZE_MSG:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_MSG_INIT (len %u id %#x, ver %u.%u max xfer %u)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_MSG_INIT (len %u id %#x, ver %u.%u max xfer %u)",
rndis_msg->init_request.len,
rndis_msg->init_request.rid,
rndis_msg->init_request.ver_major,
@@ -139,9 +139,9 @@ void hn_rndis_dump(const void *buf)
break;
case RNDIS_INITIALIZE_CMPLT:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
"RNDIS_MSG_INIT_C (len %u, id %#x, status 0x%x, vers %u.%u, "
- "flags %d, max xfer %u, max pkts %u, aligned %u)\n",
+ "flags %d, max xfer %u, max pkts %u, aligned %u)",
rndis_msg->init_complete.len,
rndis_msg->init_complete.rid,
rndis_msg->init_complete.status,
@@ -154,14 +154,14 @@ void hn_rndis_dump(const void *buf)
break;
case RNDIS_HALT_MSG:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_HALT (len %u id %#x)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_HALT (len %u id %#x)",
rndis_msg->halt.len, rndis_msg->halt.rid);
break;
case RNDIS_QUERY_MSG:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_QUERY (len %u, id %#x, oid %#x, info %u:%u)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_QUERY (len %u, id %#x, oid %#x, info %u:%u)",
rndis_msg->query_request.len,
rndis_msg->query_request.rid,
rndis_msg->query_request.oid,
@@ -170,8 +170,8 @@ void hn_rndis_dump(const void *buf)
break;
case RNDIS_QUERY_CMPLT:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_MSG_QUERY_C (len %u, id %#x, status 0x%x, buf %u:%u)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_MSG_QUERY_C (len %u, id %#x, status 0x%x, buf %u:%u)",
rndis_msg->query_complete.len,
rndis_msg->query_complete.rid,
rndis_msg->query_complete.status,
@@ -180,8 +180,8 @@ void hn_rndis_dump(const void *buf)
break;
case RNDIS_SET_MSG:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_SET (len %u, id %#x, oid %#x, info %u:%u)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_SET (len %u, id %#x, oid %#x, info %u:%u)",
rndis_msg->set_request.len,
rndis_msg->set_request.rid,
rndis_msg->set_request.oid,
@@ -190,16 +190,16 @@ void hn_rndis_dump(const void *buf)
break;
case RNDIS_SET_CMPLT:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_MSG_SET_C (len %u, id 0x%x, status 0x%x)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_MSG_SET_C (len %u, id 0x%x, status 0x%x)",
rndis_msg->set_complete.len,
rndis_msg->set_complete.rid,
rndis_msg->set_complete.status);
break;
case RNDIS_INDICATE_STATUS_MSG:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_MSG_INDICATE (len %u, status %#x, buf len %u, buf offset %u)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_MSG_INDICATE (len %u, status %#x, buf len %u, buf offset %u)",
rndis_msg->indicate_status.len,
rndis_msg->indicate_status.status,
rndis_msg->indicate_status.stbuflen,
@@ -207,38 +207,38 @@ void hn_rndis_dump(const void *buf)
break;
case RNDIS_RESET_MSG:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_RESET (len %u, id %#x)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_RESET (len %u, id %#x)",
rndis_msg->reset_request.len,
rndis_msg->reset_request.rid);
break;
case RNDIS_RESET_CMPLT:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_RESET_C (len %u, status %#x address %#x)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_RESET_C (len %u, status %#x address %#x)",
rndis_msg->reset_complete.len,
rndis_msg->reset_complete.status,
rndis_msg->reset_complete.adrreset);
break;
case RNDIS_KEEPALIVE_MSG:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_KEEPALIVE (len %u, id %#x)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_KEEPALIVE (len %u, id %#x)",
rndis_msg->keepalive_request.len,
rndis_msg->keepalive_request.rid);
break;
case RNDIS_KEEPALIVE_CMPLT:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS_KEEPALIVE_C (len %u, id %#x address %#x)\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS_KEEPALIVE_C (len %u, id %#x address %#x)",
rndis_msg->keepalive_complete.len,
rndis_msg->keepalive_complete.rid,
rndis_msg->keepalive_complete.status);
break;
default:
- rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
- "RNDIS type %#x len %u\n",
+ RTE_LOG_LINE(DEBUG, HN_DRIVER,
+ "RNDIS type %#x len %u",
rndis_msg->hdr.type,
rndis_msg->hdr.len);
break;
@@ -13,9 +13,9 @@
#include <netcope/txmac.h>
extern int nfb_logtype;
+#define RTE_LOGTYPE_NFB nfb_logtype
#define NFB_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfb_logtype, "%s(): " fmt "\n", \
- __func__, ## args)
+ RTE_LOG_LINE(level, NFB, "%s(): " fmt, __func__, ## args)
#include "nfb_rx.h"
#include "nfb_tx.h"
@@ -9,36 +9,36 @@
#include <rte_log.h>
extern int nfp_logtype_init;
+#define RTE_LOGTYPE_NFP_INIT nfp_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_init, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NFP_INIT, "%s(): " fmt, __func__, ## args)
#ifdef RTE_ETHDEV_DEBUG_RX
extern int nfp_logtype_rx;
+#define RTE_LOGTYPE_NFP_RX nfp_logtype_rx
#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NFP_RX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int nfp_logtype_tx;
+#define RTE_LOGTYPE_NFP_TX nfp_logtype_tx
#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NFP_TX, "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
extern int nfp_logtype_cpp;
+#define RTE_LOGTYPE_NFP_CPP nfp_logtype_cpp
#define PMD_CPP_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_cpp, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NFP_CPP, "%s(): " fmt, __func__, ## args)
extern int nfp_logtype_driver;
+#define RTE_LOGTYPE_NFP_DRIVER nfp_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_driver, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NFP_DRIVER, "%s(): " fmt, __func__, ## args)
#endif /* __NFP_LOGS_H__ */
@@ -10,29 +10,33 @@
* PMD_USER_LOG: for user
*/
extern int ngbe_logtype_init;
+#define RTE_LOGTYPE_NGBE_INIT ngbe_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ngbe_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, NGBE_INIT, \
+ "%s(): " fmt, __func__, ##args)
extern int ngbe_logtype_driver;
+#define RTE_LOGTYPE_NGBE_DRIVER ngbe_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ngbe_logtype_driver, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, NGBE_DRIVER, \
+ "%s(): " fmt, __func__, ##args)
#ifdef RTE_ETHDEV_DEBUG_RX
extern int ngbe_logtype_rx;
+#define RTE_LOGTYPE_NGBE_RX ngbe_logtype_rx
#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ngbe_logtype_rx, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, NGBE_RX, \
+ "%s(): " fmt, __func__, ##args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int ngbe_logtype_tx;
+#define RTE_LOGTYPE_NGBE_TX ngbe_logtype_tx
#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ngbe_logtype_tx, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, NGBE_TX, \
+ "%s(): " fmt, __func__, ##args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
@@ -76,10 +76,11 @@ static struct rte_eth_link pmd_link = {
};
RTE_LOG_REGISTER_DEFAULT(eth_null_logtype, NOTICE);
+#define RTE_LOGTYPE_ETH_NULL eth_null_logtype
#define PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, eth_null_logtype, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, ETH_NULL, \
+ "%s(): " fmt, __func__, ##args)
static uint16_t
eth_null_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
@@ -68,18 +68,18 @@
#define OTX_CUST_DATA_LEN 0
#define otx_ep_info(fmt, args...) \
- rte_log(RTE_LOG_INFO, otx_net_ep_logtype, \
- "%s():%u " fmt "\n", \
+ RTE_LOG_LINE(INFO, OTX_NET_EP, \
+ "%s():%u " fmt, \
__func__, __LINE__, ##args)
#define otx_ep_err(fmt, args...) \
- rte_log(RTE_LOG_ERR, otx_net_ep_logtype, \
- "%s():%u " fmt "\n", \
+ RTE_LOG_LINE(ERR, OTX_NET_EP, \
+ "%s():%u " fmt, \
__func__, __LINE__, ##args)
#define otx_ep_dbg(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, otx_net_ep_logtype, \
- "%s():%u " fmt "\n", \
+ RTE_LOG_LINE(DEBUG, OTX_NET_EP, \
+ "%s():%u " fmt, \
__func__, __LINE__, ##args)
/* IO Access */
@@ -916,9 +916,9 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
next_fetch = (pkts == new_pkts - 1) ? 0 : 1;
oq_pkt = otx_ep_droq_read_packet(otx_ep, droq, next_fetch);
if (!oq_pkt) {
- RTE_LOG_DP(ERR, OTX_NET_EP,
+ RTE_LOG_DP_LINE(ERR, OTX_NET_EP,
"DROQ read pkt failed pending %" PRIu64
- "last_pkt_count %" PRIu64 "new_pkts %d.\n",
+ "last_pkt_count %" PRIu64 "new_pkts %d.",
droq->pkts_pending, droq->last_pkt_count,
new_pkts);
droq->stats.rx_err++;
@@ -6,21 +6,21 @@
#define __OCTEONTX_LOGS_H__
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, otx_net_logtype_init, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, OTX_NET_INIT, \
+ "%s(): " fmt, __func__, ## args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, ">>")
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, otx_net_logtype_driver, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, OTX_NET_DRIVER, \
+ "%s(): " fmt, __func__, ## args)
#define PMD_MBOX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, OTX_NET_MBOX, \
+ "%s(): " fmt, __func__, ## args)
#define octeontx_log_info(fmt, args...) \
- RTE_LOG(INFO, OTX_NET_DRIVER, fmt "\n", ## args)
+ RTE_LOG_LINE(INFO, OTX_NET_DRIVER, fmt, ## args)
#define octeontx_log_err(s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)
#define octeontx_log_dbg(s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__)
@@ -30,8 +30,10 @@
#define PMD_TX_LOG PMD_DRV_LOG
extern int otx_net_logtype_init;
+#define RTE_LOGTYPE_OTX_NET_INIT otx_net_logtype_init
extern int otx_net_logtype_driver;
#define RTE_LOGTYPE_OTX_NET_DRIVER otx_net_logtype_driver
extern int otx_net_logtype_mbox;
+#define RTE_LOGTYPE_OTX_NET_MBOX otx_net_logtype_mbox
#endif /* __OCTEONTX_LOGS_H__*/
@@ -8,9 +8,10 @@
#include <rte_ether.h>
#define PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, eth_pcap_logtype, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, ETH_PCAP, \
+ "%s(): " fmt, __func__, ##args)
extern int eth_pcap_logtype;
+#define RTE_LOGTYPE_ETH_PCAP eth_pcap_logtype
int osdep_iface_index_get(const char *name);
int osdep_iface_mac_get(const char *name, struct rte_ether_addr *mac);
@@ -6,12 +6,11 @@
#define _PFE_LOGS_H_
extern int pfe_logtype_pmd;
-#define RTE_LOGTYPE_PFE_PMD pfe_logtype_pmd
+#define RTE_LOGTYPE_PFE_NET pfe_logtype_pmd
/* PMD related logs */
#define PFE_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, pfe_logtype_pmd, "pfe_net: %s()" \
- fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, PFE_NET, "%s()" fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PFE_PMD_LOG(DEBUG, " >>")
@@ -27,6 +26,6 @@ extern int pfe_logtype_pmd;
/* DP Logs, toggled out at compile time if level lower than current level */
#define PFE_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, PFE_PMD, fmt, ## args)
+ RTE_LOG_DP_LINE(level, PFE_NET, fmt, ## args)
#endif /* _PFE_LOGS_H_ */
@@ -68,10 +68,11 @@ static struct rte_eth_link pmd_link = {
};
RTE_LOG_REGISTER_DEFAULT(eth_ring_logtype, NOTICE);
+#define RTE_LOGTYPE_ETH_RING eth_ring_logtype
#define PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, eth_ring_logtype, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, ETH_RING, \
+ "%s(): " fmt, __func__, ##args)
static uint16_t
eth_ring_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
@@ -51,10 +51,11 @@ static const struct softnic_conn_params conn_params_default = {
};
RTE_LOG_REGISTER_DEFAULT(pmd_softnic_logtype, NOTICE);
+#define RTE_LOGTYPE_PMD_SOFTNIC pmd_softnic_logtype
#define PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, pmd_softnic_logtype, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, PMD_SOFTNIC, \
+ "%s(): " fmt, __func__, ##args)
static int
pmd_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
@@ -4,7 +4,8 @@
*/
extern int tap_logtype;
+#define RTE_LOGTYPE_TAP tap_logtype
#define TAP_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, tap_logtype, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, TAP, "%s(): " fmt, \
__func__, ## args)
@@ -20,25 +20,25 @@
#endif
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nicvf_logtype_init, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NICVF_INIT, "%s(): " fmt, __func__, ## args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, ">>")
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nicvf_logtype_driver, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NICVF_DRIVER, "%s(): " fmt, __func__, ## args)
#define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
#define PMD_MBOX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nicvf_logtype_mbox, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NICVF_MBOX, "%s(): " fmt, __func__, ## args)
#define PMD_MBOX_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
#define PMD_RX_LOG PMD_DRV_LOG
#define PMD_TX_LOG PMD_DRV_LOG
extern int nicvf_logtype_init;
+#define RTE_LOGTYPE_NICVF_INIT nicvf_logtype_init
extern int nicvf_logtype_driver;
+#define RTE_LOGTYPE_NICVF_DRIVER nicvf_logtype_driver
extern int nicvf_logtype_mbox;
+#define RTE_LOGTYPE_NICVF_MBOX nicvf_logtype_mbox
#endif /* __THUNDERX_NICVF_LOGS__ */
@@ -12,38 +12,44 @@
* PMD_USER_LOG: for user
*/
extern int txgbe_logtype_init;
+#define RTE_LOGTYPE_TXGBE_INIT txgbe_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, TXGBE_INIT, \
+ "%s(): " fmt, __func__, ##args)
extern int txgbe_logtype_driver;
+#define RTE_LOGTYPE_TXGBE_DRIVER txgbe_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_driver, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, TXGBE_DRIVER, \
+ "%s(): " fmt, __func__, ##args)
#ifdef RTE_LIBRTE_TXGBE_DEBUG_RX
extern int txgbe_logtype_rx;
+#define RTE_LOGTYPE_TXGBE_RX txgbe_logtype_rx
#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_rx, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, TXGBE_RX, \
+ "%s(): " fmt, __func__, ##args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_TXGBE_DEBUG_TX
extern int txgbe_logtype_tx;
+#define RTE_LOGTYPE_TXGBE_TX txgbe_logtype_tx
#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_tx, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, TXGBE_TX, \
+ "%s(): " fmt, __func__, ##args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_TXGBE_DEBUG_TX_FREE
extern int txgbe_logtype_tx_free;
+#define RTE_LOGTYPE_TXGBE_TX_FREE txgbe_logtype_tx_free
+#define RTE_LOGTYPE_TXGBE_TX txgbe_logtype_tx
#define PMD_TX_FREE_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_tx_free, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, TXGBE_TX_FREE, \
+ "%s(): " fmt, __func__, ##args)
#else
#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
#endif
@@ -49,12 +49,12 @@
#define NETVSC_MAX_ROUTE_LINE_SIZE 300
RTE_LOG_REGISTER_DEFAULT(vdev_netvsc_logtype, NOTICE);
+#define RTE_LOGTYPE_VDEV_NETVSC vdev_netvsc_logtype
#define DRV_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, \
- vdev_netvsc_logtype, \
+ RTE_LOG_LINE(level, VDEV_NETVSC, \
RTE_FMT(VDEV_NETVSC_DRIVER_NAME ": " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+ RTE_FMT_HEAD(__VA_ARGS__,), \
RTE_FMT_TAIL(__VA_ARGS__,)))
/** Context structure for a vdev_netvsc instance. */
@@ -25,8 +25,7 @@ RTE_LOG_REGISTER_DEFAULT(vhost_logtype, NOTICE);
#define RTE_LOGTYPE_VHOST vhost_logtype
#define VHOST_LOG_LINE(level, ...) \
- RTE_LOG(level, VHOST, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
- RTE_FMT_TAIL(__VA_ARGS__ ,)))
+ RTE_LOG_LINE(level, VHOST, __VA_ARGS__)
enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
@@ -8,22 +8,23 @@
#include <rte_log.h>
extern int virtio_logtype_init;
+#define RTE_LOGTYPE_VIRTIO_INIT virtio_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, virtio_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, VIRTIO_INIT, \
+ "%s(): " fmt, __func__, ##args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX
#define PMD_RX_LOG(level, fmt, args...) \
- RTE_LOG(level, VIRTIO_DRIVER, "%s() rx: " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, VIRTIO_DRIVER, "%s() rx: " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while(0)
#endif
#ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX
#define PMD_TX_LOG(level, fmt, args...) \
- RTE_LOG(level, VIRTIO_DRIVER, "%s() tx: " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, VIRTIO_DRIVER, "%s() tx: " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while(0)
#endif
@@ -31,7 +32,7 @@ extern int virtio_logtype_init;
extern int virtio_logtype_driver;
#define RTE_LOGTYPE_VIRTIO_DRIVER virtio_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, VIRTIO_DRIVER, \
+ "%s(): " fmt, __func__, ## args)
#endif /* _VIRTIO_LOGS_H_ */
@@ -6,28 +6,29 @@
#define _VMXNET3_LOGS_H_
extern int vmxnet3_logtype_init;
+#define RTE_LOGTYPE_VMXNET3_INIT vmxnet3_logtype_init
#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, vmxnet3_logtype_init, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, VMXNET3_INIT, \
+ "%s(): " fmt, __func__, ## args)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX
#define PMD_RX_LOG(level, fmt, args...) \
- RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, VMXNET3_DRIVER, "%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while(0)
#endif
#ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX
#define PMD_TX_LOG(level, fmt, args...) \
- RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, VMXNET3_DRIVER, "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while(0)
#endif
#ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE
#define PMD_TX_FREE_LOG(level, fmt, args...) \
- RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, VMXNET3_DRIVER, "%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
#endif
@@ -35,7 +36,6 @@ extern int vmxnet3_logtype_init;
extern int vmxnet3_logtype_driver;
#define RTE_LOGTYPE_VMXNET3_DRIVER vmxnet3_logtype_driver
#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, VMXNET3_DRIVER, "%s(): " fmt, __func__, ## args)
#endif /* _VMXNET3_LOGS_H_ */
@@ -27,10 +27,10 @@ extern "C" {
#endif
extern int cnxk_logtype_bphy;
+#define RTE_LOGTYPE_CNXK_BPHY cnxk_logtype_bphy
#define CNXK_BPHY_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, cnxk_logtype_bphy, \
- "%s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, CNXK_BPHY, "%s(): " fmt, __func__, ## args)
/** Available message types */
enum cnxk_bphy_cgx_msg_type {
@@ -6,9 +6,10 @@
#define _CNXK_GPIO_H_
extern int cnxk_logtype_gpio;
+#define RTE_LOGTYPE_CNXK_GPIO cnxk_logtype_gpio
#define CNXK_GPIO_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, cnxk_logtype_gpio, fmt "\n", ## args)
+ RTE_LOG_LINE(level, CNXK_GPIO, fmt, ## args)
struct cnxk_gpiochip;
@@ -13,12 +13,12 @@ extern int dpaa2_cmdif_logtype;
#define RTE_LOGTYPE_DPAA2_CMDIF dpaa2_cmdif_logtype
#define DPAA2_CMDIF_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "dpaa2_cmdif: " \
- fmt "\n", ## args)
+ RTE_LOG_LINE(level, DPAA2_CMDIF, \
+ fmt, ## args)
#define DPAA2_CMDIF_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_cmdif_logtype, "dpaa2_cmdif: %s(): " \
- fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(DEBUG, DPAA2_CMDIF, "%s(): " \
+ fmt, __func__, ## args)
#define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_DEBUG(">>")
@@ -31,7 +31,7 @@ extern int dpaa2_cmdif_logtype;
/* DP Logs, toggled out at compile time if level lower than current level */
#define DPAA2_CMDIF_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, DPAA2_CMDIF, "dpaa2_cmdif: " fmt "\n", ## args)
+ RTE_LOG_DP_LINE(level, DPAA2_CMDIF, fmt, ## args)
#define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \
DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args)
@@ -6,11 +6,12 @@
#define _IFPGA_RAWDEV_H_
extern int ifpga_rawdev_logtype;
+#define RTE_LOGTYPE_IFPGA_RAWDEV ifpga_rawdev_logtype
#define IFPGA_RAWDEV_NAME_FMT "IFPGA:%02x:%02x.%x"
#define IFPGA_RAWDEV_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ifpga_rawdev_logtype, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, IFPGA_RAWDEV, "%s(): " fmt, \
__func__, ##args)
#define IFPGA_RAWDEV_PMD_FUNC_TRACE() IFPGA_RAWDEV_PMD_LOG(DEBUG, ">>")
@@ -8,9 +8,10 @@
#include <stdbool.h>
extern int ntb_logtype;
+#define RTE_LOGTYPE_NTB ntb_logtype
#define NTB_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ntb_logtype, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, NTB, "%s(): " fmt, \
__func__, ##args)
/* Vendor ID */
@@ -8,9 +8,10 @@
#include <rte_rawdev.h>
extern int skeleton_pmd_logtype;
+#define RTE_LOGTYPE_SKELETON_PMD skeleton_pmd_logtype
#define SKELETON_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, skeleton_pmd_logtype, "%s(): " fmt "\n", \
+ RTE_LOG_LINE(level, SKELETON_PMD, "%s(): " fmt, \
__func__, ##args)
#define SKELETON_PMD_FUNC_TRACE() SKELETON_PMD_LOG(DEBUG, ">>")
@@ -19,7 +19,7 @@
#define TEST_DEV_NAME "rawdev_skeleton"
#define SKELDEV_LOGS(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, skeleton_pmd_logtype, fmt "\n", \
+ RTE_LOG_LINE(level, SKELETON_PMD, fmt, \
##args)
#define SKELDEV_TEST_INFO(fmt, args...) \
@@ -224,10 +224,10 @@ ifcvf_enable_mq(struct ifcvf_hw *hw)
if (mq_cfg) {
if (hw->device_type == IFCVF_BLK) {
*(u32 *)mq_cfg = nr_queue;
- RTE_LOG(INFO, IFCVF_VDPA, "%d queues are enabled\n", nr_queue);
+ RTE_LOG_LINE(INFO, IFCVF_VDPA, "%d queues are enabled", nr_queue);
} else {
*(u32 *)mq_cfg = nr_queue / 2;
- RTE_LOG(INFO, IFCVF_VDPA, "%d queue pairs are enabled\n",
+ RTE_LOG_LINE(INFO, IFCVF_VDPA, "%d queue pairs are enabled",
nr_queue / 2);
}
}
@@ -246,7 +246,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
cfg = hw->common_cfg;
if (!cfg) {
- RTE_LOG(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.\n");
+ RTE_LOG_LINE(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.");
return -1;
}
@@ -258,7 +258,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
IFCVF_WRITE_REG16(i + 1, &cfg->queue_msix_vector);
msix_vector = IFCVF_READ_REG16(&cfg->queue_msix_vector);
if (msix_vector == IFCVF_MSI_NO_VECTOR) {
- RTE_LOG(ERR, IFCVF_VDPA, "queue %d, msix vec alloc failed\n",
+ RTE_LOG_LINE(ERR, IFCVF_VDPA, "queue %d, msix vec alloc failed",
i);
return -1;
}
@@ -307,7 +307,7 @@ ifcvf_disable_vring_hw(struct ifcvf_hw *hw, int i)
cfg = hw->common_cfg;
if (!cfg) {
- RTE_LOG(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.\n");
+ RTE_LOG_LINE(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.");
return;
}
@@ -33,9 +33,10 @@
#define MIN(v1, v2) ((v1) < (v2) ? (v1) : (v2))
RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
+#define RTE_LOGTYPE_IFCVF_VDPA ifcvf_vdpa_logtype
#define DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
- "IFCVF %s(): " fmt "\n", __func__, ##args)
+ RTE_LOG_LINE(level, IFCVF_VDPA, \
+ "%s(): " fmt, __func__, ##args)
#define IFCVF_USED_RING_LEN(size) \
((size) * sizeof(struct vring_used_elem) + sizeof(uint16_t) * 3)
@@ -9,13 +9,15 @@
#include <rte_log.h>
extern int nfp_logtype_vdpa;
+#define RTE_LOGTYPE_NFP_VDPA nfp_logtype_vdpa
#define DRV_VDPA_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_vdpa, \
- "NFP_VDPA: %s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NFP_VDPA, \
+ "%s(): " fmt, __func__, ## args)
extern int nfp_logtype_core;
+#define RTE_LOGTYPE_NFP_CORE nfp_logtype_core
#define DRV_CORE_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_core, \
- "NFP_CORE: %s(): " fmt "\n", __func__, ## args)
+ RTE_LOG_LINE(level, NFP_CORE, \
+ "%s(): " fmt, __func__, ## args)
#endif /* __NFP_VDPA_LOG_H__ */