get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124686,
    "url": "https://patches.dpdk.org/api/patches/124686/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230302094808.1519310-1-david.marchand@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": "<20230302094808.1519310-1-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230302094808.1519310-1-david.marchand@redhat.com",
    "date": "2023-03-02T09:48:08",
    "name": "vhost: fix vring enable with VDPA",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "930e2ee96d8b6432b6b8b8b0b2867be6b63a92fd",
    "submitter": {
        "id": 1173,
        "url": "https://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@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/20230302094808.1519310-1-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 27224,
            "url": "https://patches.dpdk.org/api/series/27224/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=27224",
            "date": "2023-03-02T09:48:08",
            "name": "vhost: fix vring enable with VDPA",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/27224/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/124686/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/124686/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 1074B41D3D;\n\tThu,  2 Mar 2023 10:48:16 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0099F41153;\n\tThu,  2 Mar 2023 10:48:15 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 5079E40DFB\n for <dev@dpdk.org>; Thu,  2 Mar 2023 10:48:14 +0100 (CET)",
            "from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-600-782V7yxSNH2AiReUYXzu5A-1; Thu, 02 Mar 2023 04:48:12 -0500",
            "from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com\n [10.11.54.4])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 491831C05AEA;\n Thu,  2 Mar 2023 09:48:12 +0000 (UTC)",
            "from dmarchan.redhat.com (unknown [10.39.192.123])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 0E6372026D4B;\n Thu,  2 Mar 2023 09:48:10 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1677750493;\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 bh=9YJoO+ZeWEGh0rZ83BrLX5arVddAz3j/gNb7hs1HnGI=;\n b=Vkrd0gwmxa7lECBHiEtIfJqre+MrL17TTN3GuGhAPAdn+oMbmZyin3Bc4sJkrhtlQGquZP\n 9KUV+imyj0GLnFsIipE5oL5ayMy4ajVteyoKMDIniK5NcSm4AWx2zdd0p1gIkr9M09SLxI\n Tq6v9tvY3XD9rOydDna1Z5J2wq8Z2WA=",
        "X-MC-Unique": "782V7yxSNH2AiReUYXzu5A-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "ssimma@nvidia.com, yajunw@nvidia.com,\n Maxime Coquelin <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbo.xia@intel.com>,\n =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>",
        "Subject": "[PATCH] vhost: fix vring enable with VDPA",
        "Date": "Thu,  2 Mar 2023 10:48:08 +0100",
        "Message-Id": "<20230302094808.1519310-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.4",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "For VDPA devices, vq are not locked once the device has been configured.\nBut we need to hold the vq lock to check if vhost async is enabled.\n\nCombining VDPA and vhost async does not seem to make much sense, so\nprevent this combination, and only assert the lock is taken when VDPA is\nnot configured on this vq.\n\nBugzilla ID: 1169\nFixes: 4b02c2673757 (\"vhost: annotate async accesses\")\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n lib/vhost/vhost.c      | 4 ++--\n lib/vhost/vhost_user.c | 8 ++++----\n 2 files changed, 6 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex c36dc06a0a..6b73c03224 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -1754,7 +1754,7 @@ rte_vhost_async_channel_register(int vid, uint16_t queue_id)\n \n \tvq = dev->virtqueue[queue_id];\n \n-\tif (unlikely(vq == NULL || !dev->async_copy))\n+\tif (unlikely(vq == NULL || !dev->async_copy || dev->vdpa_dev))\n \t\treturn -1;\n \n \trte_spinlock_lock(&vq->access_lock);\n@@ -1778,7 +1778,7 @@ rte_vhost_async_channel_register_thread_unsafe(int vid, uint16_t queue_id)\n \n \tvq = dev->virtqueue[queue_id];\n \n-\tif (unlikely(vq == NULL || !dev->async_copy))\n+\tif (unlikely(vq == NULL || !dev->async_copy || dev->vdpa_dev))\n \t\treturn -1;\n \n \tvq_assert_lock(dev, vq);\ndiff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c\nindex d702d082dd..daf3458985 100644\n--- a/lib/vhost/vhost_user.c\n+++ b/lib/vhost/vhost_user.c\n@@ -2177,10 +2177,10 @@ vhost_user_set_vring_enable(struct virtio_net **pdev,\n \t\tenable, index);\n \n \tvq = dev->virtqueue[index];\n-\t/* vhost_user_lock_all_queue_pairs locked all qps */\n-\tvq_assert_lock(dev, vq);\n-\tif (enable && vq->async) {\n-\t\tif (vq->async->pkts_inflight_n) {\n+\tif (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) {\n+\t\t/* vhost_user_lock_all_queue_pairs locked all qps */\n+\t\tvq_assert_lock(dev, vq);\n+\t\tif (enable && vq->async && vq->async->pkts_inflight_n) {\n \t\t\tVHOST_LOG_CONFIG(dev->ifname, ERR,\n \t\t\t\t\"failed to enable vring. Inflight packets must be completed first\\n\");\n \t\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n",
    "prefixes": []
}