aboutsummaryrefslogtreecommitdiff
path: root/slirp/if.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-08-05 14:04:00 +0200
committerJan Kiszka <jan.kiszka@siemens.com>2011-08-05 14:04:00 +0200
commitfd5938799d115c966f9b2d41bbb4d5bcb5284b97 (patch)
tree722624eae5c5c40b73ddcd260e6aeb272f97820b /slirp/if.c
parent5a371a2e52facac1f79ab2cb1cf75ed661ab11b0 (diff)
downloadqemu-fd5938799d115c966f9b2d41bbb4d5bcb5284b97.zip
qemu-fd5938799d115c966f9b2d41bbb4d5bcb5284b97.tar.gz
qemu-fd5938799d115c966f9b2d41bbb4d5bcb5284b97.tar.bz2
slirp: Read current time only once per if_start call
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>
Diffstat (limited to 'slirp/if.c')
-rw-r--r--slirp/if.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/slirp/if.c b/slirp/if.c
index 2d79e45..47bebe4 100644
--- a/slirp/if.c
+++ b/slirp/if.c
@@ -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