get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 137984,
    "url": "https://patches.dpdk.org/api/patches/137984/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240305091326.2697724-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": "<20240305091326.2697724-1-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240305091326.2697724-1-david.marchand@redhat.com",
    "date": "2024-03-05T09:13:25",
    "name": "vhost: fix vring addr update with vDPA",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8f4908d34dfa9e6db59dd27583845ab38000c80d",
    "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/20240305091326.2697724-1-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 31372,
            "url": "https://patches.dpdk.org/api/series/31372/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31372",
            "date": "2024-03-05T09:13:25",
            "name": "vhost: fix vring addr update with vDPA",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/31372/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/137984/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/137984/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 378B443C51;\n\tTue,  5 Mar 2024 10:13:45 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B9775402A8;\n\tTue,  5 Mar 2024 10:13:44 +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 9E04E4026B\n for <dev@dpdk.org>; Tue,  5 Mar 2024 10:13:42 +0100 (CET)",
            "from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73])\n by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-466-tCbmZtKsOkG_C2pCtUWOFQ-1; Tue,\n 05 Mar 2024 04:13:37 -0500",
            "from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com\n [10.11.54.5])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 604131C41A03;\n Tue,  5 Mar 2024 09:13:37 +0000 (UTC)",
            "from dmarchan.redhat.com (unknown [10.45.225.66])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 1F72F175AD;\n Tue,  5 Mar 2024 09:13:35 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1709630022;\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=LtQDAA4ogcykHfzp4PzuKE4qvmA91/1ovlGa+rXB2Gw=;\n b=JrRolA7OCaDsgHPuLkkEqYnew4WaZRot9k6yGZjkRCxv1px0Sz0VGY/TPwDmQsQ1QhrxjR\n MvMc8V9aBD8QZV/ZYD/PqTYZYZI+3owGk23Mq8VB5RjbUXsKtPhFlSAOyfoSwlBu8H+41j\n FkFTPMoaMvJvTuEYOlMt4HeLfUq+3XI=",
        "X-MC-Unique": "tCbmZtKsOkG_C2pCtUWOFQ-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "ssimma@nvidia.com, Maxime Coquelin <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbox@nvidia.com>, Eelco Chaudron <echaudro@redhat.com>",
        "Subject": "[PATCH] vhost: fix vring addr update with vDPA",
        "Date": "Tue,  5 Mar 2024 10:13:25 +0100",
        "Message-ID": "<20240305091326.2697724-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.11.54.5",
        "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\nat runtime.\n\nOn the other hand, we need to hold the vq lock to evaluate vq->access_ok,\ninvalidate vring addresses and translate them.\n\nMove vring address update earlier and, when vDPA is configured, skip parts\nwhich expect lock to be taken.\n\nBugzilla ID: 1394\nFixes: 741dc052eaf9 (\"vhost: annotate virtqueue access checks\")\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n lib/vhost/vhost_user.c | 14 +++++++++-----\n 1 file changed, 9 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c\nindex 3aba32c95a..7fe1687f08 100644\n--- a/lib/vhost/vhost_user.c\n+++ b/lib/vhost/vhost_user.c\n@@ -986,17 +986,20 @@ vhost_user_set_vring_addr(struct virtio_net **pdev,\n \t/* addr->index refers to the queue index. The txq 1, rxq is 0. */\n \tvq = dev->virtqueue[ctx->msg.payload.addr.index];\n \n-\t/* vhost_user_lock_all_queue_pairs locked all qps */\n-\tVHOST_USER_ASSERT_LOCK(dev, vq, VHOST_USER_SET_VRING_ADDR);\n-\n-\taccess_ok = vq->access_ok;\n-\n \t/*\n \t * Rings addresses should not be interpreted as long as the ring is not\n \t * started and enabled\n \t */\n \tmemcpy(&vq->ring_addrs, addr, sizeof(*addr));\n \n+\tif (dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)\n+\t\tgoto out;\n+\n+\t/* vhost_user_lock_all_queue_pairs locked all qps */\n+\tVHOST_USER_ASSERT_LOCK(dev, vq, VHOST_USER_SET_VRING_ADDR);\n+\n+\taccess_ok = vq->access_ok;\n+\n \tvring_invalidate(dev, vq);\n \n \tif ((vq->enabled && (dev->features &\n@@ -1006,6 +1009,7 @@ vhost_user_set_vring_addr(struct virtio_net **pdev,\n \t\t*pdev = dev;\n \t}\n \n+out:\n \treturn RTE_VHOST_MSG_RESULT_OK;\n }\n \n",
    "prefixes": []
}