get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 127479,
    "url": "http://patches.dpdk.org/api/patches/127479/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230525162551.70359-9-maxime.coquelin@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": "<20230525162551.70359-9-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230525162551.70359-9-maxime.coquelin@redhat.com",
    "date": "2023-05-25T16:25:31",
    "name": "[v3,08/28] vhost: add offset field to IOTLB entries",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4784e6bd6a0a0516a5356dfb89b7d42840b9a303",
    "submitter": {
        "id": 512,
        "url": "http://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230525162551.70359-9-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 28187,
            "url": "http://patches.dpdk.org/api/series/28187/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28187",
            "date": "2023-05-25T16:25:23",
            "name": "Add VDUSE support to Vhost library",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/28187/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/127479/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/127479/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A9A0442B9D;\n\tThu, 25 May 2023 18:27:10 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E824242F9A;\n\tThu, 25 May 2023 18:26:48 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id CA00242D36\n for <dev@dpdk.org>; Thu, 25 May 2023 18:26:46 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-145-k-f-DAgUMEGAezZJgRLT8g-1; Thu, 25 May 2023 12:26:35 -0400",
            "from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com\n [10.11.54.7])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D0422A2AD7D;\n Thu, 25 May 2023 16:26:35 +0000 (UTC)",
            "from max-t490s.redhat.com (unknown [10.39.208.23])\n by smtp.corp.redhat.com (Postfix) with ESMTP id E4E0D140E95D;\n Thu, 25 May 2023 16:26:32 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1685032006;\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=9czbGkIafZvcd40//Ui+57ZvmoAvFB4nCHC2HULjqiI=;\n b=Tcofd6xw2XFgBJVzlolJeSiZt/MvttCVtbAYewhG0/Y0D1HkkARky8+jHkYMjSBrxFjOsI\n qY71A9wk/E/hh1Fu04PirPYFvYkkGIS6EJBwRtUwb0b6L8ySRkdQ664heAbQq2JypEZb8o\n 7dSrfRG9hDbqVcXHw5nUq27HFE8Ks1g=",
        "X-MC-Unique": "k-f-DAgUMEGAezZJgRLT8g-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, chenbo.xia@intel.com, david.marchand@redhat.com,\n mkp@redhat.com, fbl@redhat.com, jasowang@redhat.com,\n cunming.liang@intel.com, xieyongji@bytedance.com, echaudro@redhat.com,\n eperezma@redhat.com, amorenoz@redhat.com, lulu@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Subject": "[PATCH v3 08/28] vhost: add offset field to IOTLB entries",
        "Date": "Thu, 25 May 2023 18:25:31 +0200",
        "Message-Id": "<20230525162551.70359-9-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20230525162551.70359-1-maxime.coquelin@redhat.com>",
        "References": "<20230525162551.70359-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.7",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "This patch is a preliminary work to prepare for VDUSE\nsupport, for which we need to keep track of the mmaped base\naddress and offset in order to be able to unmap it later\nwhen IOTLB entry is invalidated.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\nReviewed-by: Chenbo Xia <chenbo.xia@intel.com>\n---\n lib/vhost/iotlb.c      | 30 ++++++++++++++++++------------\n lib/vhost/iotlb.h      |  2 +-\n lib/vhost/vhost_user.c |  2 +-\n 3 files changed, 20 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/lib/vhost/iotlb.c b/lib/vhost/iotlb.c\nindex f28483cb7a..14d143366b 100644\n--- a/lib/vhost/iotlb.c\n+++ b/lib/vhost/iotlb.c\n@@ -17,6 +17,7 @@ struct vhost_iotlb_entry {\n \n \tuint64_t iova;\n \tuint64_t uaddr;\n+\tuint64_t uoffset;\n \tuint64_t size;\n \tuint8_t perm;\n };\n@@ -27,15 +28,18 @@ static bool\n vhost_user_iotlb_share_page(struct vhost_iotlb_entry *a, struct vhost_iotlb_entry *b,\n \t\tuint64_t align)\n {\n-\tuint64_t a_end, b_start;\n+\tuint64_t a_start, a_end, b_start;\n \n \tif (a == NULL || b == NULL)\n \t\treturn false;\n \n+\ta_start = a->uaddr + a->uoffset;\n+\tb_start = b->uaddr + b->uoffset;\n+\n \t/* Assumes entry a lower than entry b */\n-\tRTE_ASSERT(a->uaddr < b->uaddr);\n-\ta_end = RTE_ALIGN_CEIL(a->uaddr + a->size, align);\n-\tb_start = RTE_ALIGN_FLOOR(b->uaddr, align);\n+\tRTE_ASSERT(a_start < b_start);\n+\ta_end = RTE_ALIGN_CEIL(a_start + a->size, align);\n+\tb_start = RTE_ALIGN_FLOOR(b_start, align);\n \n \treturn a_end > b_start;\n }\n@@ -43,11 +47,12 @@ vhost_user_iotlb_share_page(struct vhost_iotlb_entry *a, struct vhost_iotlb_entr\n static void\n vhost_user_iotlb_set_dump(struct virtio_net *dev, struct vhost_iotlb_entry *node)\n {\n-\tuint64_t align;\n+\tuint64_t align, start;\n \n-\talign = hua_to_alignment(dev->mem, (void *)(uintptr_t)node->uaddr);\n+\tstart = node->uaddr + node->uoffset;\n+\talign = hua_to_alignment(dev->mem, (void *)(uintptr_t)start);\n \n-\tmem_set_dump((void *)(uintptr_t)node->uaddr, node->size, true, align);\n+\tmem_set_dump((void *)(uintptr_t)start, node->size, true, align);\n }\n \n static void\n@@ -56,10 +61,10 @@ vhost_user_iotlb_clear_dump(struct virtio_net *dev, struct vhost_iotlb_entry *no\n {\n \tuint64_t align, start, end;\n \n-\tstart = node->uaddr;\n-\tend = node->uaddr + node->size;\n+\tstart = node->uaddr + node->uoffset;\n+\tend = start + node->size;\n \n-\talign = hua_to_alignment(dev->mem, (void *)(uintptr_t)node->uaddr);\n+\talign = hua_to_alignment(dev->mem, (void *)(uintptr_t)start);\n \n \t/* Skip first page if shared with previous entry. */\n \tif (vhost_user_iotlb_share_page(prev, node, align))\n@@ -234,7 +239,7 @@ vhost_user_iotlb_cache_random_evict(struct virtio_net *dev)\n \n void\n vhost_user_iotlb_cache_insert(struct virtio_net *dev, uint64_t iova, uint64_t uaddr,\n-\t\t\t\tuint64_t size, uint8_t perm)\n+\t\t\t\tuint64_t uoffset, uint64_t size, uint8_t perm)\n {\n \tstruct vhost_iotlb_entry *node, *new_node;\n \n@@ -256,6 +261,7 @@ vhost_user_iotlb_cache_insert(struct virtio_net *dev, uint64_t iova, uint64_t ua\n \n \tnew_node->iova = iova;\n \tnew_node->uaddr = uaddr;\n+\tnew_node->uoffset = uoffset;\n \tnew_node->size = size;\n \tnew_node->perm = perm;\n \n@@ -344,7 +350,7 @@ vhost_user_iotlb_cache_find(struct virtio_net *dev, uint64_t iova, uint64_t *siz\n \n \t\toffset = iova - node->iova;\n \t\tif (!vva)\n-\t\t\tvva = node->uaddr + offset;\n+\t\t\tvva = node->uaddr + node->uoffset + offset;\n \n \t\tmapped += node->size - offset;\n \t\tiova = node->iova + node->size;\ndiff --git a/lib/vhost/iotlb.h b/lib/vhost/iotlb.h\nindex 3490b9e6be..bee36c5903 100644\n--- a/lib/vhost/iotlb.h\n+++ b/lib/vhost/iotlb.h\n@@ -58,7 +58,7 @@ vhost_user_iotlb_wr_unlock_all(struct virtio_net *dev)\n }\n \n void vhost_user_iotlb_cache_insert(struct virtio_net *dev, uint64_t iova, uint64_t uaddr,\n-\t\t\t\t\tuint64_t size, uint8_t perm);\n+\t\t\t\t\tuint64_t uoffset, uint64_t size, uint8_t perm);\n void vhost_user_iotlb_cache_remove(struct virtio_net *dev, uint64_t iova, uint64_t size);\n uint64_t vhost_user_iotlb_cache_find(struct virtio_net *dev, uint64_t iova,\n \t\t\t\t\tuint64_t *size, uint8_t perm);\ndiff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c\nindex 8d0f84348b..222ccbf819 100644\n--- a/lib/vhost/vhost_user.c\n+++ b/lib/vhost/vhost_user.c\n@@ -2641,7 +2641,7 @@ vhost_user_iotlb_msg(struct virtio_net **pdev,\n \t\tif (!vva)\n \t\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \n-\t\tvhost_user_iotlb_cache_insert(dev, imsg->iova, vva, len, imsg->perm);\n+\t\tvhost_user_iotlb_cache_insert(dev, imsg->iova, vva, 0, len, imsg->perm);\n \n \t\tfor (i = 0; i < dev->nr_vring; i++) {\n \t\t\tstruct vhost_virtqueue *vq = dev->virtqueue[i];\n",
    "prefixes": [
        "v3",
        "08/28"
    ]
}