get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77585,
    "url": "http://patches.dpdk.org/api/patches/77585/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200914081727.12215-4-david.marchand@redhat.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20200914081727.12215-4-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200914081727.12215-4-david.marchand@redhat.com",
    "date": "2020-09-14T08:17:25",
    "name": "[3/5] mem: drop mapping API workaround",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9387f06781cda7a5a713f6d34bcc5a96067a37ae",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200914081727.12215-4-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 12177,
            "url": "http://patches.dpdk.org/api/series/12177/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12177",
            "date": "2020-09-14T08:17:22",
            "name": "20.11 announced cleanups",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12177/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77585/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77585/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5932BA04C9;\n\tMon, 14 Sep 2020 10:18:19 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 694E61C10F;\n\tMon, 14 Sep 2020 10:18:09 +0200 (CEST)",
            "from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com\n [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 4E98B1C10D\n for <dev@dpdk.org>; Mon, 14 Sep 2020 10:18:07 +0200 (CEST)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-69-D_a1IzQmObi-fhJi3qUUmg-1; Mon, 14 Sep 2020 04:18:04 -0400",
            "from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com\n [10.5.11.15])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7306356B2A;\n Mon, 14 Sep 2020 08:18:03 +0000 (UTC)",
            "from dmarchan.remote.csb (unknown [10.40.193.82])\n by smtp.corp.redhat.com (Postfix) with ESMTP id A6FDB75120;\n Mon, 14 Sep 2020 08:18:00 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1600071486;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=04AkxNZqwp5rIP3kc+v/jKT5RnkE9K0ua857j0hJm6c=;\n b=L01m7J37rhwDJBoVp04FqRrIdXPx4kIuhygyZgMI91447rVsY4dBO2ggQKqQtC61hBenP7\n uJDqDXre2z3EsfuUlZrPPhlF/qJ50tI49SnVIV6RLBUhyA3RREqnBF9JYbGwS6cuIdv2wx\n XItPJStK59+l4YzemWmY5j1RsHbWmUQ=",
        "X-MC-Unique": "D_a1IzQmObi-fhJi3qUUmg-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ferruh Yigit <ferruh.yigit@intel.com>,\n Anatoly Burakov <anatoly.burakov@intel.com>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,\n Dmitry Malloy <dmitrym@microsoft.com>,\n Pallavi Kadam <pallavi.kadam@intel.com>",
        "Date": "Mon, 14 Sep 2020 10:17:25 +0200",
        "Message-Id": "<20200914081727.12215-4-david.marchand@redhat.com>",
        "In-Reply-To": "<20200914081727.12215-1-david.marchand@redhat.com>",
        "References": "<20200914081727.12215-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com",
        "X-Mimecast-Spam-Score": "0.001",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 3/5] mem: drop mapping API workaround",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Now that the pci_map_resource API is private to the PCI bus, we can drop\nthe compatibility workaround we had implemented in 20.08.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n drivers/bus/pci/bsd/pci.c               |  2 +-\n drivers/bus/pci/linux/pci_uio.c         |  2 +-\n drivers/bus/pci/linux/pci_vfio.c        |  4 ++--\n drivers/bus/pci/pci_common.c            |  1 -\n drivers/bus/pci/pci_common_uio.c        |  2 +-\n drivers/bus/pci/private.h               |  2 +-\n lib/librte_eal/include/rte_eal_paging.h | 10 ----------\n lib/librte_eal/windows/include/rte_os.h |  6 ------\n 8 files changed, 6 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c\nindex a07fc241fe..2ed8261349 100644\n--- a/drivers/bus/pci/bsd/pci.c\n+++ b/drivers/bus/pci/bsd/pci.c\n@@ -192,7 +192,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,\n \tmapaddr = pci_map_resource(NULL, fd, (off_t)offset,\n \t\t\t(size_t)dev->mem_resource[res_idx].len, 0);\n \tclose(fd);\n-\tif (mapaddr == MAP_FAILED)\n+\tif (mapaddr == NULL)\n \t\tgoto error;\n \n \tmaps[map_idx].phaddr = dev->mem_resource[res_idx].phys_addr;\ndiff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c\nindex 9ab20a0b25..f3305a2f28 100644\n--- a/drivers/bus/pci/linux/pci_uio.c\n+++ b/drivers/bus/pci/linux/pci_uio.c\n@@ -346,7 +346,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,\n \tmapaddr = pci_map_resource(pci_map_addr, fd, 0,\n \t\t\t(size_t)dev->mem_resource[res_idx].len, 0);\n \tclose(fd);\n-\tif (mapaddr == MAP_FAILED)\n+\tif (mapaddr == NULL)\n \t\tgoto error;\n \n \tpci_map_addr = RTE_PTR_ADD(mapaddr,\ndiff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c\nindex c15ed3bade..34b5da80df 100644\n--- a/drivers/bus/pci/linux/pci_vfio.c\n+++ b/drivers/bus/pci/linux/pci_vfio.c\n@@ -565,7 +565,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res,\n \t\t}\n \n \t\t/* if there's a second part, try to map it */\n-\t\tif (map_addr != MAP_FAILED\n+\t\tif (map_addr != NULL\n \t\t\t&& memreg[1].offset && memreg[1].size) {\n \t\t\tvoid *second_addr = RTE_PTR_ADD(bar_addr,\n \t\t\t\t\t\t(uintptr_t)(memreg[1].offset -\n@@ -577,7 +577,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res,\n \t\t\t\t\t\t\tRTE_MAP_FORCE_ADDRESS);\n \t\t}\n \n-\t\tif (map_addr == NULL || map_addr == MAP_FAILED) {\n+\t\tif (map_addr == NULL) {\n \t\t\tmunmap(bar_addr, bar->size);\n \t\t\tbar_addr = MAP_FAILED;\n \t\t\tRTE_LOG(ERR, EAL, \"Failed to map pci BAR%d\\n\",\ndiff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c\nindex 3a2ae07958..62d45041bb 100644\n--- a/drivers/bus/pci/pci_common.c\n+++ b/drivers/bus/pci/pci_common.c\n@@ -97,7 +97,6 @@ pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size,\n \t\t\t__func__, fd, requested_addr, size,\n \t\t\t(unsigned long long)offset,\n \t\t\trte_strerror(rte_errno), mapaddr);\n-\t\tmapaddr = MAP_FAILED; /* API uses mmap error code */\n \t} else\n \t\tRTE_LOG(DEBUG, EAL, \"  PCI memory mapped at %p\\n\", mapaddr);\n \ndiff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c\nindex f4dca9da91..793dfd0a7c 100644\n--- a/drivers/bus/pci/pci_common_uio.c\n+++ b/drivers/bus/pci/pci_common_uio.c\n@@ -58,7 +58,7 @@ pci_uio_map_secondary(struct rte_pci_device *dev)\n \t\t\t\t\t\"Cannot mmap device resource file %s to address: %p\\n\",\n \t\t\t\t\tuio_res->maps[i].path,\n \t\t\t\t\tuio_res->maps[i].addr);\n-\t\t\t\tif (mapaddr != MAP_FAILED) {\n+\t\t\t\tif (mapaddr != NULL) {\n \t\t\t\t\t/* unmap addrs correctly mapped */\n \t\t\t\t\tfor (j = 0; j < i; j++)\n \t\t\t\t\t\tpci_unmap_resource(\ndiff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h\nindex 9617268024..530123767b 100644\n--- a/drivers/bus/pci/private.h\n+++ b/drivers/bus/pci/private.h\n@@ -132,7 +132,7 @@ TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);\n  *      The additional rte_mem_map() flags for the mapping range.\n  * @return\n  *   - On success, the function returns a pointer to the mapped area.\n- *   - On error, MAP_FAILED is returned.\n+ *   - On error, NULL is returned.\n  */\n void *pci_map_resource(void *requested_addr, int fd, off_t offset,\n \t\tsize_t size, int additional_flags);\ndiff --git a/lib/librte_eal/include/rte_eal_paging.h b/lib/librte_eal/include/rte_eal_paging.h\nindex 429f896c8c..ed98e70e9e 100644\n--- a/lib/librte_eal/include/rte_eal_paging.h\n+++ b/lib/librte_eal/include/rte_eal_paging.h\n@@ -3,9 +3,6 @@\n  */\n \n #include <stdint.h>\n-#ifndef RTE_EXEC_ENV_WINDOWS\n-#include <sys/mman.h>\n-#endif\n \n #include <rte_compat.h>\n \n@@ -25,7 +22,6 @@ enum rte_mem_prot {\n \n /** Additional flags for memory mapping. */\n enum rte_map_flags {\n-#ifdef RTE_EXEC_ENV_WINDOWS\n \t/** Changes to the mapped memory are visible to other processes. */\n \tRTE_MAP_SHARED = 1 << 0,\n \t/** Mapping is not backed by a regular file. */\n@@ -39,12 +35,6 @@ enum rte_map_flags {\n \t * it is not required to do so, thus mapping with this flag may fail.\n \t */\n \tRTE_MAP_FORCE_ADDRESS = 1 << 3\n-#else /* map mmap flags because they are exposed in pci_map_resource() API */\n-\tRTE_MAP_SHARED = MAP_SHARED,\n-\tRTE_MAP_ANONYMOUS = MAP_ANONYMOUS,\n-\tRTE_MAP_PRIVATE = MAP_PRIVATE,\n-\tRTE_MAP_FORCE_ADDRESS = MAP_FIXED,\n-#endif\n };\n \n /**\ndiff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h\nindex 2881bf2224..569ed92d51 100644\n--- a/lib/librte_eal/windows/include/rte_os.h\n+++ b/lib/librte_eal/windows/include/rte_os.h\n@@ -25,12 +25,6 @@ extern \"C\" {\n #define PATH_MAX _MAX_PATH\n #endif\n \n-/* sys/mman.h\n- * The syscall mmap does not exist on Windows,\n- * but this error code is used in a badly defined DPDK API for PCI mapping.\n- */\n-#define MAP_FAILED ((void *) -1)\n-\n #define sleep(x) Sleep(1000 * (x))\n \n #define strerror_r(a, b, c) strerror_s(b, c, a)\n",
    "prefixes": [
        "3/5"
    ]
}