Skip to contentSkip to conversation

Network Performance between Win Host and Linux Guest

Qemu-devel [email protected] 2 participants 3 messages Feb 9, 2006 – Mar 8, 2006

lore
Share & tools
lore
#0 lore raw

Hello,
I just upgraded to qemu 0.8.0 including vlan/tap patch and I noticed that the network speed is much slower than under 0.7.2 with tap patch ( 300KB/s vs 1MB/s ). Any hints what I can do to sped this up ?
Helmut

#1 lore raw
Quoted 5 lines · [email protected] schrieb:

Hello,
I just upgraded to qemu 0.8.0 including vlan/tap patch and I noticed that the network speed is much slower than under 0.7.2 with tap patch ( 300KB/s vs 1MB/s ). Any hints what I can do to sped this up ?
Helmut

No ideas what can cause this ? I just checked it again with the tapped win binaries from the dion page. Net performance is about 15 times faster under 0.7.2

Signature · 1 line
Helmut Auer, [email protected] 
#2 lore raw
Quoted 3 lines · Helmut Auer
Quoted 2 lines · [email protected] schrieb:

Hello,
I just upgraded to qemu 0.8.0 including vlan/tap patch and I noticed that

the network speed is much slower than under 0.7.2 with tap patch ( 300KB/s vs 1MB/s ).

Quoted 7 lines
Quoted 3 lines

Any hints what I can do to sped this up ?
Helmut

No ideas what can cause this ? I just checked it again with the tapped win binaries from the dion page. Net performance is about 15 times faster under 0.7.2

Attached patch improves the performance against current CVS.

Regards,
Kazu

Index: tap-win32.c
===================================================================
RCS file: /sources/qemu/qemu/tap-win32.c,v
retrieving revision 1.2

tap-win32.c +3 -2
diff -u -r1.2 tap-win32.c
@@ -642,7 +642,7 @@
 }
 
 /* XXX: horrible, suppress this by using proper thread signaling */
-void tap_win32_poll(void)
+int tap_win32_poll(void)
 {
     TAPState *s = tap_win32_state;
     uint8_t *buf;
@@ -650,13 +650,14 @@
     int size;
 
     if (!s)
-        return;
+        return -1;
 
     size = tap_win32_read(s->handle, &buf, max_size);
     if (size > 0) {
         qemu_send_packet(s->vc, buf, size);
         tap_win32_free_buffer(s->handle, buf);
     }
+    return size;
 }
 
 int tap_win32_init(VLANState *vlan, const char *ifname)

Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.165

vl.c +5 -5
diff -u -r1.165 vl.c
@@ -3960,8 +3960,11 @@
 #ifdef _WIN32
     /* XXX: see how to merge it with the select. The constraint is
        that the select must be interrupted by the timer */
-    if (timeout > 0)
-        Sleep(timeout);
+    ret = tap_win32_poll();
+    if (ret <= 0) {
+        if (timeout > 0)
+            Sleep(timeout);
+    }
 #endif
     /* poll any events */
     /* XXX: separate device handlers from system ones */
@@ -4002,9 +4005,6 @@
             }
         }
     }
-#ifdef _WIN32
-    tap_win32_poll();
-#endif
 
 #if defined(CONFIG_SLIRP)
     /* XXX: merge with the previous select() */

Index: vl.h
===================================================================
RCS file: /sources/qemu/qemu/vl.h,v
retrieving revision 1.105

vl.h +1 -1
diff -u -r1.105 vl.h
@@ -307,7 +307,7 @@
 
 /* TAP win32 */
 int tap_win32_init(VLANState *vlan, const char *ifname);
-void tap_win32_poll(void);
+int tap_win32_poll(void);
 
 /* NIC info */