Show a patch.

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

{
    "id": 43220,
    "url": "http://patches.dpdk.org/api/patches/43220/",
    "web_url": "http://patches.dpdk.org/patch/43220/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<153202761415.21481.4698894052167645234.stgit@T460>",
    "date": "2018-07-19T19:13:34",
    "name": "[v2,2/5] vhost: make message handling functions prepare the reply",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b69e1148f0c2bc727c0b61b9270b000a454a660c",
    "submitter": {
        "id": 1062,
        "url": "http://patches.dpdk.org/api/people/1062/",
        "name": "Nikolay Nikolaev",
        "email": "nicknickolaev@gmail.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/patch/43220/mbox/",
    "series": [
        {
            "id": 681,
            "url": "http://patches.dpdk.org/api/series/681/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=681",
            "date": "2018-07-19T19:13:20",
            "name": "vhost_user.c code cleanup",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/681/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43220/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43220/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "To": "maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com",
        "X-Google-Smtp-Source": "AAOMgpe3AnBtdoX6LjJgdqQbffSUUQgKAdIlFAK5DdbgktL7DHCvSzTXklEkeiwbouYn0Yxwrllxdg==",
        "X-Gm-Message-State": "AOUpUlEwOzALErct5NC7PBKUpxJvw/fM3X2AIyv22bekd8VuUHri9gOl\n\t3+YvOSe7Gsawkw7oljUmfmZpnfVyzhc=",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=subject:from:to:cc:date:message-id:in-reply-to:references\n\t:user-agent:mime-version:content-transfer-encoding;\n\tbh=6cg4XzjXRxCK8ANybJSK+tcCbAgT3r6KNJRCv3E9sqQ=;\n\tb=Kpl+xXebXMSkf9CNMqS7m0nSGO6l1ZWvqYcJO4PWp8v3mWqKZgPqOlzZxMbS5XA1aw\n\tYImmE8Utm7fDyzV3C/qhiGIsC5azrJHXRv5uUnDa2QGZ1lm6zn9/aQj1r6VRduSZshcZ\n\t/drXzCtmlO9quKYnHt4OcVJtNK+u0gbVC0HDhhROXwHj8P8eK/nGnolFsBySWlZCa+Y6\n\t5TnY49cyZUKkbLA0qpwgVH7SeePKvMpKJmuUr3bCC8kqrMS7F46iCD6vsXkPi8fsm7d0\n\t1bo5kMzraEMYYZUhMCOALMjQfp/mXosLZeD8iAdFsCACP0xLzOaocuJcA8QGq6UA4swO\n\tbhkg==",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Message-ID": "<153202761415.21481.4698894052167645234.stgit@T460>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 27C445B38;\n\tThu, 19 Jul 2018 21:13:37 +0200 (CEST)",
            "from mail-wm0-f67.google.com (mail-wm0-f67.google.com\n\t[74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 707B65B3C\n\tfor <dev@dpdk.org>; Thu, 19 Jul 2018 21:13:36 +0200 (CEST)",
            "by mail-wm0-f67.google.com with SMTP id z6-v6so2491249wma.0\n\tfor <dev@dpdk.org>; Thu, 19 Jul 2018 12:13:36 -0700 (PDT)",
            "from [127.0.1.1] ([82.146.27.14]) by smtp.gmail.com with ESMTPSA id\n\tm17-v6sm11377480wrg.65.2018.07.19.12.13.34\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 19 Jul 2018 12:13:35 -0700 (PDT)"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 2/5] vhost: make message handling functions\n\tprepare the reply",
        "In-Reply-To": "<153202755842.21481.1772155561595981441.stgit@T460>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Cc": "dev@dpdk.org",
        "Precedence": "list",
        "From": "Nikolay Nikolaev <nicknickolaev@gmail.com>",
        "X-Received": "by 2002:a1c:64d5:: with SMTP id\n\ty204-v6mr4900024wmb.14.1532027615896; \n\tThu, 19 Jul 2018 12:13:35 -0700 (PDT)",
        "Content-Transfer-Encoding": "7bit",
        "MIME-Version": "1.0",
        "References": "<153202755842.21481.1772155561595981441.stgit@T460>",
        "X-Original-To": "patchwork@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Delivered-To": "patchwork@dpdk.org",
        "Date": "Thu, 19 Jul 2018 22:13:34 +0300",
        "X-Mailman-Version": "2.1.15",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-transfer-encoding;\n\tbh=6cg4XzjXRxCK8ANybJSK+tcCbAgT3r6KNJRCv3E9sqQ=;\n\tb=BYCq8V6H5MbLX6+GnLeUCVjruCTbz/rFwzJH6onMZEX+rGwjgeeo+8Pn07S2sd26mI\n\tV10P02De2h3XZoZBP+VQgDLSO/fgKhDKCKtyoeE8ZaorORwkLZzN74cJC0nDzfsA/jCa\n\tb24zAtR0t72q/enJFcCYyZYcWC5oyOLEHGQj1NNs2S4mUjreE3V061OjVSeGNT3hTCtU\n\ta9vi2DXp2A2AqD+3hhe6NV/IKa2NEMzOldK61WL/D2+ja38NOcv9U/5kMuYY4sUMSs8P\n\tHB2W1FAaS7zRs4i6q3iETpIKZ9UzeJ/6GeEShqfghonPaOWiHsV95ylmqSWZ3TylI15G\n\tBhTg==",
        "User-Agent": "StGit/0.17.1-dirty"
    },
    "content": "As VhostUserMsg structure is resued to generate the reply, move the\nrelevant fields update into the respective message handling functions.\n\nSigned-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>\n---\n lib/librte_vhost/vhost_user.c |   26 ++++++++++++++++----------\n 1 file changed, 16 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex d51616695..e97b2d563 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -146,11 +146,15 @@ vhost_user_reset_owner(struct virtio_net *dev)\n  * The features that we support are requested.\n  */\n static uint64_t\n-vhost_user_get_features(struct virtio_net *dev)\n+vhost_user_get_features(struct virtio_net *dev, VhostUserMsg *msg)\n {\n \tuint64_t features = 0;\n \n \trte_vhost_driver_get_features(dev->ifname, &features);\n+\n+\tmsg->payload.u64 = features;\n+\tmsg->size = sizeof(msg->payload.u64);\n+\n \treturn features;\n }\n \n@@ -158,11 +162,15 @@ vhost_user_get_features(struct virtio_net *dev)\n  * The queue number that we support are requested.\n  */\n static uint32_t\n-vhost_user_get_queue_num(struct virtio_net *dev)\n+vhost_user_get_queue_num(struct virtio_net *dev, VhostUserMsg *msg)\n {\n \tuint32_t queue_num = 0;\n \n \trte_vhost_driver_get_queue_num(dev->ifname, &queue_num);\n+\n+\tmsg->payload.u64 = (uint64_t)queue_num;\n+\tmsg->size = sizeof(msg->payload.u64);\n+\n \treturn queue_num;\n }\n \n@@ -1109,6 +1117,8 @@ vhost_user_get_vring_base(struct virtio_net *dev,\n \trte_free(vq->batch_copy_elems);\n \tvq->batch_copy_elems = NULL;\n \n+\tmsg->size = sizeof(msg->payload.state);\n+\n \treturn 0;\n }\n \n@@ -1231,6 +1241,8 @@ vhost_user_set_log_base(struct virtio_net *dev, VhostUserMsg *msg)\n \tdev->log_base = dev->log_addr + off;\n \tdev->log_size = size;\n \n+\tmsg->size = sizeof(msg->payload.u64);\n+\n \treturn 0;\n }\n \n@@ -1644,8 +1656,7 @@ vhost_user_msg_handler(int vid, int fd)\n \n \tswitch (msg.request.master) {\n \tcase VHOST_USER_GET_FEATURES:\n-\t\tmsg.payload.u64 = vhost_user_get_features(dev);\n-\t\tmsg.size = sizeof(msg.payload.u64);\n+\t\tvhost_user_get_features(dev, &msg);\n \t\tsend_vhost_reply(fd, &msg);\n \t\tbreak;\n \tcase VHOST_USER_SET_FEATURES:\n@@ -1675,9 +1686,6 @@ vhost_user_msg_handler(int vid, int fd)\n \n \tcase VHOST_USER_SET_LOG_BASE:\n \t\tvhost_user_set_log_base(dev, &msg);\n-\n-\t\t/* it needs a reply */\n-\t\tmsg.size = sizeof(msg.payload.u64);\n \t\tsend_vhost_reply(fd, &msg);\n \t\tbreak;\n \tcase VHOST_USER_SET_LOG_FD:\n@@ -1697,7 +1705,6 @@ vhost_user_msg_handler(int vid, int fd)\n \n \tcase VHOST_USER_GET_VRING_BASE:\n \t\tvhost_user_get_vring_base(dev, &msg);\n-\t\tmsg.size = sizeof(msg.payload.state);\n \t\tsend_vhost_reply(fd, &msg);\n \t\tbreak;\n \n@@ -1715,8 +1722,7 @@ vhost_user_msg_handler(int vid, int fd)\n \t\tbreak;\n \n \tcase VHOST_USER_GET_QUEUE_NUM:\n-\t\tmsg.payload.u64 = (uint64_t)vhost_user_get_queue_num(dev);\n-\t\tmsg.size = sizeof(msg.payload.u64);\n+\t\tvhost_user_get_queue_num(dev, &msg);\n \t\tsend_vhost_reply(fd, &msg);\n \t\tbreak;\n \n",
    "prefixes": [
        "v2",
        "2/5"
    ]
}