Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1386/?format=api
https://patches.dpdk.org/api/patches/1386/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1416474399-16851-24-git-send-email-mukawa@igel.co.jp/", "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": "<1416474399-16851-24-git-send-email-mukawa@igel.co.jp>", "list_archive_url": "https://inbox.dpdk.org/dev/1416474399-16851-24-git-send-email-mukawa@igel.co.jp", "date": "2014-11-20T09:06:37", "name": "[dpdk-dev,23/25] eal/pci: Add rte_eal_pci_probe_one and rte_eal_pci_close_one", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "056ca2a8570cc2de05161dcceb01d41ee38e241e", "submitter": { "id": 64, "url": "https://patches.dpdk.org/api/people/64/?format=api", "name": "Tetsuya Mukawa", "email": "mukawa@igel.co.jp" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1416474399-16851-24-git-send-email-mukawa@igel.co.jp/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/1386/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/1386/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 8B0A6805D;\n\tThu, 20 Nov 2014 09:57:51 +0100 (CET)", "from mail-pd0-f170.google.com (mail-pd0-f170.google.com\n\t[209.85.192.170]) by dpdk.org (Postfix) with ESMTP id D0E69804C\n\tfor <dev@dpdk.org>; Thu, 20 Nov 2014 09:57:46 +0100 (CET)", "by mail-pd0-f170.google.com with SMTP id fp1so2691786pdb.15\n\tfor <dev@dpdk.org>; Thu, 20 Nov 2014 01:08:15 -0800 (PST)", "from localhost.localdomain (napt.igel.co.jp. [219.106.231.132])\n\tby mx.google.com with ESMTPSA id\n\ta6sm1432407pbu.64.2014.11.20.01.08.13 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 20 Nov 2014 01:08:15 -0800 (PST)" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=2qQyPYOXdWSNgqA2XYgczClyRV2U3WS91ILml0M9JCc=;\n\tb=DbSq2NDVWih6ZDyk0r9nEDOoxtlEJl0a3aKP4J/+xhtgcCPj+yQpGy5n+virgku6Oi\n\tAaUjwkL/mNqWsxsc39VuzzTHJZAL4Uixg+9zBok4Gg95dd3DFYM3qquz2gZEuY23P1Zu\n\tXsB6GKUmV/vh+R/bAGgKxJsIC989n64F35luZH7aTM3fpawV72ghOuNy/98eSWycLHNL\n\tulqk9pnoVsPIB/e3MS63FMHcsXA3y6WQY2lGJ8L3zJL537zhTjdmFo4+lYTyNyWEA99x\n\tQbIWQ9vweFhEGOeLD2GpRx695601whQT50pE7cmb2NR2hXIeGPf8qfMxkqXaUWfeRunS\n\tg5EA==", "X-Gm-Message-State": "ALoCoQmAILQQHJ4f80rykH9nHwM0qCxQL+I9RMiKxc/fPnTNkCy7K+xfkXWkHjOEFKz/5kByMKr6", "X-Received": "by 10.68.234.202 with SMTP id\n\tug10mr28494509pbc.134.1416474495640; \n\tThu, 20 Nov 2014 01:08:15 -0800 (PST)", "From": "Tetsuya Mukawa <mukawa@igel.co.jp>", "To": "dev@dpdk.org", "Date": "Thu, 20 Nov 2014 18:06:37 +0900", "Message-Id": "<1416474399-16851-24-git-send-email-mukawa@igel.co.jp>", "X-Mailer": "git-send-email 1.9.1", "In-Reply-To": "<1416474399-16851-1-git-send-email-mukawa@igel.co.jp>", "References": "<1414572576-21371-1-git-send-email-mukawa@igel.co.jp>\n\t<1416474399-16851-1-git-send-email-mukawa@igel.co.jp>", "Cc": "nakajima.yoshihiro@lab.ntt.co.jp, menrigh@brocade.com,\n\tmasutani.hitoshi@lab.ntt.co.jp", "Subject": "[dpdk-dev] [PATCH 23/25] eal/pci: Add rte_eal_pci_probe_one and\n\trte_eal_pci_close_one", "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": "The functions are used for probe and close a device.\nFirst the function tries to find a device that has the specfied PCI address.\nThen, probe or close the device.\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_eal/common/eal_common_pci.c | 58 +++++++++++++++++++++++++++++++++\n lib/librte_eal/common/include/rte_pci.h | 26 +++++++++++++++\n 2 files changed, 84 insertions(+)", "diff": "diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c\nindex b404ee0..5ff7b49 100644\n--- a/lib/librte_eal/common/eal_common_pci.c\n+++ b/lib/librte_eal/common/eal_common_pci.c\n@@ -152,6 +152,64 @@ pci_close_all_drivers(struct rte_pci_device *dev)\n {\n \treturn pci_invoke_all_drivers(dev, INVOKE_CLOSE);\n }\n+\n+static int\n+rte_eal_pci_invoke_one(struct rte_pci_addr *addr, int type)\n+{\n+\tstruct rte_pci_device *dev = NULL;\n+\tint ret = 0;\n+\n+\tTAILQ_FOREACH(dev, &pci_device_list, next) {\n+\t\tif (eal_compare_pci_addr(&dev->addr, addr))\n+\t\t\tcontinue;\n+\n+\t\tswitch (type) {\n+\t\tcase INVOKE_PROBE:\n+\t\t\tret = pci_probe_all_drivers(dev);\n+\t\t\tbreak;\n+\t\tcase INVOKE_CLOSE:\n+\t\t\tret = pci_close_all_drivers(dev);\n+\t\t\tbreak;\n+\t\t}\n+\t\tif (ret < 0)\n+\t\t\tgoto invoke_err_return;\n+\t\tif (type == INVOKE_CLOSE)\n+\t\t\tgoto remove_dev;\n+\t\treturn 0;\n+\t}\n+\n+\treturn -1;\n+\n+invoke_err_return:\n+\tRTE_LOG(WARNING, EAL, \"Requested device \" PCI_PRI_FMT\n+\t\t\t\" cannot be used\\n\", dev->addr.domain, dev->addr.bus,\n+\t\t\tdev->addr.devid, dev->addr.function);\n+\treturn -1;\n+\n+remove_dev:\n+\tTAILQ_REMOVE(&pci_device_list, dev, next);\n+\treturn 0;\n+}\n+\n+/*\n+ * Find the pci device specified by pci address, then invoke probe function of\n+ * the driver of the devive.\n+ */\n+int\n+rte_eal_pci_probe_one(struct rte_pci_addr *addr)\n+{\n+\treturn rte_eal_pci_invoke_one(addr, INVOKE_PROBE);\n+}\n+\n+/*\n+ * Find the pci device specified by pci address, then invoke close function of\n+ * the driver of the devive.\n+ */\n+int\n+rte_eal_pci_close_one(struct rte_pci_addr *addr)\n+{\n+\treturn rte_eal_pci_invoke_one(addr, INVOKE_CLOSE);\n+}\n #endif /* RTE_LIBRTE_EAL_HOTPLUG & RTE_LIBRTE_EAL_LINUXAPP */\n \n /*\ndiff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h\nindex 74720d1..33300be 100644\n--- a/lib/librte_eal/common/include/rte_pci.h\n+++ b/lib/librte_eal/common/include/rte_pci.h\n@@ -311,6 +311,32 @@ eal_compare_pci_addr(struct rte_pci_addr *addr, struct rte_pci_addr *addr2)\n int rte_eal_pci_probe(void);\n \n /**\n+ * Probe the single PCI device.\n+ *\n+ * Scan the content of the PCI bus, and find the pci device specified by pci\n+ * addrrss, then call the probe() function for registered driver that has a\n+ * matching entry in its id_table for discovered device.\n+ *\n+ * @return\n+ * - 0 on success.\n+ * - Negative on error.\n+ */\n+int rte_eal_pci_probe_one(struct rte_pci_addr *addr);\n+\n+/**\n+ * Close the single PCI device.\n+ *\n+ * Scan the content of the PCI bus, and find the pci device specified by pci\n+ * addrrss, then call the close() function for registered driver that has a\n+ * matching entry in its id_table for discovered device.\n+ *\n+ * @return\n+ * - 0 on success.\n+ * - Negative on error.\n+ */\n+int rte_eal_pci_close_one(struct rte_pci_addr *addr);\n+\n+/**\n * Dump the content of the PCI bus.\n *\n * @param f\n", "prefixes": [ "dpdk-dev", "23/25" ] }{ "id": 1386, "url": "