[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.4 06/12] etsec: Flush queue when rx buffer
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH for-2.4 06/12] etsec: Flush queue when rx buffer is consumed |
Date: |
Wed, 15 Jul 2015 16:04:36 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, 07/15 15:38, Jason Wang wrote:
>
>
> On 07/15/2015 02:01 PM, Fam Zheng wrote:
> > On Wed, 07/15 13:10, Jason Wang wrote:
> >>>> And can we do this without a bh? Otherwise, we may need to stop and
> >>>> restart the bh during vm stop and start?
> >>> A bh doesn't hurt when vm stop and restart (we get superfluous flush),
> >> The problem is qemu_flush_queued_packets() does not check runstate. So
> >> it may call .receive() which may modify guest state (DMA or registers).
> > You're right, .can_receive will be called incorrectly if the following
> > sequence
> > of events is processed by main loop right after we schedule it:
> >
> > 1) QMP 'stop' command:
> > Runstate is changed to STOP.
> >
> > 2) tap read:
> > A new packet is read in, but since qemu_can_send_packet is false, it
> > will
> > be queued.
> >
> > 3) aio_dispatch:
> > This BH is called too late here, and the queue is flushed, which calls
> > .receive().
> >
> > An ideal fix would be stopping tap with a vmstate handler, but for this
> > patch,
> > does the following work?
>
> Looks good for me. How about axienet then since in your series it also
> uses a bh?
Good point, the same applies, I'll fix that too.
Fam
- [Qemu-devel] [PATCH for-2.4 04/12] usbnet: Drop usbnet_can_receive, (continued)
[Qemu-devel] [PATCH for-2.4 07/12] mcf_fec: Drop mcf_fec_can_receive, Fam Zheng, 2015/07/14
[Qemu-devel] [PATCH for-2.4 09/12] mipsnet: Flush queued packets when receiving is enabled, Fam Zheng, 2015/07/14
[Qemu-devel] [PATCH for-2.4 10/12] stellaris_enet: Flush queued packets when read done, Fam Zheng, 2015/07/14
[Qemu-devel] [PATCH for-2.4 11/12] dp8393x: Flush packets when link comes up, Fam Zheng, 2015/07/14
[Qemu-devel] [PATCH for-2.4 12/12] axienet: Flush queued packets when rx is done, Fam Zheng, 2015/07/14
[Qemu-devel] [PATCH for-2.4 08/12] milkymist-minimac2: Flush queued packets when link comes up, Fam Zheng, 2015/07/14
Re: [Qemu-devel] [PATCH for-2.4 00/12] hw/net: Fix .can_receive() for NICs, Wen Congyang, 2015/07/14