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 17:14:54 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5


On 04/23/2013 04:00 PM, Stefan Hajnoczi wrote:
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

OK, I see. Thanks for attention.

--
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]