qemu-e2k/net
Mark McLoughlin be1636b3ab tap: disable draining queue in one go
If qemu_send_packet_async() returns zero, it means the packet has been
queued and the sent callback will be invoked once it has been flushed.

This is only possible where the NIC's receive() handler returns zero
and promises to notify the networking core that room is available in its
queue again.

In the case where the receive handler does not have this capability
(and its queue fills up) it returns -1 and the networking core does not
queue up the packet. This condition is indicated by a -1 return from
qemu_send_packet_async().

Currently, tap handles this condition simply by dropping the packet. It
should do its best to avoid getting into this situation by checking such
NIC's have room for a packet before copying the packet from the tap
interface.

tap_send() used to achieve this by only reading a single packet before
returning to the mainloop. That way, tap_can_send() is called before
reading each packet.

tap_send() was changed to completely drain the tap interface queue
without taking into account the situation where the NIC returns an
error and the packet is not queued. Let's start fixing this by
reverting to the previous behaviour of reading one packet at a time.

Reported-by: Scott Tsai <scottt.tw@gmail.com>
Tested-by: Sven Rudolph <Sven_Rudolph@drewag.de>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:02 -06:00
..
checksum.c net: move net-checksum.c under net/ 2009-10-30 08:39:26 -05:00
checksum.h net: move net-checksum.c under net/ 2009-10-30 08:39:26 -05:00
queue.c
queue.h
tap-aix.c net: move UFO support detection to tap-linux.c 2009-10-30 08:39:29 -05:00
tap-bsd.c Unbreak tap compilation on OS X 2009-10-30 16:38:15 -05:00
tap-linux.c net: move UFO support detection to tap-linux.c 2009-10-30 08:39:29 -05:00
tap-linux.h Unbreak Linux build 2009-10-30 16:45:20 -05:00
tap-solaris.c net: move UFO support detection to tap-linux.c 2009-10-30 08:39:29 -05:00
tap-win32.c net: move more stuff into net/tap-win32.c, add net/tap.h 2009-10-30 08:39:27 -05:00
tap.c tap: disable draining queue in one go 2009-11-09 08:43:02 -06:00
tap.h net: move UFO support detection to tap-linux.c 2009-10-30 08:39:29 -05:00