get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131728,
    "url": "http://patches.dpdk.org/api/patches/131728/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230920130147.1567735-1-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": "<20230920130147.1567735-1-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230920130147.1567735-1-maxime.coquelin@redhat.com",
    "date": "2023-09-20T13:01:47",
    "name": "net/virtio: fix descriptors buffer addresses on 32 bits builds",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "4de64081fa725ba9ad60da03b1c68b97735fdebd",
    "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/20230920130147.1567735-1-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 29573,
            "url": "http://patches.dpdk.org/api/series/29573/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29573",
            "date": "2023-09-20T13:01:47",
            "name": "net/virtio: fix descriptors buffer addresses on 32 bits builds",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/29573/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/131728/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/131728/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 A1064425F3;\n\tWed, 20 Sep 2023 15:02:03 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8F11A40A89;\n\tWed, 20 Sep 2023 15:02:03 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 78C0E40A79\n for <dev@dpdk.org>; Wed, 20 Sep 2023 15:02:01 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) 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-164-y8Zuu7plPDeKH0l21_fVcg-1; Wed, 20 Sep 2023 09:01:57 -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 ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 812CC89C6B1;\n Wed, 20 Sep 2023 13:01:53 +0000 (UTC)",
            "from max-p1.redhat.com (unknown [10.39.208.35])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 63496140273D;\n Wed, 20 Sep 2023 13:01:51 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1695214921;\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 bh=rWGiBOcnyExQ2ruyMxNr6jD4zNX/a5FvjIbj0MIeOhI=;\n b=WIMymhHG7Cd7mZESNTHZlMOGQiGIoB0PrdGuiKobjPUUv6TcQfSlCIOdLH15IIwGxPmZeH\n 2izHFgjtgM5t4erCZBINOJTaexpKtJ+OUGwQBl6LpDsVof9FVCAgtN/jNlp8pb9a2qoW1B\n /8Z5ZlOPiBmA8SyiMegO806wA929h1s=",
        "X-MC-Unique": "y8Zuu7plPDeKH0l21_fVcg-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, rmelton@cisco.com, davejo@cisco.com, speechu@cisco.com,\n chenbo.xia@outlook.com, mbumgard@cisco.com, cbrezove@cisco.com,\n david.marchand@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>,\n\tstable@dpdk.org",
        "Subject": "[PATCH] net/virtio: fix descriptors buffer addresses on 32 bits\n builds",
        "Date": "Wed, 20 Sep 2023 15:01:47 +0200",
        "Message-ID": "<20230920130147.1567735-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": "With Virtio-user, the Virtio descriptor buffer address is the\nvirtual address of the mbuf's buffer. On 32 bits builds, it is\nexpected to be 32 bits.\n\nWith Virtio-PCI, the Virtio descriptor buffer address is the\nphysical address of the mbuf's buffer. On 32 bits builds running\non 64 bits kernel, it is expected to be up to 64 bits.\n\nThis patch introduces a new mask field in virtqueue's struct to\nfilter our the upper 4 bytes of the address only when necessary.\nAn optimization is introduced for 64 bits builds to remove the\nmasking, as the address is always 64 bits wide.\n\nFixes: ba55c94a7ebc (\"net/virtio: revert forcing IOVA as VA mode for virtio-user\")\nCc: stable@dpdk.org\n\nReported-by: Sampath Peechu <speechu@cisco.com>\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n drivers/net/virtio/virtqueue.c |  2 ++\n drivers/net/virtio/virtqueue.h | 18 ++++++++++++++----\n 2 files changed, 16 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c\nindex 1d836f2530..6f419665f1 100644\n--- a/drivers/net/virtio/virtqueue.c\n+++ b/drivers/net/virtio/virtqueue.c\n@@ -469,9 +469,11 @@ virtqueue_alloc(struct virtio_hw *hw, uint16_t index, uint16_t num, int type,\n \tif (hw->use_va) {\n \t\tvq->vq_ring_mem = (uintptr_t)mz->addr;\n \t\tvq->mbuf_addr_offset = offsetof(struct rte_mbuf, buf_addr);\n+\t\tvq->mbuf_addr_mask = UINTPTR_MAX;\n \t} else {\n \t\tvq->vq_ring_mem = mz->iova;\n \t\tvq->mbuf_addr_offset = offsetof(struct rte_mbuf, buf_iova);\n+\t\tvq->mbuf_addr_mask = UINT64_MAX;\n \t}\n \n \tPMD_INIT_LOG(DEBUG, \"vq->vq_ring_mem: 0x%\" PRIx64, vq->vq_ring_mem);\ndiff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h\nindex 9d4aba11a3..c1cb941c43 100644\n--- a/drivers/net/virtio/virtqueue.h\n+++ b/drivers/net/virtio/virtqueue.h\n@@ -114,17 +114,26 @@ virtqueue_store_flags_packed(struct vring_packed_desc *dp,\n \n #define VIRTQUEUE_MAX_NAME_SZ 32\n \n+#ifdef RTE_ARCH_32\n+#define VIRTIO_MBUF_ADDR_MASK(vq) ((vq)->mbuf_addr_mask)\n+#else\n+#define VIRTIO_MBUF_ADDR_MASK(vq) UINT64_MAX\n+#endif\n+\n /**\n  * Return the IOVA (or virtual address in case of virtio-user) of mbuf\n  * data buffer.\n  *\n  * The address is firstly casted to the word size (sizeof(uintptr_t))\n- * before casting it to uint64_t. This is to make it work with different\n- * combination of word size (64 bit and 32 bit) and virtio device\n- * (virtio-pci and virtio-user).\n+ * before casting it to uint64_t. It is then masked with the expected\n+ * address length (64 bits for virtio-pci, word size for virtio-user).\n+ *\n+ * This is to make it work with different combination of word size (64\n+ * bit and 32 bit) and virtio device (virtio-pci and virtio-user).\n  */\n #define VIRTIO_MBUF_ADDR(mb, vq) \\\n-\t((uint64_t)(*(uintptr_t *)((uintptr_t)(mb) + (vq)->mbuf_addr_offset)))\n+\t((*(uint64_t *)((uintptr_t)(mb) + (vq)->mbuf_addr_offset)) & \\\n+\t\tVIRTIO_MBUF_ADDR_MASK(vq))\n \n /**\n  * Return the physical address (or virtual address in case of\n@@ -194,6 +203,7 @@ struct virtqueue {\n \tvoid *vq_ring_virt_mem;  /**< linear address of vring*/\n \tunsigned int vq_ring_size;\n \tuint16_t mbuf_addr_offset;\n+\tuint64_t mbuf_addr_mask;\n \n \tunion {\n \t\tstruct virtnet_rx rxq;\n",
    "prefixes": []
}