get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 93254,
    "url": "https://patches.dpdk.org/api/patches/93254/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210513122826.49910-1-chenbo.xia@intel.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": "<20210513122826.49910-1-chenbo.xia@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210513122826.49910-1-chenbo.xia@intel.com",
    "date": "2021-05-13T12:28:26",
    "name": "vhost: fix wrong IOTLB initialization",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "f1da11df008652abe646c3ae7dc26e08c27519f6",
    "submitter": {
        "id": 1276,
        "url": "https://patches.dpdk.org/api/people/1276/?format=api",
        "name": "Chenbo Xia",
        "email": "chenbo.xia@intel.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/20210513122826.49910-1-chenbo.xia@intel.com/mbox/",
    "series": [
        {
            "id": 16984,
            "url": "https://patches.dpdk.org/api/series/16984/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16984",
            "date": "2021-05-13T12:28:26",
            "name": "vhost: fix wrong IOTLB initialization",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/16984/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/93254/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/93254/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 6F1C0A0A02;\n\tThu, 13 May 2021 14:38:10 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 519594069D;\n\tThu, 13 May 2021 14:38:10 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id A45FD4003F\n for <dev@dpdk.org>; Thu, 13 May 2021 14:38:08 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 May 2021 05:38:06 -0700",
            "from npg-dpdk-virtio-xiachenbo-nw.sh.intel.com ([10.67.118.225])\n by fmsmga006.fm.intel.com with ESMTP; 13 May 2021 05:38:05 -0700"
        ],
        "IronPort-SDR": [
            "\n Bfyti3GdGqTe7xS15Sz3tOh+lWU12uMusuIEboyF0l8LAgZvy9ZqDhIy751djtqE1Ssk7g1T/q\n 5iGLVnCvHKqw==",
            "\n xw0QDHebCiXaWNdSooLKdA7fKksrqaqaShtEw6WqYQzF47c42ECQbNUSXsT5/prc+YuKIO7EYH\n xe9M4LJI8/aQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,9982\"; a=\"285440702\"",
            "E=Sophos;i=\"5.82,296,1613462400\"; d=\"scan'208\";a=\"285440702\"",
            "E=Sophos;i=\"5.82,296,1613462400\"; d=\"scan'208\";a=\"623617609\""
        ],
        "X-ExtLoop1": "1",
        "From": "Chenbo Xia <chenbo.xia@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.coquelin@redhat.com,\n\tdavid.marchand@redhat.com",
        "Date": "Thu, 13 May 2021 20:28:26 +0800",
        "Message-Id": "<20210513122826.49910-1-chenbo.xia@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "Subject": "[dpdk-dev] [PATCH] vhost: fix wrong IOTLB initialization",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch fixes an issue of application crash because of vhost iotlb\nnot initialized when virtio has multiqueue enabled.\n\niotlb messages will be sent when some queues are not enabled. If we\ninitialize iotlb in vhost_user_set_vring_num, it could happen that\niotlb update comes when iotlb pool of disabled queues are not\ninitialized.\n\nFixes: 968bbc7e2e50 (\"vhost: avoid IOTLB mempool allocation while IOMMU disabled\")\n\nSigned-off-by: Chenbo Xia <chenbo.xia@intel.com>\n---\n lib/vhost/vhost_user.c | 13 +++++++++----\n 1 file changed, 9 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c\nindex 611ff209e3..ae4df8eb69 100644\n--- a/lib/vhost/vhost_user.c\n+++ b/lib/vhost/vhost_user.c\n@@ -311,6 +311,7 @@ vhost_user_set_features(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \tuint64_t features = msg->payload.u64;\n \tuint64_t vhost_features = 0;\n \tstruct rte_vdpa_device *vdpa_dev;\n+\tuint32_t i;\n \n \tif (validate_msg_fds(msg, 0) != 0)\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n@@ -389,6 +390,14 @@ vhost_user_set_features(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\tvdpa_dev->ops->set_features(dev->vid);\n \n \tdev->flags &= ~VIRTIO_DEV_FEATURES_FAILED;\n+\n+\tif (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) {\n+\t\tfor (i = 0; i < dev->nr_vring; i++) {\n+\t\t\tif (vhost_user_iotlb_init(dev, i))\n+\t\t\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n+\t\t}\n+\t}\n+\n \treturn RTE_VHOST_MSG_RESULT_OK;\n }\n \n@@ -469,10 +478,6 @@ vhost_user_set_vring_num(struct virtio_net **pdev,\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n \n-\tif (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) {\n-\t\tif (vhost_user_iotlb_init(dev, msg->payload.state.index))\n-\t\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n-\t}\n \treturn RTE_VHOST_MSG_RESULT_OK;\n }\n \n",
    "prefixes": []
}