On Tue, Apr 23, 2013 at 11:41:42AM +0400, Fedorov Sergey wrote:
> >Beyond that, we also want to avoid growing net queues indefinitely.  If
> >the hub does not implement .can_receive() then it relies on growing
> >queues (keeping packets buffered in memory).
> No, net_hub_receive() calls qemu_send_packet(). If the destination
> queue cannot receive the packet qemu_net_queue_append() will take
> care of queue->nq_maxlen.

You are right, sorry.  We do discard packets at nq_maxlen.

The problem with ignoring .can_receive() on the hub is that it breaks
flow control.  For example, net/tap.c is designed to avoid reading more
packets if its peer cannot receive (see tap_can_send()).

If the hub claims it can always receive we waste cycles reading packets
from the tap device only to discard them.

Since qemu.git already has a fix which preserves flow control, I am not
going to merge your patch.

Stefan

Reply via email to