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: Fedorov Sergey
Subject: Re: [Qemu-devel] [PATCH] net/hub: remove can_receive handler
Date: Tue, 23 Apr 2013 11:27:25 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 04/22/2013 08:09 PM, Paolo Bonzini wrote:
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

The user documentation says that `-net dump' dumps network traffic on VLAN. There is nothing said about interfaces connected to VALN nor synchronization with them. In my view, VLAN hub is a device that forwards an incoming packet to all other ports as soon as possible, just like real hardware hub. I think of `-net dump' as a special network interface that dumps every packet received by VLAN hub itself, not delivered to its clients. If we want to dump packets actually delivered to network interfaces we need to do it in per-interface manner. Maybe I misunderstand?

--
Best regards,
Sergey Fedorov, Junior Software Engineer,
Samsung R&D Institute Rus.
E-mail: address@hidden




reply via email to

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