From: Alfredo Cardigliano <cardigliano@ntop.org>
To: Alfredo Cardigliano <cardigliano@ntop.org>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v4 03/17] net/ionic: add log
Date: Thu, 19 Dec 2019 23:18:33 +0100 [thread overview]
Message-ID: <20191219221847.29989-4-cardigliano@ntop.org> (raw)
In-Reply-To: <20191219221847.29989-1-cardigliano@ntop.org>
Add debug options to the config file.
Define macros used for logs and make use of config file options
to enable them.
Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
---
drivers/net/ionic/Makefile | 2 +-
drivers/net/ionic/ionic_ethdev.c | 15 +++++++++++++++
drivers/net/ionic/ionic_logs.h | 26 ++++++++++++++++++++++++++
drivers/net/ionic/meson.build | 1 +
4 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644 drivers/net/ionic/ionic_ethdev.c
create mode 100644 drivers/net/ionic/ionic_logs.h
diff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile
index 9c2f9cf2e..baa34b055 100644
--- a/drivers/net/ionic/Makefile
+++ b/drivers/net/ionic/Makefile
@@ -20,6 +20,6 @@ LDLIBS += -lrte_bus_pci
#
# all source are stored in SRCS-y
#
-SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) +=
+SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_ethdev.c
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
new file mode 100644
index 000000000..f19de85a9
--- /dev/null
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
+ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
+ */
+
+#include "ionic_logs.h"
+
+int ionic_logtype;
+
+RTE_INIT(ionic_init_log)
+{
+ ionic_logtype = rte_log_register("pmd.net.ionic");
+
+ if (ionic_logtype >= 0)
+ rte_log_set_level(ionic_logtype, RTE_LOG_NOTICE);
+}
diff --git a/drivers/net/ionic/ionic_logs.h b/drivers/net/ionic/ionic_logs.h
new file mode 100644
index 000000000..bc10ad174
--- /dev/null
+++ b/drivers/net/ionic/ionic_logs.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
+ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
+ */
+
+#ifndef _IONIC_LOGS_H_
+#define _IONIC_LOGS_H_
+
+#include <rte_log.h>
+
+extern int ionic_logtype;
+
+#define IONIC_PRINT(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
+ ionic_logtype, "%s(): " fmt "\n", __func__, ##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_ */
diff --git a/drivers/net/ionic/meson.build b/drivers/net/ionic/meson.build
index 5386e23ca..f5e3c36c9 100644
--- a/drivers/net/ionic/meson.build
+++ b/drivers/net/ionic/meson.build
@@ -2,5 +2,6 @@
# Copyright(c) 2019 Pensando
sources = files(
+ 'ionic_ethdev.c'
)
--
2.17.1
next prev parent reply other threads:[~2019-12-19 22:19 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-19 22:18 [dpdk-dev] [PATCH v4 00/17] Introduces net/ionic PMD Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 01/17] net/ionic: add skeleton Alfredo Cardigliano
2020-01-07 16:34 ` Ferruh Yigit
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 02/17] net/ionic: add hardware structures definitions Alfredo Cardigliano
2019-12-20 0:16 ` Stephen Hemminger
2020-01-03 8:22 ` Alfredo Cardigliano
2019-12-19 22:18 ` Alfredo Cardigliano [this message]
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 04/17] net/ionic: register and initialize the adapter Alfredo Cardigliano
2019-12-20 0:19 ` Stephen Hemminger
2019-12-20 0:23 ` Stephen Hemminger
2019-12-20 0:24 ` Stephen Hemminger
2019-12-20 0:27 ` Stephen Hemminger
2020-01-07 16:35 ` Ferruh Yigit
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 05/17] net/ionic: add port management commands Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 06/17] net/ionic: add basic lif support Alfredo Cardigliano
2019-12-20 1:12 ` Stephen Hemminger
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 07/17] net/ionic: add doorbells Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 08/17] net/ionic: add adminq support Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 09/17] net/ionic: add notifyq support Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 10/17] net/ionic: add basic port operations Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 11/17] net/ionic: add RX filters support Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 12/17] net/ionic: add Flow Control support Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 13/17] net/ionic: add RX and TX handling Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 14/17] net/ionic: add RSS support Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 15/17] net/ionic: add stats Alfredo Cardigliano
2019-12-20 0:28 ` Stephen Hemminger
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 16/17] net/ionic: add TX checksum support Alfredo Cardigliano
2019-12-19 22:18 ` [dpdk-dev] [PATCH v4 17/17] net/ionic: read fw version Alfredo Cardigliano
2020-01-07 16:34 ` [dpdk-dev] [PATCH v4 00/17] Introduces net/ionic PMD 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=20191219221847.29989-4-cardigliano@ntop.org \
--to=cardigliano@ntop.org \
--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).