* [PATCH] net/ionic: clean up logging issues
@ 2024-04-19 20:25 Andrew Boyer
2024-04-19 22:39 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Boyer @ 2024-04-19 20:25 UTC (permalink / raw)
To: dev; +Cc: Andrew Boyer
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net/ionic: clean up logging issues
2024-04-19 20:25 [PATCH] net/ionic: clean up logging issues Andrew Boyer
@ 2024-04-19 22:39 ` Stephen Hemminger
2024-04-26 9:49 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2024-04-19 22:39 UTC (permalink / raw)
To: Andrew Boyer; +Cc: dev
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net/ionic: clean up logging issues
2024-04-19 22:39 ` Stephen Hemminger
@ 2024-04-26 9:49 ` Ferruh Yigit
0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2024-04-26 9:49 UTC (permalink / raw)
To: Stephen Hemminger, Andrew Boyer; +Cc: dev
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-26 9:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-19 20:25 [PATCH] net/ionic: clean up logging issues Andrew Boyer
2024-04-19 22:39 ` Stephen Hemminger
2024-04-26 9:49 ` Ferruh Yigit
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).