[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] net/hub: remove can_receive handler
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] net/hub: remove can_receive handler |
Date: |
Tue, 23 Apr 2013 14:00:21 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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