Received: from eggs.gnu.org ([2001:4830:134:3::10]:50954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO3TL-0005G4-KY for qemu-devel@nongnu.org; Tue, 26 Jan 2016 08:15:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO3TH-00065N-GT for qemu-devel@nongnu.org; Tue, 26 Jan 2016 08:15:51 -0500 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:50128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO3TH-00064U-7H for qemu-devel@nongnu.org; Tue, 26 Jan 2016 08:15:47 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Jan 2016 13:15:42 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 544F81B08070 for ; Tue, 26 Jan 2016 13:15:46 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0QDFdSK63373404 for ; Tue, 26 Jan 2016 13:15:39 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0QDFdXc032536 for ; Tue, 26 Jan 2016 08:15:39 -0500 Date: Tue, 26 Jan 2016 14:15:35 +0100 From: Greg Kurz Message-ID: <20160126141535.63e29ba5@bahia.huguette.org> In-Reply-To: <56A75021.9050001@redhat.com> References: <1452713185-23517-1-git-send-email-lvivier@redhat.com> <56A099E4.4090001@redhat.com> <56A1CFC6.1080707@redhat.com> <56A75021.9050001@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] net: set endianness on all backend devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Jason Wang , qemu-devel@nongnu.org, mst@redhat.com On Tue, 26 Jan 2016 11:53:21 +0100 Laurent Vivier wrote: > On 22/01/2016 07:44, Jason Wang wrote: > > > > > > On 01/21/2016 04:42 PM, Laurent Vivier wrote: > >> ping > >> > >> [added Jason in cc:] > >> > >> On 13/01/2016 20:26, Laurent Vivier wrote: > >>> commit 5be7d9f1b1452613b95c6ba70b8d7ad3d0797991 > >>> vhost-net: tell tap backend about the vnet endianness > >>> > >>> makes vhost net to set the endianness of the device, but only for > >>> the first device. > >>> > >>> In case of multiqueue, we have multiple devices... This patch sets the > >>> endianness for all the devices of the interface. > >>> > >>> Signed-off-by: Laurent Vivier > >>> --- > >>> hw/net/vhost_net.c | 23 +++++++++++------------ > >>> 1 file changed, 11 insertions(+), 12 deletions(-) > >>> > >>> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c > >>> index 318c3e6..10e233a 100644 > >>> --- a/hw/net/vhost_net.c > >>> +++ b/hw/net/vhost_net.c > >>> @@ -300,21 +300,19 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, > >>> BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(dev))); > >>> VirtioBusState *vbus = VIRTIO_BUS(qbus); > >>> VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus); > >>> - int r, e, i; > >>> + int r, e, i, j; > >>> > >>> if (!k->set_guest_notifiers) { > >>> error_report("binding does not support guest notifiers"); > >>> - r = -ENOSYS; > >>> - goto err; > >>> + return -ENOSYS; > >>> } > >>> > >>> - r = vhost_net_set_vnet_endian(dev, ncs[0].peer, true); > >>> - if (r < 0) { > >>> - goto err; > >>> - } > >>> - > >>> - for (i = 0; i < total_queues; i++) { > >>> - vhost_net_set_vq_index(get_vhost_net(ncs[i].peer), i * 2); > >>> + for (j = 0; j < total_queues; j++) { > >>> + r = vhost_net_set_vnet_endian(dev, ncs[j].peer, true); > >>> + if (r < 0) { > >>> + goto err_endian; > >>> + } > >>> + vhost_net_set_vq_index(get_vhost_net(ncs[j].peer), j * 2); > >>> } > >>> > >>> r = k->set_guest_notifiers(qbus->parent, total_queues * 2, true); > >>> @@ -343,8 +341,9 @@ err_start: > >>> fflush(stderr); > >>> } > >>> err_endian: > >>> - vhost_net_set_vnet_endian(dev, ncs[0].peer, false); > >>> -err: > >>> + while (--j >= 0) { > >>> + vhost_net_set_vnet_endian(dev, ncs[j].peer, false); > >>> + } > >>> return r; > >>> } > >>> > > > > Reviewed-by: Jason Wang > > Thanks Jason. > > Who can pick this in his tree ? > According to MAINTAINERS, this must go through Michael's tree, but it looks like he is very busy reworking memory barriers in the kernel... > Laurent > -- Greg