Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/17204/?format=api
http://patchwork.dpdk.org/api/patches/17204/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1479931644-78960-4-git-send-email-benjamin.walker@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<1479931644-78960-4-git-send-email-benjamin.walker@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1479931644-78960-4-git-send-email-benjamin.walker@intel.com", "date": "2016-11-23T20:07:21", "name": "[dpdk-dev,v2,4/7] pci: rte_eal_pci_scan now handles removal of PCI devices", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4cea3c20efcb3308959ad5f6028c1d6787963699", "submitter": { "id": 487, "url": "http://patchwork.dpdk.org/api/people/487/?format=api", "name": "Walker, Benjamin", "email": "benjamin.walker@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1479931644-78960-4-git-send-email-benjamin.walker@intel.com/mbox/", "series": [], "comments": "http://patchwork.dpdk.org/api/patches/17204/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/17204/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 0546158C3;\n\tWed, 23 Nov 2016 21:08:00 +0100 (CET)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 0C4E75591\n\tfor <dev@dpdk.org>; Wed, 23 Nov 2016 21:07:33 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga101.fm.intel.com with ESMTP; 23 Nov 2016 12:07:32 -0800", "from bwalker-desk.ch.intel.com ([143.182.137.60])\n\tby orsmga002.jf.intel.com with ESMTP; 23 Nov 2016 12:07:31 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.31,539,1473145200\"; d=\"scan'208\";a=\"8589965\"", "From": "Ben Walker <benjamin.walker@intel.com>", "To": "dev@dpdk.org", "Cc": "Ben Walker <benjamin.walker@intel.com>", "Date": "Wed, 23 Nov 2016 13:07:21 -0700", "Message-Id": "<1479931644-78960-4-git-send-email-benjamin.walker@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1479931644-78960-1-git-send-email-benjamin.walker@intel.com>", "References": "<1479929804-19614-1-git-send-email-benjamin.walker@intel.com>\n\t<1479931644-78960-1-git-send-email-benjamin.walker@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 4/7] pci: rte_eal_pci_scan now handles removal\n\tof PCI devices", "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": "rte_eal_pci_scan can be called repeatedly to re-scan the PCI\nbus. If a device was removed from the system, the associated\ndriver will automatically be unloaded.\n\nSigned-off-by: Ben Walker <benjamin.walker@intel.com>\n---\n lib/librte_eal/linuxapp/eal/eal_pci.c | 62 +++++++++++++++++++++++++++++++++++\n 1 file changed, 62 insertions(+)", "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c\nindex 073af5f..936f076 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c\n@@ -485,7 +485,69 @@ rte_eal_pci_scan(void)\n \tDIR *dir;\n \tchar dirname[PATH_MAX];\n \tstruct rte_pci_addr addr;\n+\tstruct rte_pci_device *dev, *tmp;\n+\n+\t/* Search the device list for devices that are no longer present on the system\n+\t * and remove them.\n+\t */\n+\tTAILQ_FOREACH_SAFE(dev, &pci_device_list, next, tmp) {\n+\t\tint found = 0;\n+\n+\t\tdir = opendir(pci_get_sysfs_path());\n+\t\tif (dir == NULL) {\n+\t\t\tRTE_LOG(ERR, EAL, \"%s(): opendir failed: %s\\n\",\n+\t\t\t\t__func__, strerror(errno));\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\twhile ((e = readdir(dir)) != NULL) {\n+\t\t\tif (e->d_name[0] == '.')\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (parse_pci_addr_format(e->d_name, sizeof(e->d_name),\n+\t\t\t\t\t\t &addr) != 0)\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (rte_eal_compare_pci_addr(&addr, &dev->addr) == 0) {\n+\t\t\t\tfound = 1;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (!found) {\n+\n+\t\t\tRTE_LOG(DEBUG, EAL, \"PCI device \"PCI_PRI_FMT\" was removed.\\n\",\n+\t\t\t\t\taddr.domain, addr.bus, addr.devid,\n+\t\t\t\t\taddr.function);\n+\n+\t\t\tif (dev->driver) {\n+\t\t\t\t/* A driver was loaded against this device.\n+\t\t\t\t * Unload it. */\n+\t\t\t\tRTE_LOG(DEBUG, EAL, \" Unload driver: %x:%x %s\\n\",\n+\t\t\t\t\t\tdev->id.vendor_id, dev->id.device_id,\n+\t\t\t\t\t\tdev->driver->driver.name);\n+\n+\t\t\t\tif (dev->driver->remove) {\n+\t\t\t\t\t/* It doesn't matter what remove returns -\n+\t\t\t\t\t * we're removing the device either way. */\n+\t\t\t\t\tdev->driver->remove(dev);\n+\t\t\t\t}\n+\n+\t\t\t\t/* clear driver structure */\n+\t\t\t\tdev->driver = NULL;\n+\n+\t\t\t\tif (dev->driver->drv_flags & RTE_PCI_DRV_NEED_MAPPING)\n+\t\t\t\t\trte_eal_pci_unmap_device(dev);\n+\t\t\t}\n+\n+\t\t\tTAILQ_REMOVE(&pci_device_list, dev, next);\n+\t\t\tfree(dev);\n+\t\t}\n+\n+\t\tclosedir(dir);\n+\t}\n \n+\t/* Search sysfs for all PCI devices and add them to the device list */\n \tdir = opendir(pci_get_sysfs_path());\n \tif (dir == NULL) {\n \t\tRTE_LOG(ERR, EAL, \"%s(): opendir failed: %s\\n\",\n", "prefixes": [ "dpdk-dev", "v2", "4/7" ] }{ "id": 17204, "url": "