From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Korb Subject: Minimum Ethernet packet size problems in qemu-kvm Date: Fri, 18 Sep 2009 13:56:23 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: kvm@vger.kernel.org Return-path: Received: from snowcat.de ([91.121.43.217]:41908 "EHLO snowcat.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080AbZIRMqZ (ORCPT ); Fri, 18 Sep 2009 08:46:25 -0400 Received: from akiko.akana.i ([10.0.0.1]) by snowcat.de with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Moc8E-0004Tt-PY for kvm@vger.kernel.org; Fri, 18 Sep 2009 14:00:07 +0200 Received: from [10.0.0.4] (helo=DRAGON) by akiko.akana.i with esmtp (Exim 4.69) (envelope-from ) id 1Moc4f-000351-S8 for kvm@vger.kernel.org; Fri, 18 Sep 2009 13:56:25 +0200 Sender: kvm-owner@vger.kernel.org List-ID: Hi! I noticed a curious little problem with my virtualized DSL router which seems to indicate that qemu-kvm (kvm-88-1081-g561d3ed) will deliver packets to the guest over the emulated network card (tested with rtl8139 and ne2k_pci) which wouldn't appear on real hardware because they are shorter than the minimum packet size on Ethernet (64 bytes including CRC32). My current workaround is to enforce a minimum size of 64 in net.c/tap_send, but I believe this is not the correct solution - the guest now sees every packet as really 64 bytes long even when it shouldn't be. In case anyone cares how this problems manifests on my setup: PPPoE packets have a payload length field that in the case of my ISP always indicates an overall packet size of at least 64 bytes even if the incoming packet is smaller than that. The pppoe code of Linux added checks that drop all packets where the PPPoE-header-indicated length is larger than the packet length in commit 392fdb0e. On real hardware this check would never fail even with my broken ISP because Ethernet cannot transmit packets small enough to fail this check, with qemu-kvm those packets are now dropped. Short system summary, although I suspect it doesn't matter with this problem: - AMD Phenom II 905e - kvm-88-1081-g561d3ed - host kernel 2.6.26-2-amd64 (Debian lenny packaged, amd64 arch) - 32 bit Linux userspace - kvm parameters: -m 128 -k de -nographic -serial mon:stdio -echr 0x14 -hda router.img -net nic,vlan=0 -net nic,vlan=1 -net tap,vlan=0,script=ifup.sh,downscript=ifdown.sh -net tap,vlan=1,script=ifup.sh,downscript=ifdown.sh (both virtual NICs bridged to their own ethernet card on the host) - no changes with "-no-kvm" -ik