From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0EL5-0007q5-GG for qemu-devel@nongnu.org; Fri, 19 Jul 2013 13:19:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0EL2-0000F3-0x for qemu-devel@nongnu.org; Fri, 19 Jul 2013 13:19:31 -0400 Date: Fri, 19 Jul 2013 12:19:13 -0500 From: Scott Wood In-Reply-To: <51E90566.2020708@adacore.com> (from chouteau@adacore.com on Fri Jul 19 04:22:46 2013) Message-ID: <1374254353.5357.17@snotra> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] Add Enhanced Three-Speed Ethernet Controller (eTSEC) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 07/19/2013 04:22:46 AM, Fabien Chouteau wrote: > On 07/18/2013 10:37 PM, Scott Wood wrote: > > On 07/18/2013 04:27:50 AM, Fabien Chouteau wrote: > >> The BD is full, we will have to put the rest of padding in the =20 > next one. > > > > What rest of padding? I thought you said rx_padding was 2 =20 > somehow? If that were true, then it would be zero at the end. > > >=20 > Read my description again. OK, I was confused by your answering "yes" to "wouldn't *size be 2 =20 here" -- I thought it was clear from the context that I was talking =20 about at the time of the "if (*size =3D=3D etsec->rx_padding)" statement. = =20 Maybe you thought I was talking about what would happen at that =20 if-statement in the next descriptor? In any case, it's a bit hard to follow this code. rx_fcb_size is =20 included in to_write, but not in *size. rx_padding is included in =20 *size, but not in to_write. And it generally makes me nervous to see =20 code that will go into an infinite loop (or other odd behavior) unless =20 an exact-equality terminating condition is met, especially when it's as =20 complicated as this, without an assertion to check for the bad case =20 (even if it looks like it could never happen). -Scott=