From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37586 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmTA3-0007BA-Aq for qemu-devel@nongnu.org; Mon, 07 Feb 2011 10:37:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmT9e-0007kB-3N for qemu-devel@nongnu.org; Mon, 07 Feb 2011 10:37:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmT9d-0007jn-SV for qemu-devel@nongnu.org; Mon, 07 Feb 2011 10:37:30 -0500 From: Alex Williamson In-Reply-To: <20110207123026.GA18830@redhat.com> References: <20110207123026.GA18830@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 07 Feb 2011 08:37:15 -0700 Message-ID: <1297093035.3518.5.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] e1000: clear EOP for multi-buffer descriptors List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, Jes.Sorensen@redhat.com, Juan Quintela , agraf@suse.de, stefanha@linux.vnet.ibm.com On Mon, 2011-02-07 at 14:30 +0200, Michael S. Tsirkin wrote: > The e1000 spec says: if software statically allocates > buffers, and uses memory read to check for completed descriptors, it > simply has to zero the status byte in the descriptor to make it ready > for reuse by hardware. This is not a hardware requirement (moving the > hardware tail pointer is), but is necessary for performing an in=E2=80=93= memory > scan. >=20 > Thus the guest does not have to clear the status byte. In case it > doesn't we need to clear EOP for all descriptors > except the last. While I don't know of any such guests, > it's probably a good idea to stick to the spec. >=20 > Signed-off-by: Michael S. Tsirkin > Reported-by: Juan Quintela >=20 > --- > hw/e1000.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) >=20 > diff --git a/hw/e1000.c b/hw/e1000.c > index 3427ff3..7853c12 100644 > --- a/hw/e1000.c > +++ b/hw/e1000.c > @@ -694,6 +694,9 @@ e1000_receive(VLANClientState *nc, const uint8_t *b= uf, size_t size) > desc.length =3D cpu_to_le16(desc_size + fcs_len(s)); > desc.status |=3D E1000_RXD_STAT_EOP | E1000_RXD_STAT_I= XSM; > } else { > + /* Guest zeroing out status is not a hardware requirem= ent. > + Clear EOP in case guest didn't do it. */ > + desc.status &=3D ~E1000_RXD_STAT_EOP; > desc.length =3D cpu_to_le16(desc_size); > } > } else { // as per intel docs; skip descriptors with null buf = addr Acked-by: Alex Williamson