Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/60993/?format=api
http://patches.dpdk.org/api/patches/60993/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/157084000193.11524.4069198856747684178.stgit@devele/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<157084000193.11524.4069198856747684178.stgit@devele>", "list_archive_url": "https://inbox.dpdk.org/dev/157084000193.11524.4069198856747684178.stgit@devele", "date": "2019-10-12T00:26:41", "name": "[03/17] net/ionic: add log", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0897d85b3eb383cf2054313a29479a6779e5cde1", "submitter": { "id": 1465, "url": "http://patches.dpdk.org/api/people/1465/?format=api", "name": "Alfredo Cardigliano", "email": "cardigliano@ntop.org" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/157084000193.11524.4069198856747684178.stgit@devele/mbox/", "series": [ { "id": 6811, "url": "http://patches.dpdk.org/api/series/6811/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6811", "date": "2019-10-12T00:26:26", "name": "Series short description", "version": 1, "mbox": "http://patches.dpdk.org/series/6811/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/60993/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/60993/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D283E1EB49;\n\tSat, 12 Oct 2019 02:26:43 +0200 (CEST)", "from devele.ntop.org (net-93-145-196-230.cust.vodafonedsl.it\n\t[93.145.196.230]) by dpdk.org (Postfix) with ESMTP id 2323E1EB79\n\tfor <dev@dpdk.org>; Sat, 12 Oct 2019 02:26:42 +0200 (CEST)", "from [192.168.2.134] (localhost6.localdomain6 [IPv6:::1])\n\tby devele.ntop.org (Postfix) with ESMTP id F17B96C003C\n\tfor <dev@dpdk.org>; Sat, 12 Oct 2019 02:26:41 +0200 (CEST)" ], "From": "Alfredo Cardigliano <cardigliano@ntop.org>", "To": "dev@dpdk.org", "Date": "Sat, 12 Oct 2019 02:26:41 +0200", "Message-ID": "<157084000193.11524.4069198856747684178.stgit@devele>", "In-Reply-To": "<157083994018.11524.11276616720287263690.stgit@devele>", "References": "<157083994018.11524.11276616720287263690.stgit@devele>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Subject": "[dpdk-dev] [PATCH 03/17] net/ionic: add log", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add debug options to the config file.\nDefine macros used for logs and make use of config file options\nto enable them.\n\nSigned-off-by: Alfredo Cardigliano <cardigliano@ntop.org>\nReviewed-by: Shannon Nelson <snelson@pensando.io>\n---\n config/common_base | 2 ++\n drivers/net/ionic/Makefile | 2 +-\n drivers/net/ionic/ionic_ethdev.c | 21 +++++++++++++++++\n drivers/net/ionic/ionic_logs.h | 46 ++++++++++++++++++++++++++++++++++++++\n drivers/net/ionic/meson.build | 1 +\n 5 files changed, 71 insertions(+), 1 deletion(-)\n create mode 100644 drivers/net/ionic/ionic_ethdev.c\n create mode 100644 drivers/net/ionic/ionic_logs.h", "diff": "diff --git a/config/common_base b/config/common_base\nindex 1c11fcae6..c1b556fc1 100644\n--- a/config/common_base\n+++ b/config/common_base\n@@ -274,6 +274,8 @@ CONFIG_RTE_LIBRTE_E1000_PF_DISABLE_STRIP_CRC=n\n # Compile Pensando IONIC PMD driver\n #\n CONFIG_RTE_LIBRTE_IONIC_PMD=y\n+CONFIG_RTE_LIBRTE_IONIC_DEBUG_RX=n\n+CONFIG_RTE_LIBRTE_IONIC_DEBUG_TX=n\n \n #\n # Compile burst-oriented HINIC PMD driver\ndiff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile\nindex 3add24087..2f3296a15 100644\n--- a/drivers/net/ionic/Makefile\n+++ b/drivers/net/ionic/Makefile\n@@ -52,6 +52,6 @@ LDLIBS += -lrte_bus_pci\n #\n # all source are stored in SRCS-y\n #\n-SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) +=\n+SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_ethdev.c\n \n include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c\nnew file mode 100644\nindex 000000000..863d20d19\n--- /dev/null\n+++ b/drivers/net/ionic/ionic_ethdev.c\n@@ -0,0 +1,21 @@\n+/* SPDX-License-Identifier: GPL-2.0\n+ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.\n+ */\n+\n+#include \"ionic_logs.h\"\n+\n+int ionic_logtype_init;\n+int ionic_logtype_driver;\n+\n+RTE_INIT(ionic_init_log)\n+{\n+\tionic_logtype_init = rte_log_register(\"pmd.net.ionic.init\");\n+\n+\tif (ionic_logtype_init >= 0)\n+\t\trte_log_set_level(ionic_logtype_init, RTE_LOG_NOTICE);\n+\n+\tionic_logtype_driver = rte_log_register(\"pmd.net.ionic.driver\");\n+\n+\tif (ionic_logtype_driver >= 0)\n+\t\trte_log_set_level(ionic_logtype_driver, RTE_LOG_NOTICE);\n+}\ndiff --git a/drivers/net/ionic/ionic_logs.h b/drivers/net/ionic/ionic_logs.h\nnew file mode 100644\nindex 000000000..a4a9af888\n--- /dev/null\n+++ b/drivers/net/ionic/ionic_logs.h\n@@ -0,0 +1,46 @@\n+/* SPDX-License-Identifier: GPL-2.0\n+ * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.\n+ */\n+\n+#ifndef _IONIC_LOGS_H_\n+#define _IONIC_LOGS_H_\n+\n+#include <rte_log.h>\n+\n+extern int ionic_logtype_init;\n+extern int ionic_logtype_driver;\n+\n+#define ionic_init_print(level, fmt, args...) rte_log(RTE_LOG_ ## level, \\\n+\t\tionic_logtype_init, \"%s(): \" fmt \"\\n\", __func__, ##args)\n+\n+#define ionic_init_print_call() ionic_init_print(DEBUG, \" >>\")\n+\n+#ifndef IONIC_WARN_ON\n+#define IONIC_WARN_ON(x) do { \\\n+\tint ret = !!(x); \\\n+\tif (unlikely(ret)) \\\n+\t\tionic_init_print(WARNING, \"WARN_ON: \\\"\" #x \"\\\" at %s:%d\\n\", \\\n+\t\t\t\t__func__, __LINE__); \\\n+} while (0)\n+#endif\n+\n+#ifdef RTE_LIBRTE_IONIC_DEBUG_RX\n+#define ionic_rx_print(level, fmt, args...) RTE_LOG(level, PMD, \\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ## args)\n+#else\n+#define ionic_rx_print(level, fmt, args...) do { } while (0)\n+#endif\n+\n+#ifdef RTE_LIBRTE_IONIC_DEBUG_TX\n+#define ionic_tx_print(level, fmt, args...) RTE_LOG(level, PMD, \\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ## args)\n+#else\n+#define ionic_tx_print(level, fmt, args...) do { } while (0)\n+#endif\n+\n+#define ionic_drv_print(level, fmt, args...) rte_log(RTE_LOG_ ## level, \\\n+\t\tionic_logtype_driver, \"%s(): \" fmt \"\\n\", __func__, ## args)\n+\n+#define ionic_drv_print_call() ionic_drv_print(DEBUG, \" >>\")\n+\n+#endif /* _IONIC_LOGS_H_ */\ndiff --git a/drivers/net/ionic/meson.build b/drivers/net/ionic/meson.build\nindex 502076e3c..5534ad6c3 100644\n--- a/drivers/net/ionic/meson.build\n+++ b/drivers/net/ionic/meson.build\n@@ -4,5 +4,6 @@\n version = 1\n \n sources = files(\n+\t'ionic_ethdev.c'\n )\n \n", "prefixes": [ "03/17" ] }{ "id": 60993, "url": "