get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 116393,
    "url": "https://patches.dpdk.org/api/patches/116393/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220916090202.1190834-1-david.marchand@redhat.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": "<20220916090202.1190834-1-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220916090202.1190834-1-david.marchand@redhat.com",
    "date": "2022-09-16T09:02:02",
    "name": "vhost: reduce memory footprint when IOMMU is disabled",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "975b9a172aa021ad001485986616d0faa0e0d7a8",
    "submitter": {
        "id": 1173,
        "url": "https://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220916090202.1190834-1-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 24691,
            "url": "https://patches.dpdk.org/api/series/24691/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=24691",
            "date": "2022-09-16T09:02:02",
            "name": "vhost: reduce memory footprint when IOMMU is disabled",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/24691/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/116393/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/116393/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 4DDC5A0032;\n\tFri, 16 Sep 2022 11:02:24 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2CA844021D;\n\tFri, 16 Sep 2022 11:02:24 +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 8787A40156\n for <dev@dpdk.org>; Fri, 16 Sep 2022 11:02:22 +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-39-pJrSrZymPYOZhGhcBEAUcA-1; Fri, 16 Sep 2022 05:02:19 -0400",
            "from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com\n [10.11.54.9])\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 A88DD862FDC;\n Fri, 16 Sep 2022 09:02:18 +0000 (UTC)",
            "from localhost.localdomain (unknown [10.40.194.61])\n by smtp.corp.redhat.com (Postfix) with ESMTP id CD680492CA2;\n Fri, 16 Sep 2022 09:02:17 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1663318942;\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=mvgF2+pCZMfFbR2qEa4ft21K3y4nYW3h+hAP+3LadQY=;\n b=hwYwhlm5/hZN7JnEYJqDq9TkDntvgCwLL5rLOZ+Pu3PA62Q56b5RS9RrjdHfyWLRKmeUST\n 9tiAghtyp5MZVwrlmBAD1KwmELFNkMxRBaQal1mvSF/e2kjV8s/aNrhY2hPb6KQUd+6+iT\n q5AAzALy8rUJW9PQbKMnlRJeG3fFy1I=",
        "X-MC-Unique": "pJrSrZymPYOZhGhcBEAUcA-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbo.xia@intel.com>",
        "Subject": "[PATCH] vhost: reduce memory footprint when IOMMU is disabled",
        "Date": "Fri, 16 Sep 2022 11:02:02 +0200",
        "Message-Id": "<20220916090202.1190834-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.9",
        "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": "If an application does not request IOMMU support, we can avoid\nallocating a IOMMU pool.\n\nThis saves 112kB (IOTLB_CACHE_SIZE * sizeof(struct vhost_iotlb_entry))\nper vq.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n lib/vhost/iotlb.c  | 20 +++++++++++---------\n lib/vhost/socket.c |  4 +++-\n lib/vhost/vhost.c  |  7 ++++++-\n lib/vhost/vhost.h  |  5 ++++-\n 4 files changed, 24 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/lib/vhost/iotlb.c b/lib/vhost/iotlb.c\nindex 2a78929e78..6a729e8804 100644\n--- a/lib/vhost/iotlb.c\n+++ b/lib/vhost/iotlb.c\n@@ -341,16 +341,18 @@ vhost_user_iotlb_init(struct virtio_net *dev, struct vhost_virtqueue *vq)\n \tTAILQ_INIT(&vq->iotlb_list);\n \tTAILQ_INIT(&vq->iotlb_pending_list);\n \n-\tvq->iotlb_pool = rte_calloc_socket(\"iotlb\", IOTLB_CACHE_SIZE,\n-\t\tsizeof(struct vhost_iotlb_entry), 0, socket);\n-\tif (!vq->iotlb_pool) {\n-\t\tVHOST_LOG_CONFIG(dev->ifname, ERR,\n-\t\t\t\"Failed to create IOTLB cache pool for vq %\"PRIu32\"\\n\",\n-\t\t\tvq->index);\n-\t\treturn -1;\n+\tif (dev->flags & VIRTIO_DEV_SUPPORT_IOMMU) {\n+\t\tvq->iotlb_pool = rte_calloc_socket(\"iotlb\", IOTLB_CACHE_SIZE,\n+\t\t\tsizeof(struct vhost_iotlb_entry), 0, socket);\n+\t\tif (!vq->iotlb_pool) {\n+\t\t\tVHOST_LOG_CONFIG(dev->ifname, ERR,\n+\t\t\t\t\"Failed to create IOTLB cache pool for vq %\"PRIu32\"\\n\",\n+\t\t\t\tvq->index);\n+\t\t\treturn -1;\n+\t\t}\n+\t\tfor (i = 0; i < IOTLB_CACHE_SIZE; i++)\n+\t\t\tvhost_user_iotlb_pool_put(vq, &vq->iotlb_pool[i]);\n \t}\n-\tfor (i = 0; i < IOTLB_CACHE_SIZE; i++)\n-\t\tvhost_user_iotlb_pool_put(vq, &vq->iotlb_pool[i]);\n \n \tvq->iotlb_cache_nr = 0;\n \ndiff --git a/lib/vhost/socket.c b/lib/vhost/socket.c\nindex a8df2d484a..608ae577fd 100644\n--- a/lib/vhost/socket.c\n+++ b/lib/vhost/socket.c\n@@ -228,7 +228,8 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)\n \tvhost_set_ifname(vid, vsocket->path, size);\n \n \tvhost_setup_virtio_net(vid, vsocket->use_builtin_virtio_net,\n-\t\tvsocket->net_compliant_ol_flags, vsocket->stats_enabled);\n+\t\tvsocket->net_compliant_ol_flags, vsocket->stats_enabled,\n+\t\tvsocket->iommu_support);\n \n \tvhost_attach_vdpa_device(vid, vsocket->vdpa_dev);\n \n@@ -905,6 +906,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \tvsocket->async_copy = flags & RTE_VHOST_USER_ASYNC_COPY;\n \tvsocket->net_compliant_ol_flags = flags & RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;\n \tvsocket->stats_enabled = flags & RTE_VHOST_USER_NET_STATS_ENABLE;\n+\tvsocket->iommu_support = flags & RTE_VHOST_USER_IOMMU_SUPPORT;\n \n \tif (vsocket->async_copy &&\n \t\t(flags & (RTE_VHOST_USER_IOMMU_SUPPORT |\ndiff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex aa671f47a3..9e5e69f72d 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -771,7 +771,8 @@ vhost_set_ifname(int vid, const char *if_name, unsigned int if_len)\n }\n \n void\n-vhost_setup_virtio_net(int vid, bool enable, bool compliant_ol_flags, bool stats_enabled)\n+vhost_setup_virtio_net(int vid, bool enable, bool compliant_ol_flags, bool stats_enabled,\n+\tbool support_iommu)\n {\n \tstruct virtio_net *dev = get_device(vid);\n \n@@ -790,6 +791,10 @@ vhost_setup_virtio_net(int vid, bool enable, bool compliant_ol_flags, bool stats\n \t\tdev->flags |= VIRTIO_DEV_STATS_ENABLED;\n \telse\n \t\tdev->flags &= ~VIRTIO_DEV_STATS_ENABLED;\n+\tif (support_iommu)\n+\t\tdev->flags |= VIRTIO_DEV_SUPPORT_IOMMU;\n+\telse\n+\t\tdev->flags &= ~VIRTIO_DEV_SUPPORT_IOMMU;\n }\n \n void\ndiff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h\nindex 782d916ae0..3da6f217fd 100644\n--- a/lib/vhost/vhost.h\n+++ b/lib/vhost/vhost.h\n@@ -37,6 +37,8 @@\n #define VIRTIO_DEV_LEGACY_OL_FLAGS ((uint32_t)1 << 5)\n /*  Used to indicate the application has requested statistics collection */\n #define VIRTIO_DEV_STATS_ENABLED ((uint32_t)1 << 6)\n+/*  Used to indicate the application has requested iommu support */\n+#define VIRTIO_DEV_SUPPORT_IOMMU ((uint32_t)1 << 7)\n \n /* Backend value set by guest. */\n #define VIRTIO_DEV_STOPPED -1\n@@ -803,7 +805,8 @@ int alloc_vring_queue(struct virtio_net *dev, uint32_t vring_idx);\n void vhost_attach_vdpa_device(int vid, struct rte_vdpa_device *dev);\n \n void vhost_set_ifname(int, const char *if_name, unsigned int if_len);\n-void vhost_setup_virtio_net(int vid, bool enable, bool legacy_ol_flags, bool stats_enabled);\n+void vhost_setup_virtio_net(int vid, bool enable, bool legacy_ol_flags, bool stats_enabled,\n+\tbool support_iommu);\n void vhost_enable_extbuf(int vid);\n void vhost_enable_linearbuf(int vid);\n int vhost_enable_guest_notification(struct virtio_net *dev,\n",
    "prefixes": []
}