get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 110965,
    "url": "https://patches.dpdk.org/api/patches/110965/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220510082528.1229104-1-maxime.coquelin@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": "<20220510082528.1229104-1-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220510082528.1229104-1-maxime.coquelin@redhat.com",
    "date": "2022-05-10T08:25:28",
    "name": "vhost: add runtime locking check in unsafe APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a0768930d137ac8bd469cf52ce455e1d52611fbf",
    "submitter": {
        "id": 512,
        "url": "https://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@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/20220510082528.1229104-1-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 22863,
            "url": "https://patches.dpdk.org/api/series/22863/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22863",
            "date": "2022-05-10T08:25:28",
            "name": "vhost: add runtime locking check in unsafe APIs",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/22863/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/110965/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/110965/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 232D8A00BE;\n\tTue, 10 May 2022 10:25:37 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BB20D406B4;\n\tTue, 10 May 2022 10:25:36 +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 7E10F4069D\n for <dev@dpdk.org>; Tue, 10 May 2022 10:25:35 +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-384-SpDyZeMhNWGVOZRKPVOjYw-1; Tue, 10 May 2022 04:25:31 -0400",
            "from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com\n [10.11.54.1])\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 679BF85A5BC;\n Tue, 10 May 2022 08:25:31 +0000 (UTC)",
            "from max-t490s.redhat.com (unknown [10.39.208.28])\n by smtp.corp.redhat.com (Postfix) with ESMTP id EA000400E89E;\n Tue, 10 May 2022 08:25:29 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1652171134;\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=no0xJ27Exw9w2w3PWKCoYAW96ZRqdiqSpVFoghh+s0Q=;\n b=XNhXBUf8wrNG9/fepn7IorB0a0/6/Tzz41sQ4AFtZkSJQkwRG1XUQDjazif2ZehgtH/5FC\n YGe6l9qqVHmqynmW+yFh9v8d16ms0ctdvbGHp3DBvuHTZ4Wef2SZxnzGWPdMxPLhYSmOAZ\n Xb0NxZseIn4k0uSzeikyjq2qZySz4G4=",
        "X-MC-Unique": "SpDyZeMhNWGVOZRKPVOjYw-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, chenbo.xia@intel.com, xuan.ding@intel.com,\n jiayu.hu@intel.com, cheng1.jiang@intel.com, sunil.pai.g@intel.com,\n david.marchand@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Subject": "[PATCH] vhost: add runtime locking check in unsafe APIs",
        "Date": "Tue, 10 May 2022 10:25:28 +0200",
        "Message-Id": "<20220510082528.1229104-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.84 on 10.11.54.1",
        "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-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": "This patch adds runtime checks in unsafe Vhost async APIs,\nto ensure the access lock is taken.\n\nThe detection won't work every time, as another thread\ncould take the lock, but it would help to detect misuse\nof these unsafe API.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/vhost/vhost.c | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)",
    "diff": "diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex df0bb9d043..39cbeb415c 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -1732,6 +1732,12 @@ rte_vhost_async_channel_register_thread_unsafe(int vid, uint16_t queue_id)\n \tif (unlikely(vq == NULL || !dev->async_copy))\n \t\treturn -1;\n \n+\tif (unlikely(!rte_spinlock_is_locked(&vq->access_lock))) {\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) %s() called without access lock taken.\\n\",\n+\t\t\t\tdev->ifname, __func__);\n+\t\treturn -1;\n+\t}\n+\n \treturn async_channel_register(vid, queue_id);\n }\n \n@@ -1796,6 +1802,12 @@ rte_vhost_async_channel_unregister_thread_unsafe(int vid, uint16_t queue_id)\n \tif (vq == NULL)\n \t\treturn -1;\n \n+\tif (unlikely(!rte_spinlock_is_locked(&vq->access_lock))) {\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) %s() called without access lock taken.\\n\",\n+\t\t\t\tdev->ifname, __func__);\n+\t\treturn -1;\n+\t}\n+\n \tif (!vq->async)\n \t\treturn 0;\n \n@@ -1925,6 +1937,12 @@ rte_vhost_async_get_inflight_thread_unsafe(int vid, uint16_t queue_id)\n \tif (vq == NULL)\n \t\treturn ret;\n \n+\tif (unlikely(!rte_spinlock_is_locked(&vq->access_lock))) {\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) %s() called without access lock taken.\\n\",\n+\t\t\t\tdev->ifname, __func__);\n+\t\treturn -1;\n+\t}\n+\n \tif (!vq->async)\n \t\treturn ret;\n \n",
    "prefixes": []
}