From: Jason Wang <jasowang@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com, gkurz@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH] net: set endianness on all backend devices
Date: Fri, 22 Jan 2016 14:44:22 +0800 [thread overview]
Message-ID: <56A1CFC6.1080707@redhat.com> (raw)
In-Reply-To: <56A099E4.4090001@redhat.com>
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 <lvivier@redhat.com>
>> ---
>> 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 <jasowang@redhat.com>
next prev parent reply other threads:[~2016-01-22 6:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 19:26 [Qemu-devel] [PATCH] net: set endianness on all backend devices Laurent Vivier
2016-01-14 8:01 ` Greg Kurz
2016-01-14 10:06 ` Cornelia Huck
2016-01-21 8:42 ` Laurent Vivier
2016-01-22 6:44 ` Jason Wang [this message]
2016-01-26 10:53 ` Laurent Vivier
2016-01-26 13:15 ` Greg Kurz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56A1CFC6.1080707@redhat.com \
--to=jasowang@redhat.com \
--cc=gkurz@linux.vnet.ibm.com \
--cc=lvivier@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).