qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] fix qemu_flush_queued_packets() in presence of


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] fix qemu_flush_queued_packets() in presence of a hub
Date: Tue, 29 Jan 2013 14:08:27 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jan 22, 2013 at 07:54:20AM +0100, Luigi Rizzo wrote:
> when frontend and backend are connected through a hub as below
> (showing only one direction), and the frontend (or in general, all
> output ports of the hub) cannot accept more traffic, the backend
> queues packets in queue-A.
> 
> When the frontend (or in general, one output port) becomes ready again,
> quemu tries to flush packets from queue-B, which is unfortunately empty.
> 
>    e1000.0 <--[queue B]-- hub0port0(hub)hub0port1 <--[queue A]-- tap.0
> 
> To fix this i propose to introduce a new function net_hub_flush()
> which is called when trying to flush a queue connected to a hub.
> 
>       cheers
>       luigi
> 
> Signed-off-by: Luigi Rizzo <address@hidden>
>  net/hub.c |   13 +++++++++++++
>  net/hub.h |    1 +
>  net/net.c |    6 ++++++

Please run scripts/checkpatch.pl:

 * 4 space indentation instead of tabs.
 * Always use {} even for a 1-statement if body.

It's cleaner to add a bool (*flush)(NetClientState *nc) function to
NetClientInfo but given that net.c already knows about hub.c
specifically we don't gain much by trying to decouple this callback.  If
you want to leave it hardcoded that's fine by me.

Stefan



reply via email to

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