From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: How is irq delivered in kvm? Date: Thu, 21 Apr 2011 17:11:58 +0300 Message-ID: <4DB03B2E.1040607@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Nguyen Thai Ngoc Duy Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52167 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915Ab1DUOMD (ORCPT ); Thu, 21 Apr 2011 10:12:03 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 04/21/2011 04:49 PM, Nguyen Thai Ngoc Duy wrote: > Hi, > > I have a specialized e1000 device driver that expects to receive a > single frame per interrupt, no more. It's by design and very hard to > change (and it does not serve IP traffic). -net socket or tap can > sometimes deliver more than one frame in a row and blow up the driver > in turn. I'd like to experiment with tap/socket to only call > qemu_send_packet..() once and leave pending frames in queue until next > time, with hope that guest will have time to process the frame. I don't understand how the driver can expect that. The card is free to deliver multiple packets per interrupt. Are you counting on fast timing to process the packet before the next packet arrives? If you restrict the number of buffers you provide to the card to exactly one, you'll get one packet per interrupts (and dropped packets). > The problem is I'm new to kvm and not sure how the main loop is run. > Will there be guest execution time between two tap/socket polls, how > long is it? Or is guest run in parallel with the event loop and > qemu_set_irq() somehow signals guest immediately? The latter, it's in parallel. Are you using qemu-kvm or qemu? qemu-kvm will deliver better interrupt performance. -- error compiling committee.c: too many arguments to function