From patchwork Thu Sep 2 15:01:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 149451 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o82F1F6S006353 for ; Thu, 2 Sep 2010 15:01:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754422Ab0IBPBN (ORCPT ); Thu, 2 Sep 2010 11:01:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61890 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754629Ab0IBPBM (ORCPT ); Thu, 2 Sep 2010 11:01:12 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o82F15ss026485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Sep 2010 11:01:06 -0400 Received: from s20.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o82F1466023828; Thu, 2 Sep 2010 11:01:04 -0400 From: Alex Williamson Subject: [PATCH v2 3/4] virtio-net: Rename tx_timer_active to tx_waiting To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, alex.williamson@redhat.com, anthony@codemonkey.ws, mst@redhat.com, chrisw@redhat.com, quintela@redhat.com, jes.sorensen@redhat.com Date: Thu, 02 Sep 2010 09:01:04 -0600 Message-ID: <20100902150104.11862.74188.stgit@s20.home> In-Reply-To: <20100902150041.11862.65901.stgit@s20.home> References: <20100902150041.11862.65901.stgit@s20.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 02 Sep 2010 15:01:16 +0000 (UTC) different backends to send the packet. Signed-off-by: Alex Williamson --- hw/virtio-net.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 55f3d94..1a4ba21 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -38,7 +38,7 @@ typedef struct VirtIONet QEMUTimer *tx_timer; uint32_t tx_timeout; int32_t tx_burst; - int tx_timer_active; + int tx_waiting; uint32_t has_vnet_hdr; uint8_t has_ufo; struct { @@ -704,15 +704,15 @@ static void virtio_net_handle_tx(VirtIODevice *vdev, VirtQueue *vq) { VirtIONet *n = to_virtio_net(vdev); - if (n->tx_timer_active) { + if (n->tx_waiting) { virtio_queue_set_notification(vq, 1); qemu_del_timer(n->tx_timer); - n->tx_timer_active = 0; + n->tx_waiting = 0; virtio_net_flush_tx(n, vq); } else { qemu_mod_timer(n->tx_timer, qemu_get_clock(vm_clock) + n->tx_timeout); - n->tx_timer_active = 1; + n->tx_waiting = 1; virtio_queue_set_notification(vq, 0); } } @@ -721,7 +721,7 @@ static void virtio_net_tx_timer(void *opaque) { VirtIONet *n = opaque; - n->tx_timer_active = 0; + n->tx_waiting = 0; /* Just in case the driver is not ready on more */ if (!(n->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK)) @@ -744,7 +744,7 @@ static void virtio_net_save(QEMUFile *f, void *opaque) virtio_save(&n->vdev, f); qemu_put_buffer(f, n->mac, ETH_ALEN); - qemu_put_be32(f, n->tx_timer_active); + qemu_put_be32(f, n->tx_waiting); qemu_put_be32(f, n->mergeable_rx_bufs); qemu_put_be16(f, n->status); qemu_put_byte(f, n->promisc); @@ -773,7 +773,7 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) virtio_load(&n->vdev, f); qemu_get_buffer(f, n->mac, ETH_ALEN); - n->tx_timer_active = qemu_get_be32(f); + n->tx_waiting = qemu_get_be32(f); n->mergeable_rx_bufs = qemu_get_be32(f); if (version_id >= 3) @@ -849,7 +849,7 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) } n->mac_table.first_multi = i; - if (n->tx_timer_active) { + if (n->tx_waiting) { qemu_mod_timer(n->tx_timer, qemu_get_clock(vm_clock) + n->tx_timeout); } @@ -940,7 +940,7 @@ VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf, qemu_format_nic_info_str(&n->nic->nc, conf->macaddr.a); n->tx_timer = qemu_new_timer(vm_clock, virtio_net_tx_timer, n); - n->tx_timer_active = 0; + n->tx_waiting = 0; n->tx_timeout = net->txtimer; n->tx_burst = net->txburst; n->mergeable_rx_bufs = 0;