get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77584,
    "url": "http://patches.dpdk.org/api/patches/77584/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200914081727.12215-3-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-3-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200914081727.12215-3-david.marchand@redhat.com",
    "date": "2020-09-14T08:17:24",
    "name": "[2/5] pci: move resource mapping to the PCI bus",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ccc278e5eba88f3b7ff4590f2ddd7cd3cc5ed756",
    "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-3-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/77584/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77584/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 AB3A9A04C9;\n\tMon, 14 Sep 2020 10:18:11 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2C5511C0D8;\n\tMon, 14 Sep 2020 10:18:06 +0200 (CEST)",
            "from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com\n [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 215291C0DC\n for <dev@dpdk.org>; Mon, 14 Sep 2020 10:18:05 +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-564-EULEa7HXMoGPB1cQzdANRg-1; Mon, 14 Sep 2020 04:17:59 -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 1A18E18B9F8E;\n Mon, 14 Sep 2020 08:17:58 +0000 (UTC)",
            "from dmarchan.remote.csb (unknown [10.40.193.82])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 5214375120;\n Mon, 14 Sep 2020 08:17:55 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1600071484;\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=JvCInaX7nJAH1TkFjHJ26d2h8myCHL2pjCawv4LrAqg=;\n b=IfGrBgIKmwmuILceC4h2yvsaulYWJUmlWQ4PdSzXrcTJukmo0J0lgmN139bvMvA96xz7cl\n U5elJtj1ThhPyQljNcbUfFY9bim98heXf2FnZYBTg6f57/yihvXY0I9VkEnwM3YkyplaZ+\n VKGxl4TgBv5qmvlxMuY8zsslnRAU2ow=",
        "X-MC-Unique": "EULEa7HXMoGPB1cQzdANRg-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ray Kinsella <mdr@ashroe.eu>, Neil Horman <nhorman@tuxdriver.com>,\n John McNamara <john.mcnamara@intel.com>,\n Marko Kovacevic <marko.kovacevic@intel.com>,\n Ferruh Yigit <ferruh.yigit@intel.com>, Gaetan Rivet <grive@u256.net>",
        "Date": "Mon, 14 Sep 2020 10:17:24 +0200",
        "Message-Id": "<20200914081727.12215-3-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.002",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 2/5] pci: move resource mapping to the PCI bus",
        "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": "As reported during 20.08 work for Windows, the pci_map_resource API was\nbuilt with the assumption that its flags would be passed to mmap().\n\nThis introduced a regression when adding the rte_mem_map API as reported\nin the workaround commit 9d2b24593724 (\"pci: keep API compatibility with\nmmap values\").\n\nThis API was only used in the PCI bus code, so move it there.\nWith this move, there is no other user so no ambiguity anymore: the\npassed additional flags are documented as rte_mem_map API flags.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n doc/guides/rel_notes/deprecation.rst   | 11 -----\n doc/guides/rel_notes/release_20_11.rst |  6 +++\n drivers/bus/pci/linux/pci_init.h       |  2 +\n drivers/bus/pci/linux/pci_uio.c        |  1 +\n drivers/bus/pci/pci_common.c           | 41 ++++++++++++++++\n drivers/bus/pci/private.h              | 66 ++++++++++++++++++++++++++\n lib/librte_pci/rte_pci.c               | 42 ----------------\n lib/librte_pci/rte_pci.h               | 66 --------------------------\n lib/librte_pci/rte_pci_version.map     |  2 -\n 9 files changed, 116 insertions(+), 121 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst\nindex d9357fa182..2c7ae1f51e 100644\n--- a/doc/guides/rel_notes/deprecation.rst\n+++ b/doc/guides/rel_notes/deprecation.rst\n@@ -113,17 +113,6 @@ Deprecation Notices\n   us extending existing enum/define.\n   One solution can be using a fixed size array instead of ``.*MAX.*`` value.\n \n-* pci: The PCI resources map API (``pci_map_resource`` and\n-  ``pci_unmap_resource``) was not abstracting the Unix mmap flags (see the\n-  workaround for Windows support implemented in the commit\n-  9d2b24593724 (\"pci: keep API compatibility with mmap values\")).\n-  This API will be removed from the public API in 20.11 and moved to the PCI\n-  bus driver along with the PCI resources lists and associated structures\n-  (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and\n-  ``mapped_pci_res_list``).\n-  With this removal, there won't be a need for the mentioned workaround which\n-  will be reverted.\n-\n * mbuf: Some fields will be converted to dynamic API in DPDK 20.11\n   in order to reserve more space for the dynamic fields, as explained in\n   `this presentation <https://www.youtube.com/watch?v=Ttl6MlhmzWY>`_.\ndiff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex bffbe31947..0f6a557501 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -90,6 +90,12 @@ API Changes\n * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and\n   replaced with a private enum in the PCI subsystem.\n \n+* pci: Removed the PCI resources map API from the public API\n+  (``pci_map_resource`` and ``pci_unmap_resource``) and moved it to the\n+  PCI bus driver along with the PCI resources lists and associated structures\n+  (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and\n+  ``mapped_pci_res_list``).\n+\n * ethdev: Removed the ``kdrv`` field in the ethdev ``rte_eth_dev_data``\n   structure as it gave no useful abstracted information to the applications.\n \ndiff --git a/drivers/bus/pci/linux/pci_init.h b/drivers/bus/pci/linux/pci_init.h\nindex c2e603a374..dcea726186 100644\n--- a/drivers/bus/pci/linux/pci_init.h\n+++ b/drivers/bus/pci/linux/pci_init.h\n@@ -7,6 +7,8 @@\n \n #include <rte_vfio.h>\n \n+#include \"private.h\"\n+\n /** IO resource type: */\n #define IORESOURCE_IO         0x00000100\n #define IORESOURCE_MEM        0x00000200\ndiff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c\nindex a354920d5f..9ab20a0b25 100644\n--- a/drivers/bus/pci/linux/pci_uio.c\n+++ b/drivers/bus/pci/linux/pci_uio.c\n@@ -25,6 +25,7 @@\n \n #include \"eal_filesystem.h\"\n #include \"pci_init.h\"\n+#include \"private.h\"\n \n void *pci_map_addr = NULL;\n \ndiff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c\nindex dddf2b2aad..3a2ae07958 100644\n--- a/drivers/bus/pci/pci_common.c\n+++ b/drivers/bus/pci/pci_common.c\n@@ -19,6 +19,7 @@\n #include <rte_per_lcore.h>\n #include <rte_memory.h>\n #include <rte_eal.h>\n+#include <rte_eal_paging.h>\n #include <rte_string_fns.h>\n #include <rte_common.h>\n #include <rte_devargs.h>\n@@ -79,6 +80,46 @@ pci_name_set(struct rte_pci_device *dev)\n \t\tdev->device.name = dev->name;\n }\n \n+/* map a particular resource from a file */\n+void *\n+pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size,\n+\t\t int additional_flags)\n+{\n+\tvoid *mapaddr;\n+\n+\t/* Map the PCI memory resource of device */\n+\tmapaddr = rte_mem_map(requested_addr, size,\n+\t\tRTE_PROT_READ | RTE_PROT_WRITE,\n+\t\tRTE_MAP_SHARED | additional_flags, fd, offset);\n+\tif (mapaddr == NULL) {\n+\t\tRTE_LOG(ERR, EAL,\n+\t\t\t\"%s(): cannot map resource(%d, %p, 0x%zx, 0x%llx): %s (%p)\\n\",\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+\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 (rte_mem_unmap(requested_addr, size)) {\n+\t\tRTE_LOG(ERR, EAL, \"%s(): cannot mem unmap(%p, %#zx): %s\\n\",\n+\t\t\t__func__, requested_addr, size,\n+\t\t\trte_strerror(rte_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  * Match the PCI Driver and Device using the ID Table\n  */\ndiff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h\nindex 367cdd9a65..9617268024 100644\n--- a/drivers/bus/pci/private.h\n+++ b/drivers/bus/pci/private.h\n@@ -81,6 +81,72 @@ void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev,\n  */\n int pci_update_device(const struct rte_pci_addr *addr);\n \n+/**\n+ * A structure describing a PCI mapping.\n+ */\n+struct pci_map {\n+\tvoid *addr;\n+\tchar *path;\n+\tuint64_t offset;\n+\tuint64_t size;\n+\tuint64_t phaddr;\n+};\n+\n+struct pci_msix_table {\n+\tint bar_index;\n+\tuint32_t offset;\n+\tuint32_t size;\n+};\n+\n+/**\n+ * A structure describing a mapped PCI resource.\n+ * For multi-process we need to reproduce all PCI mappings in secondary\n+ * processes, so save them in a tailq.\n+ */\n+struct mapped_pci_resource {\n+\tTAILQ_ENTRY(mapped_pci_resource) next;\n+\n+\tstruct rte_pci_addr pci_addr;\n+\tchar path[PATH_MAX];\n+\tint nb_maps;\n+\tstruct pci_map maps[PCI_MAX_RESOURCE];\n+\tstruct pci_msix_table msix_table;\n+};\n+\n+\n+/** mapped pci device list */\n+TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);\n+\n+/**\n+ * Map a particular resource from a file.\n+ *\n+ * @param requested_addr\n+ *      The starting address for the new mapping range.\n+ * @param fd\n+ *      The file descriptor.\n+ * @param offset\n+ *      The offset for the mapping range.\n+ * @param size\n+ *      The size for the mapping range.\n+ * @param additional_flags\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+ */\n+void *pci_map_resource(void *requested_addr, int fd, off_t offset,\n+\t\tsize_t size, int additional_flags);\n+\n+/**\n+ * Unmap a particular resource.\n+ *\n+ * @param requested_addr\n+ *      The address for the unmapping range.\n+ * @param size\n+ *      The size for the unmapping range.\n+ */\n+void pci_unmap_resource(void *requested_addr, size_t size);\n+\n /**\n  * Map the PCI resource of a PCI device in virtual memory\n  *\ndiff --git a/lib/librte_pci/rte_pci.c b/lib/librte_pci/rte_pci.c\nindex 1d1cbc75ac..c91be8b167 100644\n--- a/lib/librte_pci/rte_pci.c\n+++ b/lib/librte_pci/rte_pci.c\n@@ -144,45 +144,3 @@ rte_pci_addr_parse(const char *str, struct rte_pci_addr *addr)\n \t\treturn 0;\n \treturn -1;\n }\n-\n-\n-/* map a particular resource from a file */\n-void *\n-pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size,\n-\t\t int additional_flags)\n-{\n-\tvoid *mapaddr;\n-\n-\t/* Map the PCI memory resource of device */\n-\tmapaddr = rte_mem_map(requested_addr, size,\n-\t\tRTE_PROT_READ | RTE_PROT_WRITE,\n-\t\tRTE_MAP_SHARED | additional_flags, fd, offset);\n-\tif (mapaddr == NULL) {\n-\t\tRTE_LOG(ERR, EAL,\n-\t\t\t\"%s(): cannot map resource(%d, %p, 0x%zx, 0x%llx): %s (%p)\\n\",\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-\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 (rte_mem_unmap(requested_addr, size)) {\n-\t\tRTE_LOG(ERR, EAL, \"%s(): cannot mem unmap(%p, %#zx): %s\\n\",\n-\t\t\t__func__, requested_addr, size,\n-\t\t\trte_strerror(rte_errno));\n-\t} else\n-\t\tRTE_LOG(DEBUG, EAL, \"  PCI memory unmapped at %p\\n\",\n-\t\t\t\trequested_addr);\n-}\ndiff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h\nindex a03235da1f..567c8cd68d 100644\n--- a/lib/librte_pci/rte_pci.h\n+++ b/lib/librte_pci/rte_pci.h\n@@ -64,42 +64,6 @@ struct rte_pci_addr {\n #define PCI_ANY_ID (0xffff)\n #define RTE_CLASS_ANY_ID (0xffffff)\n \n-/**\n- * A structure describing a PCI mapping.\n- */\n-struct pci_map {\n-\tvoid *addr;\n-\tchar *path;\n-\tuint64_t offset;\n-\tuint64_t size;\n-\tuint64_t phaddr;\n-};\n-\n-struct pci_msix_table {\n-\tint bar_index;\n-\tuint32_t offset;\n-\tuint32_t size;\n-};\n-\n-/**\n- * A structure describing a mapped PCI resource.\n- * For multi-process we need to reproduce all PCI mappings in secondary\n- * processes, so save them in a tailq.\n- */\n-struct mapped_pci_resource {\n-\tTAILQ_ENTRY(mapped_pci_resource) next;\n-\n-\tstruct rte_pci_addr pci_addr;\n-\tchar path[PATH_MAX];\n-\tint nb_maps;\n-\tstruct pci_map maps[PCI_MAX_RESOURCE];\n-\tstruct pci_msix_table msix_table;\n-};\n-\n-\n-/** mapped pci device list */\n-TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);\n-\n /**\n  * Utility function to write a pci device name, this device name can later be\n  * used to retrieve the corresponding rte_pci_addr using eal_parse_pci_*\n@@ -145,36 +109,6 @@ int rte_pci_addr_cmp(const struct rte_pci_addr *addr,\n  */\n int rte_pci_addr_parse(const char *str, struct rte_pci_addr *addr);\n \n-/**\n- * Map a particular resource from a file.\n- *\n- * @param requested_addr\n- *      The starting address for the new mapping range.\n- * @param fd\n- *      The file descriptor.\n- * @param offset\n- *      The offset for the mapping range.\n- * @param size\n- *      The size for the mapping range.\n- * @param additional_flags\n- *      The additional 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- */\n-void *pci_map_resource(void *requested_addr, int fd, off_t offset,\n-\t\tsize_t size, int additional_flags);\n-\n-/**\n- * Unmap a particular resource.\n- *\n- * @param requested_addr\n- *      The address for the unmapping range.\n- * @param size\n- *      The size for the unmapping range.\n- */\n-void pci_unmap_resource(void *requested_addr, size_t size);\n-\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_pci/rte_pci_version.map b/lib/librte_pci/rte_pci_version.map\nindex cd77c9dc9e..1db19a5122 100644\n--- a/lib/librte_pci/rte_pci_version.map\n+++ b/lib/librte_pci/rte_pci_version.map\n@@ -1,8 +1,6 @@\n DPDK_21 {\n \tglobal:\n \n-\tpci_map_resource;\n-\tpci_unmap_resource;\n \trte_pci_addr_cmp;\n \trte_pci_addr_parse;\n \trte_pci_device_name;\n",
    "prefixes": [
        "2/5"
    ]
}