get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 108932,
    "url": "https://patches.dpdk.org/api/patches/108932/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220328121758.26632-4-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": "<20220328121758.26632-4-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220328121758.26632-4-david.marchand@redhat.com",
    "date": "2022-03-28T12:17:56",
    "name": "[RFC,3/5] vhost: fix async access",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9f0b419466d907c72b38d2f7e57386f849f265b5",
    "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/20220328121758.26632-4-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 22266,
            "url": "https://patches.dpdk.org/api/series/22266/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22266",
            "date": "2022-03-28T12:17:53",
            "name": "vhost lock annotations",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/22266/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/108932/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/108932/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 10B56A0501;\n\tMon, 28 Mar 2022 14:18:52 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 012B242880;\n\tMon, 28 Mar 2022 14:18:52 +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 760AC41104\n for <dev@dpdk.org>; Mon, 28 Mar 2022 14:18:50 +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-272-gsDjG94sP6STym-V7HFinA-1; Mon, 28 Mar 2022 08:18:46 -0400",
            "from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com\n [10.11.54.8])\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 2D0B0101AA46;\n Mon, 28 Mar 2022 12:18:46 +0000 (UTC)",
            "from dmarchan.remote.csb (unknown [10.40.195.27])\n by smtp.corp.redhat.com (Postfix) with ESMTP id D5848C15D40;\n Mon, 28 Mar 2022 12:18:44 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1648469930;\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=fIkl5t5r6G/U+xVmXJurnpkXlWG5lPaLX2htjlnLEFE=;\n b=MF8Z8v/CPwNkj1dB+rQbr1FSCJBVAWSiSD9DSuSZrlkcW1dTbV2XkNzrctZIBIYAgjMiyG\n 6KDAjlo42fYtI+q/8TmpaM2eeDKBVEKz+MsatZoU4P+Lxub4say04pdrRFGlE9xSNcpF5D\n h0Nq6N+H3lSMeqHyRUKS7F/jHzCPM0c=",
        "X-MC-Unique": "gsDjG94sP6STym-V7HFinA-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.coquelin@redhat.com, chenbo.xia@intel.com, stable@dpdk.org,\n Patrick Fu <patrick.fu@intel.com>, Jiayu Hu <jiayu.hu@intel.com>",
        "Subject": "[RFC PATCH 3/5] vhost: fix async access",
        "Date": "Mon, 28 Mar 2022 14:17:56 +0200",
        "Message-Id": "<20220328121758.26632-4-david.marchand@redhat.com>",
        "In-Reply-To": "<20220328121758.26632-1-david.marchand@redhat.com>",
        "References": "<20220328121758.26632-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.85 on 10.11.54.8",
        "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 is 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---\nThis has been reported by Jiayu too:\nhttps://patchwork.dpdk.org/project/dpdk/patch/20220328020754.1155063-1-jiayu.hu@intel.com/\n\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 863cd9131e..9e6ca506ff 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 (vhost_spinlock_trylock(&vq->access_lock) == 0) {\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 \tvhost_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 (vhost_spinlock_trylock(&vq->access_lock) == 0) {\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 \tvhost_spinlock_unlock(&vq->access_lock);\n \n \treturn ret;\n",
    "prefixes": [
        "RFC",
        "3/5"
    ]
}