From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: kvm <kvm@vger.kernel.org>, netdev <netdev@vger.kernel.org>,
virtualization <virtualization@lists.linux-foundation.org>,
Yongji Xie <xieyongji@bytedance.com>,
"Dawar, Gautam" <gautam.dawar@amd.com>,
"Zhu, Lingshan" <lingshan.zhu@intel.com>
Subject: Re: [PATCH 2/2] vDPA: conditionally read fields in virtio-net dev
Date: Thu, 18 Aug 2022 23:52:42 -0400 [thread overview]
Message-ID: <20220818235137-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CACGkMEumKfktMUJOTUYL_JYkFbw8qH331gGARPB2bTH=7wKWPg@mail.gmail.com>
On Fri, Aug 19, 2022 at 08:42:32AM +0800, Jason Wang wrote:
> On Fri, Aug 19, 2022 at 7:20 AM Si-Wei Liu <si-wei.liu@oracle.com> wrote:
> >
> >
> >
> > On 8/17/2022 9:15 PM, Jason Wang wrote:
> > >
> > > 在 2022/8/17 18:37, Michael S. Tsirkin 写道:
> > >> On Wed, Aug 17, 2022 at 05:43:22PM +0800, Zhu, Lingshan wrote:
> > >>>
> > >>> On 8/17/2022 5:39 PM, Michael S. Tsirkin wrote:
> > >>>> On Wed, Aug 17, 2022 at 05:13:59PM +0800, Zhu, Lingshan wrote:
> > >>>>> On 8/17/2022 4:55 PM, Michael S. Tsirkin wrote:
> > >>>>>> On Wed, Aug 17, 2022 at 10:14:26AM +0800, Zhu, Lingshan wrote:
> > >>>>>>> Yes it is a little messy, and we can not check _F_VERSION_1
> > >>>>>>> because of
> > >>>>>>> transitional devices, so maybe this is the best we can do for now
> > >>>>>> I think vhost generally needs an API to declare config space
> > >>>>>> endian-ness
> > >>>>>> to kernel. vdpa can reuse that too then.
> > >>>>> Yes, I remember you have mentioned some IOCTL to set the endian-ness,
> > >>>>> for vDPA, I think only the vendor driver knows the endian,
> > >>>>> so we may need a new function vdpa_ops->get_endian().
> > >>>>> In the last thread, we say maybe it's better to add a comment for
> > >>>>> now.
> > >>>>> But if you think we should add a vdpa_ops->get_endian(), I can work
> > >>>>> on it for sure!
> > >>>>>
> > >>>>> Thanks
> > >>>>> Zhu Lingshan
> > >>>> I think QEMU has to set endian-ness. No one else knows.
> > >>> Yes, for SW based vhost it is true. But for HW vDPA, only
> > >>> the device & driver knows the endian, I think we can not
> > >>> "set" a hardware's endian.
> > >> QEMU knows the guest endian-ness and it knows that
> > >> device is accessed through the legacy interface.
> > >> It can accordingly send endian-ness to the kernel and
> > >> kernel can propagate it to the driver.
> > >
> > >
> > > I wonder if we can simply force LE and then Qemu can do the endian
> > > conversion?
> > convert from LE for config space fields only, or QEMU has to forcefully
> > mediate and covert endianness for all device memory access including
> > even the datapath (fields in descriptor and avail/used rings)?
>
> Former. Actually, I want to force modern devices for vDPA when
> developing the vDPA framework. But then we see requirements for
> transitional or even legacy (e.g the Ali ENI parent). So it
> complicates things a lot.
>
> I think several ideas has been proposed:
>
> 1) Your proposal of having a vDPA specific way for
> modern/transitional/legacy awareness. This seems very clean since each
> transport should have the ability to do that but it still requires
> some kind of mediation for the case e.g running BE legacy guest on LE
> host.
>
> 2) Michael suggests using VHOST_SET_VRING_ENDIAN where it means we
> need a new config ops for vDPA bus, but it doesn't solve the issue for
> config space (at least from its name). We probably need a new ioctl
> for both vring and config space.
>
> or
Yea, like VHOST_SET_CONFIG_ENDIAN.
> 3) revisit the idea of forcing modern only device which may simplify
> things a lot
Problem is vhost needs VHOST_SET_CONFIG_ENDIAN too. it's not
a vdpa specific issue.
> which way should we go?
>
> > I hope
> > it's not the latter, otherwise it loses the point to use vDPA for
> > datapath acceleration.
> >
> > Even if its the former, it's a little weird for vendor device to
> > implement a LE config space with BE ring layout, although still possible...
>
> Right.
>
> Thanks
>
> >
> > -Siwei
> > >
> > > Thanks
> > >
> > >
> > >>
> > >>> So if you think we should add a vdpa_ops->get_endian(),
> > >>> I will drop these comments in the next version of
> > >>> series, and work on a new patch for get_endian().
> > >>>
> > >>> Thanks,
> > >>> Zhu Lingshan
> > >> Guests don't get endian-ness from devices so this seems pointless.
> > >>
> > >
> >
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2022-08-19 3:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220815092638.504528-1-lingshan.zhu@intel.com>
[not found] ` <20220815092638.504528-2-lingshan.zhu@intel.com>
2022-08-15 18:15 ` [PATCH 1/2] vDPA: allow userspace to query features of a vDPA device Si-Wei Liu
[not found] ` <cea494d0-d446-274f-f913-723822a53e6a@intel.com>
2022-08-16 2:07 ` Parav Pandit via Virtualization
[not found] ` <20220815092638.504528-3-lingshan.zhu@intel.com>
2022-08-15 15:52 ` [PATCH 2/2] vDPA: conditionally read fields in virtio-net dev Michael S. Tsirkin
2022-08-15 23:32 ` Si-Wei Liu
[not found] ` <20e92551-a639-ec13-3d9c-13bb215422e1@intel.com>
2022-08-16 7:58 ` Si-Wei Liu
2022-08-16 8:08 ` Si-Wei Liu
[not found] ` <22e0236f-b556-c6a8-0043-b39b02928fd6@intel.com>
2022-08-16 23:14 ` Si-Wei Liu
[not found] ` <52a47bc7-bf26-b8f9-257f-7dc5cea66d23@intel.com>
2022-08-17 8:55 ` Michael S. Tsirkin
[not found] ` <a91fa479-d1cc-a2d6-0821-93386069a2c1@intel.com>
2022-08-17 9:39 ` Michael S. Tsirkin
[not found] ` <449c2fb2-3920-7bf9-8c5c-a68456dfea76@intel.com>
2022-08-17 10:37 ` Michael S. Tsirkin
2022-08-18 4:15 ` Jason Wang
2022-08-18 23:20 ` Si-Wei Liu
2022-08-19 0:42 ` Jason Wang
2022-08-19 3:52 ` Michael S. Tsirkin [this message]
2022-08-20 8:55 ` Si-Wei Liu
[not found] ` <e06d1f6d-3199-1b75-d369-2e5d69040271@intel.com>
2022-08-23 3:26 ` Jason Wang
2022-08-26 6:23 ` Si-Wei Liu
2022-09-02 6:03 ` Jason Wang
2022-09-02 6:14 ` Michael S. Tsirkin
2022-09-05 3:54 ` Jason Wang
2022-08-17 18:50 ` Si-Wei Liu
2022-08-16 2:32 ` Parav Pandit via Virtualization
[not found] ` <4184a943-f1c0-a57b-6411-bdd21e0bc710@intel.com>
2022-08-16 21:02 ` Parav Pandit via Virtualization
2022-08-16 21:09 ` Michael S. Tsirkin
[not found] ` <352e9533-8ab1-cec0-0141-ce0735ee39f5@intel.com>
2022-08-18 4:18 ` Jason Wang
2022-08-18 17:20 ` Parav Pandit via Virtualization
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=20220818235137-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=gautam.dawar@amd.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lingshan.zhu@intel.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=xieyongji@bytedance.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).