Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/30348/?format=api
http://patches.dpdk.org/api/patches/30348/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1507895521-48299-5-git-send-email-jianfeng.tan@intel.com/", "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": "<1507895521-48299-5-git-send-email-jianfeng.tan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1507895521-48299-5-git-send-email-jianfeng.tan@intel.com", "date": "2017-10-13T11:52:01", "name": "[dpdk-dev,v7,4/4] bus/vdev: change log type", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4233e5dd49cff5964d27e0d50e8789b6c1adc324", "submitter": { "id": 313, "url": "http://patches.dpdk.org/api/people/313/?format=api", "name": "Jianfeng Tan", "email": "jianfeng.tan@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1507895521-48299-5-git-send-email-jianfeng.tan@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/30348/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/30348/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 B353B1B6AF;\n\tFri, 13 Oct 2017 13:50:51 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 6B40F1B6A5\n\tfor <dev@dpdk.org>; Fri, 13 Oct 2017 13:50:44 +0200 (CEST)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga105.fm.intel.com with ESMTP; 13 Oct 2017 04:50:43 -0700", "from dpdk06.sh.intel.com ([10.67.110.196])\n\tby FMSMGA003.fm.intel.com with ESMTP; 13 Oct 2017 04:50:39 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.43,370,1503385200\"; d=\"scan'208\";a=\"909605070\"", "From": "Jianfeng Tan <jianfeng.tan@intel.com>", "To": "dev@dpdk.org", "Cc": "jblunck@infradead.org, bruce.richardson@intel.com,\n\tkonstantin.ananyev@intel.com, pablo.de.lara.guarch@intel.com,\n\tthomas@monjalon.net, yliu@fridaylinux.org, maxime.coquelin@redhat.com,\n\tmtetsuyah@gmail.com, ferruh.yigit@intel.com,\n\tJianfeng Tan <jianfeng.tan@intel.com>", "Date": "Fri, 13 Oct 2017 11:52:01 +0000", "Message-Id": "<1507895521-48299-5-git-send-email-jianfeng.tan@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1507895521-48299-1-git-send-email-jianfeng.tan@intel.com>", "References": "<1507519229-80692-1-git-send-email-jianfeng.tan@intel.com>\n\t<1507895521-48299-1-git-send-email-jianfeng.tan@intel.com>", "Subject": "[dpdk-dev] [PATCH v7 4/4] bus/vdev: change log type", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Use specialized dynamic log type for vdev bus logging.\n\nSuggested-by: Gaetan Rivet <gaetan.rivet@6wind.com>\nSuggested-by: Shreyansh Jain <shreyansh.jain@nxp.com>\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\n---\n drivers/bus/vdev/vdev.c | 20 ++++++++++++++++----\n drivers/bus/vdev/vdev_logs.h | 45 ++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 61 insertions(+), 4 deletions(-)\n create mode 100644 drivers/bus/vdev/vdev_logs.h", "diff": "diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c\nindex a16eb71..be2be6f 100644\n--- a/drivers/bus/vdev/vdev.c\n+++ b/drivers/bus/vdev/vdev.c\n@@ -47,6 +47,9 @@\n #include <rte_errno.h>\n \n #include \"rte_vdev.h\"\n+#include \"vdev_logs.h\"\n+\n+int vdev_logtype_bus;\n \n /* Forward declare to access virtual bus name */\n static struct rte_bus rte_vdev_bus;\n@@ -103,7 +106,7 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev)\n \n \tname = rte_vdev_device_name(dev);\n \n-\tRTE_LOG(DEBUG, EAL, \"Search driver %s to probe device %s\\n\", name,\n+\tVDEV_LOG(DEBUG, \"Search driver %s to probe device %s\\n\", name,\n \t\trte_vdev_device_name(dev));\n \n \tif (vdev_parse(name, &driver))\n@@ -190,7 +193,7 @@ rte_vdev_init(const char *name, const char *args)\n \tret = vdev_probe_all_drivers(dev);\n \tif (ret) {\n \t\tif (ret > 0)\n-\t\t\tRTE_LOG(ERR, EAL, \"no driver found for %s\\n\", name);\n+\t\t\tVDEV_LOG(ERR, \"no driver found for %s\\n\", name);\n \t\tgoto fail;\n \t}\n \n@@ -213,7 +216,7 @@ vdev_remove_driver(struct rte_vdev_device *dev)\n \tconst struct rte_vdev_driver *driver;\n \n \tif (!dev->device.driver) {\n-\t\tRTE_LOG(DEBUG, EAL, \"no driver attach to device %s\\n\", name);\n+\t\tVDEV_LOG(DEBUG, \"no driver attach to device %s\\n\", name);\n \t\treturn 1;\n \t}\n \n@@ -294,7 +297,7 @@ vdev_probe(void)\n \t\t\tcontinue;\n \n \t\tif (vdev_probe_all_drivers(dev)) {\n-\t\t\tRTE_LOG(ERR, EAL, \"failed to initialize %s device\\n\",\n+\t\t\tVDEV_LOG(ERR, \"failed to initialize %s device\\n\",\n \t\t\t\trte_vdev_device_name(dev));\n \t\t\treturn -1;\n \t\t}\n@@ -342,3 +345,12 @@ static struct rte_bus rte_vdev_bus = {\n };\n \n RTE_REGISTER_BUS(vdev, rte_vdev_bus);\n+\n+RTE_INIT(vdev_init_log);\n+static void\n+vdev_init_log(void)\n+{\n+\tvdev_logtype_bus = rte_log_register(\"bus.vdev\");\n+\tif (vdev_logtype_bus >= 0)\n+\t\trte_log_set_level(vdev_logtype_bus, RTE_LOG_NOTICE);\n+}\ndiff --git a/drivers/bus/vdev/vdev_logs.h b/drivers/bus/vdev/vdev_logs.h\nnew file mode 100644\nindex 0000000..43b0ab8\n--- /dev/null\n+++ b/drivers/bus/vdev/vdev_logs.h\n@@ -0,0 +1,45 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright(c) 2017 Intel Corporation. All rights reserved.\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of Intel Corporation nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _VDEV_LOGS_H_\n+#define _VDEV_LOGS_H_\n+\n+#include <rte_log.h>\n+\n+extern int vdev_logtype_bus;\n+\n+#define VDEV_LOG(level, fmt, args...) \\\n+\trte_log(RTE_LOG_ ## level, vdev_logtype_bus, \"%s(): \" fmt \"\\n\", \\\n+\t\t__func__, ##args)\n+\n+#endif /* _VDEV_LOGS_H_ */\n", "prefixes": [ "dpdk-dev", "v7", "4/4" ] }{ "id": 30348, "url": "