Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/58133/?format=api
http://patches.dpdk.org/api/patches/58133/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/25d9aeb9ba061b45d394081cc0cc7a347f7dfb2e.1567003335.git.echaudro@redhat.com/", "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": "<25d9aeb9ba061b45d394081cc0cc7a347f7dfb2e.1567003335.git.echaudro@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/25d9aeb9ba061b45d394081cc0cc7a347f7dfb2e.1567003335.git.echaudro@redhat.com", "date": "2019-08-28T14:49:39", "name": "vhost: add device opr when notification to guest is sent", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "25322a63482832741f4cd05d08bd2f0b1da03949", "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/25d9aeb9ba061b45d394081cc0cc7a347f7dfb2e.1567003335.git.echaudro@redhat.com/mbox/", "series": [ { "id": 6156, "url": "http://patches.dpdk.org/api/series/6156/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6156", "date": "2019-08-28T14:49:39", "name": "vhost: add device opr when notification to guest is sent", "version": 1, "mbox": "http://patches.dpdk.org/series/6156/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/58133/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/58133/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 970931BEEE;\n\tWed, 28 Aug 2019 16:49:46 +0200 (CEST)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id 109561BE82\n\tfor <dev@dpdk.org>; Wed, 28 Aug 2019 16:49:45 +0200 (CEST)", "from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 7E4F730832C0;\n\tWed, 28 Aug 2019 14:49:44 +0000 (UTC)", "from netdev64.ntdv.lab.eng.bos.redhat.com\n\t(wsfd-netdev64.ntdv.lab.eng.bos.redhat.com [10.19.188.127])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 008065D70D;\n\tWed, 28 Aug 2019 14:49:41 +0000 (UTC)" ], "From": "Eelco Chaudron <echaudro@redhat.com>", "To": "maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com", "Cc": "dev@dpdk.org", "Date": "Wed, 28 Aug 2019 10:49:39 -0400", "Message-Id": "<25d9aeb9ba061b45d394081cc0cc7a347f7dfb2e.1567003335.git.echaudro@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.44]); Wed, 28 Aug 2019 14:49:44 +0000 (UTC)", "Subject": "[dpdk-dev] [PATCH] vhost: add device opr when notification to guest\n\tis sent", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch adds an operation callback which gets called every time\nthe library is waking up the guest trough an eventfd_write() call.\n\nThis can be used by 3rd party application, like OVS, to track the\nnumber of times interrupts where generated. This might be of\ninterest to find out system-call were called in the fast path.\n\nSigned-off-by: Eelco Chaudron <echaudro@redhat.com>\n---\n lib/librte_vhost/rte_vhost.h | 10 +++++++++-\n lib/librte_vhost/vhost.h | 15 ++++++++++++---\n 2 files changed, 21 insertions(+), 4 deletions(-)", "diff": "diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h\nindex 7fb1729..878e339 100644\n--- a/lib/librte_vhost/rte_vhost.h\n+++ b/lib/librte_vhost/rte_vhost.h\n@@ -172,7 +172,15 @@ struct vhost_device_ops {\n \tint (*new_connection)(int vid);\n \tvoid (*destroy_connection)(int vid);\n \n-\tvoid *reserved[2]; /**< Reserved for future extension */\n+\t/**\n+\t * This callback gets called each time a guest gets notified\n+\t * about waiting packets. This is the interrupt handling trough\n+\t * the eventfd_write(callfd), which can be used for counting these\n+\t * \"slow\" syscalls.\n+\t */\n+\tvoid (*guest_notified)(int vid);\n+\n+\tvoid *reserved[1]; /**< Reserved for future extension */\n };\n \n /**\ndiff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 884befa..5131a97 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -543,13 +543,19 @@ void *vhost_alloc_copy_ind_table(struct virtio_net *dev,\n \n \t\tif ((vhost_need_event(vhost_used_event(vq), new, old) &&\n \t\t\t\t\t(vq->callfd >= 0)) ||\n-\t\t\t\tunlikely(!signalled_used_valid))\n+\t\t\t\tunlikely(!signalled_used_valid)) {\n \t\t\teventfd_write(vq->callfd, (eventfd_t) 1);\n+\t\t\tif (dev->notify_ops->guest_notified)\n+\t\t\t\tdev->notify_ops->guest_notified(dev->vid);\n+\t\t}\n \t} else {\n \t\t/* Kick the guest if necessary. */\n \t\tif (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)\n-\t\t\t\t&& (vq->callfd >= 0))\n+\t\t\t\t&& (vq->callfd >= 0)) {\n \t\t\teventfd_write(vq->callfd, (eventfd_t)1);\n+\t\t\tif (dev->notify_ops->guest_notified)\n+\t\t\t\tdev->notify_ops->guest_notified(dev->vid);\n+\t\t}\n \t}\n }\n \n@@ -600,8 +606,11 @@ void *vhost_alloc_copy_ind_table(struct virtio_net *dev,\n \tif (vhost_need_event(off, new, old))\n \t\tkick = true;\n kick:\n-\tif (kick)\n+\tif (kick) {\n \t\teventfd_write(vq->callfd, (eventfd_t)1);\n+\t\tif (dev->notify_ops->guest_notified)\n+\t\t\tdev->notify_ops->guest_notified(dev->vid);\n+\t}\n }\n \n static __rte_always_inline void\n", "prefixes": [] }{ "id": 58133, "url": "