From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9FF9C88213 for ; Sat, 15 Oct 2022 16:10:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7D90A18B for ; Sat, 15 Oct 2022 16:10:16 +0200 (CEST) Received: from bastionodiso.odiso.net (bastionodiso.odiso.net [IPv6:2a0a:1580:2000::2d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Sat, 15 Oct 2022 16:10:15 +0200 (CEST) Received: from kvmformation3.odiso.net (formationkvm3.odiso.net [10.3.94.12]) by bastionodiso.odiso.net (Postfix) with ESMTP id 124368108; Sat, 15 Oct 2022 16:10:09 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id F1F78146940; Sat, 15 Oct 2022 16:10:08 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Sat, 15 Oct 2022 16:10:05 +0200 Message-Id: <20221015141005.451633-1-aderumier@odiso.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.231 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% HEADER_FROM_DIFFERENT_DOMAINS 0.25 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods KAM_NUMSUBJECT 0.5 Subject ends in numbers excluding current years NO_DNS_FOR_FROM 0.001 Envelope sender has no MX or A DNS records SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH qemu-server] fix #4296: virtio-net: enable packed queues for qemu 7.1 X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2022 14:10:46 -0000 virtio 1.1 have improve virtio multiqueue performance, with a new implementation called "packed queues". https://www.redhat.com/en/blog/packed-virtqueue-how-reduce-overhead-virtio https://archive.fosdem.org/2018/schedule/event/virtio/attachments/slides/2167/export/events/attachments/virtio/slides/2167/fosdem_virtio1_1.pdf This patch enable it by default for qemu 7.1 This don't break old guests with old virtio 1.0 drivers, as virtio device/devices are forward/backward compatible. Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 4e85dd0..55451de 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1726,7 +1726,7 @@ sub print_pbs_blockdev { } sub print_netdevice_full { - my ($vmid, $conf, $net, $netid, $bridges, $use_old_bios_files, $arch, $machine_type) = @_; + my ($vmid, $conf, $net, $netid, $bridges, $use_old_bios_files, $arch, $machine_type, $machine_version) = @_; my $device = $net->{model}; if ($net->{model} eq 'virtio') { @@ -1740,6 +1740,9 @@ sub print_netdevice_full { # and out of each queue plus one config interrupt and control vector queue my $vectors = $net->{queues} * 2 + 2; $tmpstr .= ",vectors=$vectors,mq=on"; + if (min_version($machine_version, 7, 1)) { + $tmpstr .= ",packed=on"; + } } $tmpstr .= ",bootindex=$net->{bootindex}" if $net->{bootindex} ; @@ -4017,7 +4020,7 @@ sub config_to_command { push @$devices, '-netdev', $netdevfull; my $netdevicefull = print_netdevice_full( - $vmid, $conf, $d, $netname, $bridges, $use_old_bios_files, $arch, $machine_type); + $vmid, $conf, $d, $netname, $bridges, $use_old_bios_files, $arch, $machine_type, $machine_version); push @$devices, '-device', $netdevicefull; } @@ -4248,11 +4251,12 @@ sub vm_deviceplug { return if !qemu_netdevadd($vmid, $conf, $arch, $device, $deviceid); my $machine_type = PVE::QemuServer::Machine::qemu_machine_pxe($vmid, $conf); + my $machine_version = PVE::QemuServer::Machine::extract_version($machine_type); my $use_old_bios_files = undef; ($use_old_bios_files, $machine_type) = qemu_use_old_bios_files($machine_type); my $netdevicefull = print_netdevice_full( - $vmid, $conf, $device, $deviceid, undef, $use_old_bios_files, $arch, $machine_type); + $vmid, $conf, $device, $deviceid, undef, $use_old_bios_files, $arch, $machine_type, $machine_version); qemu_deviceadd($vmid, $netdevicefull); eval { qemu_deviceaddverify($vmid, $deviceid); -- 2.30.2