qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kazu" <kazoo@r3.dion.ne.jp>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Network Performance between Win Host and Linux Guest
Date: Wed, 8 Mar 2006 13:52:20 +0900	[thread overview]
Message-ID: <000e01c6426c$150fdc60$0464a8c0@athlon> (raw)
In-Reply-To: 440CAD5B.7070109@helmutauer.de

[-- Attachment #1: Type: text/plain, Size: 556 bytes --]

Tuesday, March 07, 2006 6:44 AM Helmut Auer wrote:


> vdr@helmutauer.de 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
>

Attached patch improves the performance against current CVS.

Regards,
Kazu

[-- Attachment #2: qemu-20060307-tap.patch --]
[-- Type: application/octet-stream, Size: 2149 bytes --]

Index: tap-win32.c
===================================================================
RCS file: /sources/qemu/qemu/tap-win32.c,v
retrieving revision 1.2
diff -u -r1.2 tap-win32.c
--- tap-win32.c	19 Feb 2006 12:40:00 -0000	1.2
+++ tap-win32.c	7 Mar 2006 04:18:44 -0000
@@ -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
diff -u -r1.165 vl.c
--- vl.c	20 Feb 2006 00:33:36 -0000	1.165
+++ vl.c	7 Mar 2006 04:18:49 -0000
@@ -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
diff -u -r1.105 vl.h
--- vl.h	20 Feb 2006 00:33:36 -0000	1.105
+++ vl.h	7 Mar 2006 04:18:50 -0000
@@ -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 */
 

  reply	other threads:[~2006-03-08  4:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-09 11:00 [Qemu-devel] Network Performance between Win Host and Linux Guest vdr
2006-03-06 21:44 ` Helmut Auer
2006-03-08  4:52   ` Kazu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-03-15 12:41 Míguel
2005-10-11 10:04 Lars Bakker
2005-08-26 13:57 vdr
2005-08-26 14:31 ` Jonas Maebe
2005-08-29 19:10   ` Filip Navara
2005-08-26 16:21 ` Christian MICHON
2005-08-26 17:18   ` Helmut Auer
2005-08-26 18:25     ` Christian MICHON
2005-08-26 20:20 ` Fabrice Bellard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000e01c6426c$150fdc60$0464a8c0@athlon' \
    --to=kazoo@r3.dion.ne.jp \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).