get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8041,
    "url": "https://patches.dpdk.org/api/patches/8041/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1445932306-11880-1-git-send-email-mukawa@igel.co.jp/",
    "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": "<1445932306-11880-1-git-send-email-mukawa@igel.co.jp>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1445932306-11880-1-git-send-email-mukawa@igel.co.jp",
    "date": "2015-10-27T07:51:46",
    "name": "[dpdk-dev] vhost: Fix wrong handling of virtqueue array index",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "d1be5d9db61d066ebc7573bab38ba6fe1e9f4689",
    "submitter": {
        "id": 64,
        "url": "https://patches.dpdk.org/api/people/64/?format=api",
        "name": "Tetsuya Mukawa",
        "email": "mukawa@igel.co.jp"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1445932306-11880-1-git-send-email-mukawa@igel.co.jp/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8041/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8041/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 34A6A6A80;\n\tTue, 27 Oct 2015 08:52:05 +0100 (CET)",
            "from mail-pa0-f47.google.com (mail-pa0-f47.google.com\n\t[209.85.220.47]) by dpdk.org (Postfix) with ESMTP id CF5706787\n\tfor <dev@dpdk.org>; Tue, 27 Oct 2015 08:52:03 +0100 (CET)",
            "by pasz6 with SMTP id z6so214644338pas.2\n\tfor <dev@dpdk.org>; Tue, 27 Oct 2015 00:52:03 -0700 (PDT)",
            "from localhost.localdomain (napt.igel.co.jp. [219.106.231.132])\n\tby smtp.gmail.com with ESMTPSA id\n\tkp4sm37921916pbc.34.2015.10.27.00.52.00\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 27 Oct 2015 00:52:02 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=igel_co_jp.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id;\n\tbh=cE1R078v41IQJ5c2VZKD/ls6B+iZ/XJYDtNmMyvaKho=;\n\tb=hhYpANspDIwTtO3I/ZR2+e7/xNwUjpe37KxU4+Y3rMSImKHv8SUerirmhVgBofUy/W\n\tPYgzG2VSuryBJ9UWuQiFW2RGlXjRd4ik1+rZOiKlm/X+NctjPZgbXwUN9wONPqAJwMRe\n\tvIN8KFBmS2jGA/9jEu1OiCtFAt9cSpRuBxBoohtrVcrtiixtykml8jrfKiRCRLuv9cVY\n\t0zoKsIw+S02FY3L1EMh+Wukag68EN0hXxIgcEQoE9iacFdJPzio0/09k/EHssugwxaBC\n\tUOJcPyz+31zPq42UlfxNWCsWkH2dqeusrFZHsgyhHSGo7BB1oy54a8g/B0AQfhUZvhKF\n\t4Lyg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=cE1R078v41IQJ5c2VZKD/ls6B+iZ/XJYDtNmMyvaKho=;\n\tb=aWGqgj4Oq0L+f7RclyZs5sbdFg+xWlkWBQw4oZTcun5P5BkY2bLYoqrfoy69e3vivQ\n\tS7+qO4JHVbyuVE8RUE0JJjIopFc+hHyNjzz5ZEnFhwgZt0yleRe6djdt+2uSEqKnNbTd\n\tzs83MJQf773xGl0idDL8tmTXFyt+5SLBC6lwGOtkv5YPDf8wZg2Xba10n0a4JiguAx1d\n\tBhvip5cM8O1d/tkOiR+KQguXHXrs0E1dty2Uu7WVZ25pFHqIKc+Qbmvs2coGe1fUzO9w\n\tR7aT09+2AoGvLBLV37HjcogCu8sgsV6VXxWvylF2bwPIz9y+BOEvqWImYQim8+b6pJpE\n\tmfpg==",
        "X-Gm-Message-State": "ALoCoQmA26we2HVplzwgBdvS+DxvPIGxlJZxq/eiNuUI/bzpoc6dbZHLQH3r3tekFsPo7by8lANb",
        "X-Received": "by 10.68.131.36 with SMTP id oj4mr26485558pbb.141.1445932323205; \n\tTue, 27 Oct 2015 00:52:03 -0700 (PDT)",
        "From": "Tetsuya Mukawa <mukawa@igel.co.jp>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 27 Oct 2015 16:51:46 +0900",
        "Message-Id": "<1445932306-11880-1-git-send-email-mukawa@igel.co.jp>",
        "X-Mailer": "git-send-email 2.1.4",
        "Cc": "ann.zhuangyanying@huawei.com",
        "Subject": "[dpdk-dev] [PATCH] vhost: Fix wrong handling of virtqueue array\n\tindex",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The patch fixes wrong handling of virtqueue array index when\nGET_VRING_BASE message comes.\nThe vhost backend will receive the message per virtqueue.\nAlso we should call a destroy callback handler when both RXQ\nand TXQ receives the message.\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_vhost/vhost_user/virtio-net-user.c | 20 ++++++++++----------\n 1 file changed, 10 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c\nindex a998ad8..99c075f 100644\n--- a/lib/librte_vhost/vhost_user/virtio-net-user.c\n+++ b/lib/librte_vhost/vhost_user/virtio-net-user.c\n@@ -283,12 +283,10 @@ user_get_vring_base(struct vhost_device_ctx ctx,\n \tstruct vhost_vring_state *state)\n {\n \tstruct virtio_net *dev = get_device(ctx);\n+\tuint16_t base_idx = state->index / VIRTIO_QNUM * VIRTIO_QNUM;\n \n \tif (dev == NULL)\n \t\treturn -1;\n-\t/* We have to stop the queue (virtio) if it is running. */\n-\tif (dev->flags & VIRTIO_DEV_RUNNING)\n-\t\tnotify_ops->destroy_device(dev);\n \n \t/* Here we are safe to get the last used index */\n \tops->get_vring_base(ctx, state->index, state);\n@@ -300,15 +298,17 @@ user_get_vring_base(struct vhost_device_ctx ctx,\n \t * sent and only sent in vhost_vring_stop.\n \t * TODO: cleanup the vring, it isn't usable since here.\n \t */\n-\tif (dev->virtqueue[state->index + VIRTIO_RXQ]->kickfd >= 0) {\n-\t\tclose(dev->virtqueue[state->index + VIRTIO_RXQ]->kickfd);\n-\t\tdev->virtqueue[state->index + VIRTIO_RXQ]->kickfd = -1;\n-\t}\n-\tif (dev->virtqueue[state->index + VIRTIO_TXQ]->kickfd >= 0) {\n-\t\tclose(dev->virtqueue[state->index + VIRTIO_TXQ]->kickfd);\n-\t\tdev->virtqueue[state->index + VIRTIO_TXQ]->kickfd = -1;\n+\tif (dev->virtqueue[state->index]->kickfd >= 0) {\n+\t\tclose(dev->virtqueue[state->index]->kickfd);\n+\t\tdev->virtqueue[state->index]->kickfd = -1;\n \t}\n \n+\t/* We have to stop the queue (virtio) if it is running. */\n+\tif ((dev->flags & VIRTIO_DEV_RUNNING) &&\n+\t\t\t(dev->virtqueue[base_idx + VIRTIO_RXQ]->kickfd == -1) &&\n+\t\t\t(dev->virtqueue[base_idx + VIRTIO_TXQ]->kickfd == -1))\n+\t\tnotify_ops->destroy_device(dev);\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "dpdk-dev"
    ]
}