qemu: generate signals on tap I/O
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 11 Nov 2008 13:30:53 +0000 (13:30 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 11 Nov 2008 13:30:53 +0000 (13:30 +0000)
Currently tap does not generate signals on I/O; this causes
network latency to be dependent on the timer tick (1ms without
dyntick, guest dependent with dyntick).  By generating a signal
on I/O, we can inform the guest immediately that a packet has
arrived.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5688 c046a42c-6fe2-441c-8c8c-71466251a162

net.c
vl.c

diff --git a/net.c b/net.c
index 35aeb1e..bb9ea6e 100644 (file)
--- a/net.c
+++ b/net.c
@@ -622,6 +622,8 @@ static void tap_send(void *opaque)
 
 /* fd support */
 
+void enable_sigio_timer(int fd);
+
 static TAPState *net_tap_fd_init(VLANState *vlan, int fd)
 {
     TAPState *s;
@@ -630,6 +632,7 @@ static TAPState *net_tap_fd_init(VLANState *vlan, int fd)
     if (!s)
         return NULL;
     s->fd = fd;
+    enable_sigio_timer(fd);
     s->vc = qemu_new_vlan_client(vlan, tap_receive, NULL, s);
     qemu_set_fd_handler(s->fd, tap_send, NULL, s);
     snprintf(s->vc->info_str, sizeof(s->vc->info_str), "tap: fd=%d", fd);
diff --git a/vl.c b/vl.c
index 7bcffd3..24c9c32 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1403,7 +1403,7 @@ static int fcntl_setfl(int fd, int flag)
 
 #define RTC_FREQ 1024
 
-static void enable_sigio_timer(int fd)
+void enable_sigio_timer(int fd)
 {
     struct sigaction act;