DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Boyer <andrew.boyer@amd.com>
To: <dev@dpdk.org>
Cc: Andrew Boyer <andrew.boyer@amd.com>
Subject: [PATCH] net/ionic: clean up logging issues
Date: Fri, 19 Apr 2024 13:25:56 -0700	[thread overview]
Message-ID: <20240419202556.46188-1-andrew.boyer@amd.com> (raw)

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(-)

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_ */
-- 
2.17.1


             reply	other threads:[~2024-04-19 20:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 20:25 Andrew Boyer [this message]
2024-04-19 22:39 ` Stephen Hemminger
2024-04-26  9:49   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240419202556.46188-1-andrew.boyer@amd.com \
    --to=andrew.boyer@amd.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).