From nobody Sat Apr 27 17:19:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1497536459884162.72491753013242; Thu, 15 Jun 2017 07:20:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C68BD33459C; Thu, 15 Jun 2017 14:20:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A481865E8; Thu, 15 Jun 2017 14:20:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 323BC1841C42; Thu, 15 Jun 2017 14:20:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5FEHxP3010330 for ; Thu, 15 Jun 2017 10:17:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 93B5580739; Thu, 15 Jun 2017 14:17:59 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-139.ams2.redhat.com [10.36.116.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEE1C80736; Thu, 15 Jun 2017 14:17:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C68BD33459C Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C68BD33459C From: sferdjao@redhat.com To: libvir-list@redhat.com Date: Thu, 15 Jun 2017 10:17:13 -0400 Message-Id: <20170615141715.17708-2-sferdjao@redhat.com> In-Reply-To: <20170615141715.17708-1-sferdjao@redhat.com> References: <20170615141715.17708-1-sferdjao@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Sahid Orentino Ferdjaoui , laine@redhat.com Subject: [libvirt] [PATCH 1/3] qemu: add capability for vhost-net busy polling X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 15 Jun 2017 14:20:57 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Sahid Orentino Ferdjaoui QEMU 2.7.0 adds support of busy polling on vhost-net. 69e87b32680a41d9761191443587c595b6f5fc3f Signed-off-by: Sahid Orentino Ferdjaoui --- src/qemu/qemu_capabilities.c | 6 ++++++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 + tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 + tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + 7 files changed, 12 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c0c39bd..faf6d82 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -376,6 +376,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "intel-iommu.device-iotlb", /* 260 */ "virtio.iommu_platform", "virtio.ats", + "vhost-net.poll_us", ); =20 =20 @@ -4773,6 +4774,11 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (qemuCaps->version >=3D 2006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT); =20 + /* Support for busy polling on vhost-net devices ("-netdev + * tap,...,poll-us=3Dn") */ + if (qemuCaps->version >=3D 2007000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_VHOST_NET_POLL_US); + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) goto cleanup; =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index e57cae9..33f8ed0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -415,6 +415,7 @@ typedef enum { QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB, /* intel-iommu.device-iotlb */ QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, /* virtio-*-pci.iommu_platform */ QEMU_CAPS_VIRTIO_PCI_ATS, /* virtio-*-pci.ats */ + QEMU_CAPS_VHOST_NET_POLL_US, /* vhost-net with -netdev poll-us=3D */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_2.7.0.s390x.xml index 70cce64..f833d4a 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml @@ -132,6 +132,7 @@ + 2007000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.7.0.x86_64.xml index 49c0462..2ab44cf 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -205,6 +205,7 @@ + 2007000 0 (v2.7.0) diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_2.8.0.s390x.xml index 51be9bc..98f763d 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml @@ -134,6 +134,7 @@ + 2007093 0 diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.8.0.x86_64.xml index 01edbc8..bafe08f 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml @@ -207,6 +207,7 @@ + 2008000 0 (v2.8.0) diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index 58dd9f6..dc93b5a 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -218,6 +218,7 @@ + 2009000 0 (v2.9.0) --=20 2.9.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:19:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1497536327988205.39582863480302; Thu, 15 Jun 2017 07:18:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3CEEC80C2F; Thu, 15 Jun 2017 14:18:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15F3B82AE8; Thu, 15 Jun 2017 14:18:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6CED31841C4F; Thu, 15 Jun 2017 14:18:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5FEI1gs010340 for ; Thu, 15 Jun 2017 10:18:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6EA0380736; Thu, 15 Jun 2017 14:18:01 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-139.ams2.redhat.com [10.36.116.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01B447E4BC; Thu, 15 Jun 2017 14:17:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3CEEC80C2F Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3CEEC80C2F From: sferdjao@redhat.com To: libvir-list@redhat.com Date: Thu, 15 Jun 2017 10:17:14 -0400 Message-Id: <20170615141715.17708-3-sferdjao@redhat.com> In-Reply-To: <20170615141715.17708-1-sferdjao@redhat.com> References: <20170615141715.17708-1-sferdjao@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Sahid Orentino Ferdjaoui , laine@redhat.com Subject: [libvirt] [PATCH 2/3] conf: introduce 'poll_us' attribute for domain interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 15 Jun 2017 14:18:46 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Sahid Orentino Ferdjaoui In this commit we introduce 'poll_us' attribute which will be passed then to the QEMU command line to enable support of busy polling. This commit also take into account that attribute to generate the XML. Signed-off-by: Sahid Orentino Ferdjaoui --- src/conf/domain_conf.c | 16 ++++++++++++++++ src/conf/domain_conf.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0507ec1..803f517 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9748,6 +9748,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, char *event_idx =3D NULL; char *queues =3D NULL; char *rx_queue_size =3D NULL; + char *pollus =3D NULL; char *str =3D NULL; char *filter =3D NULL; char *internal =3D NULL; @@ -9921,6 +9922,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, event_idx =3D virXMLPropString(cur, "event_idx"); queues =3D virXMLPropString(cur, "queues"); rx_queue_size =3D virXMLPropString(cur, "rx_queue_size"); + pollus =3D virXMLPropString(cur, "poll_us"); } else if (xmlStrEqual(cur->name, BAD_CAST "filterref")) { if (filter) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -10318,6 +10320,17 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlo= pt, } def->driver.virtio.rx_queue_size =3D q; } + if (pollus) { + unsigned int us; + if (virStrToLong_uip(pollus, NULL, 10, &us) < 0) { + virReportError(VIR_ERR_XML_DETAIL, + _("'poll_us' attribute must be positive num= ber: %s"), + pollus); + goto error; + } + if (us > 1) + def->driver.virtio.pollus =3D us; + } if ((str =3D virXPathString("string(./driver/host/@csum)", ctxt)))= { if ((val =3D virTristateSwitchTypeFromString(str)) <=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -10515,6 +10528,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, VIR_FREE(event_idx); VIR_FREE(queues); VIR_FREE(rx_queue_size); + VIR_FREE(pollus); VIR_FREE(str); VIR_FREE(filter); VIR_FREE(type); @@ -22308,6 +22322,8 @@ virDomainVirtioNetDriverFormat(char **outstr, if (def->driver.virtio.rx_queue_size) virBufferAsprintf(&buf, " rx_queue_size=3D'%u'", def->driver.virtio.rx_queue_size); + if (def->driver.virtio.pollus) + virBufferAsprintf(&buf, " poll_us=3D'%u'", def->driver.virtio.poll= us); =20 virDomainVirtioOptionsFormat(&buf, def->virtio); =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index e67b6fd..d97d776 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -967,6 +967,7 @@ struct _virDomainNetDef { virTristateSwitch event_idx; unsigned int queues; /* Multiqueue virtio-net */ unsigned int rx_queue_size; + unsigned int pollus; /* busy polling for tap */ struct { virTristateSwitch csum; virTristateSwitch gso; --=20 2.9.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 17:19:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1497536466682456.2814536574923; Thu, 15 Jun 2017 07:21:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33479C04B937; Thu, 15 Jun 2017 14:21:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D726D17AA0; Thu, 15 Jun 2017 14:21:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 874B44A48D; Thu, 15 Jun 2017 14:21:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5FEI3D0010354 for ; Thu, 15 Jun 2017 10:18:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4A08D80739; Thu, 15 Jun 2017 14:18:03 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-139.ams2.redhat.com [10.36.116.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1E717E4BC; Thu, 15 Jun 2017 14:18:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 33479C04B937 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 33479C04B937 From: sferdjao@redhat.com To: libvir-list@redhat.com Date: Thu, 15 Jun 2017 10:17:15 -0400 Message-Id: <20170615141715.17708-4-sferdjao@redhat.com> In-Reply-To: <20170615141715.17708-1-sferdjao@redhat.com> References: <20170615141715.17708-1-sferdjao@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Sahid Orentino Ferdjaoui , laine@redhat.com Subject: [libvirt] [PATCH 3/3] qemu: add busy polling support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 15 Jun 2017 14:21:03 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Sahid Orentino Ferdjaoui This patch finalizes support of 'poll_us' attribute as an option of the NIC driver-specific element, the commit also takes care of hotplug. That option is supported for all networks which are using a tap device. To be used the backend should be specificly set to use vhost. Signed-off-by: Sahid Orentino Ferdjaoui --- docs/formatdomain.html.in | 12 ++++++++++- docs/schemas/domaincommon.rng | 5 +++++ src/qemu/qemu_command.c | 22 ++++++++++++++++++= +++ src/qemu/qemu_hotplug.c | 12 +++++++++++ .../qemuxml2argv-net-virtio-netdev-pollus-fail.xml | 23 ++++++++++++++++++= ++++ ...xml2argv-net-virtio-netdev-pollus-qemu-fail.xml | 23 ++++++++++++++++++= ++++ .../qemuxml2argv-net-virtio-netdev-pollus.args | 23 ++++++++++++++++++= ++++ .../qemuxml2argv-net-virtio-netdev-pollus.xml | 23 ++++++++++++++++++= ++++ tests/qemuxml2argvtest.c | 9 +++++++++ 9 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-p= ollus-fail.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-p= ollus-qemu-fail.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-p= ollus.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-p= ollus.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 52119f0..7bfeabc 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5043,7 +5043,7 @@ qemu-kvm -net nic,model=3D? /dev/null <model type=3D'virtio'/> <driver name=3D'vhost' txmode=3D'iothread' ioeventfd=3D'on' even= t_idx=3D'off' queues=3D'5' rx_queue_size=3D'256'> <host csum=3D'off' gso=3D'off' tso4=3D'off' tso6=3D'off' ecn=3D'o= ff' ufo=3D'off' mrg_rxbuf=3D'off'/> - <guest csum=3D'off' tso4=3D'off' tso6=3D'off' ecn=3D'off' ufo=3D'= off'/> + <guest csum=3D'off' tso4=3D'off' tso6=3D'off' ecn=3D'off' ufo=3D'= off' poll_us=3D'50'/> </driver> </interface> @@ -5171,6 +5171,16 @@ qemu-kvm -net nic,model=3D? /dev/null In general you should leave this option alone, unless you are very certain you know what you are doing. +
+ The optional poll_us attribute configure the + maximum number of microseconds that could be spent on busy + polling. It improves the performance, but requires more + CPU. This option is only available with vhost backend driver. + Since 2.7.0 (QEMU and KVM only)
<= br/> + + In general you should leave this option alone, unless you + are very certain you know what you are doing. +
virtio options
For virtio interfaces, diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4950ddc..f304385 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2687,6 +2687,11 @@ + + + + + diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8c12b2b..412496e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3955,6 +3955,9 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, } if (net->tune.sndbuf_specified) virBufferAsprintf(&buf, "sndbuf=3D%lu,", net->tune.sndbuf); + if (net->driver.virtio.pollus) + virBufferAsprintf(&buf, "poll-us=3D%u,", + net->driver.virtio.pollus); } =20 virObjectUnref(cfg); @@ -8451,6 +8454,25 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr drive= r, return -1; } =20 + if (net->driver.virtio.pollus > 0) { + if (net->driver.virtio.name !=3D VIR_DOMAIN_NET_BACKEND_TYPE_VHOST= ) { + virReportError( + VIR_ERR_CONFIG_UNSUPPORTED, + _("Busy polling is only supported with vhost backend drive= r")); + return -1; + } + /* Nothing besides TAP devices supports busy polling. */ + if (!(actualType =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK || + actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE || + actualType =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT || + actualType =3D=3D VIR_DOMAIN_NET_TYPE_ETHERNET)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Busy polling is not supported for: %s"), + virDomainNetTypeToString(actualType)); + return -1; + } + } + /* and only TAP devices support nwfilter rules */ if (net->filter && !(actualType =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK || diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 0b8d3d8..33884b7 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -995,6 +995,18 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, return -1; } =20 + /* and nothing besides TAP devices supports busy polling. */ + if (net->driver.virtio.pollus > 0 && + !(actualType =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK || + actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE || + actualType =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT || + actualType =3D=3D VIR_DOMAIN_NET_TYPE_ETHERNET)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Busy polling is not supported for: %s"), + virDomainNetTypeToString(actualType)); + return -1; + } + /* and only TAP devices support nwfilter rules */ if (net->filter && !(actualType =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK || diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus-f= ail.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus-fail= .xml new file mode 100644 index 0000000..3b664b9 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus-fail.xml @@ -0,0 +1,23 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus-q= emu-fail.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus= -qemu-fail.xml new file mode 100644 index 0000000..18999c3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus-qemu-fai= l.xml @@ -0,0 +1,23 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus.a= rgs b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus.args new file mode 100644 index 0000000..8d44134 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus.args @@ -0,0 +1,23 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-M pc \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-usb \ +-netdev tap,fd=3D3,id=3Dhostnet0,poll-us=3D50 \ +-device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:23:bc:ba= ,bus=3Dpci.0,\ +addr=3D0x3 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus.x= ml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus.xml new file mode 100644 index 0000000..46ef7d6 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev-pollus.xml @@ -0,0 +1,23 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 799aea9..54d1b07 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1133,6 +1133,15 @@ mymain(void) QEMU_CAPS_NODEFCONFIG); DO_TEST("net-virtio-netdev", QEMU_CAPS_NETDEV, QEMU_CAPS_NODEFCONFIG); + DO_TEST("net-virtio-netdev-pollus", + QEMU_CAPS_NETDEV, + QEMU_CAPS_VHOST_NET_POLL_US); + DO_TEST_FAILURE("net-virtio-netdev-pollus-fail", + QEMU_CAPS_NETDEV, + QEMU_CAPS_VHOST_NET_POLL_US); + DO_TEST_FAILURE("net-virtio-netdev-pollus-qemu-fail", + QEMU_CAPS_NETDEV, + QEMU_CAPS_VHOST_NET_POLL_US); DO_TEST("net-virtio-s390", QEMU_CAPS_VIRTIO_S390); DO_TEST("net-virtio-ccw", --=20 2.9.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list