qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] net/hub: remove can_receive handler


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] net/hub: remove can_receive handler
Date: Mon, 22 Apr 2013 18:09:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

Il 22/04/2013 17:27, Fedorov Sergey ha scritto:
> 
> E.g. network hub has 3 ports. Suppose when iterating through port list
> in net_hub_port_can_receive() a packet is successfully delivered to the
> first port, and then is queued in the source port queue because the
> second port cannot receive packets. Later net_hub_flush() will flush the
> packet from the source port queue and it will be delivered in every
> port. But it had been already delivered to one of them. So it will be
> delivered twice to some ports. Moreover there is less chance to dequeue
> the packet if several clients can't receive periodically.

Perhaps it is indeed wrong to do this blocking in can_receive()...
You're right that a hubport can always receive, but the hub itself
should have a queue.  If one port cannot receive, the packet should be
appended to the hub's queue.  And net_hub_flush will just go through the
hub's queue.

> Anyway, actually there is no need in net_hub_port_can_receive() as the
> network hub can always receive  packets and pass it to its port network
> clients with qemu_send_packet(). I think it's more natural solution.

I think the point was to keep dumps in sync with what actually happened
on the other ports.  Otherwise a "-net dump" port will show the packet
immediately, even though it hasn't been delivered yet.

Paolo



reply via email to

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