From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXt3J-0003HQ-GY for qemu-devel@nongnu.org; Mon, 12 Nov 2012 07:23:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXt3G-00039D-ED for qemu-devel@nongnu.org; Mon, 12 Nov 2012 07:23:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXt3G-00038z-6D for qemu-devel@nongnu.org; Mon, 12 Nov 2012 07:23:42 -0500 Date: Mon, 12 Nov 2012 13:23:39 +0100 From: Stefan Hajnoczi Message-ID: <20121112122339.GC32040@stefanha-thinkpad.redhat.com> References: <20121112071918.GA31752@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121112071918.GA31752@redhat.com> Subject: Re: [Qemu-devel] [PATCH] tap: reset vnet header size on open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Anthony Liguori , qemu-devel@nongnu.org, agraf@suse.de On Mon, Nov 12, 2012 at 09:19:18AM +0200, Michael S. Tsirkin wrote: > For tap, we currently assume the vnet header size is 10 > (the default value) but that might not be the case > if tap is persistent and has been used by qemu previously. > To fix, set vnet header size correctly on open. > > Signed-off-by: Michael S. Tsirkin > --- > > This fixes the issue reported by Alexander Graf on the kvm forum. > Alexander, could you confirm please? > Thanks, > > net/tap-linux.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/net/tap-linux.c b/net/tap-linux.c > index c6521be..3eaedc4 100644 > --- a/net/tap-linux.c > +++ b/net/tap-linux.c > @@ -39,6 +39,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required > { > struct ifreq ifr; > int fd, ret; > + int len = sizeof(struct virtio_net_hdr); We probably want the same behavior in the tap,fd= codepath. How about a call to tap_set_vnet_hdr_len() in net_init_tap() instead? Stefan