get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 34873,
    "url": "http://patches.dpdk.org/api/patches/34873/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1517614137-62926-3-git-send-email-zhihong.wang@intel.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": "<1517614137-62926-3-git-send-email-zhihong.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1517614137-62926-3-git-send-email-zhihong.wang@intel.com",
    "date": "2018-02-02T23:28:52",
    "name": "[dpdk-dev,2/7] vhost: export vhost feature definitions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f4e415ef8758fef92dec75af0f36a303caa26b65",
    "submitter": {
        "id": 156,
        "url": "http://patches.dpdk.org/api/people/156/?format=api",
        "name": "Zhihong Wang",
        "email": "zhihong.wang@intel.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/1517614137-62926-3-git-send-email-zhihong.wang@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/34873/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/34873/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 674A7A84E;\n\tFri,  2 Feb 2018 12:33:48 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id A3F7C7CD8\n\tfor <dev@dpdk.org>; Fri,  2 Feb 2018 12:33:46 +0100 (CET)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Feb 2018 03:33:45 -0800",
            "from unknown (HELO dpdk98.sh.intel.com) ([10.67.111.140])\n\tby orsmga004.jf.intel.com with ESMTP; 02 Feb 2018 03:33:43 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.46,448,1511856000\"; d=\"scan'208\";a=\"171132730\"",
        "From": "Zhihong Wang <zhihong.wang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jianfeng.tan@intel.com, tiwei.bie@intel.com, maxime.coquelin@redhat.com, \n\tyliu@fridaylinux.org, cunming.liang@intel.com, xiao.w.wang@intel.com,\n\tdan.daly@intel.com, Zhihong Wang <zhihong.wang@intel.com>",
        "Date": "Fri,  2 Feb 2018 18:28:52 -0500",
        "Message-Id": "<1517614137-62926-3-git-send-email-zhihong.wang@intel.com>",
        "X-Mailer": "git-send-email 2.7.5",
        "In-Reply-To": "<1517614137-62926-1-git-send-email-zhihong.wang@intel.com>",
        "References": "<1517614137-62926-1-git-send-email-zhihong.wang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/7] vhost: export vhost feature definitions",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://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": "<https://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": "This patch exports vhost-user protocol features to support device driver\ndevelopment.\n\nSigned-off-by: Zhihong Wang <zhihong.wang@intel.com>\n---\n lib/librte_vhost/rte_vhost.h  |  8 ++++++++\n lib/librte_vhost/vhost.h      |  4 +---\n lib/librte_vhost/vhost_user.c |  9 +++++----\n lib/librte_vhost/vhost_user.h | 20 +++++++-------------\n 4 files changed, 21 insertions(+), 20 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h\nindex 12cf48f..6c92580 100644\n--- a/lib/librte_vhost/rte_vhost.h\n+++ b/lib/librte_vhost/rte_vhost.h\n@@ -29,6 +29,14 @@ extern \"C\" {\n #define RTE_VHOST_USER_DEQUEUE_ZERO_COPY\t(1ULL << 2)\n #define RTE_VHOST_USER_IOMMU_SUPPORT\t(1ULL << 3)\n \n+#define RTE_VHOST_USER_PROTOCOL_F_MQ\t\t0\n+#define RTE_VHOST_USER_PROTOCOL_F_LOG_SHMFD\t1\n+#define RTE_VHOST_USER_PROTOCOL_F_RARP\t\t2\n+#define RTE_VHOST_USER_PROTOCOL_F_REPLY_ACK\t3\n+#define RTE_VHOST_USER_PROTOCOL_F_NET_MTU\t4\n+#define RTE_VHOST_USER_PROTOCOL_F_SLAVE_REQ\t5\n+#define RTE_VHOST_USER_F_PROTOCOL_FEATURES\t30\n+\n /**\n  * Information relating to memory regions including offsets to\n  * addresses in QEMUs memory file.\ndiff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 646aad3..09a745d 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -172,8 +172,6 @@ struct vhost_msg {\n  #define VIRTIO_F_VERSION_1 32\n #endif\n \n-#define VHOST_USER_F_PROTOCOL_FEATURES\t30\n-\n /* Features supported by this builtin vhost-user net driver. */\n #define VIRTIO_NET_SUPPORTED_FEATURES ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | \\\n \t\t\t\t(1ULL << VIRTIO_F_ANY_LAYOUT) | \\\n@@ -183,7 +181,7 @@ struct vhost_msg {\n \t\t\t\t(1ULL << VIRTIO_NET_F_MQ)      | \\\n \t\t\t\t(1ULL << VIRTIO_F_VERSION_1)   | \\\n \t\t\t\t(1ULL << VHOST_F_LOG_ALL)      | \\\n-\t\t\t\t(1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | \\\n+\t\t\t\t(1ULL << RTE_VHOST_USER_F_PROTOCOL_FEATURES) | \\\n \t\t\t\t(1ULL << VIRTIO_NET_F_GSO) | \\\n \t\t\t\t(1ULL << VIRTIO_NET_F_HOST_TSO4) | \\\n \t\t\t\t(1ULL << VIRTIO_NET_F_HOST_TSO6) | \\\ndiff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex 87ba267..b1762e6 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -510,7 +510,7 @@ vhost_user_set_vring_addr(struct virtio_net **pdev, VhostUserMsg *msg)\n \tvring_invalidate(dev, vq);\n \n \tif (vq->enabled && (dev->features &\n-\t\t\t\t(1ULL << VHOST_USER_F_PROTOCOL_FEATURES))) {\n+\t\t\t\t(1ULL << RTE_VHOST_USER_F_PROTOCOL_FEATURES))) {\n \t\tdev = translate_ring_addresses(dev, msg->payload.state.index);\n \t\tif (!dev)\n \t\t\treturn -1;\n@@ -847,11 +847,11 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *pmsg)\n \tvq = dev->virtqueue[file.index];\n \n \t/*\n-\t * When VHOST_USER_F_PROTOCOL_FEATURES is not negotiated,\n+\t * When RTE_VHOST_USER_F_PROTOCOL_FEATURES is not negotiated,\n \t * the ring starts already enabled. Otherwise, it is enabled via\n \t * the SET_VRING_ENABLE message.\n \t */\n-\tif (!(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)))\n+\tif (!(dev->features & (1ULL << RTE_VHOST_USER_F_PROTOCOL_FEATURES)))\n \t\tvq->enabled = 1;\n \n \tif (vq->kickfd >= 0)\n@@ -961,7 +961,8 @@ vhost_user_get_protocol_features(struct virtio_net *dev)\n \t * Qemu versions (from v2.7.0 to v2.9.0).\n \t */\n \tif (!(features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)))\n-\t\tprotocol_features &= ~(1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK);\n+\t\tprotocol_features &=\n+\t\t\t~(1ULL << RTE_VHOST_USER_PROTOCOL_F_REPLY_ACK);\n \n \treturn protocol_features;\n }\ndiff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h\nindex d4bd604..58e475d 100644\n--- a/lib/librte_vhost/vhost_user.h\n+++ b/lib/librte_vhost/vhost_user.h\n@@ -14,19 +14,13 @@\n \n #define VHOST_MEMORY_MAX_NREGIONS 8\n \n-#define VHOST_USER_PROTOCOL_F_MQ\t0\n-#define VHOST_USER_PROTOCOL_F_LOG_SHMFD\t1\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_SLAVE_REQ))\n+#define VHOST_USER_PROTOCOL_FEATURES \\\n+\t\t\t((1ULL << RTE_VHOST_USER_PROTOCOL_F_MQ) | \\\n+\t\t\t (1ULL << RTE_VHOST_USER_PROTOCOL_F_LOG_SHMFD) |\\\n+\t\t\t (1ULL << RTE_VHOST_USER_PROTOCOL_F_RARP) | \\\n+\t\t\t (1ULL << RTE_VHOST_USER_PROTOCOL_F_REPLY_ACK) | \\\n+\t\t\t (1ULL << RTE_VHOST_USER_PROTOCOL_F_NET_MTU) | \\\n+\t\t\t (1ULL << RTE_VHOST_USER_PROTOCOL_F_SLAVE_REQ))\n \n typedef enum VhostUserRequest {\n \tVHOST_USER_NONE = 0,\n",
    "prefixes": [
        "dpdk-dev",
        "2/7"
    ]
}