get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81069,
    "url": "https://patches.dpdk.org/api/patches/81069/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1602840525-8848-1-git-send-email-wangyunjian@huawei.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": "<1602840525-8848-1-git-send-email-wangyunjian@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1602840525-8848-1-git-send-email-wangyunjian@huawei.com",
    "date": "2020-10-16T09:28:45",
    "name": "[v3] eal: fix create user mem map repeatedly when it exists",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "67aef0401b904b3c92f3c71148fd80ed303bbf7c",
    "submitter": {
        "id": 551,
        "url": "https://patches.dpdk.org/api/people/551/?format=api",
        "name": "Yunjian Wang",
        "email": "wangyunjian@huawei.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1602840525-8848-1-git-send-email-wangyunjian@huawei.com/mbox/",
    "series": [
        {
            "id": 13051,
            "url": "https://patches.dpdk.org/api/series/13051/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13051",
            "date": "2020-10-16T09:28:45",
            "name": "[v3] eal: fix create user mem map repeatedly when it exists",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/13051/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/81069/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/81069/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 BA675A04DB;\n\tFri, 16 Oct 2020 11:29:01 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9D2281EB36;\n\tFri, 16 Oct 2020 11:29:00 +0200 (CEST)",
            "from huawei.com (szxga05-in.huawei.com [45.249.212.191])\n by dpdk.org (Postfix) with ESMTP id 8ECE71D5CA;\n Fri, 16 Oct 2020 11:28:58 +0200 (CEST)",
            "from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58])\n by Forcepoint Email with ESMTP id 8D3B13AC377A173C5D4C;\n Fri, 16 Oct 2020 17:28:56 +0800 (CST)",
            "from localhost (10.174.187.156) by DGGEMS403-HUB.china.huawei.com\n (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Fri, 16 Oct 2020\n 17:28:47 +0800"
        ],
        "From": "wangyunjian <wangyunjian@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<david.marchand@redhat.com>, <anatoly.burakov@intel.com>,\n <jerry.lilijun@huawei.com>, <xudingke@huawei.com>, Yunjian Wang\n <wangyunjian@huawei.com>, <stable@dpdk.org>",
        "Date": "Fri, 16 Oct 2020 17:28:45 +0800",
        "Message-ID": "<1602840525-8848-1-git-send-email-wangyunjian@huawei.com>",
        "X-Mailer": "git-send-email 1.9.5.msysgit.1",
        "In-Reply-To": "<1595515713-24640-1-git-send-email-wangyunjian@huawei.com>",
        "References": "<1595515713-24640-1-git-send-email-wangyunjian@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.174.187.156]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH v3] eal: fix create user mem map repeatedly when\n\tit exists",
        "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": "From: Yunjian Wang <wangyunjian@huawei.com>\n\nCurrently, a issue that a container has many devices and the\napplication will map the same memory many times. The kernel\ndriver returns EEXIST as long as there are overlapping memory\nareas. As a result, we repeatedly create new user mem map entry\nfor the same memory segment and this will lead to no more space\nfor other user mem maps.\n\nTo resolve the issue, add support to remove the same entry in\nthe function compact_user_maps().\n\nFixes: 0cbce3a167f1 (\"vfio: skip DMA map failure if already mapped\")\nCc: stable@dpdk.org\n\nSigned-off-by: Yunjian Wang <wangyunjian@huawei.com>\nAcked-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\nv3:\n   Only update commit log and title\n---\n lib/librte_eal/linux/eal_vfio.c | 5 +++++\n 1 file changed, 5 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c\nindex 380f2f44a..7cff51e16 100644\n--- a/lib/librte_eal/linux/eal_vfio.c\n+++ b/lib/librte_eal/linux/eal_vfio.c\n@@ -167,6 +167,10 @@ adjust_map(struct user_mem_map *src, struct user_mem_map *end,\n static int\n merge_map(struct user_mem_map *left, struct user_mem_map *right)\n {\n+\t/* merge the same maps into one */\n+\tif (memcmp(left, right, sizeof(struct user_mem_map)) == 0)\n+\t\tgoto out;\n+\n \tif (left->addr + left->len != right->addr)\n \t\treturn 0;\n \tif (left->iova + left->len != right->iova)\n@@ -174,6 +178,7 @@ merge_map(struct user_mem_map *left, struct user_mem_map *right)\n \n \tleft->len += right->len;\n \n+out:\n \tmemset(right, 0, sizeof(*right));\n \n \treturn 1;\n",
    "prefixes": [
        "v3"
    ]
}