get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 116182,
    "url": "http://patches.dpdk.org/api/patches/116182/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/0383bb821dd65d8511a91e9f13b193230be59557.1662952732.git.kangjie.xu@linux.alibaba.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": "<0383bb821dd65d8511a91e9f13b193230be59557.1662952732.git.kangjie.xu@linux.alibaba.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/0383bb821dd65d8511a91e9f13b193230be59557.1662952732.git.kangjie.xu@linux.alibaba.com",
    "date": "2022-09-12T03:36:46",
    "name": "[v3,1/2] vhost: destroy device when all vqs are inactive",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "28da30483efb99a7f307e6adc44dbcb4fb1446f9",
    "submitter": {
        "id": 2778,
        "url": "http://patches.dpdk.org/api/people/2778/?format=api",
        "name": "Kangjie Xu",
        "email": "kangjie.xu@linux.alibaba.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/0383bb821dd65d8511a91e9f13b193230be59557.1662952732.git.kangjie.xu@linux.alibaba.com/mbox/",
    "series": [
        {
            "id": 24630,
            "url": "http://patches.dpdk.org/api/series/24630/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24630",
            "date": "2022-09-12T03:36:45",
            "name": "vhost: support VIRTIO_F_RING_RESET for vhost-user",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/24630/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/116182/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/116182/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 0E6EEA00C5;\n\tMon, 12 Sep 2022 05:37:04 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 850AF427FF;\n\tMon, 12 Sep 2022 05:36:55 +0200 (CEST)",
            "from out199-5.us.a.mail.aliyun.com (out199-5.us.a.mail.aliyun.com\n [47.90.199.5]) by mails.dpdk.org (Postfix) with ESMTP id 132E7400D4\n for <dev@dpdk.org>; Mon, 12 Sep 2022 05:36:53 +0200 (CEST)",
            "from localhost(mailfrom:kangjie.xu@linux.alibaba.com\n fp:SMTPD_---0VPNZKqD_1662953808) by smtp.aliyun-inc.com;\n Mon, 12 Sep 2022 11:36:49 +0800"
        ],
        "X-Alimail-AntiSpam": "AC=PASS; BC=-1|-1; BR=01201311R171e4; CH=green;\n DM=||false|;\n DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045170;\n MF=kangjie.xu@linux.alibaba.com; NM=1; PH=DS; RN=7; SR=0;\n TI=SMTPD_---0VPNZKqD_1662953808;",
        "From": "Kangjie Xu <kangjie.xu@linux.alibaba.com>",
        "To": "maxime.coquelin@redhat.com,\n\tchenbo.xia@intel.com",
        "Cc": "dev@dpdk.org, xuanzhuo@linux.alibaba.com, hengqi@linux.alibaba.com,\n jasowang@redhat.com, mst@redhat.com",
        "Subject": "[PATCH v3 1/2] vhost: destroy device when all vqs are inactive",
        "Date": "Mon, 12 Sep 2022 11:36:46 +0800",
        "Message-Id": "\n <0383bb821dd65d8511a91e9f13b193230be59557.1662952732.git.kangjie.xu@linux.alibaba.com>",
        "X-Mailer": "git-send-email 2.32.0",
        "In-Reply-To": "<cover.1662952732.git.kangjie.xu@linux.alibaba.com>",
        "References": "<cover.1662952732.git.kangjie.xu@linux.alibaba.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "We change the behavior of vhost_user_get_vring_base(). Previosly,\ndestroying a virtqueue will cause the whole device to be destroyed.\nThe behavior is not specified in the vhost-user protocol.\n\nThus, we refactor this part. The device will be destroyed only when\nall virtqueues in the device are going to be destroyed.\n\nThis helps us to simplify the implementation when resetting a virtqueue.\n\nSigned-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com>\nSigned-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>\n---\n lib/vhost/vhost_user.c | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c\nindex 4ad28bac45..a9f0709f94 100644\n--- a/lib/vhost/vhost_user.c\n+++ b/lib/vhost/vhost_user.c\n@@ -2088,10 +2088,16 @@ vhost_user_get_vring_base(struct virtio_net **pdev,\n {\n \tstruct virtio_net *dev = *pdev;\n \tstruct vhost_virtqueue *vq = dev->virtqueue[ctx->msg.payload.state.index];\n+\tuint32_t i, num_live_vring = 0;\n \tuint64_t val;\n \n-\t/* We have to stop the queue (virtio) if it is running. */\n-\tvhost_destroy_device_notify(dev);\n+\t/* Stop the device when vq is the last active queue */\n+\tfor (i = 0; i < dev->nr_vring; i++)\n+\t\tif (dev->virtqueue[i]->access_ok)\n+\t\t\tnum_live_vring++;\n+\n+\tif (num_live_vring == 1 && vq->access_ok)\n+\t\tvhost_destroy_device_notify(dev);\n \n \tdev->flags &= ~VIRTIO_DEV_READY;\n \tdev->flags &= ~VIRTIO_DEV_VDPA_CONFIGURED;\n",
    "prefixes": [
        "v3",
        "1/2"
    ]
}