get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 3692,
    "url": "https://patches.dpdk.org/api/patches/3692/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1424837093-5661-10-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": "<1424837093-5661-10-git-send-email-mukawa@igel.co.jp>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1424837093-5661-10-git-send-email-mukawa@igel.co.jp",
    "date": "2015-02-25T04:04:47",
    "name": "[dpdk-dev,v14,09/13] eal/linux/pci: Add functions for unmapping igb_uio resources",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "f377f1bb575d4a4c922900a190010ae86fea23ec",
    "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/1424837093-5661-10-git-send-email-mukawa@igel.co.jp/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/3692/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/3692/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 6BB9AAD8C;\n\tWed, 25 Feb 2015 05:05:48 +0100 (CET)",
            "from mail-pd0-f174.google.com (mail-pd0-f174.google.com\n\t[209.85.192.174]) by dpdk.org (Postfix) with ESMTP id 46CC99AE2\n\tfor <dev@dpdk.org>; Wed, 25 Feb 2015 05:05:38 +0100 (CET)",
            "by pdjy10 with SMTP id y10so1859299pdj.6\n\tfor <dev@dpdk.org>; Tue, 24 Feb 2015 20:05:37 -0800 (PST)",
            "from localhost.localdomain (napt.igel.co.jp. [219.106.231.132])\n\tby mx.google.com with ESMTPSA id\n\ty7sm3140021pdp.92.2015.02.24.20.05.35\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 24 Feb 2015 20:05:36 -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=Iqd1NtMHv6D0wUZdGHiacxOpGONvcGqHtATbJCK4G2s=;\n\tb=VmHDjqpPxF3e565iinpgWwESk6cIZqAgSdDM8wNvBK6vqevSRvhvA02GTL1Ayz2s2Q\n\tVyG5nIFEvE+S2gqRvfS6D4X0VwLo+ONTEcv4IcQyWHwHApylJbrWcdPUswxl+ZJlcPr8\n\tPBKnRCgOitmuiYAWbhrAFcmNGUycTx7nsseWBjJEf0vwhdk/YJf7dIo4UJtNARAYu29I\n\thKxxYsBZXuto34U8JnA9NwrntxX+JHtKXhPSEbz/U+C4VRttSNGlOX9KBGRm6X53bDVg\n\tdojn6YXcE3bAupm3SLHYUX4xV4Sw3Ynj+WtYTyaWTpv0f98f9VSUwK+ENVUCC4fcR9F6\n\t/XQQ==",
        "X-Gm-Message-State": "ALoCoQlW9C/MgylALZoyVHwZ0BuAwxxIQAkzfdXjyRpyq3MlzHoX38ksQDa6zVDCpuCQykv7+l5Z",
        "X-Received": "by 10.66.235.1 with SMTP id ui1mr2059043pac.80.1424837137707;\n\tTue, 24 Feb 2015 20:05:37 -0800 (PST)",
        "From": "Tetsuya Mukawa <mukawa@igel.co.jp>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 25 Feb 2015 13:04:47 +0900",
        "Message-Id": "<1424837093-5661-10-git-send-email-mukawa@igel.co.jp>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1424837093-5661-1-git-send-email-mukawa@igel.co.jp>",
        "References": "<1424060073-23484-2-git-send-email-mukawa@igel.co.jp>\n\t<1424837093-5661-1-git-send-email-mukawa@igel.co.jp>",
        "Subject": "[dpdk-dev] [PATCH v14 09/13] eal/linux/pci: Add functions for\n\tunmapping igb_uio resources",
        "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 patch adds functions for unmapping igb_uio resources. The patch is only\nfor Linux and igb_uio environment. VFIO and BSD are not supported.\n\nv9:\n- Remove \"rte_dev_hotplug.h\".\n- Remove needless \"#ifdef\".\n  (Thanks to Thomas Monjalon and Neil Horman)\n- Remove pci_unmap_device(). It will be implemented in later patch.\nv8:\n- Fix typo.\n  (Thanks to Iremonger, Bernard)\nv5:\n- Fix pci_unmap_device() to check pt_driver.\nv4:\n- Add parameter checking.\n- Add header file to determine if hotplug can be enabled.\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_eal/linuxapp/eal/eal_pci.c      | 17 ++++++++\n lib/librte_eal/linuxapp/eal/eal_pci_init.h |  7 ++++\n lib/librte_eal/linuxapp/eal/eal_pci_uio.c  | 65 ++++++++++++++++++++++++++++++\n 3 files changed, 89 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c\nindex 06bfc1a..d03429c 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c\n@@ -168,6 +168,23 @@ pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size,\n \treturn mapaddr;\n }\n \n+/* unmap a particular resource */\n+void\n+pci_unmap_resource(void *requested_addr, size_t size)\n+{\n+\tif (requested_addr == NULL)\n+\t\treturn;\n+\n+\t/* Unmap the PCI memory resource of device */\n+\tif (munmap(requested_addr, size)) {\n+\t\tRTE_LOG(ERR, EAL, \"%s(): cannot munmap(%p, 0x%lx): %s\\n\",\n+\t\t\t__func__, requested_addr, (unsigned long)size,\n+\t\t\tstrerror(errno));\n+\t} else\n+\t\tRTE_LOG(DEBUG, EAL, \"  PCI memory unmapped at %p\\n\",\n+\t\t\t\trequested_addr);\n+}\n+\n /* parse the \"resource\" sysfs file */\n static int\n pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev)\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_pci_init.h b/lib/librte_eal/linuxapp/eal/eal_pci_init.h\nindex 03d2b52..6af84d1 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci_init.h\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci_init.h\n@@ -72,6 +72,13 @@ void *pci_map_resource(void *requested_addr, int fd, off_t offset,\n /* map IGB_UIO resource prototype */\n int pci_uio_map_resource(struct rte_pci_device *dev);\n \n+void pci_unmap_resource(void *requested_addr, size_t size);\n+\n+#ifdef RTE_LIBRTE_EAL_HOTPLUG\n+/* unmap IGB_UIO resource prototype */\n+void pci_uio_unmap_resource(struct rte_pci_device *dev);\n+#endif /* RTE_LIBRTE_EAL_HOTPLUG */\n+\n #ifdef VFIO_PRESENT\n \n #define VFIO_MAX_GROUPS 64\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c\nindex c5e0cf3..35d31c5 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c\n@@ -386,3 +386,68 @@ pci_uio_map_resource(struct rte_pci_device *dev)\n \n \treturn 0;\n }\n+\n+#ifdef RTE_LIBRTE_EAL_HOTPLUG\n+static void\n+pci_uio_unmap(struct mapped_pci_resource *uio_res)\n+{\n+\tint i;\n+\n+\tif (uio_res == NULL)\n+\t\treturn;\n+\n+\tfor (i = 0; i != uio_res->nb_maps; i++)\n+\t\tpci_unmap_resource(uio_res->maps[i].addr,\n+\t\t\t\t(size_t)uio_res->maps[i].size);\n+}\n+\n+static struct mapped_pci_resource *\n+pci_uio_find_resource(struct rte_pci_device *dev)\n+{\n+\tstruct mapped_pci_resource *uio_res;\n+\n+\tif (dev == NULL)\n+\t\treturn NULL;\n+\n+\tTAILQ_FOREACH(uio_res, pci_res_list, next) {\n+\n+\t\t/* skip this element if it doesn't match our PCI address */\n+\t\tif (!rte_eal_compare_pci_addr(&uio_res->pci_addr, &dev->addr))\n+\t\t\treturn uio_res;\n+\t}\n+\treturn NULL;\n+}\n+\n+/* unmap the PCI resource of a PCI device in virtual memory */\n+void\n+pci_uio_unmap_resource(struct rte_pci_device *dev)\n+{\n+\tstruct mapped_pci_resource *uio_res;\n+\n+\tif (dev == NULL)\n+\t\treturn;\n+\n+\t/* find an entry for the device */\n+\tuio_res = pci_uio_find_resource(dev);\n+\tif (uio_res == NULL)\n+\t\treturn;\n+\n+\t/* secondary processes - just free maps */\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn pci_uio_unmap(uio_res);\n+\n+\tTAILQ_REMOVE(pci_res_list, uio_res, next);\n+\n+\t/* unmap all resources */\n+\tpci_uio_unmap(uio_res);\n+\n+\t/* free uio resource */\n+\trte_free(uio_res);\n+\n+\t/* close fd if in primary process */\n+\tclose(dev->intr_handle.fd);\n+\n+\tdev->intr_handle.fd = -1;\n+\tdev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;\n+}\n+#endif /* RTE_LIBRTE_EAL_HOTPLUG */\n",
    "prefixes": [
        "dpdk-dev",
        "v14",
        "09/13"
    ]
}