get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50417,
    "url": "https://patches.dpdk.org/api/patches/50417/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/5d21b1fa3298560798d568a38319d8ca1777a766.1550760028.git.shahafs@mellanox.com/",
    "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": "<5d21b1fa3298560798d568a38319d8ca1777a766.1550760028.git.shahafs@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/5d21b1fa3298560798d568a38319d8ca1777a766.1550760028.git.shahafs@mellanox.com",
    "date": "2019-02-21T14:50:44",
    "name": "[v2,1/6] vfio: allow DMA map of memory for the default vfio fd",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "830703da7805291b10c85ab0d9bfbda9ad943353",
    "submitter": {
        "id": 634,
        "url": "https://patches.dpdk.org/api/people/634/?format=api",
        "name": "Shahaf Shuler",
        "email": "shahafs@mellanox.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/5d21b1fa3298560798d568a38319d8ca1777a766.1550760028.git.shahafs@mellanox.com/mbox/",
    "series": [
        {
            "id": 3501,
            "url": "https://patches.dpdk.org/api/series/3501/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3501",
            "date": "2019-02-21T14:50:46",
            "name": "introduce DMA memory mapping for external memory",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/3501/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/50417/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/50417/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 58CF62C4F;\n\tThu, 21 Feb 2019 15:51:13 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 7C1B52BB5\n\tfor <dev@dpdk.org>; Thu, 21 Feb 2019 15:51:06 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tshahafs@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 21 Feb 2019 16:51:02 +0200",
            "from unicorn01.mtl.labs.mlnx. (unicorn01.mtl.labs.mlnx\n\t[10.7.12.62])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x1LEp2lo022817;\n\tThu, 21 Feb 2019 16:51:02 +0200"
        ],
        "From": "Shahaf Shuler <shahafs@mellanox.com>",
        "To": "anatoly.burakov@intel.com, yskoh@mellanox.com, thomas@monjalon.net,\n\tferruh.yigit@intel.com, nhorman@tuxdriver.com, gaetan.rivet@6wind.com",
        "Cc": "dev@dpdk.org",
        "Date": "Thu, 21 Feb 2019 16:50:44 +0200",
        "Message-Id": "<5d21b1fa3298560798d568a38319d8ca1777a766.1550760028.git.shahafs@mellanox.com>",
        "X-Mailer": "git-send-email 2.12.0",
        "In-Reply-To": [
            "<cover.1550760026.git.shahafs@mellanox.com>",
            "<cover.1550760026.git.shahafs@mellanox.com>"
        ],
        "References": [
            "<cover.1550760026.git.shahafs@mellanox.com>",
            "<cover.1550048187.git.shahafs@mellanox.com>\n\t<cover.1550760026.git.shahafs@mellanox.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 1/6] vfio: allow DMA map of memory for the\n\tdefault vfio fd",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Enable users the option to call rte_vfio_dma_map with request to map\nto the default vfio fd.\n\nSigned-off-by: Shahaf Shuler <shahafs@mellanox.com>\n---\n doc/guides/rel_notes/release_19_05.rst   |  3 +++\n lib/librte_eal/common/include/rte_vfio.h |  8 ++++++--\n lib/librte_eal/linuxapp/eal/eal_vfio.c   | 10 ++++++++--\n 3 files changed, 17 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst\nindex 2b0f60d3d8..2c682e36cf 100644\n--- a/doc/guides/rel_notes/release_19_05.rst\n+++ b/doc/guides/rel_notes/release_19_05.rst\n@@ -110,6 +110,9 @@ ABI Changes\n    Also, make sure to start the actual text at the margin.\n    =========================================================\n \n+* vfio: Functions ``rte_vfio_container_dma_map`` and\n+  ``rte_vfio_container_dma_unmap`` have been extended with an option to\n+  request mapping or un-mapping to the default vfio container fd.\n \n Shared Library Versions\n -----------------------\ndiff --git a/lib/librte_eal/common/include/rte_vfio.h b/lib/librte_eal/common/include/rte_vfio.h\nindex cae96fab90..54a0df5726 100644\n--- a/lib/librte_eal/common/include/rte_vfio.h\n+++ b/lib/librte_eal/common/include/rte_vfio.h\n@@ -73,6 +73,8 @@ struct vfio_info_cap_header {\n #define RTE_VFIO_CAP_MSIX_MAPPABLE 3\n #endif\n \n+#define RTE_VFIO_DEFAULT_CONTAINER_FD (-1)\n+\n #else /* not VFIO_PRESENT */\n \n /* we don't need an actual definition, only pointer is used */\n@@ -347,7 +349,8 @@ rte_vfio_container_group_unbind(int container_fd, int iommu_group_num);\n  * Perform DMA mapping for devices in a container.\n  *\n  * @param container_fd\n- *   the specified container fd\n+ *   the specified container fd. Use RTE_VFIO_DEFAULT_CONTAINER_FD to\n+ *   use the default container.\n  *\n  * @param vaddr\n  *   Starting virtual address of memory to be mapped.\n@@ -370,7 +373,8 @@ rte_vfio_container_dma_map(int container_fd, uint64_t vaddr,\n  * Perform DMA unmapping for devices in a container.\n  *\n  * @param container_fd\n- *   the specified container fd\n+ *   the specified container fd. Use RTE_VFIO_DEFAULT_CONTAINER_FD to\n+ *   use the default container.\n  *\n  * @param vaddr\n  *   Starting virtual address of memory to be unmapped.\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c\nindex c821e83826..9adbda8bb7 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c\n@@ -1897,7 +1897,10 @@ rte_vfio_container_dma_map(int container_fd, uint64_t vaddr, uint64_t iova,\n \t\treturn -1;\n \t}\n \n-\tvfio_cfg = get_vfio_cfg_by_container_fd(container_fd);\n+\tif (container_fd == RTE_VFIO_DEFAULT_CONTAINER_FD)\n+\t\tvfio_cfg = default_vfio_cfg;\n+\telse\n+\t\tvfio_cfg = get_vfio_cfg_by_container_fd(container_fd);\n \tif (vfio_cfg == NULL) {\n \t\tRTE_LOG(ERR, EAL, \"Invalid container fd\\n\");\n \t\treturn -1;\n@@ -1917,7 +1920,10 @@ rte_vfio_container_dma_unmap(int container_fd, uint64_t vaddr, uint64_t iova,\n \t\treturn -1;\n \t}\n \n-\tvfio_cfg = get_vfio_cfg_by_container_fd(container_fd);\n+\tif (container_fd == RTE_VFIO_DEFAULT_CONTAINER_FD)\n+\t\tvfio_cfg = default_vfio_cfg;\n+\telse\n+\t\tvfio_cfg = get_vfio_cfg_by_container_fd(container_fd);\n \tif (vfio_cfg == NULL) {\n \t\tRTE_LOG(ERR, EAL, \"Invalid container fd\\n\");\n \t\treturn -1;\n",
    "prefixes": [
        "v2",
        "1/6"
    ]
}