qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.4] e1000: flush packets when link comes up


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH for-2.4] e1000: flush packets when link comes up
Date: Thu, 25 Jun 2015 18:55:25 +0800
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, 06/25 10:18, Stefan Hajnoczi wrote:
> e1000_can_receive() checks the link up status register bit.  If the bit
> is clear, packets will be queued and the peer may disable receive to
> avoid wasting CPU reading packets that cannot be delivered.  The queue
> must be flushed once the link comes back up again.
> 
> This patch fixes broken e1000 receive with Mac OS X Snow Leopard guests
> and tap networking.  Flushing the queue invokes the async send callback,
> which re-enables tap fd read.
> 
> Reported-by: Jonathan Liu <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>

Reviewed-by: Fam Zheng <address@hidden>

> ---
>  hw/net/e1000.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/net/e1000.c b/hw/net/e1000.c
> index bab8e2a..5c6bcd0 100644
> --- a/hw/net/e1000.c
> +++ b/hw/net/e1000.c
> @@ -185,6 +185,9 @@ e1000_link_up(E1000State *s)
>  {
>      s->mac_reg[STATUS] |= E1000_STATUS_LU;
>      s->phy_reg[PHY_STATUS] |= MII_SR_LINK_STATUS;
> +
> +    /* E1000_STATUS_LU is tested by e1000_can_receive() */
> +    qemu_flush_queued_packets(qemu_get_queue(s->nic));
>  }
>  
>  static bool
> -- 
> 2.4.3
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]