net/ionic: clean up logging issues
PATCH 1/1 net/ionic: clean up logging issues
Switch to the new RTE_LOG_LINE_PREFIX logging macro. While here, fix up some trailing-newline issues reported by the new macro.
Signed-off-by Andrew Boyer <[email protected]>
--- drivers/net/ionic/ionic_dev_pci.c | 7 +++---- drivers/net/ionic/ionic_lif.c | 8 ++++---- drivers/net/ionic/ionic_logs.h | 14 +++----------- 3 files changed, 10 insertions(+), 19 deletions(-)
drivers/net/ionic/ionic_dev_pci.c +3 -4
@@ -43,13 +43,12 @@ ionic_pci_setup(struct ionic_adapter *adapter)/* BAR0: dev_cmd and interrupts */ if (num_bars <1 ) { -IONIC_PRINT (ERR ,"No bars found, aborting\n" ); +IONIC_PRINT (ERR ,"No bars found, aborting" );return -EFAULT ; }if (bar->len <IONIC_BAR0_SIZE ) { -IONIC_PRINT (ERR , -"Resource bar size %lu too small, aborting\n" , +IONIC_PRINT (ERR ,"Resource bar size %lu too small, aborting" , bar->len);return -EFAULT ; }
@@ -84,7 +83,7 @@ ionic_pci_setup(struct ionic_adapter *adapter)/* BAR1: doorbells */ bar++;if (num_bars <IONIC_BARS_MIN ) { -IONIC_PRINT (ERR ,"Doorbell bar missing, aborting\n" ); +IONIC_PRINT (ERR ,"Doorbell bar missing, aborting" );return -EFAULT ; }
drivers/net/ionic/ionic_lif.c +4 -4
@@ -990,13 +990,13 @@ ionic_lif_queue_identify(struct ionic_lif *lif) qtype, ionic_qtype_vers[qtype]); err =ionic_dev_cmd_wait_check (idev,IONIC_DEVCMD_TIMEOUT );if (err == -EINVAL ) { -IONIC_PRINT (ERR ,"qtype %d not supported\n" , qtype); +IONIC_PRINT (ERR ,"qtype %d not supported" , qtype);continue ; }else if (err == -EIO ) { -IONIC_PRINT (ERR ,"q_ident failed, older FW\n" ); +IONIC_PRINT (ERR ,"q_ident failed, older FW" );return ; }else if (err) { -IONIC_PRINT (ERR ,"q_ident failed, qtype %d: %d\n" , +IONIC_PRINT (ERR ,"q_ident failed, qtype %d: %d" , qtype, err);return ; }
@@ -1380,7 +1380,7 @@ ionic_lif_handle_fw_down(struct ionic_lif *lif)if (lif->state &IONIC_LIF_F_UP ) {IONIC_PRINT (NOTICE , -"Surprise FW stop, stopping %s\n" , lif->name); +"Surprise FW stop, stopping %s" , lif->name);ionic_lif_stop (lif); }
drivers/net/ionic/ionic_logs.h +3 -11
@@ -8,19 +8,11 @@#include <rte_log.h> extern int ionic_logtype; +#define RTE_LOGTYPE_IONIC ionic_logtype -#define IONIC_PRINT(level, fmt, args...) rte_log(RTE_LOG_ ## level, \ - ionic_logtype, "%s(): " fmt "\n", __func__, ##args) +#define IONIC_PRINT (level, ...) \ + RTE_LOG_LINE_PREFIX(level, IONIC, "%s(): ", __func__, __VA_ARGS__)#define IONIC_PRINT_CALL () IONIC_PRINT(DEBUG, " >>") -#ifndef IONIC_WARN_ON -#define IONIC_WARN_ON (x) do { \ - int ret = !!(x); \ - if (unlikely(ret)) \ - IONIC_PRINT(WARNING, "WARN_ON: \"" #x "\" at %s:%d\n", \ - __func__, __LINE__); \ -} while (0) -#endif -#endif /* _IONIC_LOGS_H_ */
Signature · 1 line
2.17.1
Quoted 4 lines · On Fri, 19 Apr 2024 13:25:56 -0700 Andrew Boyer <[email protected]> wrote:
Switch to the new
RTE_LOG_LINE_PREFIXlogging macro. While here, fix up some trailing-newline issues reported by the new macro.Signed-off-by Andrew Boyer <[email protected]>
Ferruh Yigit
AppliedQuoted 9 lines · Stephen Hemminger
Quoted 4 lines · On Fri, 19 Apr 2024 13:25:56 -0700 Andrew Boyer <[email protected]> wrote:
Switch to the new
RTE_LOG_LINE_PREFIXlogging macro. While here, fix up some trailing-newline issues reported by the new macro.Signed-off-by Andrew Boyer <[email protected]>
Applied to dpdk-next-net/main, thanks.