Skip to content

Commit

Permalink
drivers: convert to RTE_LOG
Browse files Browse the repository at this point in the history
Signed-off-by: David Marchand <[email protected]>
  • Loading branch information
david-marchand committed Dec 13, 2023
1 parent 86911b8 commit 7c678cc
Show file tree
Hide file tree
Showing 127 changed files with 419 additions and 247 deletions.
3 changes: 2 additions & 1 deletion drivers/baseband/acc/acc_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +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", \
RTE_LOG(level, ACC_COMMON, fmt "\n", \
##__VA_ARGS__)

/* ACC100 DMA Descriptor triplet */
Expand Down
3 changes: 2 additions & 1 deletion drivers/baseband/acc/rte_acc100_pmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
#define LOGTYPE_LEVEL INFO
#endif
RTE_LOG_REGISTER_SUFFIX(acc100_logtype, acc100, LOGTYPE_LEVEL);
#define RTE_LOGTYPE_ACC100 acc100_logtype

/* Helper macro for logging */
#define rte_bbdev_log(level, fmt, ...) \
rte_log(RTE_LOG_ ## level, acc100_logtype, fmt "\n", ##__VA_ARGS__)
RTE_LOG(level, ACC100, fmt "\n", ##__VA_ARGS__)

#ifdef RTE_LIBRTE_BBDEV_DEBUG
#define rte_bbdev_log_debug(fmt, ...) \
Expand Down
3 changes: 2 additions & 1 deletion drivers/baseband/acc/rte_vrb_pmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
#define LOGTYPE_LEVEL INFO
#endif
RTE_LOG_REGISTER_SUFFIX(vrb_logtype, vrb, LOGTYPE_LEVEL);
#define RTE_LOGTYPE_VRB vrb_logtype

/* Helper macro for logging */
#define rte_bbdev_log(level, fmt, ...) \
rte_log(RTE_LOG_ ## level, vrb_logtype, fmt "\n", ##__VA_ARGS__)
RTE_LOG(level, VRB, fmt "\n", ##__VA_ARGS__)

#ifdef RTE_LIBRTE_BBDEV_DEBUG
#define rte_bbdev_log_debug(fmt, ...) \
Expand Down
2 changes: 1 addition & 1 deletion drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/* Helper macro for logging */
#define rte_bbdev_log(level, fmt, ...) \
rte_log(RTE_LOG_ ## level, fpga_5gnr_fec_logtype, fmt "\n", \
RTE_LOG(level, FPGA_5GNR_FEC, fmt "\n", \
##__VA_ARGS__)

#ifdef RTE_LIBRTE_BBDEV_DEBUG
Expand Down
1 change: 1 addition & 0 deletions drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define LOGTYPE_LEVEL INFO
#endif
RTE_LOG_REGISTER_DEFAULT(fpga_5gnr_fec_logtype, LOGTYPE_LEVEL);
#define RTE_LOGTYPE_FPGA_5GNR_FEC fpga_5gnr_fec_logtype

#ifdef RTE_LIBRTE_BBDEV_DEBUG

Expand Down
3 changes: 2 additions & 1 deletion drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
#define LOGTYPE_LEVEL INFO
#endif
RTE_LOG_REGISTER_DEFAULT(fpga_lte_fec_logtype, LOGTYPE_LEVEL);
#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", \
RTE_LOG(level, FPGA_LTE_FEC, fmt "\n", \
##__VA_ARGS__)

#ifdef RTE_LIBRTE_BBDEV_DEBUG
Expand Down
3 changes: 2 additions & 1 deletion drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
#define _BBDEV_LA12XX_PMD_LOGS_H_

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", \
RTE_LOG(level, BBDEV_LA12XX, fmt "\n", \
##__VA_ARGS__)

#ifdef RTE_LIBRTE_BBDEV_DEBUG
Expand Down
3 changes: 2 additions & 1 deletion drivers/baseband/null/bbdev_null.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
RTE_LOG(level, BBDEV_NULL, fmt "\n", ##__VA_ARGS__)

#define rte_bbdev_log_debug(fmt, ...) \
rte_bbdev_log(DEBUG, RTE_STR(__LINE__) ":%s() " fmt, __func__, \
Expand Down
3 changes: 2 additions & 1 deletion drivers/baseband/turbo_sw/bbdev_turbo_software.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +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", \
RTE_LOG(level, BBDEV_TURBO_SW, fmt "\n", \
##__VA_ARGS__)

#define rte_bbdev_log_debug(fmt, ...) \
Expand Down
3 changes: 2 additions & 1 deletion drivers/bus/auxiliary/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +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_LOG(level, AUXILIARY_BUS, \
RTE_FMT("auxiliary bus: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
RTE_FMT_TAIL(__VA_ARGS__,)))

Expand Down
5 changes: 3 additions & 2 deletions drivers/bus/cdx/cdx_logs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#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", \
RTE_LOG(level, CDX_BUS, "cdx: " fmt "\n", \
##args)

/* Debug logs with Function names */
#define CDX_BUS_DEBUG(fmt, args...) \
rte_log(RTE_LOG_DEBUG, cdx_logtype_bus, "cdx: %s(): " fmt "\n", \
RTE_LOG(DEBUG, CDX_BUS, "cdx: %s(): " fmt "\n", \
__func__, ##args)

#define CDX_BUS_INFO(fmt, args...) \
Expand Down
5 changes: 3 additions & 2 deletions drivers/bus/dpaa/rte_dpaa_logs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
#include <rte_log.h>

extern int dpaa_logtype_bus;
#define RTE_LOGTYPE_DPAA_BUS dpaa_logtype_bus

#define DPAA_BUS_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "dpaa: " fmt "\n", ##args)
RTE_LOG(level, DPAA_BUS, "dpaa: " fmt "\n", ##args)

#ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
#define DPAA_BUS_HWWARN(cond, fmt, args...) \
Expand All @@ -25,7 +26,7 @@ extern int dpaa_logtype_bus;
#endif

#define DPAA_BUS_DEBUG(fmt, args...) \
rte_log(RTE_LOG_DEBUG, dpaa_logtype_bus, "dpaa: %s(): " fmt "\n", \
RTE_LOG(DEBUG, DPAA_BUS, "dpaa: %s(): " fmt "\n", \
__func__, ##args)

#define BUS_INIT_FUNC_TRACE() DPAA_BUS_DEBUG(" >>")
Expand Down
5 changes: 3 additions & 2 deletions drivers/bus/fslmc/fslmc_logs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
#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", \
RTE_LOG(level, DPAA2_BUS, "fslmc: " fmt "\n", \
##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", \
RTE_LOG(DEBUG, DPAA2_BUS, "fslmc: %s(): " fmt "\n", \
__func__, ##args)

#define DPAA2_BUS_INFO(fmt, args...) \
Expand Down
5 changes: 3 additions & 2 deletions drivers/bus/ifpga/ifpga_logs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
#include <rte_log.h>

extern int ifpga_bus_logtype;
#define RTE_LOGTYPE_IFPGA_BUS ifpga_bus_logtype

#define IFPGA_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, ifpga_bus_logtype, "%s(): " fmt "\n", \
RTE_LOG(level, IFPGA_BUS, "%s(): " fmt "\n", \
__func__, ##args)

#define IFPGA_BUS_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, ifpga_bus_logtype, "%s(): " fmt "\n", \
RTE_LOG(level, IFPGA_BUS, "%s(): " fmt "\n", \
__func__, ##args)

#define IFPGA_BUS_FUNC_TRACE() IFPGA_BUS_LOG(DEBUG, ">>")
Expand Down
3 changes: 2 additions & 1 deletion drivers/bus/platform/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

extern struct rte_platform_bus platform_bus;
extern int platform_bus_logtype;
#define RTE_LOGTYPE_PLATFORM_BUS platform_bus_logtype

/* Platform bus iterators. */
#define FOREACH_DEVICE_ON_PLATFORM_BUS(p) \
Expand All @@ -34,7 +35,7 @@ struct rte_platform_bus {
};

#define PLATFORM_LOG(level, ...) \
rte_log(RTE_LOG_ ## level, platform_bus_logtype, \
RTE_LOG(level, PLATFORM_BUS, \
RTE_FMT("platform bus: " RTE_FMT_HEAD(__VA_ARGS__,), \
RTE_FMT_TAIL(__VA_ARGS__,)))

Expand Down
3 changes: 2 additions & 1 deletion drivers/bus/vdev/vdev_logs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#include <rte_log.h>

extern int vdev_logtype_bus;
#define RTE_LOGTYPE_VDEV_BUS vdev_logtype_bus

#define VDEV_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, vdev_logtype_bus, "%s(): " fmt "\n", \
RTE_LOG(level, VDEV_BUS, "%s(): " fmt "\n", \
__func__, ##args)

#endif /* _VDEV_LOGS_H_ */
3 changes: 2 additions & 1 deletion drivers/bus/vmbus/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ extern struct rte_vmbus_bus rte_vmbus_bus;
RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.driver_list), next)

extern int vmbus_logtype_bus;
#define RTE_LOGTYPE_VMBUS_BUS vmbus_logtype_bus
#define VMBUS_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, vmbus_logtype_bus, "%s(): " fmt "\n", \
RTE_LOG(level, VMBUS_BUS, "%s(): " fmt "\n", \
__func__, ##args)

struct vmbus_br {
Expand Down
5 changes: 3 additions & 2 deletions drivers/common/dpaax/dpaax_logs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <rte_log.h>

extern int dpaax_logger;
#define RTE_LOGTYPE_DPAAX_LOGGER dpaax_logger

#ifdef RTE_LIBRTE_DPAAX_DEBUG
#define DPAAX_HWWARN(cond, fmt, args...) \
Expand All @@ -20,12 +21,12 @@ extern int dpaax_logger;
#endif

#define DPAAX_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, dpaax_logger, "dpaax: " fmt "\n", \
RTE_LOG(level, DPAAX_LOGGER, "dpaax: " fmt "\n", \
##args)

/* Debug logs are with Function names */
#define DPAAX_DEBUG(fmt, args...) \
rte_log(RTE_LOG_DEBUG, dpaax_logger, "dpaax: %s(): " fmt "\n", \
RTE_LOG(DEBUG, DPAAX_LOGGER, "dpaax: %s(): " fmt "\n", \
__func__, ##args)

#define DPAAX_INFO(fmt, args...) \
Expand Down
7 changes: 4 additions & 3 deletions drivers/common/iavf/iavf_osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,16 @@ writeq(uint64_t value, volatile void *addr)
#define IAVF_WRITE_FLUSH(a) IAVF_READ_REG(a, IAVF_VFGEN_RSTAT)

extern int iavf_common_logger;
#define RTE_LOGTYPE_IAVF_COMMON_LOGGER iavf_common_logger

#define DEBUGOUT(S) rte_log(RTE_LOG_DEBUG, iavf_common_logger, S)
#define DEBUGOUT2(S, A...) rte_log(RTE_LOG_DEBUG, iavf_common_logger, S, ##A)
#define DEBUGOUT(S) RTE_LOG(DEBUG, IAVF_COMMON_LOGGER, S)
#define DEBUGOUT2(S, A...) RTE_LOG(DEBUG, IAVF_COMMON_LOGGER, S, ##A)
#define DEBUGFUNC(F) DEBUGOUT(F "\n")

#define iavf_debug(h, m, s, ...) \
do { \
if (((m) & (h)->debug_mask)) \
rte_log(RTE_LOG_DEBUG, iavf_common_logger, \
RTE_LOG(DEBUG, IAVF_COMMON_LOGGER, \
"iavf %02x.%x " s, \
(h)->bus.device, (h)->bus.func, \
##__VA_ARGS__); \
Expand Down
5 changes: 3 additions & 2 deletions drivers/common/idpf/base/idpf_osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ typedef struct idpf_lock idpf_lock;
#define MAKEMASK(m, s) ((m) << (s))

extern int idpf_common_logger;
#define RTE_LOGTYPE_IDPF_COMMON_LOGGER idpf_common_logger

#define DEBUGOUT(S) rte_log(RTE_LOG_DEBUG, idpf_common_logger, S)
#define DEBUGOUT2(S, A...) rte_log(RTE_LOG_DEBUG, idpf_common_logger, S, ##A)
#define DEBUGOUT(S) RTE_LOG(DEBUG, IDPF_COMMON_LOGGER, S)
#define DEBUGOUT2(S, A...) RTE_LOG(DEBUG, IDPF_COMMON_LOGGER, S, ##A)
#define DEBUGFUNC(F) DEBUGOUT(F "\n")

#define idpf_debug(h, m, s, ...) \
Expand Down
4 changes: 2 additions & 2 deletions drivers/common/idpf/idpf_common_logs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include <rte_log.h>

extern int idpf_common_logtype;
#define RTE_LOGTYPE_IDPF_COMMON idpf_common_logtype

#define DRV_LOG_RAW(level, ...) \
rte_log(RTE_LOG_ ## level, \
idpf_common_logtype, \
RTE_LOG(level, IDPF_COMMON, \
RTE_FMT("%s(): " \
RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
__func__, \
Expand Down
3 changes: 2 additions & 1 deletion drivers/common/nfp/nfp_common_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
#include <rte_log.h>

extern int nfp_logtype_common;
#define RTE_LOGTYPE_NFP_COMMON nfp_logtype_common
#define PMD_DRV_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, nfp_logtype_common, \
RTE_LOG(level, NFP_COMMON, \
"%s(): " fmt "\n", __func__, ## args)

#endif/* __NFP_COMMON_LOG_H__ */
3 changes: 2 additions & 1 deletion drivers/common/octeontx/octeontx_mbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


#define MBOX_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, octeontx_logtype_mbox,\
RTE_LOG(level, OCTEONTX_MBOX,\
"%s() line %u: " fmt "\n", __func__, __LINE__, ## args)

#define mbox_log_info(fmt, ...) MBOX_LOG(INFO, fmt, ##__VA_ARGS__)
Expand All @@ -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 */
Expand Down
6 changes: 4 additions & 2 deletions drivers/common/qat/qat_logs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
#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, \
RTE_LOG(level, QAT_GEN, \
"%s(): " fmt "\n", __func__, ## args)

#define QAT_DP_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, qat_dp_logtype, \
RTE_LOG(level, QAT_DP, \
"%s(): " fmt "\n", __func__, ## args)

#define QAT_DP_HEXDUMP_LOG(level, title, buf, len) \
Expand Down
3 changes: 2 additions & 1 deletion drivers/compress/isal/isal_compress_pmd_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
/**< ISA-L comp PMD device name */

extern int isal_logtype_driver;
#define RTE_LOGTYPE_ISAL_DRIVER isal_logtype_driver
#define ISAL_PMD_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, isal_logtype_driver, "%s(): "fmt "\n", \
RTE_LOG(level, ISAL_DRIVER, "%s(): "fmt "\n", \
__func__, ##args)

/* private data structure for each ISA-L compression device */
Expand Down
6 changes: 3 additions & 3 deletions drivers/compress/octeontx/otx_zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -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: */
Expand Down Expand Up @@ -77,9 +78,8 @@ extern int octtx_zip_logtype_driver;
#define COMPRESSDEV_NAME_ZIP_PMD compress_octeontx

#define ZIP_PMD_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, \
octtx_zip_logtype_driver, "%s(): "fmt "\n", \
__func__, ##args)
RTE_LOG(level, OCTTX_ZIP_DRIVER, \
"%s(): "fmt "\n", __func__, ##args)

#define ZIP_PMD_INFO(fmt, args...) \
ZIP_PMD_LOG(INFO, fmt, ## args)
Expand Down
3 changes: 2 additions & 1 deletion drivers/compress/zlib/zlib_pmd_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
#define DEF_MEM_LEVEL 8

extern int zlib_logtype_driver;
#define RTE_LOGTYPE_ZLIB_DRIVER zlib_logtype_driver
#define ZLIB_PMD_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, zlib_logtype_driver, "%s(): "fmt "\n", \
RTE_LOG(level, ZLIB_DRIVER, "%s(): "fmt "\n", \
__func__, ##args)

#define ZLIB_PMD_INFO(fmt, args...) \
Expand Down
Loading

0 comments on commit 7c678cc

Please sign in to comment.