get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 109027,
    "url": "http://patches.dpdk.org/api/patches/109027/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220330134956.18927-5-david.marchand@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": "<20220330134956.18927-5-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220330134956.18927-5-david.marchand@redhat.com",
    "date": "2022-03-30T13:49:51",
    "name": "[RFC,v2,4/9] vhost: fix async access",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "004482605824d668810768d36ea9751257533f0f",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220330134956.18927-5-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 22292,
            "url": "http://patches.dpdk.org/api/series/22292/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22292",
            "date": "2022-03-30T13:49:47",
            "name": "vhost lock annotations",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/22292/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/109027/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/109027/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 7324AA050D;\n\tWed, 30 Mar 2022 15:50:39 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A1B5E428F9;\n\tWed, 30 Mar 2022 15:50:26 +0200 (CEST)",
            "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 5CF84428F4\n for <dev@dpdk.org>; Wed, 30 Mar 2022 15:50:25 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) 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-558-5zP1lTi3MBSLGifenlX-FA-1; Wed, 30 Mar 2022 09:50:22 -0400",
            "from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com\n [10.11.54.2])\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 F1719100BAAF;\n Wed, 30 Mar 2022 13:50:21 +0000 (UTC)",
            "from dmarchan.remote.csb (unknown [10.40.195.27])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 4CB47400E10D;\n Wed, 30 Mar 2022 13:50:20 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1648648223;\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=JXqqOCgj9Xe/FQOqOIN7I2y64iYcA0IN2TJAaMdM+cI=;\n b=by7KTDL6czSiEVNhjGez+RZGCFGImJBQ2BmYYE8zyqz8yTrRll7savwfISUpOZeurwOVnT\n Vl/BF060ol10qkshihLdPhqkPJjKhb6LJSxs8uNnJ2I86Grdfvw+gi+e3GTQCsAsaMrMR5\n BRHdgETtuv+GCcQ0EQxg53LOQ6MGO1c=",
        "X-MC-Unique": "5zP1lTi3MBSLGifenlX-FA-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.coquelin@redhat.com, chenbo.xia@intel.com, jiayu.hu@intel.com,\n yuanx.wang@intel.com, xuan.ding@intel.com, stable@dpdk.org,\n Patrick Fu <patrick.fu@intel.com>",
        "Subject": "[RFC PATCH v2 4/9] vhost: fix async access",
        "Date": "Wed, 30 Mar 2022 15:49:51 +0200",
        "Message-Id": "<20220330134956.18927-5-david.marchand@redhat.com>",
        "In-Reply-To": "<20220330134956.18927-1-david.marchand@redhat.com>",
        "References": "<20220328121758.26632-1-david.marchand@redhat.com>\n <20220330134956.18927-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.84 on 10.11.54.2",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com",
        "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": "vq->async accesses must be protected with vq->access_lock.\n\nFixes: eb666d24085f (\"vhost: fix async unregister deadlock\")\nFixes: 0c0935c5f794 (\"vhost: allow to check in-flight packets for async vhost\")\nCc: stable@dpdk.org\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n lib/vhost/vhost.c | 25 ++++++++++---------------\n 1 file changed, 10 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex 2f96a28dac..a93e41f314 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -1753,27 +1753,23 @@ rte_vhost_async_channel_unregister(int vid, uint16_t queue_id)\n \tif (vq == NULL)\n \t\treturn ret;\n \n-\tret = 0;\n-\n-\tif (!vq->async)\n-\t\treturn ret;\n-\n \tif (!rte_spinlock_trylock(&vq->access_lock)) {\n \t\tVHOST_LOG_CONFIG(ERR, \"(%s) failed to unregister async channel, virtqueue busy.\\n\",\n \t\t\t\tdev->ifname);\n-\t\treturn -1;\n+\t\treturn ret;\n \t}\n \n-\tif (vq->async->pkts_inflight_n) {\n+\tif (!vq->async) {\n+\t\tret = 0;\n+\t} else if (vq->async->pkts_inflight_n) {\n \t\tVHOST_LOG_CONFIG(ERR, \"(%s) failed to unregister async channel.\\n\", dev->ifname);\n \t\tVHOST_LOG_CONFIG(ERR, \"(%s) inflight packets must be completed before unregistration.\\n\",\n \t\t\tdev->ifname);\n-\t\tret = -1;\n-\t\tgoto out;\n+\t} else {\n+\t\tvhost_free_async_mem(vq);\n+\t\tret = 0;\n \t}\n \n-\tvhost_free_async_mem(vq);\n-out:\n \trte_spinlock_unlock(&vq->access_lock);\n \n \treturn ret;\n@@ -1891,9 +1887,6 @@ rte_vhost_async_get_inflight(int vid, uint16_t queue_id)\n \tif (vq == NULL)\n \t\treturn ret;\n \n-\tif (!vq->async)\n-\t\treturn ret;\n-\n \tif (!rte_spinlock_trylock(&vq->access_lock)) {\n \t\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\t\"(%s) failed to check in-flight packets. virtqueue busy.\\n\",\n@@ -1901,7 +1894,9 @@ rte_vhost_async_get_inflight(int vid, uint16_t queue_id)\n \t\treturn ret;\n \t}\n \n-\tret = vq->async->pkts_inflight_n;\n+\tif (vq->async)\n+\t\tret = vq->async->pkts_inflight_n;\n+\n \trte_spinlock_unlock(&vq->access_lock);\n \n \treturn ret;\n",
    "prefixes": [
        "RFC",
        "v2",
        "4/9"
    ]
}