From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: performance of virtual functions compared to virtio Date: Thu, 21 Apr 2011 16:09:51 +0300 Message-ID: <4DB02C9F.2050901@redhat.com> References: <4DAF8EF0.8010203@gmail.com> <1303353349.3110.181.camel@x201> <4DAFE5BE.1070506@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alex Williamson , David Ahern , KVM mailing list To: Stefan Hajnoczi Return-path: Received: from mx1.redhat.com ([209.132.183.28]:63680 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945Ab1DUNJ4 (ORCPT ); Thu, 21 Apr 2011 09:09:56 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 04/21/2011 03:31 PM, Stefan Hajnoczi wrote: > On Thu, Apr 21, 2011 at 9:07 AM, Avi Kivity wrote: > > Note I think in both cases we can make significant improvements: > > - for VFs, steer device interrupts to the cpus which run the vcpus that will > > receive the interrupts eventually (ISTR some work about this, but not sure) > > - for virtio, use a DMA engine to copy data (I think there exists code in > > upstream which does this, but has this been enabled/tuned?) > > Which data copy in virtio? Is this a vhost-net specific thing you're > thinking about? There are several copies. qemu's virtio-net implementation incurs a copy on tx and on rx when calling the kernel; in addition there is also an internal copy: /* copy in packet. ugh */ len = iov_from_buf(sg, elem.in_num, buf + offset, size - offset); In principle vhost-net can avoid the tx copy, but I think now we have 1 copy on rx and tx each. If a host interface is dedicated to backing a vhost-net interface (say if you have an SR/IOV card) then you can in principle avoid the rx copy as well. An alternative to avoiding the copies is to use a dma engine, like I mentioned. -- error compiling committee.c: too many arguments to function