get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 28125,
    "url": "http://patches.dpdk.org/api/patches/28125/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20170831095023.21037-6-maxime.coquelin@redhat.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": "<20170831095023.21037-6-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170831095023.21037-6-maxime.coquelin@redhat.com",
    "date": "2017-08-31T09:50:07",
    "name": "[dpdk-dev,05/21] vhost: add support to slave requests channel",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5810cbdd9e8f59617e6cb3846fa9a0abaa04b484",
    "submitter": {
        "id": 512,
        "url": "http://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "delegate": {
        "id": 355,
        "url": "http://patches.dpdk.org/api/users/355/?format=api",
        "username": "yliu",
        "first_name": "Yuanhan",
        "last_name": "Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20170831095023.21037-6-maxime.coquelin@redhat.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/28125/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/28125/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 BEEF147CD;\n\tThu, 31 Aug 2017 11:51:25 +0200 (CEST)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id E43B937AC\n\tfor <dev@dpdk.org>; Thu, 31 Aug 2017 11:51:24 +0200 (CEST)",
            "from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 3F33F552FE;\n\tThu, 31 Aug 2017 09:51:24 +0000 (UTC)",
            "from localhost.localdomain (ovpn-112-32.ams2.redhat.com\n\t[10.36.112.32])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 71DDE841C6;\n\tThu, 31 Aug 2017 09:51:21 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 3F33F552FE",
        "Authentication-Results": [
            "ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=maxime.coquelin@redhat.com"
        ],
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, yliu@fridaylinux.org, jfreiman@redhat.com,\n\ttiwei.bie@intel.com",
        "Cc": "mst@redhat.com, vkaplans@redhat.com, jasowang@redhat.com,\n\tMaxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Thu, 31 Aug 2017 11:50:07 +0200",
        "Message-Id": "<20170831095023.21037-6-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20170831095023.21037-1-maxime.coquelin@redhat.com>",
        "References": "<20170831095023.21037-1-maxime.coquelin@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]); Thu, 31 Aug 2017 09:51:24 +0000 (UTC)",
        "Subject": "[dpdk-dev] [PATCH 05/21] vhost: add support to slave requests\n\tchannel",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "Currently, only QEMU sends requests, the backend sends\nreplies. In some cases, the backend may need to send\nrequests to QEMU, like IOTLB miss events when IOMMU is\nsupported.\n\nThis patch introduces a new channel for such requests.\nQEMU sends a file descriptor of a new socket using\nVHOST_USER_SET_SLAVE_REQ_FD.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/librte_vhost/vhost.h      |  2 ++\n lib/librte_vhost/vhost_user.c | 27 +++++++++++++++++++++++++++\n lib/librte_vhost/vhost_user.h | 10 +++++++++-\n 3 files changed, 38 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 18ad69c85..2340b0c2a 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -196,6 +196,8 @@ struct virtio_net {\n \tuint32_t\t\tnr_guest_pages;\n \tuint32_t\t\tmax_guest_pages;\n \tstruct guest_page       *guest_pages;\n+\n+\tint\t\t\tslave_req_fd;\n } __rte_cache_aligned;\n \n \ndiff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex 8984dcb6a..7b3c2f32a 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -76,6 +76,7 @@ static const char *vhost_message_str[VHOST_USER_MAX] = {\n \t[VHOST_USER_SET_VRING_ENABLE]  = \"VHOST_USER_SET_VRING_ENABLE\",\n \t[VHOST_USER_SEND_RARP]  = \"VHOST_USER_SEND_RARP\",\n \t[VHOST_USER_NET_SET_MTU]  = \"VHOST_USER_NET_SET_MTU\",\n+\t[VHOST_USER_SET_SLAVE_REQ_FD]  = \"VHOST_USER_SET_SLAVE_REQ_FD\",\n };\n \n static uint64_t\n@@ -122,6 +123,11 @@ vhost_backend_cleanup(struct virtio_net *dev)\n \t\tmunmap((void *)(uintptr_t)dev->log_addr, dev->log_size);\n \t\tdev->log_addr = 0;\n \t}\n+\n+\tif (dev->slave_req_fd >= 0) {\n+\t\tclose(dev->slave_req_fd);\n+\t\tdev->slave_req_fd = -1;\n+\t}\n }\n \n /*\n@@ -844,6 +850,23 @@ vhost_user_net_set_mtu(struct virtio_net *dev, struct VhostUserMsg *msg)\n \treturn 0;\n }\n \n+static int\n+vhost_user_set_req_fd(struct virtio_net *dev, struct VhostUserMsg *msg)\n+{\n+\tint fd = msg->fds[0];\n+\n+\tif (fd < 0) {\n+\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\t\t\"Invalid file descriptor for slave channel (%d)\\n\",\n+\t\t\t\tfd);\n+\t\treturn -1;\n+\t}\n+\n+\tdev->slave_req_fd = fd;\n+\n+\treturn 0;\n+}\n+\n /* return bytes# of read on success or negative val on failure. */\n static int\n read_vhost_message(int sockfd, struct VhostUserMsg *msg)\n@@ -1073,6 +1096,10 @@ vhost_user_msg_handler(int vid, int fd)\n \t\tret = vhost_user_net_set_mtu(dev, &msg);\n \t\tbreak;\n \n+\tcase VHOST_USER_SET_SLAVE_REQ_FD:\n+\t\tret = vhost_user_set_req_fd(dev, &msg);\n+\t\tbreak;\n+\n \tdefault:\n \t\tret = -1;\n \t\tbreak;\ndiff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h\nindex 2ba22dbb0..98f6e6f37 100644\n--- a/lib/librte_vhost/vhost_user.h\n+++ b/lib/librte_vhost/vhost_user.h\n@@ -48,12 +48,14 @@\n #define VHOST_USER_PROTOCOL_F_RARP\t2\n #define VHOST_USER_PROTOCOL_F_REPLY_ACK\t3\n #define VHOST_USER_PROTOCOL_F_NET_MTU 4\n+#define VHOST_USER_PROTOCOL_F_SLAVE_REQ 5\n \n #define VHOST_USER_PROTOCOL_FEATURES\t((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \\\n \t\t\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) |\\\n \t\t\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_RARP) | \\\n \t\t\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK) | \\\n-\t\t\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_NET_MTU))\n+\t\t\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_NET_MTU) | \\\n+\t\t\t\t\t (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ))\n \n typedef enum VhostUserRequest {\n \tVHOST_USER_NONE = 0,\n@@ -77,9 +79,15 @@ typedef enum VhostUserRequest {\n \tVHOST_USER_SET_VRING_ENABLE = 18,\n \tVHOST_USER_SEND_RARP = 19,\n \tVHOST_USER_NET_SET_MTU = 20,\n+\tVHOST_USER_SET_SLAVE_REQ_FD = 21,\n \tVHOST_USER_MAX\n } VhostUserRequest;\n \n+typedef enum VhostUserSlaveRequest {\n+\tVHOST_USER_SLAVE_NONE = 0,\n+\tVHOST_USER_SLAVE_MAX\n+} VhostUserSlaveRequest;\n+\n typedef struct VhostUserMemoryRegion {\n \tuint64_t guest_phys_addr;\n \tuint64_t memory_size;\n",
    "prefixes": [
        "dpdk-dev",
        "05/21"
    ]
}