From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38402 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORi2k-0004lw-1g for qemu-devel@nongnu.org; Thu, 24 Jun 2010 04:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORi2b-000440-KR for qemu-devel@nongnu.org; Thu, 24 Jun 2010 04:44:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11589) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORi2b-00043w-CJ for qemu-devel@nongnu.org; Thu, 24 Jun 2010 04:44:09 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5O8i8rD021316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 24 Jun 2010 04:44:08 -0400 Date: Thu, 24 Jun 2010 11:39:14 +0300 From: "Michael S. Tsirkin" Message-ID: <20100624083914.GC937@redhat.com> References: <20100623095118.GA9796@redhat.com> <20100624084213.GQ27193@amit-laptop.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100624084213.GQ27193@amit-laptop.redhat.com> Subject: [Qemu-devel] Re: [PATCH] virtio-net: correct header length math List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: alex.williamson@redhat.com, qemu-devel@nongnu.org, Juan Quintela On Thu, Jun 24, 2010 at 02:12:13PM +0530, Amit Shah wrote: > On (Wed) Jun 23 2010 [12:51:18], Michael S. Tsirkin wrote: > > We were requesting too much when checking buffer > > length: size already includes host header length. > > > > Signed-off-by: Michael S. Tsirkin > > --- > > hw/virtio-net.c | 20 +++++++++++--------- > > 1 files changed, 11 insertions(+), 9 deletions(-) > > Couple of minor comments. But I'll still provide the > > ACK > > > @@ -556,9 +557,10 @@ static ssize_t virtio_net_receive(VLANClientState *nc, const uint8_t *buf, size_ > > virtqueue_pop(n->rx_vq, &elem) == 0) { > > if (i == 0) > > return -1; > > - fprintf(stderr, "virtio-net truncating packet: " > > - "offset %zd, size %zd, hdr_len %zd\n", > > - offset, size, hdr_len); > > + fprintf(stderr, "virtio-net truncating packet: i %d mergeable %d " > > + "offset %zd, size %zd, guest hdr %zd, host hdr %zd\n", > > + i, n->mergeable_rx_bufs, > > + offset, size, guest_hdr_len, host_hdr_len); > > Again, tab usage and 'guest hdr len' and 'host hdr len' make better > sense than 'guest hdr' and 'host hdr' > > > exit(1); > > Can we drop the packet(s) instead of exiting? > > Amit This is a guest bug in the same way as moving indexes incorrectly. But since we do have such buggy guests in the field (old virtio), I guess we should. -- MST