qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Shkolnyy <kshk@linux.ibm.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: eperezma@redhat.com, sgarzare@redhat.com, mjrosato@linux.ibm.com,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] vdpa: Allow vDPA to work on big-endian machine
Date: Thu, 20 Feb 2025 21:40:01 -0600	[thread overview]
Message-ID: <c47e1834-c6b2-49e6-8e22-f1e1ebf02522@linux.ibm.com> (raw)
In-Reply-To: <20250220105323-mutt-send-email-mst@kernel.org>

On 2/20/2025 09:57, Michael S. Tsirkin wrote:
> On Tue, Feb 11, 2025 at 10:19:23AM -0600, Konstantin Shkolnyy wrote:
>> Add .set_vnet_le() function that always returns success, assuming that
>> vDPA h/w always implements LE data format. Otherwise, QEMU disables vDPA and
>> outputs the message:
>> "backend does not support LE vnet headers; falling back on userspace virtio"
>>
>> Signed-off-by: Konstantin Shkolnyy <kshk@linux.ibm.com>
> 
> Thanks for the patch! Yet something to improve:
> 
> 
>> ---
>>   net/vhost-vdpa.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
>> index 231b45246c..7219aa2eee 100644
>> --- a/net/vhost-vdpa.c
>> +++ b/net/vhost-vdpa.c
>> @@ -270,6 +270,11 @@ static bool vhost_vdpa_has_ufo(NetClientState *nc)
>>   
>>   }
>>   
>> +static int vhost_vdpa_set_vnet_le(NetClientState *nc, bool is_le)
>> +{
>> +    return 0;
> 
> How about checking is_le is true then?

As I understand, the control comes here from 
virtio_net_set_vnet_endian(...., bool enable). That "enable" is copied 
into the "is_le" here. Thus, it doesn't look like "is_le = false" means 
BE. Rather, it looks like it means "default endianness of the 
NetClient". If so, the function should probably just return 0 in both cases.

I think, that is also why we have .set_vnet_le() and .set_vnet_be() 
instead of just one function.

If the above is correct, maybe I should rename "is_le" into "enable"? (I 
simply copied the name from another function...)

> And add a code comment with an explanation, please.

Sure.



  reply	other threads:[~2025-02-21  3:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 16:19 [PATCH] vdpa: Allow vDPA to work on big-endian machine Konstantin Shkolnyy
2025-02-12 13:38 ` Eugenio Perez Martin
2025-02-12 14:47   ` Konstantin Shkolnyy
2025-02-12 14:52 ` Philippe Mathieu-Daudé
2025-02-12 17:24   ` Konstantin Shkolnyy
2025-02-12 18:07     ` Philippe Mathieu-Daudé
2025-02-12 20:01       ` Konstantin Shkolnyy
2025-02-18 13:27         ` Konstantin Shkolnyy
2025-02-18 14:02           ` Philippe Mathieu-Daudé
2025-02-19  0:29             ` Jason Wang
2025-02-20 15:57 ` Michael S. Tsirkin
2025-02-21  3:40   ` Konstantin Shkolnyy [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-06-14 22:44 [PATCH] vdpa: Allow VDPA " Konstantin Shkolnyy
2025-06-16  2:49 ` Jason Wang
2025-06-16  6:19 ` Eugenio Perez Martin
2025-06-16  8:56 ` Akihiko Odaki

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=c47e1834-c6b2-49e6-8e22-f1e1ebf02522@linux.ibm.com \
    --to=kshk@linux.ibm.com \
    --cc=eperezma@redhat.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    /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).