From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRiWI-0007Pq-Hx for qemu-devel@nongnu.org; Fri, 05 Feb 2016 10:42:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRiWF-0005T3-BJ for qemu-devel@nongnu.org; Fri, 05 Feb 2016 10:42:02 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:46224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRiWF-0005S6-18 for qemu-devel@nongnu.org; Fri, 05 Feb 2016 10:41:59 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 5 Feb 2016 15:41:57 -0000 Date: Fri, 5 Feb 2016 16:41:49 +0100 From: Greg Kurz Message-ID: <20160205164149.10f5d6d0@bahia.huguette.org> In-Reply-To: <20160205123344.5daf7a47.cornelia.huck@de.ibm.com> References: <20160205103927.21017.26364.stgit@bahia.huguette.org> <20160205103937.21017.4795.stgit@bahia.huguette.org> <20160205123344.5daf7a47.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 1/6] virtio-net: use the backend cross-endian capabilities List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: Laurent Vivier , qemu-devel@nongnu.org, "Michael S. Tsirkin" On Fri, 5 Feb 2016 12:33:44 +0100 Cornelia Huck wrote: > On Fri, 05 Feb 2016 11:43:11 +0100 > Greg Kurz wrote: > > > +static bool virtio_net_set_vnet_endian(VirtIODevice *vdev, NetClientState *ncs, > > + int queues, bool enable) > > You might consider adding a comment like "returns whether endianness > handling needs to fall back to the device" or so, as it's not > immediately obvious what true/false is supposed to mean. But the patch > is fine. > I agree it is not that obvious. If Michael agrees, I'll send a followup patch when these series has been applied. Thanks. -- Greg > > +{ > > + int i; > > + > > + for (i = 0; i < queues; i++) { > > + if (virtio_net_set_vnet_endian_one(vdev, ncs[i].peer, enable) < 0 && > > + enable) { > > + while (--i >= 0) { > > + virtio_net_set_vnet_endian_one(vdev, ncs[i].peer, false); > > + } > > + > > + return true; > > + } > > + } > > + > > + return false; > > +}