get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 72600,
    "url": "https://patches.dpdk.org/api/patches/72600/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200701105400.1145875-2-amorenoz@redhat.com/",
    "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": "<20200701105400.1145875-2-amorenoz@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200701105400.1145875-2-amorenoz@redhat.com",
    "date": "2020-07-01T10:53:59",
    "name": "[v2,1/2] net/virtio: add vhost-user protocol features support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cae14e232a6c09ccfd86d1ac08d0564e6dd28d31",
    "submitter": {
        "id": 1397,
        "url": "https://patches.dpdk.org/api/people/1397/?format=api",
        "name": "Adrian Moreno",
        "email": "amorenoz@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200701105400.1145875-2-amorenoz@redhat.com/mbox/",
    "series": [
        {
            "id": 10708,
            "url": "https://patches.dpdk.org/api/series/10708/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10708",
            "date": "2020-07-01T10:53:58",
            "name": "net/virtio: add vhost-user protocol features support",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/10708/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/72600/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/72600/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E5375A0350;\n\tWed,  1 Jul 2020 12:54:39 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0E69A1D453;\n\tWed,  1 Jul 2020 12:54:30 +0200 (CEST)",
            "from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com\n [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 8F78A1D146\n for <dev@dpdk.org>; Wed,  1 Jul 2020 12:54:27 +0200 (CEST)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-61-Ia8TzRwkOn2_T8qgduTIRg-1; Wed, 01 Jul 2020 06:54:22 -0400",
            "from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com\n [10.5.11.16])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4043784E218;\n Wed,  1 Jul 2020 10:54:21 +0000 (UTC)",
            "from amorenoz.users.ipa.redhat.com (ovpn-112-91.ams2.redhat.com\n [10.36.112.91])\n by smtp.corp.redhat.com (Postfix) with ESMTP id C2A8D5C5B7;\n Wed,  1 Jul 2020 10:54:18 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1593600866;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=Yq4JzJVNdeDOOI8R/4+qfFWzPbEehnPHa3Cq6VGlWi8=;\n b=JW2Unl//Sgbg48TQscb4QswrqiLV9noT03/ef7oPOd5/2m1d96i7uv/fbBm8JKnr1paXIi\n UCZZvVnCp+I1Rhw2LT6Kg+NfaoiVcQdZ9B1HuHPz9poW1epKGI4zL6JIYN6snN8BD5pXET\n HQpQ7tgOwVx58iVAKcsZglY0mjwMbMg=",
        "X-MC-Unique": "Ia8TzRwkOn2_T8qgduTIRg-1",
        "From": "Adrian Moreno <amorenoz@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "chenbo.xia@intel.com, zhihong.wang@intel.com, xiao.w.wang@intel.com,\n ferruh.yigit@intel.com, maxime.coquelin@redhat.com",
        "Date": "Wed,  1 Jul 2020 12:53:59 +0200",
        "Message-Id": "<20200701105400.1145875-2-amorenoz@redhat.com>",
        "In-Reply-To": "<20200701105400.1145875-1-amorenoz@redhat.com>",
        "References": "<20200701105400.1145875-1-amorenoz@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.16",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] net/virtio: add vhost-user protocol\n\tfeatures support",
        "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://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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Maxime Coquelin <maxime.coquelin@redhat.com>\n\nThis patch adds support for Vhost-user protocol features.\nIt is required to support protocol features that were not in\ninitial Vhost-user specification, such as reply-ack, MTU...\n\nAlso, this patch prevents Virtio multiqueue feature negotiation\nif the slave does not support MQ protocol feature as stated\nin Vhost-user specification:\n\"The multiple queues feature is supported only when the protocol\nfeature ``VHOST_USER_PROTOCOL_F_MQ`` (bit 0) is set.\"\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n drivers/net/virtio/virtio_user/vhost.h        |  9 +++++\n drivers/net/virtio/virtio_user/vhost_user.c   |  3 ++\n .../net/virtio/virtio_user/virtio_user_dev.c  | 39 ++++++++++++++++++-\n .../net/virtio/virtio_user/virtio_user_dev.h  |  3 ++\n drivers/net/virtio/virtio_user_ethdev.c       | 19 +++++++++\n 5 files changed, 71 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h\nindex 1e784e58e..9ace1a90c 100644\n--- a/drivers/net/virtio/virtio_user/vhost.h\n+++ b/drivers/net/virtio/virtio_user/vhost.h\n@@ -44,6 +44,15 @@ struct vhost_vring_addr {\n \tuint64_t log_guest_addr;\n };\n \n+#ifndef VHOST_USER_F_PROTOCOL_FEATURES\n+#define VHOST_USER_F_PROTOCOL_FEATURES 30\n+#endif\n+\n+/** Protocol features. */\n+#ifndef VHOST_USER_PROTOCOL_F_MQ\n+#define VHOST_USER_PROTOCOL_F_MQ\t0\n+#endif\n+\n enum vhost_user_request {\n \tVHOST_USER_NONE = 0,\n \tVHOST_USER_GET_FEATURES = 1,\ndiff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c\nindex 74b82e56e..b68766504 100644\n--- a/drivers/net/virtio/virtio_user/vhost_user.c\n+++ b/drivers/net/virtio/virtio_user/vhost_user.c\n@@ -269,10 +269,12 @@ vhost_user_sock(struct virtio_user_dev *dev,\n \n \tswitch (req) {\n \tcase VHOST_USER_GET_FEATURES:\n+\tcase VHOST_USER_GET_PROTOCOL_FEATURES:\n \t\tneed_reply = 1;\n \t\tbreak;\n \n \tcase VHOST_USER_SET_FEATURES:\n+\tcase VHOST_USER_SET_PROTOCOL_FEATURES:\n \tcase VHOST_USER_SET_LOG_BASE:\n \t\tmsg.payload.u64 = *((__u64 *)arg);\n \t\tmsg.size = sizeof(m.payload.u64);\n@@ -351,6 +353,7 @@ vhost_user_sock(struct virtio_user_dev *dev,\n \n \t\tswitch (req) {\n \t\tcase VHOST_USER_GET_FEATURES:\n+\t\tcase VHOST_USER_GET_PROTOCOL_FEATURES:\n \t\t\tif (msg.size != sizeof(m.payload.u64)) {\n \t\t\t\tPMD_DRV_LOG(ERR, \"Received bad msg size\");\n \t\t\t\treturn -1;\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c\nindex 7fb135f49..e45159ddd 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -151,8 +151,10 @@ virtio_user_start_device(struct virtio_user_dev *dev)\n \tif (virtio_user_queue_setup(dev, virtio_user_create_queue) < 0)\n \t\tgoto error;\n \n-\t/* Step 1: set features */\n+\t/* Step 1: negotiate protocol features & set features */\n \tfeatures = dev->features;\n+\n+\n \t/* Strip VIRTIO_NET_F_MAC, as MAC address is handled in vdev init */\n \tfeatures &= ~(1ull << VIRTIO_NET_F_MAC);\n \t/* Strip VIRTIO_NET_F_CTRL_VQ, as devices do not really need to know */\n@@ -417,13 +419,19 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)\n \t 1ULL << VIRTIO_NET_F_GUEST_TSO6\t|\t\\\n \t 1ULL << VIRTIO_F_IN_ORDER\t\t|\t\\\n \t 1ULL << VIRTIO_F_VERSION_1\t\t|\t\\\n-\t 1ULL << VIRTIO_F_RING_PACKED)\n+\t 1ULL << VIRTIO_F_RING_PACKED\t\t|\t\\\n+\t 1ULL << VHOST_USER_F_PROTOCOL_FEATURES)\n+\n+#define VIRTIO_USER_SUPPORTED_PROTOCOL_FEATURES\t\t\\\n+\t(1ULL << VHOST_USER_PROTOCOL_F_MQ)\n \n int\n virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t\t     int cq, int queue_size, const char *mac, char **ifname,\n \t\t     int server, int mrg_rxbuf, int in_order, int packed_vq)\n {\n+\tuint64_t protocol_features = 0;\n+\n \tpthread_mutex_init(&dev->mutex, NULL);\n \tstrlcpy(dev->path, path, PATH_MAX);\n \tdev->started = 0;\n@@ -434,6 +442,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \tdev->mac_specified = 0;\n \tdev->frontend_features = 0;\n \tdev->unsupported_features = ~VIRTIO_USER_SUPPORTED_FEATURES;\n+\tdev->protocol_features = VIRTIO_USER_SUPPORTED_PROTOCOL_FEATURES;\n \tparse_mac(dev, mac);\n \n \tif (*ifname) {\n@@ -446,6 +455,10 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t\treturn -1;\n \t}\n \n+\tif (!is_vhost_user_by_type(dev->path))\n+\t\tdev->unsupported_features |=\n+\t\t\t(1ULL << VHOST_USER_F_PROTOCOL_FEATURES);\n+\n \tif (!dev->is_server) {\n \t\tif (dev->ops->send_request(dev, VHOST_USER_SET_OWNER,\n \t\t\t\t\t   NULL) < 0) {\n@@ -460,6 +473,26 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t\t\t\t     strerror(errno));\n \t\t\treturn -1;\n \t\t}\n+\n+\n+\t\tif (dev->device_features &\n+\t\t\t\t(1ULL << VHOST_USER_F_PROTOCOL_FEATURES)) {\n+\t\t\tif (dev->ops->send_request(dev,\n+\t\t\t\t\tVHOST_USER_GET_PROTOCOL_FEATURES,\n+\t\t\t\t\t&protocol_features))\n+\t\t\t\treturn -1;\n+\n+\t\t\tdev->protocol_features &= protocol_features;\n+\n+\t\t\tif (dev->ops->send_request(dev,\n+\t\t\t\t\t\tVHOST_USER_SET_PROTOCOL_FEATURES,\n+\t\t\t\t\t\t&dev->protocol_features))\n+\t\t\t\treturn -1;\n+\n+\t\t\tif (!(dev->protocol_features &\n+\t\t\t\t\t\t(1ULL << VHOST_USER_PROTOCOL_F_MQ)))\n+\t\t\t\tdev->unsupported_features |= (1ull << VIRTIO_NET_F_MQ);\n+\t\t}\n \t} else {\n \t\t/* We just pretend vhost-user can support all these features.\n \t\t * Note that this could be problematic that if some feature is\n@@ -469,6 +502,8 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t\tdev->device_features = VIRTIO_USER_SUPPORTED_FEATURES;\n \t}\n \n+\n+\n \tif (!mrg_rxbuf)\n \t\tdev->unsupported_features |= (1ull << VIRTIO_NET_F_MRG_RXBUF);\n \ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h\nindex 3b6b6065a..56e638f8a 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.h\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h\n@@ -40,6 +40,9 @@ struct virtio_user_dev {\n \tuint64_t\tdevice_features; /* supported features by device */\n \tuint64_t\tfrontend_features; /* enabled frontend features */\n \tuint64_t\tunsupported_features; /* unsupported features mask */\n+\tuint64_t\tprotocol_features; /* negotiated protocol features\n+\t\t\t\t\t    * (Vhost-user only)\n+\t\t\t\t\t    */\n \tuint8_t\t\tstatus;\n \tuint16_t\tport_id;\n \tuint8_t\t\tmac_addr[RTE_ETHER_ADDR_LEN];\ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex 798f191c3..ccb5a18e2 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -68,6 +68,7 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)\n \tint connectfd;\n \tstruct rte_eth_dev *eth_dev = &rte_eth_devices[dev->port_id];\n \tstruct virtio_hw *hw = eth_dev->data->dev_private;\n+\tuint64_t protocol_features;\n \n \tconnectfd = accept(dev->listenfd, NULL, NULL);\n \tif (connectfd < 0)\n@@ -81,6 +82,24 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)\n \t\treturn -1;\n \t}\n \n+\tif (dev->device_features &\n+\t\t\t(1ULL << VHOST_USER_F_PROTOCOL_FEATURES)) {\n+\t\tif (dev->ops->send_request(dev,\n+\t\t\t\t\tVHOST_USER_GET_PROTOCOL_FEATURES,\n+\t\t\t\t\t&protocol_features))\n+\t\t\treturn -1;\n+\n+\t\tdev->protocol_features &= protocol_features;\n+\n+\t\tif (dev->ops->send_request(dev,\n+\t\t\t\t\tVHOST_USER_SET_PROTOCOL_FEATURES,\n+\t\t\t\t\t&dev->protocol_features))\n+\t\t\treturn -1;\n+\t}\n+\n+\tif (!(dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_MQ)))\n+\t\tdev->unsupported_features |= (1ull << VIRTIO_NET_F_MQ);\n+\n \tdev->device_features |= dev->frontend_features;\n \n \t/* umask vhost-user unsupported features */\n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}