@@ -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)
+#define CDX_BUS_LOG(level, ...) \
+ RTE_LOG_LINE(level, CDX_BUS, __VA_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)
+#define CDX_BUS_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, CDX_BUS, "%s(): ", __func__, __VA_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)
+#define DPAA_BUS_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA_BUS, __VA_ARGS__)
#ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
#define DPAA_BUS_HWWARN(cond, fmt, args...) \
@@ -24,9 +25,8 @@ extern int dpaa_logtype_bus;
#define DPAA_BUS_HWWARN(cond, fmt, args...) do { } while (0)
#endif
-#define DPAA_BUS_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa_logtype_bus, "dpaa: %s(): " fmt "\n", \
- __func__, ##args)
+#define DPAA_BUS_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA_BUS, "%s(): ", __func__, __VA_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)
+#define DPAA2_BUS_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA2_BUS, __VA_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)
+#define DPAA2_BUS_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_BUS, "%s(): ", __func__, __VA_ARGS__)
#define DPAA2_BUS_INFO(fmt, args...) \
DPAA2_BUS_LOG(INFO, fmt, ## args)
@@ -8,10 +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", \
- __func__, ##args)
+#define IFPGA_BUS_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IFPGA_BUS, "%s(): ", __func__, __VA_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 UACCE_BUS_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, uacce_bus_logtype, "uacce: " fmt "\n", \
- ##args)
+#define RTE_LOGTYPE_UACCE_BUS uacce_bus_logtype
+#define UACCE_BUS_LOG(level, ...) \
+ RTE_LOG_LINE(level, UACCE_BUS, __VA_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,9 @@
#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", \
- __func__, ##args)
+#define VDEV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VDEV_BUS, "%s(): ", __func__, __VA_ARGS__)
#endif /* _VDEV_LOGS_H_ */
@@ -34,9 +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 VMBUS_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, vmbus_logtype_bus, "%s(): " fmt "\n", \
- __func__, ##args)
+#define RTE_LOGTYPE_VMBUS_BUS vmbus_logtype_bus
+#define VMBUS_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VMBUS_BUS, "%s(): ", __func__, __VA_ARGS__)
struct vmbus_br {
struct vmbus_bufring *vbr;
@@ -260,37 +260,50 @@ 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)
+#define plt_err(...) \
+ RTE_LOG_LINE_PREFIX(ERR, CNXK, "%s():%u ", __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
+#define plt_info(...) RTE_LOG_LINE(INFO, CNXK, __VA_ARGS__)
+#define plt_warn(...) RTE_LOG_LINE(WARNING, CNXK, __VA_ARGS__)
+#define plt_print(...) RTE_LOG_LINE(INFO, CNXK, __VA_ARGS__)
#define plt_dump(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)
#define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
/**
* 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__, \
-##args)
+#define plt_dbg(subsystem, ...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, subsystem, "%s():%u ", __func__ RTE_LOG_COMMA __LINE__, \
+ __VA_ARGS__)
#define plt_base_dbg(fmt, ...) plt_dbg(base, fmt, ##__VA_ARGS__)
#define plt_cpt_dbg(fmt, ...) plt_dbg(cpt, fmt, ##__VA_ARGS__)
@@ -308,12 +321,15 @@ extern int cnxk_logtype_esw;
#define plt_esw_dbg(fmt, ...) plt_dbg(esw, fmt, ##__VA_ARGS__)
/* Datapath logs */
-#define plt_dp_err(fmt, args...) \
- RTE_LOG_DP(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_dp_info(fmt, args...) \
- RTE_LOG_DP(INFO, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_dp_dbg(fmt, args...) \
- RTE_LOG_DP(DEBUG, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+#define plt_dp_err(...) \
+ RTE_LOG_DP_LINE_PREFIX(ERR, CNXK, "%s():%u ", __func__ RTE_LOG_COMMA __LINE__, \
+ __VA_ARGS__)
+#define plt_dp_info(...) \
+ RTE_LOG_DP_LINE_PREFIX(INFO, CNXK, "%s():%u ", __func__ RTE_LOG_COMMA __LINE__, \
+ __VA_ARGS__)
+#define plt_dp_dbg(...) \
+ RTE_LOG_DP_LINE_PREFIX(DEBUG, CNXK, "%s():%u ", __func__ RTE_LOG_COMMA __LINE__, \
+ __VA_ARGS__)
#ifdef __cplusplus
#define CNXK_PCI_ID(subsystem_dev, dev) \
@@ -17,32 +17,31 @@
*/
#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, ...) \
+ RTE_LOG_LINE_PREFIX(level, CPT, "%s(): ", __func__, __VA_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)
-#define CPT_LOG_WARN(fmt, args...) \
- CPT_PMD_DRV_LOG_RAW(WARNING, fmt, ## args)
-#define CPT_LOG_ERR(fmt, args...) \
- CPT_PMD_DRV_LOG_RAW(ERR, fmt, ## args)
+#define CPT_LOG_INFO(...) \
+ CPT_PMD_DRV_LOG(INFO, __VA_ARGS__)
+#define CPT_LOG_WARN(...) \
+ CPT_PMD_DRV_LOG(WARNING, __VA_ARGS__)
+#define CPT_LOG_ERR(...) \
+ CPT_PMD_DRV_LOG(ERR, __VA_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)
-
-#define CPT_LOG_DP_DEBUG(fmt, args...) \
- CPT_LOG_DP(DEBUG, fmt, ## args)
-#define CPT_LOG_DP_INFO(fmt, args...) \
- CPT_LOG_DP(INFO, fmt, ## args)
-#define CPT_LOG_DP_WARN(fmt, args...) \
- CPT_LOG_DP(WARNING, fmt, ## args)
-#define CPT_LOG_DP_ERR(fmt, args...) \
- CPT_LOG_DP(ERR, fmt, ## args)
+#define CPT_LOG_DP(level, ...) \
+ RTE_LOG_DP_LINE(level, CPT, __VA_ARGS__)
+
+#define CPT_LOG_DP_DEBUG(...) \
+ CPT_LOG_DP(DEBUG, __VA_ARGS__)
+#define CPT_LOG_DP_INFO(...) \
+ CPT_LOG_DP(INFO, __VA_ARGS__)
+#define CPT_LOG_DP_WARN(...) \
+ CPT_LOG_DP(WARNING, __VA_ARGS__)
+#define CPT_LOG_DP_ERR(...) \
+ CPT_LOG_DP(ERR, __VA_ARGS__)
#endif /* _CPT_PMD_LOGS_H_ */
@@ -20,14 +20,12 @@ extern int dpaax_logger;
#define DPAAX_HWWARN(cond, fmt, args...) do { } while (0)
#endif
-#define DPAAX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaax_logger, "dpaax: " fmt "\n", \
- ##args)
+#define DPAAX_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAAX_LOGGER, __VA_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)
+#define DPAAX_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAAX_LOGGER, "%s(): ", __func__, __VA_ARGS__)
#define DPAAX_INFO(fmt, args...) \
DPAAX_LOG(INFO, fmt, ## args)
@@ -10,36 +10,19 @@
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_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- __func__, \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+#define DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IDPF_COMMON, "%s(): ", __func__, __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,8 @@
#include <rte_log.h>
extern int nfp_logtype_common;
-#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_common, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_NFP_COMMON nfp_logtype_common
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NFP_COMMON, "%s(): ", __func__, __VA_ARGS__)
#endif/* __NFP_COMMON_LOG_H__ */
@@ -7,7 +7,7 @@
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)
+#define NITROX_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NITROX, "%s:%d ", __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
#endif /* _NITROX_LOGS_H_ */
@@ -17,9 +17,9 @@
#define RM_INTERFACE_VERSION 0x2
-#define MBOX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, octeontx_logtype_mbox,\
- "%s() line %u: " fmt "\n", __func__, __LINE__, ## args)
+#define MBOX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OCTEONTX_MBOX, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_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)
+#define QAT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, QAT_GEN, "%s(): ", __func__, __VA_ARGS__)
-#define QAT_DP_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, qat_dp_logtype, \
- "%s(): " fmt "\n", __func__, ## args)
+#define QAT_DP_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, QAT_DP, "%s(): ", __func__, __VA_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,9 +9,9 @@
/**< ISA-L comp PMD device name */
extern int isal_logtype_driver;
-#define ISAL_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, isal_logtype_driver, "%s(): "fmt "\n", \
- __func__, ##args)
+#define RTE_LOGTYPE_ISAL_DRIVER isal_logtype_driver
+#define ISAL_PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ISAL_DRIVER, "%s(): ", __func__, __VA_ARGS__)
/* private data structure for each ISA-L compression device */
struct isal_comp_private {
@@ -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: */
@@ -76,10 +77,8 @@ extern int octtx_zip_logtype_driver;
/**< ZIP PMD device name */
#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)
+#define ZIP_PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OCTTX_ZIP_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#define ZIP_PMD_INFO(fmt, args...) \
ZIP_PMD_LOG(INFO, fmt, ## args)
@@ -27,10 +27,10 @@ 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__, \
- ## __VA_ARGS__)
+#define UADK_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, UADK_COMPRESS, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
#endif /* _UADK_COMPRESS_PMD_PRIVATE_H_ */
@@ -15,9 +15,9 @@
#define DEF_MEM_LEVEL 8
extern int zlib_logtype_driver;
-#define ZLIB_PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, zlib_logtype_driver, "%s(): "fmt "\n", \
- __func__, ##args)
+#define RTE_LOGTYPE_ZLIB_DRIVER zlib_logtype_driver
+#define ZLIB_PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ZLIB_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#define ZLIB_PMD_INFO(fmt, args...) \
ZLIB_PMD_LOG(INFO, fmt, ## args)
@@ -11,24 +11,19 @@
/**< 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), \
- __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), \
- __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), \
- __func__, __LINE__, ## args)
+#define ARMV8_CRYPTO_LOG_ERR(...) \
+ RTE_LOG_LINE_PREFIX(ERR, CRYPTO_ARMV8, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
+
+#define ARMV8_CRYPTO_LOG_INFO(...) \
+ RTE_LOG_LINE_PREFIX(INFO, CRYPTO_ARMV8, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
+
+#define ARMV8_CRYPTO_LOG_DBG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, CRYPTO_ARMV8, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
#define NBBY 8 /* Number of bits in a byte */
#define BYTE_LENGTH(x) ((x) / NBBY) /* Number of bytes in x (round down) */
@@ -9,15 +9,15 @@
#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)
+#define BCMFS_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, BCMFS_CONF, "%s(): ", __func__, __VA_ARGS__)
-#define BCMFS_DP_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, bcmfs_dp_logtype, \
- "%s(): " fmt "\n", __func__, ## args)
+#define BCMFS_DP_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, BCMFS_DP, "%s(): ", __func__, __VA_ARGS__)
#define BCMFS_DP_HEXDUMP_LOG(level, title, buf, len) \
bcmfs_hexdump_log(RTE_LOG_ ## level, bcmfs_dp_logtype, title, buf, len)
@@ -10,13 +10,11 @@
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)
+#define CAAM_JR_LOG(level, ...) \
+ RTE_LOG_LINE(level, CAAM_JR, __VA_ARGS__)
-#define CAAM_JR_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, caam_jr_logtype, "caam_jr: %s(): " \
- fmt "\n", __func__, ##args)
+#define CAAM_JR_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, CAAM_JR, "%s(): ", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() CAAM_JR_DEBUG(" >>")
@@ -28,8 +26,8 @@ extern int caam_jr_logtype;
CAAM_JR_LOG(WARNING, fmt, ## args)
/* 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)
+#define CAAM_JR_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, CAAM_JR, __VA_ARGS__)
#define CAAM_JR_DP_DEBUG(fmt, args...) \
CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
@@ -11,18 +11,21 @@
extern int crypto_ccp_logtype;
#define RTE_LOGTYPE_CRYPTO_CCP crypto_ccp_logtype
-#define CCP_LOG_ERR(fmt, args...) \
- RTE_LOG_LINE(ERR, CRYPTO_CCP, "%s() line %u: " fmt, __func__, __LINE__, ## args)
+#define CCP_LOG_ERR(...) \
+ RTE_LOG_LINE_PREFIX(ERR, CRYPTO_CCP, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
#ifdef RTE_LIBRTE_CCP_DEBUG
-#define CCP_LOG_INFO(fmt, args...) \
- RTE_LOG_LINE(INFO, CRYPTO_CCP, "%s() line %u: " fmt, __func__, __LINE__, ## args)
+#define CCP_LOG_INFO(...) \
+ RTE_LOG_LINE_PREFIX(INFO, CRYPTO_CCP, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
-#define CCP_LOG_DBG(fmt, args...) \
- RTE_LOG_LINE(DEBUG, CRYPTO_CCP, "%s() line %u: " fmt, __func__, __LINE__, ## args)
+#define CCP_LOG_DBG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, CRYPTO_CCP, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
#else
-#define CCP_LOG_INFO(fmt, args...)
-#define CCP_LOG_DBG(fmt, args...)
+#define CCP_LOG_INFO(...)
+#define CCP_LOG_DBG(...)
#endif
/**< Maximum queue pairs supported by CCP PMD */
@@ -11,13 +11,11 @@
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)
+#define DPAA2_SEC_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA2_SEC, __VA_ARGS__)
-#define DPAA2_SEC_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_logtype_sec, "dpaa2_sec: %s(): " \
- fmt "\n", __func__, ##args)
+#define DPAA2_SEC_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_SEC, "%s(): ", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() DPAA2_SEC_DEBUG(">>")
@@ -29,8 +27,8 @@ extern int dpaa2_logtype_sec;
DPAA2_SEC_LOG(WARNING, fmt, ## args)
/* 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)
+#define DPAA2_SEC_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, DPAA2_SEC, __VA_ARGS__)
#define DPAA2_SEC_DP_DEBUG(fmt, args...) \
DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)
@@ -11,13 +11,11 @@
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)
+#define DPAA_SEC_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA_SEC, __VA_ARGS__)
-#define DPAA_SEC_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa_logtype_sec, "dpaa_sec: %s(): " \
- fmt "\n", __func__, ##args)
+#define DPAA_SEC_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA_SEC, "%s(): ", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() DPAA_SEC_DEBUG(" >>")
@@ -29,8 +27,8 @@ extern int dpaa_logtype_sec;
DPAA_SEC_LOG(WARNING, fmt, ## args)
/* DP Logs, toggled out at compile time if level lower than current level */
-#define DPAA_SEC_DP_LOG(level, fmt, args...) \
- RTE_LOG_DP_LINE(level, DPAA_SEC, fmt, ## args)
+#define DPAA_SEC_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, DPAA_SEC, __VA_ARGS__)
#define DPAA_SEC_DP_DEBUG(fmt, args...) \
DPAA_SEC_DP_LOG(DEBUG, fmt, ## args)
@@ -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 IPSEC_MB_LOG(level, fmt, ...) \
- rte_log(RTE_LOG_##level, ipsec_mb_logtype_driver, \
- "%s() line %u: " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
+#define RTE_LOGTYPE_IPSEC_MB ipsec_mb_logtype_driver
+#define IPSEC_MB_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IPSEC_MB, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
/** All supported device types */
enum ipsec_mb_pmd_types {
@@ -14,11 +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__, \
- ## __VA_ARGS__)
+#define MRVL_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, MRVL_DRIVER, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
/**
* Handy bits->bytes conversion macro.
@@ -9,11 +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__, \
- ## __VA_ARGS__)
+#define NULL_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NULL_DRIVER, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
/** private data structure for each NULL crypto device */
@@ -23,10 +23,10 @@
/** OPENSSL PMD LOGTYPE DRIVER */
extern int openssl_logtype_driver;
-#define OPENSSL_LOG(level, fmt, ...) \
- rte_log(RTE_LOG_ ## level, openssl_logtype_driver, \
- "%s() line %u: " fmt "\n", __func__, __LINE__, \
- ## __VA_ARGS__)
+#define RTE_LOGTYPE_OPENSSL_DRIVER openssl_logtype_driver
+#define OPENSSL_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OPENSSL_DRIVER, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
/* Maximum length for digest (SHA-512 needs 64 bytes) */
#define DIGEST_LENGTH_MAX 64
@@ -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)
+#define CR_SCHED_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, SCHEDULER_DRIVER, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
struct scheduler_worker {
uint8_t dev_id;
@@ -71,10 +71,10 @@ 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__, \
- ## __VA_ARGS__)
+#define UADK_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, UADK_CRYPTO, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
#endif /* _UADK_CRYPTO_PMD_PRIVATE_H_ */
@@ -8,18 +8,18 @@
#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)
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_INIT, "%s(): ", __func__, __VA_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)
+#define VIRTIO_CRYPTO_INIT_LOG_IMPL(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_INIT, "%s(): ", __func__, __VA_ARGS__)
#define VIRTIO_CRYPTO_INIT_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_INIT_LOG_IMPL(INFO, fmt, ## args)
@@ -31,10 +31,10 @@ 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)
+#define VIRTIO_CRYPTO_SESSION_LOG_IMPL(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_SESSION, "%s(): ", __func__, __VA_ARGS__)
#define VIRTIO_CRYPTO_SESSION_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_SESSION_LOG_IMPL(INFO, fmt, ## args)
@@ -46,10 +46,10 @@ 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)
+#define VIRTIO_CRYPTO_RX_LOG_IMPL(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_RX, "%s(): ", __func__, __VA_ARGS__)
#define VIRTIO_CRYPTO_RX_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_RX_LOG_IMPL(INFO, fmt, ## args)
@@ -61,10 +61,10 @@ 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)
+#define VIRTIO_CRYPTO_TX_LOG_IMPL(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_TX, "%s(): ", __func__, __VA_ARGS__)
#define VIRTIO_CRYPTO_TX_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_TX_LOG_IMPL(INFO, fmt, ## args)
@@ -76,10 +76,10 @@ 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)
+#define VIRTIO_CRYPTO_DRV_LOG_IMPL(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_CRYPTO_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#define VIRTIO_CRYPTO_DRV_LOG_INFO(fmt, args...) \
VIRTIO_CRYPTO_DRV_LOG_IMPL(INFO, fmt, ## args)
@@ -8,13 +8,11 @@
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)
+#define DPAA_QDMA_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA_QDMA, __VA_ARGS__)
-#define DPAA_QDMA_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa_qdma_logtype, "dpaa_qdma: %s(): " \
- fmt "\n", __func__, ## args)
+#define DPAA_QDMA_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA_QDMA, "%s(): ", __func__, __VA_ARGS__)
#define DPAA_QDMA_FUNC_TRACE() DPAA_QDMA_DEBUG(">>")
@@ -26,8 +24,8 @@ extern int dpaa_qdma_logtype;
DPAA_QDMA_LOG(WARNING, fmt, ## args)
/* 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)
+#define DPAA_QDMA_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, DPAA_QDMA, __VA_ARGS__)
#define DPAA_QDMA_DP_DEBUG(fmt, args...) \
DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
@@ -12,13 +12,11 @@ extern "C" {
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)
+#define DPAA2_QDMA_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA2_QDMA, __VA_ARGS__)
-#define DPAA2_QDMA_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_qdma_logtype, "dpaa2_qdma: %s(): " \
- fmt "\n", __func__, ## args)
+#define DPAA2_QDMA_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_QDMA, "%s(): ", __func__, __VA_ARGS__)
#define DPAA2_QDMA_FUNC_TRACE() DPAA2_QDMA_DEBUG(">>")
@@ -30,8 +28,8 @@ extern int dpaa2_qdma_logtype;
DPAA2_QDMA_LOG(WARNING, fmt, ## args)
/* 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)
+#define DPAA2_QDMA_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, DPAA2_QDMA, __VA_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 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, \
- __func__, ##args)
-#define HISI_DMA_DEBUG(hw, fmt, args...) \
- HISI_DMA_LOG_RAW(hw, DEBUG, fmt, ## args)
-#define HISI_DMA_INFO(hw, fmt, args...) \
- HISI_DMA_LOG_RAW(hw, INFO, fmt, ## args)
-#define HISI_DMA_WARN(hw, fmt, args...) \
- HISI_DMA_LOG_RAW(hw, WARNING, fmt, ## args)
-#define HISI_DMA_ERR(hw, fmt, args...) \
- HISI_DMA_LOG_RAW(hw, ERR, fmt, ## args)
+#define RTE_LOGTYPE_HISI_DMA hisi_dma_logtype
+#define HISI_DMA_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HISI_DMA, "%s(): ", __func__, __VA_ARGS__)
+#define HISI_DMA_DEV_LOG(hw, level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HISI_DMA, "%s %s(): ", \
+ (hw)->data->dev_name RTE_LOG_COMMA __func__, __VA_ARGS__)
+#define HISI_DMA_DEBUG(hw, ...) \
+ HISI_DMA_DEV_LOG(hw, DEBUG, __VA_ARGS__)
+#define HISI_DMA_INFO(hw, ...) \
+ HISI_DMA_DEV_LOG(hw, INFO, __VA_ARGS__)
+#define HISI_DMA_WARN(hw, ...) \
+ HISI_DMA_DEV_LOG(hw, WARNING, __VA_ARGS__)
+#define HISI_DMA_ERR(hw, ...) \
+ HISI_DMA_DEV_LOG(hw, ERR, __VA_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, ...) \
+ RTE_LOG_LINE_PREFIX(level, IDXD_PMD, "%s(): ", __func__, __VA_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, ...) \
+ RTE_LOG_LINE_PREFIX(level, IOAT_PMD, "%s(): ", __func__, __VA_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,11 @@ 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_PREFIX(level, ODM, "%s(): %u", __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
/*
* Structure odm_instr_hdr_s for ODM
@@ -21,9 +21,9 @@
#include "skeleton_dmadev.h"
RTE_LOG_REGISTER_DEFAULT(skeldma_logtype, INFO);
-#define SKELDMA_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, skeldma_logtype, "%s(): " fmt "\n", \
- __func__, ##args)
+#define RTE_LOGTYPE_SKELDMA skeldma_logtype
+#define SKELDMA_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, SKELDMA, "%s(): ", __func__, __VA_ARGS__)
static int
skeldma_info_get(const struct rte_dma_dev *dev, struct rte_dma_info *dev_info,
@@ -9,8 +9,8 @@ extern int eventdev_dlb2_log_level;
#define RTE_LOGTYPE_EVENTDEV_DLB2 eventdev_dlb2_log_level
/* Dynamic logging */
-#define DLB2_LOG_IMPL(level, fmt, args...) \
- RTE_LOG(level, EVENTDEV_DLB2, "%s" fmt "\n", __func__, ##args)
+#define DLB2_LOG_IMPL(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, EVENTDEV_DLB2, "%s", __func__, __VA_ARGS__)
#define DLB2_LOG_INFO(fmt, args...) \
DLB2_LOG_IMPL(INFO, fmt, ## args)
@@ -19,7 +19,7 @@ extern int eventdev_dlb2_log_level;
DLB2_LOG_IMPL(ERR, fmt, ## args)
/* remove debug logs at compile time unless actually debugging */
-#define DLB2_LOG_LINE_DBG(fmt, args...) \
- RTE_LOG_DP(DEBUG, EVENTDEV_DLB2, fmt "\n", ## args)
+#define DLB2_LOG_LINE_DBG(...) \
+ RTE_LOG_DP_LINE(DEBUG, EVENTDEV_DLB2, __VA_ARGS__)
#endif /* _DLB2_EVDEV_LOG_H_ */
@@ -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"
@@ -77,9 +77,8 @@ struct dpaa_eventdev {
uint32_t event_dev_cfg;
};
-#define DPAA_EVENTDEV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, dpaa_logtype_eventdev, "%s(): " fmt "\n", \
- __func__, ##args)
+#define DPAA_EVENTDEV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, DPAA_EVENTDEV, "%s(): ", __func__, __VA_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)
+#define DPAA2_EVENTDEV_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA2_EVENT, __VA_ARGS__)
-#define DPAA2_EVENTDEV_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_logtype_event, "dpaa2_event: %s(): " \
- fmt "\n", __func__, ##args)
+#define DPAA2_EVENTDEV_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_EVENT, "%s():", __func__, __VA_ARGS__)
#define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_DEBUG(" >>")
@@ -305,7 +305,7 @@ dsw_pmd_priv(const struct rte_eventdev *eventdev)
extern int event_dsw_logtype;
#define RTE_LOGTYPE_EVENT_DSW event_dsw_logtype
#define DSW_LOG_DP_LINE(level, fmt, args...) \
- RTE_LOG_DP(level, EVENT_DSW, "%s() line %u: " fmt "\n", \
+ RTE_LOG_DP_LINE(level, EVENT_DSW, "%s() line %u: " fmt, \
__func__, __LINE__, ## args)
#define DSW_LOG_DP_PORT_LINE(level, port_id, fmt, args...) \
@@ -19,10 +19,9 @@
#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_STR(EVENTDEV_NAME_OCTEONTX_PMD), __func__, ## args)
+#define SSOVF_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OTX_SSOVF, "[%s] %s() ", \
+ RTE_STR(EVENTDEV_NAME_OCTEONTX_PMD) RTE_LOG_COMMA __func__, __VA_ARGS__)
#define ssovf_log_info(fmt, ...) SSOVF_LOG(INFO, fmt, ##__VA_ARGS__)
#define ssovf_log_dbg(fmt, ...) SSOVF_LOG(DEBUG, fmt, ##__VA_ARGS__)
@@ -171,6 +170,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,
@@ -26,10 +26,9 @@
#include <octeontx_mbox.h>
#include <octeontx_fpavf.h>
-#define timvf_log(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, otx_logtype_timvf, \
- "[%s] %s() " fmt "\n", \
- RTE_STR(event_timer_octeontx), __func__, ## args)
+#define timvf_log(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OTX_TIMVF, "[%s] %s() ", \
+ RTE_STR(event_timer_octeontx) RTE_LOG_COMMA __func__, __VA_ARGS__)
#define timvf_log_info(fmt, ...) timvf_log(INFO, fmt, ##__VA_ARGS__)
#define timvf_log_dbg(fmt, ...) timvf_log(DEBUG, fmt, ##__VA_ARGS__)
@@ -113,6 +112,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 RTE_LOGTYPE_OPDL opdl_logtype_driver
-#define PMD_DRV_LOG_RAW(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, opdl_logtype_driver, "%s(): " fmt, \
- __func__, ## args)
-
-#define PMD_DRV_LOG(level, fmt, args...) \
- PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
-
-
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OPDL, "%s(): ", __func__, __VA_ARGS__)
#endif /* _OPDL_LOGS_H_ */
@@ -9,20 +9,19 @@
#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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, SKELETON_EVENTDEV, "%s(): ", __func__, __VA_ARGS__)
#define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
#else
-#define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
+#define PMD_DRV_LOG(...) do { } while (0)
#define PMD_DRV_FUNC_TRACE() do { } while (0)
#endif
-#define PMD_DRV_ERR(fmt, args...) \
- rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \
- "%s(): " fmt "\n", __func__, ## args)
+#define PMD_DRV_ERR(...) \
+ RTE_LOG_LINE_PREFIX(ERR, SKELETON_EVENTDEV, "%s(): ", __func__, __VA_ARGS__)
struct __rte_cache_aligned skeleton_eventdev {
uintptr_t reg_base;
@@ -6,10 +6,10 @@
#define _SW_EVDEV_LOG_H_
extern int eventdev_sw_log_level;
+#define RTE_LOGTYPE_EVENT_SW eventdev_sw_log_level
-#define SW_LOG_IMPL(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, eventdev_sw_log_level, "%s" fmt "\n", \
- __func__, ##args)
+#define SW_LOG_IMPL(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, EVENT_SW, "%s", __func__, __VA_ARGS__)
#define SW_LOG_INFO(fmt, args...) \
SW_LOG_IMPL(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__, \
@@ -60,9 +60,8 @@ 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)
+#define DPAA_MEMPOOL_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, DPAA_MEMPOOL, "%s(): ", __func__, __VA_ARGS__)
#define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
@@ -8,14 +8,12 @@
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)
+#define DPAA2_MEMPOOL_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA2_MEMPOOL, __VA_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)
+#define DPAA2_MEMPOOL_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_MEMPOOL, "%s(): ", __func__, __VA_ARGS__)
#define DPAA2_MEMPOOL_INFO(fmt, args...) \
DPAA2_MEMPOOL_LOG(INFO, fmt, ## args)
@@ -7,9 +7,9 @@
#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)
+#define FPAVF_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OCTEONTX_FPAVF, "%s() line %u: ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_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,14 @@ 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)
+#define PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, AFPACKET, "%s(): ", __func__, __VA_ARGS__)
-#define PMD_LOG_ERRNO(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, af_packet_logtype, \
- "%s(): " fmt ":%s\n", __func__, ##args, strerror(errno))
+#define PMD_LOG_ERRNO(level, fmt, ...) \
+ RTE_LOG_LINE(level, AFPACKET, "%s(): " fmt ":%s", __func__, \
+ ## __VA_ARGS__, strerror(errno))
static uint16_t
eth_af_packet_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -65,8 +65,8 @@
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)
+#define AF_XDP_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NET_AF_XDP, "%s(): ", __func__, __VA_ARGS__)
#define ETH_AF_XDP_FRAME_SIZE 2048
#define ETH_AF_XDP_NUM_BUFFERS 4096
@@ -7,26 +7,22 @@
#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)
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ATL_INIT, "%s(): ", __func__, __VA_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)
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_DP_LINE_PREFIX(level, ATL_DRIVER, "%s(): ", __func__, __VA_ARGS__)
-#define PMD_TX_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_DP_LINE_PREFIX(level, ATL_DRIVER, "%s(): ", __func__, __VA_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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ATL_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif
@@ -8,15 +8,15 @@
#include <rte_log.h>
#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__)
+#define PMD_RX_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, AVP_DRIVER, "%s() rx: ", __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__)
+#define PMD_TX_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, AVP_DRIVER, "%s() tx: ", __func__, __VA_ARGS__)
#else
#define PMD_TX_LOG_LINE(...) do { } while (0)
#endif
@@ -24,7 +24,7 @@
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__)
+#define PMD_DRV_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, AVP_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif /* _AVP_LOGS_H_ */
@@ -8,9 +8,9 @@
#include <stdio.h>
extern int axgbe_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, axgbe_logtype_init, "%s(): " fmt "\n", \
- __func__, ##args)
+#define RTE_LOGTYPE_AXGBE_INIT axgbe_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, AXGBE_INIT, "%s(): ", __func__, __VA_ARGS__)
#ifdef RTE_LIBRTE_AXGBE_PMD_DEBUG
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
@@ -20,7 +20,7 @@ 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__)
+#define PMD_DRV_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, AXGBE_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif /* _AXGBE_LOGS_H_ */
@@ -9,44 +9,40 @@
#define _PMD_LOGS_H_
extern int 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)
+#define RTE_LOGTYPE_BNX2X_INIT bnx2x_logtype_init
+#define PMD_INIT_LOG(level, sc, ...) \
+ RTE_LOG_LINE_PREFIX(level, BNX2X_INIT, "[%s] %s() ", \
+ (sc)->devinfo.name RTE_LOG_COMMA __func__, __VA_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, \
- "[%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)
+#define RTE_LOGTYPE_BNX2X_DRIVER bnx2x_logtype_driver
+#define PMD_DRV_LOG(level, sc, ...) \
+ RTE_LOG_LINE_PREFIX(level, BNX2X_DRIVER, "[%s:%d(%s)] ", \
+ __func__ RTE_LOG_COMMA __LINE__ RTE_LOG_COMMA \
+ (sc)->devinfo.name ? (sc)->devinfo.name : "", __VA_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)
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, BNX2X_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_RX_LOG(...) 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)
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, BNX2X_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_LOG(...) 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__, \
- (sc)->devinfo.name ? (sc)->devinfo.name : "", ## args)
+#define PMD_DEBUG_PERIODIC_LOG(level, sc, ...) \
+ RTE_LOG_LINE_PREFIX(level, BNX2X_DRIVER, "%s(%s): ", \
+ __func__ RTE_LOG_COMMA (sc)->devinfo.name ? (sc)->devinfo.name : "", __VA_ARGS__)
#else
-#define PMD_DEBUG_PERIODIC_LOG(level, sc, fmt, args...) do { } while (0)
+#define PMD_DEBUG_PERIODIC_LOG(...) do { } while (0)
#endif
#endif /* _PMD_LOGS_H_ */
@@ -1207,8 +1207,8 @@ 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__)
+#define PMD_DRV_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, BNXT, "%s(): ", __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);
@@ -34,10 +34,10 @@
#define PMD_BOND_XMIT_POLICY_LAYER34_KVARG ("l34")
extern int bond_logtype;
+#define RTE_LOGTYPE_BOND bond_logtype
-#define RTE_BOND_LOG(lvl, msg, ...) \
- rte_log(RTE_LOG_ ## lvl, bond_logtype, \
- "%s(%d) - " msg "\n", __func__, __LINE__, ##__VA_ARGS__)
+#define RTE_BOND_LOG(lvl, ...) \
+ RTE_LOG_LINE_PREFIX(lvl, BOND, "%s(%d) - ", __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
#define BONDING_MODE_INVALID 0xFF
@@ -16,11 +16,10 @@
static void bond_mode_8023ad_ext_periodic_cb(void *arg);
#ifdef RTE_LIBRTE_BOND_DEBUG_8023AD
-#define MODE4_DEBUG_LOG(fmt, ...) \
- rte_log(RTE_LOG_DEBUG, bond_logtype, \
- "%6u [Port %u: %s] " fmt "\n", \
- bond_dbg_get_time_diff_ms(), member_id, \
- __func__, ##__VA_ARGS__)
+#define MODE4_DEBUG_LOG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, BOND, "%6u [Port %u: %s] ", \
+ bond_dbg_get_time_diff_ms() RTE_LOG_COMMA member_id RTE_LOG_COMMA __func__, \
+ __VA_ARGS__)
static uint64_t start_time;
@@ -491,9 +491,9 @@ update_client_stats(uint32_t addr, uint16_t port, uint32_t *TXorRXindicator)
#ifdef RTE_LIBRTE_BOND_DEBUG_ALB
#define MODE6_DEBUG(info, src_ip, dst_ip, eth_h, arp_op, port, burstnumber) \
- rte_log(RTE_LOG_DEBUG, bond_logtype, \
+ RTE_LOG_LINE(DEBUG, BOND, \
"%s port:%d SrcMAC:" RTE_ETHER_ADDR_PRT_FMT " SrcIP:%s " \
- "DstMAC:" RTE_ETHER_ADDR_PRT_FMT " DstIP:%s %s %d\n", \
+ "DstMAC:" RTE_ETHER_ADDR_PRT_FMT " DstIP:%s %s %d", \
info, \
port, \
RTE_ETHER_ADDR_BYTES(ð_h->src_addr), \
@@ -8,22 +8,14 @@
#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_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- __func__, \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+ RTE_LOG_LINE_PREFIX(level, CPFL_INIT, "%s(): ", __func__, __VA_ARGS__)
#define PMD_DRV_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, \
- cpfl_logtype_driver, \
- RTE_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- __func__, \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+ RTE_LOG_LINE_PREFIX(level, CPFL_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif /* _CPFL_LOGS_H_ */
@@ -216,9 +216,8 @@ dpaa_rx_cb_atomic(void *event,
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", \
- __func__, ##args)
+#define DPAA_PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, DPAA_PMD, "%s(): ", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() DPAA_PMD_LOG(DEBUG, " >>")
@@ -232,7 +231,7 @@ extern int dpaa_logtype_pmd;
DPAA_PMD_LOG(WARNING, fmt, ## args)
/* 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)
+#define DPAA_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, DPAA_PMD, __VA_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)
+#define DPAA2_PMD_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA2_NET, __VA_ARGS__)
-#define DPAA2_PMD_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_logtype_pmd, "dpaa2_net: %s(): "\
- fmt "\n", __func__, ##args)
+#define DPAA2_PMD_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_NET, "%s(): ", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() DPAA2_PMD_DEBUG(">>")
@@ -28,8 +26,8 @@ extern int dpaa2_logtype_pmd;
DPAA2_PMD_LOG(WARNING, fmt, ## args)
/* 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)
+#define DPAA2_PMD_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, DPAA2_NET, __VA_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,35 +8,35 @@
#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)
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, E1000_INIT, "%s(): ", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
#ifdef RTE_ETHDEV_DEBUG_RX
extern int e1000_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, e1000_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_E1000_RX e1000_logtype_rx
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, E1000_RX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int e1000_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, e1000_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_E1000_TX e1000_logtype_tx
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, E1000_TX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, E1000_DRIVER, "%s(): ", __func__, __VA_ARGS__)
/* log init function shared by e1000 and igb drivers */
void e1000_igb_init_log(void);
@@ -8,14 +8,14 @@
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__)
+#define PMD_INIT_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ENA_INIT, "%s(): ", __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__)
+#define PMD_RX_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ENA_RX, "%s(): ", __func__, __VA_ARGS__)
#else
#define PMD_RX_LOG_LINE(...) do { } while (0)
#endif
@@ -23,15 +23,15 @@ extern int ena_logtype_rx;
#ifdef RTE_ETHDEV_DEBUG_TX
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__)
+#define PMD_TX_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ENA_TX, "%s(): ", __func__, __VA_ARGS__)
#else
#define PMD_TX_LOG_LINE(...) do { } while (0)
#endif
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__)
+#define PMD_DRV_LOG_LINE(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ENA_DRIVER, "%s(): ", __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)
+#define ENETC_PMD_LOG(level, ...) \
+ RTE_LOG_LINE(level, ENETC_NET, __VA_ARGS__)
-#define ENETC_PMD_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, enetc_logtype_pmd, "enetc_net: %s(): "\
- fmt "\n", __func__, ##args)
+#define ENETC_PMD_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, ENETC_NET, "%s(): ", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() ENETC_PMD_DEBUG(">>")
@@ -30,8 +28,8 @@ extern int enetc_logtype_pmd;
ENETC_PMD_LOG(WARNING, fmt, ## args)
/* 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)
+#define ENETC_PMD_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, ENETC_NET, __VA_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)
+#define ENETFEC_PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ENETFEC_NET, "%s()", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() ENET_PMD_LOG(DEBUG, " >>")
@@ -28,7 +27,7 @@ extern int enetfec_logtype_pmd;
ENETFEC_PMD_LOG(WARNING, fmt, ## args)
/* 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)
+#define ENETFEC_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, ENETFEC_NET, __VA_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, \
@@ -36,9 +37,8 @@ extern int enic_pmd_logtype;
#define dev_warning(x, args...) dev_printk(WARNING, args)
#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)
+#define ENICPMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ENIC_PMD, "%s ", __func__, __VA_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,33 +8,33 @@
#include <rte_log.h>
extern int fm10k_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, fm10k_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_FM10K_INIT fm10k_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, FM10K_INIT, "%s(): ", __func__, __VA_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, ...) \
+ RTE_LOG_LINE_PREFIX(level, FM10K_RX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) 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, ...) \
+ RTE_LOG_LINE_PREFIX(level, FM10K_TX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, FM10K_DRIVER, "%s(): ", __func__, __VA_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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, GVE_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif
@@ -80,14 +80,11 @@ typedef uint64_t dma_addr_t;
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
-/* Reported driver name. */
-#define HINIC_DRIVER_NAME "net_hinic"
-
extern int hinic_logtype;
+#define RTE_LOGTYPE_NET_HINIC hinic_logtype
-#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hinic_logtype, \
- HINIC_DRIVER_NAME": " fmt "\n", ##args)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE(level, NET_HINIC, __VA_ARGS__)
/* common definition */
#ifndef ETH_ALEN
@@ -6,47 +6,50 @@
#define HNS3_LOGS_H
extern int hns3_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hns3_logtype_init, "%s(): " fmt "\n", \
- __func__, ##args)
+#define RTE_LOGTYPE_HNS3_INIT hns3_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HNS3_INIT, "%s(): ", __func__, __VA_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, \
- (hw)->data->name, __func__, ## args)
+#define RTE_LOGTYPE_HNS3_DRIVER hns3_logtype_driver
+#define PMD_DRV_LOG(hw, level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HNS3_DRIVER, "%s %s(): ", \
+ (hw)->data->name RTE_LOG_COMMA __func__, __VA_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 PMD_RX_LOG(hw, level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hns3_logtype_rx, "%s %s(): " fmt "\n", \
- (hw)->data->name, __func__, ## args)
+#define RTE_LOGTYPE_HNS3_RX hns3_logtype_rx
+#define PMD_RX_LOG(hw, level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HNS3_RX, "%s %s(): ", \
+ (hw)->data->name RTE_LOG_COMMA __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(hw, level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int hns3_logtype_tx;
-#define PMD_TX_LOG(hw, level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hns3_logtype_tx, "%s %s(): " fmt "\n", \
- (hw)->data->name, __func__, ## args)
+#define RTE_LOGTYPE_HNS3_TX hns3_logtype_tx
+#define PMD_TX_LOG(hw, level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HNS3_TX, "%s %s(): ", \
+ (hw)->data->name RTE_LOG_COMMA __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(hw, level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
#endif /* HNS3_LOGS_H */
@@ -6,32 +6,32 @@
#define _I40E_LOGS_H_
extern int i40e_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, i40e_logtype_init, "%s(): " fmt "\n", \
- __func__, ##args)
+#define RTE_LOGTYPE_I40E_INIT i40e_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, I40E_INIT, "%s(): ", __func__, __VA_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, ...) \
+ RTE_LOG_LINE_PREFIX(level, I40E_RX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) 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, ...) \
+ RTE_LOG_LINE_PREFIX(level, I40E_TX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, I40E_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif /* _I40E_LOGS_H_ */
@@ -6,37 +6,34 @@
#define _IAVF_LOG_H_
extern int iavf_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, iavf_logtype_init, "%s(): " fmt "\n", \
- __func__, ## args)
+#define RTE_LOGTYPE_IAVF_INIT iavf_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IAVF_INIT, "%s(): ", __func__, __VA_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 PMD_DRV_LOG(level, fmt, args...) \
- PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+#define RTE_LOGTYPE_IAVF_DRIVER iavf_logtype_driver
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IAVF_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
#ifdef RTE_ETHDEV_DEBUG_RX
extern int iavf_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, iavf_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_IAVF_RX iavf_logtype_rx
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IAVF_RX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int iavf_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, iavf_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_IAVF_TX iavf_logtype_tx
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IAVF_TX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
#endif /* _IAVF_LOG_H_ */
@@ -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)
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ICE_INIT, "%s(): ", __func__, __VA_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, ...) \
+ RTE_LOG_LINE_PREFIX(level, ICE_RX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) 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, ...) \
+ RTE_LOG_LINE_PREFIX(level, ICE_TX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
-#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, ICE_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ICE_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif /* _ICE_LOGS_H_ */
@@ -8,25 +8,14 @@
#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_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- __func__, \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+ RTE_LOG_LINE_PREFIX(level, IDPF_INIT, "%s(): ", __func__, __VA_ARGS__)
-#define PMD_DRV_LOG_RAW(level, ...) \
- rte_log(RTE_LOG_ ## level, \
- idpf_logtype_driver, \
- RTE_FMT("%s(): " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- __func__, \
- RTE_FMT_TAIL(__VA_ARGS__,)))
-
-#define PMD_DRV_LOG(level, fmt, args...) \
- PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IDPF_DRIVER, "%s(): ", __func__, __VA_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)
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IGC_INIT, "%s(): ", __func__, __VA_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)
+#define PMD_RX_LOG(...) 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)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
-#define PMD_DRV_LOG(level, fmt, args...) \
- RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IGC_DRIVER, "%s(): ", __func__, __VA_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)
+#define IPN3KE_AFU_PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IPN3KE_AFU, "%s(): ", __func__, __VA_ARGS__)
#define IPN3KE_AFU_PMD_FUNC_TRACE() IPN3KE_AFU_PMD_LOG(DEBUG, ">>")
@@ -6,33 +6,33 @@
#define _IXGBE_LOGS_H_
extern int ixgbe_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ixgbe_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_IXGBE_INIT ixgbe_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IXGBE_INIT, "%s(): ", __func__, __VA_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, ...) \
+ RTE_LOG_LINE_PREFIX(level, IXGBE_RX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) 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, ...) \
+ RTE_LOG_LINE_PREFIX(level, IXGBE_TX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IXGBE_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif /* _IXGBE_LOGS_H_ */
@@ -466,17 +466,16 @@ 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", \
- __func__, ## args)
+#define DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, MANA_DRIVER, "%s(): ", __func__, __VA_ARGS__)
-#define DP_LOG(level, fmt, args...) \
- RTE_LOG_DP(level, MANA_DRIVER, fmt "\n", ## args)
+#define DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, MANA_DRIVER, __VA_ARGS__)
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
- __func__, ## args)
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, MANA_INIT, "%s(): ", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
@@ -28,10 +28,10 @@
#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)
+#define MIF_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, MEMIF, "%s(): ", __func__, __VA_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,12 +47,9 @@ 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", \
- pmd_drv_log_basename(__FILE__), \
- __LINE__, \
- __func__, \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+ RTE_LOG_LINE_PREFIX(level, MLX4, "%s:%u: %s(): ", \
+ pmd_drv_log_basename(__FILE__) RTE_LOG_COMMA __LINE__ RTE_LOG_COMMA __func__, \
+ __VA_ARGS__)
#define MLX4_ASSERT(exp) RTE_VERIFY(exp)
#define claim_zero(...) MLX4_ASSERT((__VA_ARGS__) == 0)
@@ -63,10 +61,7 @@ pmd_drv_log_basename(const char *s)
*/
#define PMD_DRV_LOG(level, ...) \
- rte_log(RTE_LOG_ ## level, mlx4_logtype, \
- RTE_FMT(MLX4_DRIVER_NAME ": " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+ RTE_LOG_LINE(level, MLX4, MLX4_DRIVER_NAME ": " __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)
+#define MVNETA_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, MVNETA, "%s(): ", __func__, __VA_ARGS__)
#endif /* _MVNETA_ETHDEV_H_ */
@@ -200,10 +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", \
- __func__, ##args)
+#define MRVL_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, MRVL, "%s(): ", __func__, __VA_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)
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HN_INIT, "%s(): ", __func__, __VA_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)
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HN_DRIVER, "%s() rx: ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) 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)
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HN_DRIVER, "%s() tx: ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
-#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, hn_logtype_driver, "%s(): " fmt "\n", \
- __func__, ## args)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, HN_DRIVER, "%s(): ", __func__, __VA_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 NFB_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfb_logtype, "%s(): " fmt "\n", \
- __func__, ## args)
+#define RTE_LOGTYPE_NFB nfb_logtype
+#define NFB_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NFB, "%s(): ", __func__, __VA_ARGS__)
#include "nfb_rx.h"
#include "nfb_tx.h"
@@ -9,36 +9,36 @@
#include <rte_log.h>
extern int nfp_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_init, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_NFP_INIT nfp_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NFP_INIT, "%s(): ", __func__, __VA_ARGS__)
#ifdef RTE_ETHDEV_DEBUG_RX
extern int nfp_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_rx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_NFP_RX nfp_logtype_rx
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NFP_RX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int nfp_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_tx, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_NFP_TX nfp_logtype_tx
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NFP_TX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
extern int nfp_logtype_cpp;
-#define PMD_CPP_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_cpp, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_NFP_CPP nfp_logtype_cpp
+#define PMD_CPP_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NFP_CPP, "%s(): ", __func__, __VA_ARGS__)
extern int nfp_logtype_driver;
-#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nfp_logtype_driver, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_NFP_DRIVER nfp_logtype_driver
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NFP_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif /* __NFP_LOGS_H__ */
@@ -10,31 +10,31 @@
* PMD_USER_LOG: for user
*/
extern int ngbe_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ngbe_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_NGBE_INIT ngbe_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NGBE_INIT, "%s(): ", __func__, __VA_ARGS__)
extern int ngbe_logtype_driver;
-#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ngbe_logtype_driver, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_NGBE_DRIVER ngbe_logtype_driver
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NGBE_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#ifdef RTE_ETHDEV_DEBUG_RX
extern int ngbe_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ngbe_logtype_rx, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_NGBE_RX ngbe_logtype_rx
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NGBE_RX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int ngbe_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ngbe_logtype_tx, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_NGBE_TX ngbe_logtype_tx
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NGBE_TX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
#define DEBUGOUT(fmt, args...) PMD_DRV_LOG(DEBUG, fmt, ##args)
@@ -76,10 +76,10 @@ 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)
+#define PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ETH_NULL, "%s(): ", __func__, __VA_ARGS__)
static uint16_t
eth_null_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
@@ -67,20 +67,17 @@
#define OTX_EP_MAX_IOQS_PER_VF 8
#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", \
- __func__, __LINE__, ##args)
-
-#define otx_ep_err(fmt, args...) \
- rte_log(RTE_LOG_ERR, otx_net_ep_logtype, \
- "%s():%u " fmt "\n", \
- __func__, __LINE__, ##args)
-
-#define otx_ep_dbg(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, otx_net_ep_logtype, \
- "%s():%u " fmt "\n", \
- __func__, __LINE__, ##args)
+#define otx_ep_info(...) \
+ RTE_LOG_LINE_PREFIX(INFO, OTX_NET_EP, "%s():%u ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
+
+#define otx_ep_err(...) \
+ RTE_LOG_LINE_PREFIX(ERR, OTX_NET_EP, "%s():%u ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
+
+#define otx_ep_dbg(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, OTX_NET_EP, "%s():%u ", \
+ __func__ RTE_LOG_COMMA __LINE__, __VA_ARGS__)
/* IO Access */
#define oct_ep_read64(addr) rte_read64_relaxed((void *)(addr))
@@ -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++;
@@ -5,22 +5,19 @@
#ifndef __OCTEONTX_LOGS_H__
#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)
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OTX_NET_INIT, "%s(): ", __func__, __VA_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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OTX_NET_DRIVER, "%s(): ", __func__, __VA_ARGS__)
-#define PMD_MBOX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \
- "%s(): " fmt "\n", __func__, ## args)
+#define PMD_MBOX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, OTX_NET_MBOX, "%s(): ", __func__, __VA_ARGS__)
-#define octeontx_log_info(fmt, args...) \
- RTE_LOG(INFO, OTX_NET_DRIVER, fmt "\n", ## args)
+#define octeontx_log_info(...) \
+ RTE_LOG_LINE(INFO, OTX_NET_DRIVER, __VA_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 +27,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__*/
@@ -7,10 +7,10 @@
#include <rte_ether.h>
-#define PMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, eth_pcap_logtype, \
- "%s(): " fmt "\n", __func__, ##args)
+#define PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ETH_PCAP, "%s(): ", __func__, __VA_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)
+#define PFE_PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, PFE_NET, "%s()", __func__, __VA_ARGS__)
#define PMD_INIT_FUNC_TRACE() PFE_PMD_LOG(DEBUG, " >>")
@@ -26,7 +25,7 @@ extern int pfe_logtype_pmd;
PFE_PMD_LOG(WARNING, fmt, ## args)
/* 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)
+#define PFE_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, PFE_NET, __VA_ARGS__)
#endif /* _PFE_LOGS_H_ */
@@ -68,10 +68,10 @@ 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)
+#define PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, ETH_RING, "%s(): ", __func__, __VA_ARGS__)
static uint16_t
eth_ring_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
@@ -51,10 +51,10 @@ 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)
+#define PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, PMD_SOFTNIC, "%s(): ", __func__, __VA_ARGS__)
static int
pmd_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
@@ -4,7 +4,7 @@
*/
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", \
- __func__, ## args)
+#define TAP_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, TAP, "%s(): ", __func__, __VA_ARGS__)
@@ -19,26 +19,26 @@
#define NICVF_TX_ASSERT(x) do { } while (0)
#endif
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, nicvf_logtype_init, \
- "%s(): " fmt "\n", __func__, ## args)
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NICVF_INIT, "%s(): ", __func__, __VA_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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NICVF_DRIVER, "%s(): ", __func__, __VA_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)
+#define PMD_MBOX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NICVF_MBOX, "%s(): ", __func__, __VA_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,40 +12,41 @@
* PMD_USER_LOG: for user
*/
extern int txgbe_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_TXGBE_INIT txgbe_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, TXGBE_INIT, "%s(): ", __func__, __VA_ARGS__)
extern int txgbe_logtype_driver;
-#define PMD_DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_driver, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_TXGBE_DRIVER txgbe_logtype_driver
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, TXGBE_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#ifdef RTE_LIBRTE_TXGBE_DEBUG_RX
extern int txgbe_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_rx, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_TXGBE_RX txgbe_logtype_rx
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, TXGBE_RX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_RX_LOG(...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_TXGBE_DEBUG_TX
extern int txgbe_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_tx, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_TXGBE_TX txgbe_logtype_tx
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, TXGBE_TX, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_LOG(...) do { } while (0)
#endif
#ifdef RTE_LIBRTE_TXGBE_DEBUG_TX_FREE
extern int txgbe_logtype_tx_free;
-#define PMD_TX_FREE_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, txgbe_logtype_tx_free, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_TXGBE_TX_FREE txgbe_logtype_tx_free
+#define RTE_LOGTYPE_TXGBE_TX txgbe_logtype_tx
+#define PMD_TX_FREE_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, TXGBE_TX_FREE, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
+#define PMD_TX_FREE_LOG(...) do { } while (0)
#endif
#define DEBUGOUT(fmt, args...) PMD_DRV_LOG(DEBUG, fmt, ##args)
@@ -49,13 +49,10 @@
#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_FMT(VDEV_NETVSC_DRIVER_NAME ": " \
- RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
- RTE_FMT_TAIL(__VA_ARGS__,)))
+ RTE_LOG_LINE(level, VDEV_NETVSC, __VA_ARGS__)
/** Context structure for a vdev_netvsc instance. */
struct vdev_netvsc_ctx {
@@ -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,30 +8,29 @@
#include <rte_log.h>
extern int virtio_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, virtio_logtype_init, \
- "%s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_VIRTIO_INIT virtio_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_INIT, "%s(): ", __func__, __VA_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)
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_DRIVER, "%s() rx: ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_RX_LOG(...) 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)
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_DRIVER, "%s() tx: ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_LOG(...) do { } while(0)
#endif
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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VIRTIO_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#endif /* _VIRTIO_LOGS_H_ */
@@ -6,36 +6,35 @@
#define _VMXNET3_LOGS_H_
extern int vmxnet3_logtype_init;
-#define PMD_INIT_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, vmxnet3_logtype_init, \
- "%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_VMXNET3_INIT vmxnet3_logtype_init
+#define PMD_INIT_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VMXNET3_INIT, "%s(): ", __func__, __VA_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)
+#define PMD_RX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VMXNET3_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_RX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_RX_LOG(...) 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)
+#define PMD_TX_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VMXNET3_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_LOG(...) 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)
+#define PMD_TX_FREE_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VMXNET3_DRIVER, "%s(): ", __func__, __VA_ARGS__)
#else
-#define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
+#define PMD_TX_FREE_LOG(...) do { } while(0)
#endif
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)
+#define PMD_DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, VMXNET3_DRIVER, "%s(): ", __func__, __VA_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)
+#define CNXK_BPHY_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, CNXK_BPHY, "%s(): ", __func__, __VA_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)
+#define CNXK_GPIO_LOG(level, ...) \
+ RTE_LOG_LINE(level, CNXK_GPIO, __VA_ARGS__)
struct cnxk_gpiochip;
@@ -12,13 +12,11 @@ extern "C" {
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)
+#define DPAA2_CMDIF_LOG(level, ...) \
+ RTE_LOG_LINE(level, DPAA2_CMDIF, __VA_ARGS__)
-#define DPAA2_CMDIF_DEBUG(fmt, args...) \
- rte_log(RTE_LOG_DEBUG, dpaa2_cmdif_logtype, "dpaa2_cmdif: %s(): " \
- fmt "\n", __func__, ## args)
+#define DPAA2_CMDIF_DEBUG(...) \
+ RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_CMDIF, "%s(): ", __func__, __VA_ARGS__)
#define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_DEBUG(">>")
@@ -30,8 +28,8 @@ extern int dpaa2_cmdif_logtype;
DPAA2_CMDIF_LOG(WARNING, fmt, ## args)
/* 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)
+#define DPAA2_CMDIF_DP_LOG(level, ...) \
+ RTE_LOG_DP_LINE(level, DPAA2_CMDIF, __VA_ARGS__)
#define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \
DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args)
@@ -6,12 +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", \
- __func__, ##args)
+#define IFPGA_RAWDEV_PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IFPGA_RAWDEV, "%s(): ", __func__, __VA_ARGS__)
#define IFPGA_RAWDEV_PMD_FUNC_TRACE() IFPGA_RAWDEV_PMD_LOG(DEBUG, ">>")
@@ -8,10 +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", \
- __func__, ##args)
+#define NTB_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NTB, "%s(): ", __func__, __VA_ARGS__)
/* Vendor ID */
#define NTB_INTEL_VENDOR_ID 0x8086
@@ -8,10 +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", \
- __func__, ##args)
+#define SKELETON_PMD_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, SKELETON_PMD, "%s(): ", __func__, __VA_ARGS__)
#define SKELETON_PMD_FUNC_TRACE() SKELETON_PMD_LOG(DEBUG, ">>")
@@ -18,9 +18,8 @@
#define TEST_DEV_NAME "rawdev_skeleton"
-#define SKELDEV_LOGS(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, skeleton_pmd_logtype, fmt "\n", \
- ##args)
+#define SKELDEV_LOGS(level, ...) \
+ RTE_LOG_LINE(level, SKELETON_PMD, __VA_ARGS__)
#define SKELDEV_TEST_INFO(fmt, args...) \
SKELDEV_LOGS(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,9 @@
#define MIN(v1, v2) ((v1) < (v2) ? (v1) : (v2))
RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
-#define DRV_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
- "IFCVF %s(): " fmt "\n", __func__, ##args)
+#define RTE_LOGTYPE_IFCVF_VDPA ifcvf_vdpa_logtype
+#define DRV_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, IFCVF_VDPA, "%s(): ", __func__, __VA_ARGS__)
#define IFCVF_USED_RING_LEN(size) \
((size) * sizeof(struct vring_used_elem) + sizeof(uint16_t) * 3)
@@ -9,13 +9,13 @@
#include <rte_log.h>
extern int 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)
+#define RTE_LOGTYPE_NFP_VDPA nfp_logtype_vdpa
+#define DRV_VDPA_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NFP_VDPA, "%s(): ", __func__, __VA_ARGS__)
extern int 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)
+#define RTE_LOGTYPE_NFP_CORE nfp_logtype_core
+#define DRV_CORE_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, NFP_CORE, "%s(): ", __func__, __VA_ARGS__)
#endif /* __NFP_VDPA_LOG_H__ */