From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: QEMU PIC indirection patch for in-kernel APIC work Date: Mon, 09 Apr 2007 10:10:20 +0300 Message-ID: <4619E6DC.3010804@qumranet.com> References: <4613B438.60107@codemonkey.ws> <4613B89F.8090806@qumranet.com> <4613BC6B.1070708@codemonkey.ws> <4613BF07.50606@qumranet.com> <4613C993.9020405@codemonkey.ws> <4613CC01.1090500@qumranet.com> <4613CDB2.4000903@codemonkey.ws> <4613D001.3040606@qumranet.com> <20070404200112.GA6070@elte.hu> <4614098F.2030307@us.ibm.com> <20070404212103.GA19026@elte.hu> <1175728768.12230.593.camel@localhost.localdomain> <4614A294.3000607@qumranet.com> <1175821357.12230.642.camel@localhost.localdomain> <46187F4E.1080807@qumranet.com> <1176087018.11664.65.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, netdev To: Rusty Russell Return-path: In-reply-to: <1176087018.11664.65.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: netdev.vger.kernel.org Rusty Russell wrote: > On Sun, 2007-04-08 at 08:36 +0300, Avi Kivity wrote: > >> Rusty Russell wrote: >> >>> Hi Avi, >>> >>> I don't think you've thought about this very hard. The receive copy is >>> completely independent with whether the packet is going to the guest via >>> a kernel driver or via userspace, so not relevant. >>> >>> >> A packet received in the kernel cannot be made available to userspace in >> a safe manner without a copy, as it will not be aligned with page >> boundaries, so userspace cannot examine the packet until after one copy >> has occured. >> > > Hi Avi! > > I'm a little puzzled by your response. Hmm... > > lguest's userspace network frontend does exactly as many copies as > Ingo's in-host-kernel code. One from the Guest, one to the Guest. > > kvm pvnet is suboptimal now. The number of copies could be reduced by two (to zero), by constructing an skb that points to guest memory. Right now, this can only be done in-kernel. With current userspace networking interfaces, one cannot build a network device that has less than one copy on transmit, because sendmsg() *must* copy the data (as there is no completion notification). sendfilev(), even if it existed, cannot be used: it is copyless, but lacks completion notification. It is useful only on unchanging data like read-only files. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV