Received: from [140.186.70.92] (port=41267 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OxcRw-0005eX-3B for qemu-devel@nongnu.org; Mon, 20 Sep 2010 05:14:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OxcRl-0006m7-CL for qemu-devel@nongnu.org; Mon, 20 Sep 2010 05:14:12 -0400 Received: from mtagate5.uk.ibm.com ([194.196.100.165]:46627) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OxcRl-0006lN-4G for qemu-devel@nongnu.org; Mon, 20 Sep 2010 05:14:01 -0400 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate5.uk.ibm.com (8.13.1/8.13.1) with ESMTP id o8K9Dwdh015316 for ; Mon, 20 Sep 2010 09:13:58 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o8K9DqqS2846902 for ; Mon, 20 Sep 2010 10:13:58 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o8K9Dp5Y002122 for ; Mon, 20 Sep 2010 10:13:52 +0100 Date: Mon, 20 Sep 2010 10:13:50 +0100 From: Stefan Hajnoczi Subject: Re: [Qemu-devel] [PATCH] e1000: Pad short frames to minimum size (60 bytes) Message-ID: <20100920091350.GB2376@stefan-thinkpad.transitives.com> References: <1284842625-13920-1-git-send-email-stefanha@linux.vnet.ibm.com> <4C9527D1.4030707@reactos.org> <4C971E77.1000708@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <4C971E77.1000708@redhat.com> Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Stefan Hajnoczi , 638955@bugs.launchpad.net, =?iso-8859-1?Q?Herv=E9?= Poussineau , qemu-devel@nongnu.org, "Michael S. Tsirkin" On Mon, Sep 20, 2010 at 10:42:31AM +0200, Kevin Wolf wrote: > Am 18.09.2010 23:12, schrieb Stefan Hajnoczi: > > On Sat, Sep 18, 2010 at 9:57 PM, Herv=E9 Poussineau wrote: > >> Another patch creating ARP replies at least 64 bytes long has been > >> committed: > >> http://git.savannah.gnu.org/cgit/qemu.git/commit/?id=3Ddbf3c4b4baceb= 91eb64d09f787cbe92d65188813 > >> > >> Does it fix your issue? > >=20 > > No I don't think so. This is an e1000 issue, it will happen if you > > use tap networking too. The commit you linked to only affects slirp > > and pads its ARP code. > >=20 > > I think there are two places where the minimum frame length can be en= forced: > > 1. The NIC emulation code. This is currently how rtl8139, pcnet, and > > ne2000 do it. My patch adds the same for e1000. > > 2. The net layer. If we're emulating Ethernet then it would be > > possible to pad to minimum frame length in common networking code > > (net.c). >=20 > 3. The sender. I think it should be the sender's decision which packet > he sends and there's no reason to manipulate it on its way to the guest. > If the sender sends too short packets, this is where the bug is. >=20 > Actually, instead of padding the packet we should already drop it in th= e > device model if RCTL.SBP =3D 0. Does a real Solaris work when it receiv= es > the same packet? >=20 > On the other hand, it seems that we're missing the padding where it > actually belongs: when sending packets with TCTL.PSP =3D 1. Did you sen= d > the ARP packet from another qemu instance? If so, this might be the rea= l > reason. No, I brought up the tap interface on the host and tried to ping the guest directly. This caused the host to send an ARP request over the tap interface. It was not padded. Perhaps Linux expects the NIC to deal with padding transmit frames but tap does not do this. That's just my theory though from the experience that real NICs often do pad to minimum size. Does anyone know the definitive answer? Stefan