From nobody Fri May 10 00:43:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646336632; cv=none; d=zohomail.com; s=zohoarc; b=PPpS9sStfKs/I2IwWavnXO9WwISRTqyLsfYjHXYchyW6TuUBR2uSnCUqIAWmWKJPbx+W9AhEnnju7OwKyZIhjaLYmnGP/EtHW9qlT6LAtfR3ZLCpmhP6C2ffccnSP1hKScZl2pmvS6uVkZAyNFn3Vi+0PrrMRshgezVYARLCX6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646336632; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=Re4xz6RgNAtZ56t+EgN7OYzbJEAUBVuz+HnLG9uLljU=; b=C2QnsRzOy0DcY46/8bTEhKeFfJqp6/4VQE0B3FxRDZ6etcLm/DXjfiKxUhixwdH/Jx902mTzVQhf0R7uSKHDtqobYFVqcMD5r0eNxkdr85XHcFGAYJfZ/0Ydntx4mYQTtHB111VWw9eVYnb86gvMO9OudjFH6prC4m+CseOkhSk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1646336632529635.4521760660696; Thu, 3 Mar 2022 11:43:52 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-212-MN4w0KkmPRWm8B_Dem_6qg-1; Thu, 03 Mar 2022 14:43:47 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F04A883DBC4; Thu, 3 Mar 2022 19:43:38 +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 E98481006846; Thu, 3 Mar 2022 19:43:37 +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 0A73444A59; Thu, 3 Mar 2022 19:43:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 223JhXKC022123 for ; Thu, 3 Mar 2022 14:43:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1D22EADDD; Thu, 3 Mar 2022 19:43:33 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.12.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A60385DF2E for ; Thu, 3 Mar 2022 19:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646336631; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Re4xz6RgNAtZ56t+EgN7OYzbJEAUBVuz+HnLG9uLljU=; b=aIHRsDFlq1WlRzzrBs6DWoR64f1GwThknIpmO4E971zQcbGr5+FmxL0AYGfFCkH+qZnCRI qMb5PF1sdjtGfxRGkNrdHYA1FD/ntY7uLyx96kRw2lbRl/XpehyKOqEjUzEOvHpIWngXvZ BjmfGQD6gfTaJ3Lo2ggLCjzcAo9AHiY= X-MC-Unique: MN4w0KkmPRWm8B_Dem_6qg-1 From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v2] qemu: support multiqueue for vdpa net device Date: Thu, 3 Mar 2022 13:43:11 -0600 Message-Id: <20220303194311.1261817-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1646336633525100001 Content-Type: text/plain; charset="utf-8" Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2024406 Signed-off-by: Jonathon Jongsma Reviewed-by: Martin Kletzander --- Changes in v2: - remove error message in virDomainNetDefParseXML(). The model is already checked in the post parse validation step. src/conf/domain_conf.c | 2 ++ src/qemu/qemu_domain.c | 3 +- .../net-vdpa-multiqueue.x86_64-latest.args | 36 +++++++++++++++++++ .../qemuxml2argvdata/net-vdpa-multiqueue.xml | 29 +++++++++++++++ tests/qemuxml2argvtest.c | 1 + .../net-vdpa-multiqueue.xml | 36 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 7 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/net-vdpa-multiqueue.x86_64-lates= t.args create mode 100644 tests/qemuxml2argvdata/net-vdpa-multiqueue.xml create mode 100644 tests/qemuxml2xmloutdata/net-vdpa-multiqueue.xml diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 34fec887a3..9634c9256e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10552,6 +10552,8 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, goto error; } def->data.vdpa.devicepath =3D g_steal_pointer(&dev); + if (!def->model) + def->model =3D VIR_DOMAIN_NET_MODEL_VIRTIO; break; =20 case VIR_DOMAIN_NET_TYPE_BRIDGE: diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index acc76c1cd6..6b61fefb8f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4523,7 +4523,8 @@ qemuDomainValidateActualNetDef(const virDomainNetDef = *net, actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE || actualType =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT || actualType =3D=3D VIR_DOMAIN_NET_TYPE_ETHERNET || - actualType =3D=3D VIR_DOMAIN_NET_TYPE_VHOSTUSER)) { + actualType =3D=3D VIR_DOMAIN_NET_TYPE_VHOSTUSER || + actualType =3D=3D VIR_DOMAIN_NET_TYPE_VDPA)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("interface %s - multiqueue is not supported f= or network interfaces of type %s"), macstr, virDomainNetTypeToString(actualType)); diff --git a/tests/qemuxml2argvdata/net-vdpa-multiqueue.x86_64-latest.args = b/tests/qemuxml2argvdata/net-vdpa-multiqueue.x86_64-latest.args new file mode 100644 index 0000000000..26ef666036 --- /dev/null +++ b/tests/qemuxml2argvdata/net-vdpa-multiqueue.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram \ +-accel tcg \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-add-fd set=3D0,fd=3D1732,opaque=3Dnet0-vdpa \ +-netdev vhost-vdpa,vhostdev=3D/dev/fdset/0,id=3Dhostnet0 \ +-device '{"driver":"virtio-net-pci","mq":true,"vectors":6,"netdev":"hostne= t0","id":"net0","mac":"52:54:00:95:db:c0","bus":"pci.0","addr":"0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/net-vdpa-multiqueue.xml b/tests/qemuxml= 2argvdata/net-vdpa-multiqueue.xml new file mode 100644 index 0000000000..2e38c6f976 --- /dev/null +++ b/tests/qemuxml2argvdata/net-vdpa-multiqueue.xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ce475df466..7e1167e60e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1609,6 +1609,7 @@ mymain(void) DO_TEST_FAILURE("net-hostdev-fail", QEMU_CAPS_DEVICE_VFIO_PCI); DO_TEST_CAPS_LATEST("net-vdpa"); + DO_TEST_CAPS_LATEST("net-vdpa-multiqueue"); =20 DO_TEST("hostdev-pci-multifunction", QEMU_CAPS_KVM, diff --git a/tests/qemuxml2xmloutdata/net-vdpa-multiqueue.xml b/tests/qemux= ml2xmloutdata/net-vdpa-multiqueue.xml new file mode 100644 index 0000000000..0876d5df62 --- /dev/null +++ b/tests/qemuxml2xmloutdata/net-vdpa-multiqueue.xml @@ -0,0 +1,36 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + +
+ + + + + + + +
+ + + +