OSDN Git Service

tap: drain queue in tap_send()
authorMark McLoughlin <markmc@redhat.com>
Tue, 27 Oct 2009 18:16:39 +0000 (18:16 +0000)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 9 Nov 2009 14:43:02 +0000 (08:43 -0600)
commit5819c91806911e0976a187cf908b429ecb138da5
treeb93a5c2cf4ebc2140f033dd08661fdf9b64ac2b6
parentcdd5cc12ba8cf0c068da319370bdd3ba45eaf7ac
tap: drain queue in tap_send()

Okay, let's try re-enabling the drain-entire-queue behaviour, with a
difference - before each subsequent packet, use qemu_can_send_packet()
to check that we can send it. This is similar to how we check before
polling the tap fd and avoids having to drop a packet if the receiver
cannot handle it.

This patch should be a performance improvement since we no longer have
to go through the mainloop for each packet.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net/tap.c