From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: [PATCH 01/12] kvm: qemu: Fix virtio_net tx timer Date: Mon, 11 Aug 2008 21:12:04 +0100 Message-ID: <1218485535-877-2-git-send-email-markmc@redhat.com> References: <1218485535-877-1-git-send-email-markmc@redhat.com> Cc: kvm@vger.kernel.org, Mark McLoughlin To: Avi Kivity Return-path: Received: from mail05.svc.cra.dublin.eircom.net ([159.134.118.21]:47011 "HELO mail05.svc.cra.dublin.eircom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757535AbYHKUMd (ORCPT ); Mon, 11 Aug 2008 16:12:33 -0400 In-Reply-To: <1218485535-877-1-git-send-email-markmc@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: The current virtio_net tx timer is 2ns, which doesn't make any sense. Set it to a more reasonable 250us instead. However, even though we were requesting a 2ns tx timer, it was actually getting limited to MIN_TIMER_REARM_US which is currently 250us. So, even though the timer itself would only fire after 250us, expire_time was only set to +2ns, so we'd get the timeout callback next time qemu_run_timers() was called from the mainloop. This probably accounted for a lot of the jitter in the throughput numbers - the effective tx timer length was anywhere between 2ns and 250us depending on e.g. whether there was rx data available on the tap fd. Signed-off-by: Mark McLoughlin --- qemu/hw/virtio-net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index 2e57e5a..3a39c8f 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/virtio-net.c @@ -26,7 +26,7 @@ #define VIRTIO_NET_F_MAC 5 #define VIRTIO_NET_F_GS0 6 -#define TX_TIMER_INTERVAL (1000 / 500) +#define TX_TIMER_INTERVAL 250000 /* 250 us */ /* The config defining mac address (6 bytes) */ struct virtio_net_config -- 1.5.4.1