net/ionic: clean up logging issues

Message ID 20240419202556.46188-1-andrew.boyer@amd.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series net/ionic: clean up logging issues |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS

Commit Message

Andrew Boyer April 19, 2024, 8:25 p.m. UTC
  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 <andrew.boyer@amd.com>
---
 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(-)
  

Comments

Stephen Hemminger April 19, 2024, 10:39 p.m. UTC | #1
On Fri, 19 Apr 2024 13:25:56 -0700
Andrew Boyer <andrew.boyer@amd.com> wrote:

> 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 <andrew.boyer@amd.com>

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Ferruh Yigit April 26, 2024, 9:49 a.m. UTC | #2
On 4/19/2024 11:39 PM, Stephen Hemminger wrote:
> On Fri, 19 Apr 2024 13:25:56 -0700
> Andrew Boyer <andrew.boyer@amd.com> wrote:
> 
>> 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 <andrew.boyer@amd.com>
> 
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/drivers/net/ionic/ionic_dev_pci.c b/drivers/net/ionic/ionic_dev_pci.c
index 2d7b4f223e..76235cad51 100644
--- a/drivers/net/ionic/ionic_dev_pci.c
+++ b/drivers/net/ionic/ionic_dev_pci.c
@@ -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;
 	}
 
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 7f02b67610..b4dc118fef 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -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);
 	}
 
diff --git a/drivers/net/ionic/ionic_logs.h b/drivers/net/ionic/ionic_logs.h
index c10b06c051..739de00af8 100644
--- a/drivers/net/ionic/ionic_logs.h
+++ b/drivers/net/ionic/ionic_logs.h
@@ -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_ */