From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDqpC-0005tL-Mf for qemu-devel@nongnu.org; Thu, 13 Feb 2014 02:35:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDqp6-0000hh-3r for qemu-devel@nongnu.org; Thu, 13 Feb 2014 02:35:10 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:44877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDqp5-0000gc-V4 for qemu-devel@nongnu.org; Thu, 13 Feb 2014 02:35:04 -0500 Received: by mail-pd0-f177.google.com with SMTP id x10so10123713pdj.36 for ; Wed, 12 Feb 2014 23:35:02 -0800 (PST) Received: from aik.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPSA id nz11sm7958797pab.6.2014.02.12.23.34.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 23:35:01 -0800 (PST) Message-ID: <52FC75A0.5020902@ozlabs.ru> Date: Thu, 13 Feb 2014 18:34:56 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] tap networking - how? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Hi! I am debugging spapr-vlan and hit the following issue. When I run QEMU as below, the kernel's DHCP client does not continue till I hit any key in console. If I replace spapr-vlan with e1000/rtl8139/virtio-net, everything is just fine. If I use "user" network - everything is fine too. So the problem is with combination of spapr-vlan + tap. The issue looks like - the guest kernel boots and then prints: Sending DHCP requests .. and it keeps printing dots till I press key or timeout expires. tcpdump (running on the tap interface) shows one DHCP request and one DHCP response. What normally happens is that QEMU calls os_host_main_loop_wait() which calls qemu_poll_ns() and it is sitting there till eventfd signals. This eventfd is registered via qemu_init_main_loop() -> aio_context_new() -> aio_set_event_notifier() but I cannot find where it gets passed to the kernel (otherwise why would we need eventfd?). When eventfd signals, QEMU calls qemu_iohandler_poll() which checks if TAP device has something to read and eventually calls tap_send(). However in my bad example QEMU does not exit qemu_poll_ns() on eventfd, only on stdin event. I can see AIO eventfd created and event_notifier_test_and_clear() is called on it before the kernel starts using spapr-vlan. So. h_send_logical_lan() is called to sent a DHCP request packet. Now I expect eventfd to signal but this does not happen. Have I missed some reset or notification request or "bottom half" (virtio-net uses them but e1000/rtl8139 do not)? Please, help. Thanks! ./qemu-system-ppc64 \ -enable-kvm \ -m 2048 \ -L qemu-ppc64-bios/ \ -machine pseries \ -trace events=qemu_trace_events \ -nographic \ -vga none \ -netdev tap,id=id0,ifname=tap-id0,script=ifup.sh,downscript=ifdown.sh \ -device spapr-vlan,id=id1,netdev=id0,mac=C0:41:49:4b:00:00 \ -kernel vml313 \ -append "root=/dev/nfs ip=dhcp selinux=0 nfsroot=10.61.145.11:/scratch/alexey/fc19nfs_/" -- Alexey