Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/126910/?format=api
http://patches.dpdk.org/api/patches/126910/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/168431453456.558450.8798179744539843068.stgit@ebuild.local/", "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": "<168431453456.558450.8798179744539843068.stgit@ebuild.local>", "list_archive_url": "https://inbox.dpdk.org/dev/168431453456.558450.8798179744539843068.stgit@ebuild.local", "date": "2023-05-17T09:08:56", "name": "[v3,2/4] vhost: make the guest_notifications statistic counter atomic", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "3ab4e56239cf0cde7f4ae79d747666c74a719da3", "submitter": { "id": 672, "url": "http://patches.dpdk.org/api/people/672/?format=api", "name": "Eelco Chaudron", "email": "echaudro@redhat.com" }, "delegate": { "id": 2642, "url": "http://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/168431453456.558450.8798179744539843068.stgit@ebuild.local/mbox/", "series": [ { "id": 28022, "url": "http://patches.dpdk.org/api/series/28022/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28022", "date": "2023-05-17T09:08:30", "name": "vhost: add device op to offload the interrupt kick", "version": 3, "mbox": "http://patches.dpdk.org/series/28022/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/126910/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/126910/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 D83FA42B2A;\n\tWed, 17 May 2023 11:09:02 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A0FE442D2F;\n\tWed, 17 May 2023 11:09:02 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id 650854114A\n for <dev@dpdk.org>; Wed, 17 May 2023 11:09:00 +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-345-WPZ1DnAoN-yEPyV2cgVjig-1; Wed, 17 May 2023 05:08:58 -0400", "from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com\n [10.11.54.9])\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 4459485A588;\n Wed, 17 May 2023 09:08:58 +0000 (UTC)", "from ebuild.redhat.com (unknown [10.39.195.120])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 874A5492B00;\n Wed, 17 May 2023 09:08:57 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1684314539;\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=q4L5prnidxqi8bdQ9JYTRVD+0dnlAfo32PGFitT4KoE=;\n b=JSXlntnrPGhoDmqP90urLkS2PMD2q7Lq9cFpmRX/UnlQjEjdN8rtVZB/O8mWvwBqh4PryN\n HcyHTsAHfYASVcc+y1VYkBUS900YF8dz9UHJl85fmCkPFNwH+WC2+cCbKNxyD/Hp+M0QLi\n vlqDIkK57srCs2XrT6gcAQ/GgrrXr8Q=", "X-MC-Unique": "WPZ1DnAoN-yEPyV2cgVjig-1", "From": "Eelco Chaudron <echaudro@redhat.com>", "To": "maxime.coquelin@redhat.com, chenbo.xia@intel.com,\n david.marchand@redhat.com", "Cc": "dev@dpdk.org", "Subject": "[PATCH v3 2/4] vhost: make the guest_notifications statistic counter\n atomic", "Date": "Wed, 17 May 2023 11:08:56 +0200", "Message-Id": "<168431453456.558450.8798179744539843068.stgit@ebuild.local>", "In-Reply-To": "<168431450017.558450.16680518469610688737.stgit@ebuild.local>", "References": "<168431450017.558450.16680518469610688737.stgit@ebuild.local>", "User-Agent": "StGit/1.5", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.9", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "8bit", "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": "Making the guest_notifications statistic counter atomic, allows\nit to be safely incremented while holding the read access_lock.\n\nSigned-off-by: Eelco Chaudron <echaudro@redhat.com>\n---\n lib/vhost/vhost.c | 8 ++++++++\n lib/vhost/vhost.h | 9 ++++++---\n 2 files changed, 14 insertions(+), 3 deletions(-)", "diff": "diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex 74bdbfd810..8ff6434c93 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -2086,6 +2086,10 @@ rte_vhost_vring_stats_get(int vid, uint16_t queue_id,\n \n \trte_rwlock_write_lock(&vq->access_lock);\n \tfor (i = 0; i < VHOST_NB_VQ_STATS; i++) {\n+\t\t/*\n+\t\t * No need to the read atomic counters as such, due to the\n+\t\t * above write access_lock preventing them to be updated.\n+\t\t */\n \t\tstats[i].value =\n \t\t\t*(uint64_t *)(((char *)vq) + vhost_vq_stat_strings[i].offset);\n \t\tstats[i].id = i;\n@@ -2112,6 +2116,10 @@ int rte_vhost_vring_stats_reset(int vid, uint16_t queue_id)\n \tvq = dev->virtqueue[queue_id];\n \n \trte_rwlock_write_lock(&vq->access_lock);\n+\t/*\n+\t * No need to the reset atomic counters as such, due to the\n+\t * above write access_lock preventing them to be updated.\n+\t */\n \tmemset(&vq->stats, 0, sizeof(vq->stats));\n \trte_rwlock_write_unlock(&vq->access_lock);\n \ndiff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h\nindex 5c939ef06f..37609c7c8d 100644\n--- a/lib/vhost/vhost.h\n+++ b/lib/vhost/vhost.h\n@@ -135,11 +135,12 @@ struct virtqueue_stats {\n \tuint64_t broadcast;\n \t/* Size bins in array as RFC 2819, undersized [0], 64 [1], etc */\n \tuint64_t size_bins[8];\n-\tuint64_t guest_notifications;\n \tuint64_t iotlb_hits;\n \tuint64_t iotlb_misses;\n \tuint64_t inflight_submitted;\n \tuint64_t inflight_completed;\n+\t/* Counters below are atomic, and should be incremented as such. */\n+\tuint64_t guest_notifications;\n };\n \n /**\n@@ -907,7 +908,8 @@ vhost_vring_call_split(struct virtio_net *dev, struct vhost_virtqueue *vq)\n \t\t\t\tunlikely(!signalled_used_valid)) {\n \t\t\teventfd_write(vq->callfd, (eventfd_t) 1);\n \t\t\tif (dev->flags & VIRTIO_DEV_STATS_ENABLED)\n-\t\t\t\tvq->stats.guest_notifications++;\n+\t\t\t\t__atomic_fetch_add(&vq->stats.guest_notifications,\n+\t\t\t\t\t1, __ATOMIC_RELAXED);\n \t\t\tif (dev->notify_ops->guest_notified)\n \t\t\t\tdev->notify_ops->guest_notified(dev->vid);\n \t\t}\n@@ -917,7 +919,8 @@ vhost_vring_call_split(struct virtio_net *dev, struct vhost_virtqueue *vq)\n \t\t\t\t&& (vq->callfd >= 0)) {\n \t\t\teventfd_write(vq->callfd, (eventfd_t)1);\n \t\t\tif (dev->flags & VIRTIO_DEV_STATS_ENABLED)\n-\t\t\t\tvq->stats.guest_notifications++;\n+\t\t\t\t__atomic_fetch_add(&vq->stats.guest_notifications,\n+\t\t\t\t\t1, __ATOMIC_RELAXED);\n \t\t\tif (dev->notify_ops->guest_notified)\n \t\t\t\tdev->notify_ops->guest_notified(dev->vid);\n \t\t}\n", "prefixes": [ "v3", "2/4" ] }{ "id": 126910, "url": "