From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxFkX-0005Dj-Ik for qemu-devel@nongnu.org; Fri, 13 Nov 2015 09:54:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxFkS-0004bi-JO for qemu-devel@nongnu.org; Fri, 13 Nov 2015 09:54:49 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:44776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxFkS-0004bT-An for qemu-devel@nongnu.org; Fri, 13 Nov 2015 09:54:44 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Nov 2015 14:54:42 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 35C4A17D8056 for ; Fri, 13 Nov 2015 14:55:00 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tADEseRr59703312 for ; Fri, 13 Nov 2015 14:54:40 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tADEseEg009930 for ; Fri, 13 Nov 2015 07:54:40 -0700 Date: Fri, 13 Nov 2015 15:54:37 +0100 From: Greg Kurz Message-ID: <20151113155437.5ff8d0ff@bahia.local> In-Reply-To: <20151113154606.11429148.cornelia.huck@de.ibm.com> References: <20151109172840.3075.48900.stgit@bahia.huguette.org> <20151109174021.3075.94401.stgit@bahia.huguette.org> <20151112185255.1bd6197b.cornelia.huck@de.ibm.com> <20151113092626.4ef6a434@bahia.local> <20151113154606.11429148.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 v2 1/2] virtio-net: use the backend cross-endian capabilities List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" On Fri, 13 Nov 2015 15:46:06 +0100 Cornelia Huck wrote: > On Fri, 13 Nov 2015 09:26:26 +0100 > Greg Kurz wrote: > > > On Thu, 12 Nov 2015 18:52:55 +0100 > > Cornelia Huck wrote: > > > > > On Mon, 09 Nov 2015 18:41:33 +0100 > > > Greg Kurz wrote: > > > > > +static bool virtio_net_needs_hdr_swap(VirtIONet *n) > > > > +{ > > > > + /* virtio_needs_swap() is constant for fixed endian targets: call it > > > > + * first to filter them out without penalty. > > > > > > What do you mean with 'constant' here? It still needs to retrieve the > > > feature bit from the device, no? > > > > > > > Yes the comment is inaccurate... With the "virtio: cross-endian helpers fixes" > > series, virtio_needs_swap() indeed resolves to { return 0; } for fixed little > > endian targets but we still need to check the feature bit when the target is big > > endian. > > > > If I drop the call to virtio_needs_swap(), all targets will have the same > > penalty. If I keep it, fixed little endian targets have no penalty but fixed > > big endian targets get an extra check and bi-endian targets get two extra checks... > > > > Not sure what to decide... > > The impact probably isn't too large, but improving one configuration > via penalizing others feels wrong. > > Just check the bool value to make the decision? Sounds fair. I'll drop the call to virtio_needs_swap() then. Thanks. -- Greg