From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5srP-0008I9-7i for qemu-devel@nongnu.org; Fri, 19 Jun 2015 05:45:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5srL-0007EL-SB for qemu-devel@nongnu.org; Fri, 19 Jun 2015 05:45:19 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:57948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5srL-0007DT-Jy for qemu-devel@nongnu.org; Fri, 19 Jun 2015 05:45:15 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Jun 2015 10:45:14 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id D7E882190023 for ; Fri, 19 Jun 2015 10:44:49 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t5J9jBs218546772 for ; Fri, 19 Jun 2015 09:45:11 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t5J9jBRf020120 for ; Fri, 19 Jun 2015 03:45:11 -0600 Date: Fri, 19 Jun 2015 11:45:06 +0200 From: Greg Kurz Message-ID: <20150619114506.06896c28@bahia.local> In-Reply-To: <20150619111635.1a37f6e2@thh440s> References: <20150617132323.6560.29432.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <20150617132349.6560.80324.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <20150619111635.1a37f6e2@thh440s> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/6] vhost-net: tell tap backend about the vnet endianness List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: Cornelia Huck , Jason Wang , qemu-devel@nongnu.org, Stefan Hajnoczi , "Michael S. Tsirkin" On Fri, 19 Jun 2015 11:16:35 +0200 Thomas Huth wrote: > > Hi, > > On Wed, 17 Jun 2015 15:23:49 +0200 > Greg Kurz wrote: > > > The default behaviour for TAP/MACVTAP is to consider vnet as native endian. > > > > This patch handles the cases when this is not true: > > - virtio 1.0: always little-endian > > - legacy cross-endian > > > > Signed-off-by: Greg Kurz > > --- > > hw/net/vhost_net.c | 33 ++++++++++++++++++++++++++++++++- > > 1 file changed, 32 insertions(+), 1 deletion(-) > > > > diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c > > index 1c55517e3611..8cbb2f618c1c 100644 > > --- a/hw/net/vhost_net.c > > +++ b/hw/net/vhost_net.c > ... > > @@ -365,6 +394,8 @@ void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, > > fflush(stderr); > > } > > assert(r >= 0); > > + > > + assert(vhost_net_set_vnet_endian(dev, ncs[0].peer, false) >= 0); > > } > > Putting the vhost_net_set_vnet_endian() within the assert statement > looks somewhat wrong to me. assert() gets defined to nothing in case > NDEBUG is defined, so the call would then simply be dropped. > I guess you rather want something like this here: > > r = vhost_net_set_vnet_endian(dev, ncs[0].peer, false); > assert(r >= 0); > > ? > > Thomas > Oops you're right... I'll send a fix. -- Greg