get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 130997,
    "url": "https://patches.dpdk.org/api/patches/130997/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230831140252.3747449-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": "<20230831140252.3747449-1-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230831140252.3747449-1-maxime.coquelin@redhat.com",
    "date": "2023-08-31T14:02:52",
    "name": "vhost: add IRQ suppression",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d9788a0ec322b19ed496434437376d9b4d4fc4cc",
    "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/20230831140252.3747449-1-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 29393,
            "url": "https://patches.dpdk.org/api/series/29393/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29393",
            "date": "2023-08-31T14:02:52",
            "name": "vhost: add IRQ suppression",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/29393/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/130997/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/130997/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 755D841FDE;\n\tThu, 31 Aug 2023 16:03:00 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5475B40285;\n\tThu, 31 Aug 2023 16:03:00 +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 7B6604027B\n for <dev@dpdk.org>; Thu, 31 Aug 2023 16:02:59 +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-138-LZlRo4JNMYmLj-V8eDk5GA-1; Thu, 31 Aug 2023 10:02:55 -0400",
            "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 5FBA3823D66;\n Thu, 31 Aug 2023 14:02:55 +0000 (UTC)",
            "from max-p1.redhat.com (unknown [10.39.208.19])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 2CDEC2026D35;\n Thu, 31 Aug 2023 14:02:53 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1693490579;\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=nGabi+DRvhRY1svkkLhb9obMFGsLMUEaiwAukMBw00k=;\n b=A+lfB2XxJR5jV7BG5A43JJLJQqFdY+WoOGfCiopeNQeBZEEKcb75d81B2RLcumH9Al8aBc\n X1i6cEUEj3K/2GGZLGT8SUeov5x0WIG49mH5W0AoBRvtbfUvP6Nl2ZZ1Et2km74Uuo6kf+\n 7fOqLLoEDoWIABfrdZK7noZN7X4iNCE=",
        "X-MC-Unique": "LZlRo4JNMYmLj-V8eDk5GA-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, chenbo.xia@intel.com, david.marchand@redhat.com,\n echaudro@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Subject": "[PATCH] vhost: add IRQ suppression",
        "Date": "Thu, 31 Aug 2023 16:02:52 +0200",
        "Message-ID": "<20230831140252.3747449-1-maxime.coquelin@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": "Guest notifications offloading, which has been introduced\nin v23.07, aims at offloading syscalls out of the datapath.\n\nThis patch optimizes the offloading by not offloading the\nguest notification for a given virtqueue if one is already\nbeing offloaded by the application.\n\nWith a single VDUSE device, we can already see few\nnotifications being suppressed when doing throughput\ntesting with Iperf3. We can expect to see much more being\nsuppressed when the offloading thread is under pressure.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/vhost/vhost.c |  4 ++++\n lib/vhost/vhost.h | 26 ++++++++++++++++++++------\n 2 files changed, 24 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex eb6309b681..7794f29c18 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -48,6 +48,8 @@ static const struct vhost_vq_stats_name_off vhost_vq_stat_strings[] = {\n \t\tstats.guest_notifications_offloaded)},\n \t{\"guest_notifications_error\", offsetof(struct vhost_virtqueue,\n \t\tstats.guest_notifications_error)},\n+\t{\"guest_notifications_suppressed\", offsetof(struct vhost_virtqueue,\n+\t\tstats.guest_notifications_suppressed)},\n \t{\"iotlb_hits\",             offsetof(struct vhost_virtqueue, stats.iotlb_hits)},\n \t{\"iotlb_misses\",           offsetof(struct vhost_virtqueue, stats.iotlb_misses)},\n \t{\"inflight_submitted\",     offsetof(struct vhost_virtqueue, stats.inflight_submitted)},\n@@ -1516,6 +1518,8 @@ rte_vhost_notify_guest(int vid, uint16_t queue_id)\n \n \trte_rwlock_read_lock(&vq->access_lock);\n \n+\t__atomic_store_n(&vq->irq_pending, false, __ATOMIC_RELEASE);\n+\n \tif (dev->backend_ops->inject_irq(dev, vq)) {\n \t\tif (dev->flags & VIRTIO_DEV_STATS_ENABLED)\n \t\t\t__atomic_fetch_add(&vq->stats.guest_notifications_error,\ndiff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h\nindex 1febfcc150..75e3859e87 100644\n--- a/lib/vhost/vhost.h\n+++ b/lib/vhost/vhost.h\n@@ -156,6 +156,7 @@ struct virtqueue_stats {\n \tuint64_t iotlb_misses;\n \tuint64_t inflight_submitted;\n \tuint64_t inflight_completed;\n+\tuint64_t guest_notifications_suppressed;\n \t/* Counters below are atomic, and should be incremented as such. */\n \tuint64_t guest_notifications;\n \tuint64_t guest_notifications_offloaded;\n@@ -365,6 +366,7 @@ struct vhost_virtqueue {\n \tstruct virtqueue_stats\tstats;\n \n \tstruct vhost_reconnect_vring *log;\n+\tbool irq_pending;\n } __rte_cache_aligned;\n \n /* Virtio device status as per Virtio specification */\n@@ -930,12 +932,24 @@ vhost_need_event(uint16_t event_idx, uint16_t new_idx, uint16_t old)\n static __rte_always_inline void\n vhost_vring_inject_irq(struct virtio_net *dev, struct vhost_virtqueue *vq)\n {\n-\tif (dev->notify_ops->guest_notify &&\n-\t    dev->notify_ops->guest_notify(dev->vid, vq->index)) {\n-\t\tif (dev->flags & VIRTIO_DEV_STATS_ENABLED)\n-\t\t\t__atomic_fetch_add(&vq->stats.guest_notifications_offloaded,\n-\t\t\t\t1, __ATOMIC_RELAXED);\n-\t\treturn;\n+\tbool expected = false;\n+\n+\tif (dev->notify_ops->guest_notify) {\n+\t\tif (__atomic_compare_exchange_n(&vq->irq_pending, &expected, true, 0,\n+\t\t\t\t  __ATOMIC_RELEASE, __ATOMIC_RELAXED)) {\n+\t\t\tif (dev->notify_ops->guest_notify(dev->vid, vq->index)) {\n+\t\t\t\tif (dev->flags & VIRTIO_DEV_STATS_ENABLED)\n+\t\t\t\t\t__atomic_fetch_add(&vq->stats.guest_notifications_offloaded,\n+\t\t\t\t\t\t1, __ATOMIC_RELAXED);\n+\t\t\t\treturn;\n+\t\t\t}\n+\n+\t\t\t/* Offloading failed, fallback to direct IRQ injection */\n+\t\t\t__atomic_store_n(&vq->irq_pending, 0, __ATOMIC_RELEASE);\n+\t\t} else {\n+\t\t\tvq->stats.guest_notifications_suppressed++;\n+\t\t\treturn;\n+\t\t}\n \t}\n \n \tif (dev->backend_ops->inject_irq(dev, vq)) {\n",
    "prefixes": []
}