* How is irq delivered in kvm?
@ 2011-04-21 13:49 Nguyen Thai Ngoc Duy
2011-04-21 14:11 ` Avi Kivity
0 siblings, 1 reply; 4+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2011-04-21 13:49 UTC (permalink / raw)
To: kvm
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.
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?
--
Duy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How is irq delivered in kvm?
2011-04-21 13:49 How is irq delivered in kvm? Nguyen Thai Ngoc Duy
@ 2011-04-21 14:11 ` Avi Kivity
2011-04-21 14:23 ` Nguyen Thai Ngoc Duy
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2011-04-21 14:11 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: kvm
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How is irq delivered in kvm?
2011-04-21 14:11 ` Avi Kivity
@ 2011-04-21 14:23 ` Nguyen Thai Ngoc Duy
2011-04-21 15:01 ` Avi Kivity
0 siblings, 1 reply; 4+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2011-04-21 14:23 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm
On Thu, Apr 21, 2011 at 9:11 PM, Avi Kivity <avi@redhat.com> wrote:
> 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?
Yes. It uses ethernet as transport to "clone" memory from one machine
to another in a short, precalculated amount of time.
> 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.
I'm using qemu-kvm. What function is used to deliver the interrupt
then, kvm_inject_irq?
--
Duy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How is irq delivered in kvm?
2011-04-21 14:23 ` Nguyen Thai Ngoc Duy
@ 2011-04-21 15:01 ` Avi Kivity
0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2011-04-21 15:01 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: kvm
On 04/21/2011 05:23 PM, Nguyen Thai Ngoc Duy wrote:
> On Thu, Apr 21, 2011 at 9:11 PM, Avi Kivity<avi@redhat.com> wrote:
> > 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?
>
> Yes. It uses ethernet as transport to "clone" memory from one machine
> to another in a short, precalculated amount of time.
Well, anything time related will misbehave under virtualization.
> > 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.
>
> I'm using qemu-kvm. What function is used to deliver the interrupt
> then, kvm_inject_irq?
No, kvm_set_irq_level().
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-21 15:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-21 13:49 How is irq delivered in kvm? Nguyen Thai Ngoc Duy
2011-04-21 14:11 ` Avi Kivity
2011-04-21 14:23 ` Nguyen Thai Ngoc Duy
2011-04-21 15:01 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).