Received: from eggs.gnu.org ([208.118.235.92]:57356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tx7Tl-0006P7-5J for qemu-devel@nongnu.org; Sun, 20 Jan 2013 21:51:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tx7Tj-0000p0-UY for qemu-devel@nongnu.org; Sun, 20 Jan 2013 21:51:20 -0500 Received: from onelab2.iet.unipi.it ([131.114.59.238]:60379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tx7Tj-0000ov-NY for qemu-devel@nongnu.org; Sun, 20 Jan 2013 21:51:19 -0500 Date: Mon, 21 Jan 2013 03:50:50 +0100 From: Luigi Rizzo Message-ID: <20130121025050.GA20214@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] wrong argument to qemu_flush_queued_packets() in network frontends ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org While running qemu 1.3.0 with the following network-related flags: -net nic -net tap,ifname=tap0,script='' I encountered the same problem (should be common to several frontends, e.g. e100, eepro100, virtio-net, xen_nic): in net/tap.c :: tap_send(), if qemu_send_packet_async() returns 0 (e.g. because the NIC has no buffers available) traffic stops, despite the fact that the frontend will try to pull queued packets when the receive ring is updated. Upon investigation, it turns out that the backend code does size = qemu_send_packet_async(&s->nc, buf, size, tap_send_completed); if (size == 0) { tap_read_poll(s, 0); and the arguments are s->nc.name = "tap.0" s->nc.peer->name = "hub0port1" s->nc.send_queue = 0x7f40b2f61e20 s->nc.peer->send_queue = 0x7f40b2f63690 <--- enqueued here whereis the frontend is trying to pull from a different queue qemu_flush_queued_packets(&s->nic->nc); with arguments s->nic->nc.name = "e1000.0" s->nic->nc.peer->name = "hub0port0" <--- try to flush this s->nic->nc.send_queue = 0x7f40b3008ae0 s->nic->nc.peer->send_queue = 0x7f40b2f63660 Note, regular traffic flows correctly across the hub, but qemu_flush_queued_packets() seems to try and pull from the wrong place. Any idea how to fix this (other than the inefficient solution of leaving read_poll=1 in the frontend) cheers luigi