get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74945,
    "url": "http://patches.dpdk.org/api/patches/74945/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200728165021.216291-2-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": "<20200728165021.216291-2-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200728165021.216291-2-maxime.coquelin@redhat.com",
    "date": "2020-07-28T16:50:19",
    "name": "[v2,1/3] vhost: fix guest notification setting",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "44c8eeeb1f3bb6d75b902eb59b0e6c22274bb1f2",
    "submitter": {
        "id": 512,
        "url": "http://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.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/20200728165021.216291-2-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 11365,
            "url": "http://patches.dpdk.org/api/series/11365/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11365",
            "date": "2020-07-28T16:50:18",
            "name": "Fix Vhost regressions",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/11365/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74945/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/74945/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 E1509A052B;\n\tTue, 28 Jul 2020 18:50:47 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7983D1C012;\n\tTue, 28 Jul 2020 18:50:42 +0200 (CEST)",
            "from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com\n [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 6BD9C1C00E\n for <dev@dpdk.org>; Tue, 28 Jul 2020 18:50:41 +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-42-5yffN2dDNweSSiH1udEdGA-1; Tue, 28 Jul 2020 12:50:36 -0400",
            "from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com\n [10.5.11.14])\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 6616D80BCBA;\n Tue, 28 Jul 2020 16:50:35 +0000 (UTC)",
            "from localhost.localdomain (unknown [10.36.110.21])\n by smtp.corp.redhat.com (Postfix) with ESMTP id ECFE45D9E8;\n Tue, 28 Jul 2020 16:50:32 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1595955040;\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=KRV2asHxOKGWYvicn9QemiZk/MqSdTVl6dp5mW567SA=;\n b=D5x75iW5ii/SYFlNXpAr98NwhRFYkXapOSZJTcKrQAjcNcyEOCi7TC1MBpM6sRCRxa9raA\n qc/OWmVudj+SrxqgY5oiRMKQ5aH4tZL+PP0VKZ0rmGxbXc3MHuwSjFSaKlrYnRLUOsDRh1\n Y+WUb+Q0iALtryivaC7vzUPmZmjKYEQ=",
        "X-MC-Unique": "5yffN2dDNweSSiH1udEdGA-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, matan@mellanox.com, chenbo.xia@intel.com,\n yong.liu@intel.com,\n yinan.wang@intel.com",
        "Cc": "thomas@monjalon.net, ferruh.yigit@intel.com, david.marchand@redhat.com,\n Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Tue, 28 Jul 2020 18:50:19 +0200",
        "Message-Id": "<20200728165021.216291-2-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20200728165021.216291-1-maxime.coquelin@redhat.com>",
        "References": "<20200728165021.216291-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@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/3] vhost: fix guest notification setting",
        "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": "If rte_vhost_enable_guest_notification is called before\nthe virtqueue is ready, the configuration is lost.\n\nThis patch fixes this by saving the guest notification\nenablement value requested by the application, and apply\nit before the virtqueue is made ready to the application.\n\nFixes: 604052ae5395 (\"net/vhost: support queue update\")\n\nReported-by: Yinan Wang <yinan.wang@intel.com>\nTested-by: Yinan Wang <yinan.wang@intel.com>\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\nReviewed-by: Chenbo Xia <chenbo.xia@intel.com>\n---\n lib/librte_vhost/vhost.c      | 24 ++++++++++++++++++++----\n lib/librte_vhost/vhost.h      |  5 +++++\n lib/librte_vhost/vhost_user.c | 11 ++++++++---\n 3 files changed, 33 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex 14b3e253e8..8f20a0818f 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -534,6 +534,7 @@ init_vring_queue(struct virtio_net *dev, uint32_t vring_idx)\n \n \tvq->kickfd = VIRTIO_UNINITIALIZED_EVENTFD;\n \tvq->callfd = VIRTIO_UNINITIALIZED_EVENTFD;\n+\tvq->notif_enable = VIRTIO_UNINITIALIZED_NOTIF;\n \n \tvhost_user_iotlb_init(dev, vring_idx);\n \t/* Backends are set to -1 indicating an inactive device. */\n@@ -1311,6 +1312,23 @@ vhost_enable_notify_packed(struct virtio_net *dev,\n \treturn 0;\n }\n \n+int\n+vhost_enable_guest_notification(struct virtio_net *dev,\n+\t\tstruct vhost_virtqueue *vq, int enable)\n+{\n+\t/*\n+\t * If the virtqueue is not ready yet, it will be applied\n+\t * when it will become ready.\n+\t */\n+\tif (!vq->ready)\n+\t\treturn 0;\n+\n+\tif (vq_is_packed(dev))\n+\t\treturn vhost_enable_notify_packed(dev, vq, enable);\n+\telse\n+\t\treturn vhost_enable_notify_split(dev, vq, enable);\n+}\n+\n int\n rte_vhost_enable_guest_notification(int vid, uint16_t queue_id, int enable)\n {\n@@ -1325,10 +1343,8 @@ rte_vhost_enable_guest_notification(int vid, uint16_t queue_id, int enable)\n \n \trte_spinlock_lock(&vq->access_lock);\n \n-\tif (vq_is_packed(dev))\n-\t\tret = vhost_enable_notify_packed(dev, vq, enable);\n-\telse\n-\t\tret = vhost_enable_notify_split(dev, vq, enable);\n+\tvq->notif_enable = enable;\n+\tret = vhost_enable_guest_notification(dev, vq, enable);\n \n \trte_spinlock_unlock(&vq->access_lock);\n \ndiff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 0f7212f888..a29c6638e2 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -164,6 +164,9 @@ struct vhost_virtqueue {\n \tint\t\t\tenabled;\n \tint\t\t\taccess_ok;\n \tint\t\t\tready;\n+\tint\t\t\tnotif_enable;\n+#define VIRTIO_UNINITIALIZED_NOTIF\t(-1)\n+\n \trte_spinlock_t\t\taccess_lock;\n \n \t/* Used to notify the guest (trigger interrupt) */\n@@ -668,6 +671,8 @@ void vhost_enable_dequeue_zero_copy(int vid);\n void vhost_set_builtin_virtio_net(int vid, bool enable);\n void vhost_enable_extbuf(int vid);\n void vhost_enable_linearbuf(int vid);\n+int vhost_enable_guest_notification(struct virtio_net *dev,\n+\t\tstruct vhost_virtqueue *vq, int enable);\n \n struct vhost_device_ops const *vhost_driver_callback_get(const char *path);\n \ndiff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex 9ddeae3622..c3c924faec 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -235,6 +235,11 @@ vhost_user_notify_queue_state(struct virtio_net *dev, uint16_t index,\n \t\t\t      int enable)\n {\n \tstruct rte_vdpa_device *vdpa_dev = dev->vdpa_dev;\n+\tstruct vhost_virtqueue *vq = dev->virtqueue[index];\n+\n+\t/* Configure guest notifications on enable */\n+\tif (enable && vq->notif_enable != VIRTIO_UNINITIALIZED_NOTIF)\n+\t\tvhost_enable_guest_notification(dev, vq, vq->notif_enable);\n \n \tif (vdpa_dev && vdpa_dev->ops->set_vring_state)\n \t\tvdpa_dev->ops->set_vring_state(dev->vid, index, enable);\n@@ -1640,8 +1645,8 @@ vhost_user_set_vring_call(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \tvq = dev->virtqueue[file.index];\n \n \tif (vq->ready) {\n-\t\tvhost_user_notify_queue_state(dev, file.index, 0);\n \t\tvq->ready = 0;\n+\t\tvhost_user_notify_queue_state(dev, file.index, 0);\n \t}\n \n \tif (vq->callfd >= 0)\n@@ -1903,8 +1908,8 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t}\n \n \tif (vq->ready) {\n-\t\tvhost_user_notify_queue_state(dev, file.index, 0);\n \t\tvq->ready = 0;\n+\t\tvhost_user_notify_queue_state(dev, file.index, 0);\n \t}\n \n \tif (vq->kickfd >= 0)\n@@ -2917,8 +2922,8 @@ vhost_user_msg_handler(int vid, int fd)\n \t\tbool cur_ready = vq_is_ready(dev, vq);\n \n \t\tif (cur_ready != (vq && vq->ready)) {\n-\t\t\tvhost_user_notify_queue_state(dev, i, cur_ready);\n \t\t\tvq->ready = cur_ready;\n+\t\t\tvhost_user_notify_queue_state(dev, i, cur_ready);\n \t\t}\n \t}\n \n",
    "prefixes": [
        "v2",
        "1/3"
    ]
}