slirp: Read current time only once per if_start call
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 5 Aug 2011 12:04:00 +0000 (14:04 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Fri, 5 Aug 2011 12:04:00 +0000 (14:04 +0200)
No need to update the current time for each packet we send from the
queue. Processing time is comparably short.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
slirp/if.c

index 2d79e45bcde2b5628c74bc6ca6943efecf2f6bcc..47bebe4925d05b510c425a4b26e751b95efc6f79 100644 (file)
@@ -157,9 +157,8 @@ diddit:
 void
 if_start(Slirp *slirp)
 {
+    uint64_t now = qemu_get_clock_ns(rt_clock);
     int requeued = 0;
-    uint64_t now;
-
        struct mbuf *ifm, *ifqt;
 
        DEBUG_CALL("if_start");
@@ -172,8 +171,6 @@ if_start(Slirp *slirp)
         if (!slirp_can_output(slirp->opaque))
             return;
 
-        now = qemu_get_clock_ns(rt_clock);
-
        /*
         * See which queue to get next packet from
         * If there's something in the fastq, select it immediately