get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1383/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1383,
    "url": "https://patches.dpdk.org/api/patches/1383/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1416474399-16851-21-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-21-git-send-email-mukawa@igel.co.jp>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1416474399-16851-21-git-send-email-mukawa@igel.co.jp",
    "date": "2014-11-20T09:06:34",
    "name": "[dpdk-dev,20/25] eal/pci: Add rte_eal_pci_close_one_driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f164f62f8f1c543a0f770304dedd184b09009122",
    "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-21-git-send-email-mukawa@igel.co.jp/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1383/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1383/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 C617B8049;\n\tThu, 20 Nov 2014 09:57:43 +0100 (CET)",
            "from mail-pa0-f48.google.com (mail-pa0-f48.google.com\n\t[209.85.220.48]) by dpdk.org (Postfix) with ESMTP id 15C087F7C\n\tfor <dev@dpdk.org>; Thu, 20 Nov 2014 09:57:39 +0100 (CET)",
            "by mail-pa0-f48.google.com with SMTP id rd3so2160383pab.35\n\tfor <dev@dpdk.org>; Thu, 20 Nov 2014 01:08:07 -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.05 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 20 Nov 2014 01:08:07 -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=qiWjcYcU7fLTff3ND6wovBpt16E2ElCaXxhiQzeb9OM=;\n\tb=M1H0cY8Z/Te7O9PXkE5+NqrXPDimsQ2YooqLEFr89hPKrz4gWWw8rSNdHrFDT8EJiU\n\txb863fg8iFZzq6hFV+Tn0D/Ber5qhT27pkdnYmTtelEmJy/x4/3h1hV8cHIpCZrehTT7\n\tCy7Gv/w3kAdMjZQwwlhsUjVw6I/GUD/8qkdTAtXll0TcGuesgd4XSyCTt5Fue/fplckm\n\teRlRgaYR74PvR3sTKXsBLNHhkOAvIQBPXjoomkjt2wpDCEZt0xbSb1FhqY3ZHwfPu9Nu\n\t5u4yRcB68j8AVr5v+hDAu44Qr3+5vb1AuNhmJ2z1JhEnwA+370CT8hPf7NBaDEoR4fdh\n\tGVLQ==",
        "X-Gm-Message-State": "ALoCoQn1PZY7Ifmf1Tlat7x3ZxYEz4Evy5MhzhUKMnMWDirHnYzu5rQgiDV4MwwObSQhv7xv2YlV",
        "X-Received": "by 10.66.234.100 with SMTP id ud4mr19445328pac.36.1416474487782; \n\tThu, 20 Nov 2014 01:08:07 -0800 (PST)",
        "From": "Tetsuya Mukawa <mukawa@igel.co.jp>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 20 Nov 2014 18:06:34 +0900",
        "Message-Id": "<1416474399-16851-21-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 20/25] eal/pci: Add rte_eal_pci_close_one_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": "The function is used for closing the specified driver and device.\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_eal/common/include/eal_private.h | 11 ++++++\n lib/librte_eal/linuxapp/eal/eal_pci.c       | 58 +++++++++++++++++++++++++++++\n 2 files changed, 69 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/include/eal_private.h b/lib/librte_eal/common/include/eal_private.h\nindex a1127ab..b2776cc 100644\n--- a/lib/librte_eal/common/include/eal_private.h\n+++ b/lib/librte_eal/common/include/eal_private.h\n@@ -176,6 +176,17 @@ int rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr,\n \t\tstruct rte_pci_device *dev);\n \n /**\n+ * Munmap memory for single PCI device\n+ *\n+ * This function is private to EAL.\n+ *\n+ * @return\n+ *   0 on success, negative on error\n+ */\n+int rte_eal_pci_close_one_driver(struct rte_pci_driver *dr,\n+\t\tstruct rte_pci_device *dev);\n+\n+/**\n  * Init tail queues for non-EAL library structures. This is to allow\n  * the rings, mempools, etc. lists to be shared among multiple processes\n  *\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c\nindex 0317366..fbfef40 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c\n@@ -599,6 +599,64 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d\n \treturn 1;\n }\n \n+#if defined(RTE_LIBRTE_EAL_HOTPLUG) && defined(RTE_LIBRTE_EAL_LINUXAPP)\n+/*\n+ * If vendor/device ID match, call the devshutdown() function of the\n+ * driver.\n+ */\n+int\n+rte_eal_pci_close_one_driver(struct rte_pci_driver *dr,\n+\t\tstruct rte_pci_device *dev)\n+{\n+\tstruct rte_pci_id *id_table;\n+\n+\tfor (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {\n+\n+\t\t/* check if device's identifiers match the driver's ones */\n+\t\tif (id_table->vendor_id != dev->id.vendor_id &&\n+\t\t\t\tid_table->vendor_id != PCI_ANY_ID)\n+\t\t\tcontinue;\n+\t\tif (id_table->device_id != dev->id.device_id &&\n+\t\t\t\tid_table->device_id != PCI_ANY_ID)\n+\t\t\tcontinue;\n+\t\tif (id_table->subsystem_vendor_id !=\n+\t\t\t\tdev->id.subsystem_vendor_id &&\n+\t\t\t\tid_table->subsystem_vendor_id != PCI_ANY_ID)\n+\t\t\tcontinue;\n+\t\tif (id_table->subsystem_device_id !=\n+\t\t\t\tdev->id.subsystem_device_id &&\n+\t\t\t\tid_table->subsystem_device_id != PCI_ANY_ID)\n+\t\t\tcontinue;\n+\n+\t\tstruct rte_pci_addr *loc = &dev->addr;\n+\n+\t\tRTE_LOG(DEBUG, EAL,\n+\t\t\t\t\"PCI device \"PCI_PRI_FMT\" on NUMA socket %i\\n\",\n+\t\t\t\tloc->domain, loc->bus, loc->devid,\n+\t\t\t\tloc->function, dev->numa_node);\n+\n+\t\tRTE_LOG(DEBUG, EAL, \"  remove driver: %x:%x %s\\n\",\n+\t\t\t\tdev->id.vendor_id, dev->id.device_id,\n+\t\t\t\tdr->name);\n+\n+\t\t/* call the driver devshutdown() function */\n+\t\tif (dr->devshutdown && (dr->devshutdown(dr, dev) < 0))\n+\t\t\treturn -1;\t/* negative value is an error */\n+\n+\t\t/* clear driver structure */\n+\t\tdev->driver = NULL;\n+\n+\t\tif (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING)\n+\t\t\t/* unmap resources for devices that use igb_uio */\n+\t\t\tpci_unmap_device(dev);\n+\n+\t\treturn 0;\n+\t}\n+\t/* return positive value if driver is not found */\n+\treturn 1;\n+}\n+#endif /* RTE_LIBRTE_EAL_HOTPLUG & RTE_LIBRTE_EAL_LINUXAPP */\n+\n /* Init the PCI EAL subsystem */\n int\n rte_eal_pci_init(void)\n",
    "prefixes": [
        "dpdk-dev",
        "20/25"
    ]
}