Skip to contentSkip to conversation

[5688] qemu: generate signals on tap I/O

Qemu-devel Aurelien Jarno 1 participant 1 message Nov 11, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5688

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5688
Author:   aurel32
Date:     2008-11-11 13:30:53 +0000 (Tue, 11 Nov 2008)

Log Message:
-----------
qemu: generate signals on tap I/O

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.

Modified Paths:
--------------
trunk/net.c
trunk/vl.c

Modified: trunk/net.c
===================================================================

net.c +3 -0
@@ -622,6 +622,8 @@
 
 /* fd support */
 
+void enable_sigio_timer(int fd);
+
 static TAPState *net_tap_fd_init(VLANState *vlan, int fd)
 {
     TAPState *s;
@@ -630,6 +632,7 @@
     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);

Modified: trunk/vl.c
===================================================================

vl.c +1 -1
@@ -1403,7 +1403,7 @@
 
 #define RTC_FREQ 1024
 
-static void enable_sigio_timer(int fd)
+void enable_sigio_timer(int fd)
 {
     struct sigaction act;