From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8Dih-0000mr-3W for qemu-devel@nongnu.org; Tue, 28 Jan 2014 13:49:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8Dic-0008EE-C8 for qemu-devel@nongnu.org; Tue, 28 Jan 2014 13:49:11 -0500 Received: from mail-ea0-x22a.google.com ([2a00:1450:4013:c01::22a]:44467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8Dic-0008EA-4o for qemu-devel@nongnu.org; Tue, 28 Jan 2014 13:49:06 -0500 Received: by mail-ea0-f170.google.com with SMTP id k10so429293eaj.29 for ; Tue, 28 Jan 2014 10:49:05 -0800 (PST) Date: Tue, 28 Jan 2014 19:48:35 +0100 From: Beniamino Galvani Message-ID: <20140128184834.GB4660@gmail.com> References: <1390772392-4705-1-git-send-email-b.galvani@gmail.com> <1390772392-4705-2-git-send-email-b.galvani@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v4 1/3] util/fifo8: implement push/pop of multiple bytes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Stefan Hajnoczi , Peter Crosthwaite , QEMU Developers , Li Guang , Andreas =?iso-8859-1?Q?F=E4rber?= On Tue, Jan 28, 2014 at 10:43:28AM +0000, Peter Maydell wrote: > On 28 January 2014 00:04, Peter Crosthwaite > wrote: > > On Tue, Jan 28, 2014 at 4:32 AM, Peter Maydell wrote: > >>> void fifo8_reset(Fifo8 *fifo) > >>> { > >>> fifo->num = 0; > >>> + fifo->head = 0; > >> > >> This is a bug fix, right? It should go in its own patch. > >> > > > > No bug - where the ring buffer starts following a reset is undefined > > and need not be defined. But it improves the predicatability of the > > newly added pop_buf fn as you can now following a reset, guarantee > > that a single pop_buf will take all contents if its the first pop > > (which is how its being used in P2). > > True. I still think it should have its own patch (and > indeed it would be worth saying what you just did as > part of the commit message for that patch...) Ok, I will move the change to a new patch. > I think it's also nicer for any state that gets migrated > to be reset cleanly. Do you mean also the buffer content? In the emac the tx fifo gets reset after each transmission. Isn't this too costly? Beniamino