Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/12501/?format=api
https://patches.dpdk.org/api/patches/12501/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1462542490-15556-15-git-send-email-viktorin@rehivetech.com/", "project": { "id": 1, "url": "https://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": "<1462542490-15556-15-git-send-email-viktorin@rehivetech.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1462542490-15556-15-git-send-email-viktorin@rehivetech.com", "date": "2016-05-06T13:47:56", "name": "[dpdk-dev,v1,14/28] eal/soc: detect assigned kernel driver", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "5ba54bccb8d2cf3ccdb023a46068e0b766e3eb85", "submitter": { "id": 292, "url": "https://patches.dpdk.org/api/people/292/?format=api", "name": "Jan Viktorin", "email": "viktorin@rehivetech.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1462542490-15556-15-git-send-email-viktorin@rehivetech.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/12501/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/12501/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id E48A75AB0;\n\tFri, 6 May 2016 15:50:23 +0200 (CEST)", "from wes1-so2.wedos.net (wes1-so2.wedos.net [46.28.106.16])\n\tby dpdk.org (Postfix) with ESMTP id 1B3E658F1\n\tfor <dev@dpdk.org>; Fri, 6 May 2016 15:50:10 +0200 (CEST)", "from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz\n\t[147.229.13.147])\n\tby wes1-so2.wedos.net (Postfix) with ESMTPSA id 3r1Y7P6Dmkz7HF;\n\tFri, 6 May 2016 15:50:09 +0200 (CEST)" ], "From": "Jan Viktorin <viktorin@rehivetech.com>", "To": "dev@dpdk.org", "Cc": "Jan Viktorin <viktorin@rehivetech.com>,\n\tDavid Marchand <david.marchand@6wind.com>,\n\tThomas Monjalon <thomas.monjalon@6wind.com>,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tDeclan Doherty <declan.doherty@intel.com>, jianbo.liu@linaro.org,\n\tjerin.jacob@caviumnetworks.com, Keith Wiles <keith.wiles@intel.com>, \n\tStephen Hemminger <stephen@networkplumber.org>", "Date": "Fri, 6 May 2016 15:47:56 +0200", "Message-Id": "<1462542490-15556-15-git-send-email-viktorin@rehivetech.com>", "X-Mailer": "git-send-email 2.8.0", "In-Reply-To": [ "<1462542490-15556-1-git-send-email-viktorin@rehivetech.com>", "<1451682326-5834-1-git-send-email-viktorin@rehivetech.com>" ], "References": [ "<1462542490-15556-1-git-send-email-viktorin@rehivetech.com>", "<1451682326-5834-1-git-send-email-viktorin@rehivetech.com>" ], "Subject": "[dpdk-dev] [PATCH v1 14/28] eal/soc: detect assigned kernel driver", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <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": "We reuse the existing infrastructure (rte_eal_get_kernel_driver_by_path) here\nhowever another possible implementation is by parsing the uevent file.\n\nAs there are no well-known driver for SoC infra, we does not detect any. This\nwill be changed in the future by checking for VFIO and UIO drivers.\n\nSigned-off-by: Jan Viktorin <viktorin@rehivetech.com>\n---\n lib/librte_eal/common/include/rte_soc.h | 2 ++\n lib/librte_eal/linuxapp/eal/eal_soc.c | 28 ++++++++++++++++++++++++++++\n 2 files changed, 30 insertions(+)", "diff": "diff --git a/lib/librte_eal/common/include/rte_soc.h b/lib/librte_eal/common/include/rte_soc.h\nindex 00fd0a6..206244a 100644\n--- a/lib/librte_eal/common/include/rte_soc.h\n+++ b/lib/librte_eal/common/include/rte_soc.h\n@@ -53,6 +53,7 @@ extern \"C\" {\n \n #include <rte_debug.h>\n #include <rte_eal.h>\n+#include <rte_dev.h>\n \n TAILQ_HEAD(soc_driver_list, rte_soc_driver); /**< SoC drivers in D-linked Q. */\n TAILQ_HEAD(soc_device_list, rte_soc_device); /**< SoC devices in D-linked Q. */\n@@ -83,6 +84,7 @@ struct rte_soc_device {\n \tstruct rte_soc_id *id; /**< SoC device ID list */\n \tstruct rte_soc_driver *driver; /**< Associated driver */\n \tstruct rte_devargs *devargs; /**< Device user arguments */\n+\tenum rte_kernel_driver kdrv; /**< Kernel driver */\n };\n \n struct rte_soc_driver;\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_soc.c b/lib/librte_eal/linuxapp/eal/eal_soc.c\nindex 742d80d..4f9070e 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_soc.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_soc.c\n@@ -179,6 +179,30 @@ dev_content_free(struct rte_soc_device *dev)\n \tdev->id = NULL;\n }\n \n+static int\n+dev_setup_associated_driver(struct rte_soc_device *dev, const char *dirname)\n+{\n+\tchar filename[PATH_MAX];\n+\tchar driver[PATH_MAX];\n+\tint ret;\n+\n+\t/* parse driver */\n+\tsnprintf(filename, sizeof(filename), \"%s/driver\", dirname);\n+\tret = rte_eal_get_kernel_driver_by_path(filename, driver);\n+\tif (ret < 0) {\n+\t\tRTE_LOG(ERR, EAL, \"Fail to get kernel driver for %s\\n\", dirname);\n+\t\treturn 1;\n+\t}\n+\n+\tif (!ret) {\n+\t\tdev->kdrv = RTE_KDRV_UNKNOWN;\n+\t} else {\n+\t\tdev->kdrv = RTE_KDRV_NONE;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /**\n * Scan one SoC sysfs entry, and fill the devices list from it.\n * We require to have the uevent file with records: OF_FULLNAME and\n@@ -217,6 +241,9 @@ soc_scan_one(const char *dirname, const char *name)\n \t\tgoto fail;\n \tfree(uevent); /* not needed anymore */\n \n+\tif ((ret = dev_setup_associated_driver(dev, dirname)))\n+\t\tgoto fail;\n+\n \t/* device is valid, add in list (sorted) */\n \tif (TAILQ_EMPTY(&soc_device_list)) {\n \t\tTAILQ_INSERT_TAIL(&soc_device_list, dev, next);\n@@ -231,6 +258,7 @@ soc_scan_one(const char *dirname, const char *name)\n \t\t\tif (ret < 0) {\n \t\t\t\tTAILQ_INSERT_BEFORE(dev2, dev, next);\n \t\t\t} else { /* already registered */\n+\t\t\t\tdev2->kdrv = dev->kdrv;\n \n \t\t\t\tdev_content_free(dev2);\n \t\t\t\tdev2->addr.fdt_path = dev->addr.fdt_path;\n", "prefixes": [ "dpdk-dev", "v1", "14/28" ] }{ "id": 12501, "url": "