From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: Re: Virtio network performance on Debian Date: Tue, 17 Apr 2012 12:33:50 +0400 Message-ID: <4F8D2AEE.6010308@msgid.tls.msk.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Hans-Kristian Bakke Return-path: Received: from isrv.corpit.ru ([86.62.121.231]:52467 "EHLO isrv.corpit.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755313Ab2DQIdw (ORCPT ); Tue, 17 Apr 2012 04:33:52 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 12.04.2012 11:42, Hans-Kristian Bakke wrote: > Hi > > For some reason I am not able to get good network performance using > virtio/vhost-net on Debian KVM host (perhaps also valid for Ubuntu > hosts then). The issue has been identified, after Hans-Kristian gave me access to his machine and I did alot of testing. And as usual, the root cause was very stupid... ;) In last release of debian qemu-kvm package I changed the way how debian package version string propagates to build procedure -- before it was a patch grabbing values from debian/version, but in last release I used --with-pkgversion configure flag. This resulted in the following change: - QEMU emulator version 1.0 (qemu-kvm-1.0 Debian 1.0+dfsg-8), Copyright (c) 2003-2008 Fabrice Bellard + QEMU emulator version 1.0 (Debian qemu-kvm 1.0+dfsg-9), Copyright (c) 2003-2008 Fabrice Bellard As it turns out, libvirt parses `qemu -version' output and looks for " (qemu-kvm-" string in there, and if it is found, libvirt enables some "extra" features. Important for us was setting IFF_VNET_HDR flag for a tap device, -- apparently this flag makes a HUGE difference in networking speed, especially when using vhost_net. Obviously this is a change unique to debian, and I never thought about such an.. "interesting" effect it may give us. This is a libvirt bug actually, since support of vnet_hdr can be determined by other means, and since upstream qemu now has almost everything from qemu-kvm, and it wants to be fast too. But since qemu[-kvm] has a long history of changing features, it is difficult to blame libvirt that much... Oh well. Thanks! /mjt