From: Jason Wang <jasowang@redhat.com>
To: Parav Pandit <parav@nvidia.com>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>
Cc: Eli Cohen <elic@nvidia.com>, "mst@redhat.com" <mst@redhat.com>
Subject: Re: [PATCH linux-next v2 04/14] vdpa: Introduce query of device config layout
Date: Wed, 7 Apr 2021 15:12:06 +0800 [thread overview]
Message-ID: <fdc137cf-ad6a-5eec-01cf-52c0165b6229@redhat.com> (raw)
In-Reply-To: <BY5PR12MB432289ECA113D8DCD4EA1582DC759@BY5PR12MB4322.namprd12.prod.outlook.com>
在 2021/4/7 下午1:10, Parav Pandit 写道:
>
>> From: Jason Wang <jasowang@redhat.com>
>> Sent: Wednesday, April 7, 2021 9:26 AM
> [..]
>>> /**
>>> * struct vdpa_config_ops - operations for configuring a vDPA device.
>>> * Note: vDPA device drivers are required to implement all of the @@
>>> -164,6 +200,10 @@ struct vdpa_iova_range {
>>> * @buf: buffer used to write from
>>> * @len: the length to write to
>>> * configuration space
>>> + * @get_ce_config: Read device specific configuration in
>>> + * cpu endianness.
>>> + * @vdev: vdpa device
>>> + * @config: pointer to config buffer used to
>> read to
>>
>>
>> So I wonder what's the reason for having this? If it's only the reason of
>> endian, we can just use get_config.
>>
> Didn't follow your suggestion.
> How does in kernel management tool caller get_config know how to do endianenss conversion?
LE should be used, so it's the responsibility of the vDPA parent
(driver) to do the endian conversion.
> Or you are proposing to send this whole virtio_config structure as binary data to user space via netlink?
> If so, it is not a practice in netlink to return struct.
I don't get here, it should work as mac address I think.
>
> Also making netlink user space to understand __virtio16 doesn't sound correct.
> Often orchestration is not written in C. I cannot think of returning virtio_net_config via netlink socket if it is your thought.
I'm not sure I get here. __virtio16 is part of uapi which is defined
virtio_types.h so did the virtio_net_config. Duplicating those through
dedicated netlink attr looks like burden. E.g you need to introduce new
attrs for each field of the config for every virtio devices and keep it
up-to-date with the virtio uapis.
>
> And decoding it requires to query features too. Querying features and config are not atomic so parsed value can be wrong.
So I think device should maintain a stable features that will is
returned by get_features(), otherwise a lot of things will be broken.
>
> Endianness has to be self-contained in fields return via netlink. With that baseline, lets think further.
Then mandating LE seem self-contained.
>
>> We don't plan to expose a legacy or transition device, so we can simply do
>> the endian conversion in the device.
>>
> I am bit confused with Michael's suggestion in v1 [1].
>
> VIRTIO_F_VERSION_1 is set today by mlx5 and ifcvf driver.
I've had some disucssion with Michael, the conclusion is that we should
only advertise (or mandate) a modern device to be exposed userspace.
Otherwise it could be a lot of burden. Qemu can still present a
transtitonal device by doing the endian conversion when necessary in the
middle. I'm working on the Qemu patches to do that.
Thanks
>
>> Then we can stick to the uapi of virtio_net_config and there's no need for the
>> VDPA_ATTR_DEV_NET_CFG_XXX?
>>
> [1] https://lore.kernel.org/virtualization/20210224020336-mutt-send-email-mst@kernel.org/
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2021-04-07 7:12 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 17:04 [PATCH linux-next v2 00/14] vdpa: Enable user to set mac address, mtu Parav Pandit
2021-04-06 17:04 ` [PATCH linux-next v2 01/14] vdpa: Follow kdoc comment style Parav Pandit
2021-04-07 3:08 ` Jason Wang
2021-04-06 17:04 ` [PATCH linux-next v2 02/14] " Parav Pandit
2021-04-07 3:09 ` Jason Wang
2021-04-06 17:04 ` [PATCH linux-next v2 03/14] vdpa: Introduce and use vdpa device get, set config, features helpers Parav Pandit
2021-04-07 3:18 ` [PATCH linux-next v2 03/14] vdpa: Introduce and use vdpa device get,set " Jason Wang
2021-04-07 3:52 ` Parav Pandit
2021-04-06 17:04 ` [PATCH linux-next v2 04/14] vdpa: Introduce query of device config layout Parav Pandit
2021-04-07 3:56 ` Jason Wang
2021-04-07 5:10 ` Parav Pandit
2021-04-07 7:12 ` Jason Wang [this message]
2021-04-08 6:23 ` Parav Pandit
2021-04-06 17:04 ` [PATCH linux-next v2 05/14] vdpa: Enable user to set mac and mtu of vdpa device Parav Pandit
2021-04-07 3:59 ` Jason Wang
2021-04-06 17:04 ` [PATCH linux-next v2 06/14] vdpa_sim_net: Enable user to set mac address and mtu Parav Pandit
2021-04-06 17:04 ` [PATCH linux-next v2 07/14] vdpa/mlx5: Use the correct dma device when registering memory Parav Pandit
2021-04-07 4:00 ` Jason Wang
2021-04-06 17:04 ` [PATCH linux-next v2 08/14] vdpa/mlx5: Retrieve BAR address suitable any function Parav Pandit
2021-04-07 5:32 ` Jason Wang
2021-04-06 17:04 ` [PATCH linux-next v2 09/14] vdpa/mlx5: Enable user to add/delete vdpa device Parav Pandit
2021-04-06 17:04 ` [PATCH linux-next v2 10/14] vdpa/mlx5: Support configuration of MAC Parav Pandit
2021-04-07 7:21 ` Jason Wang
2021-04-06 17:04 ` [PATCH linux-next v2 11/14] vdpa/mlx5: Forward only packets with allowed MAC address Parav Pandit
2021-04-06 17:04 ` [PATCH linux-next v2 12/14] vdpa/mlx5: should exclude header length and fcs from mtu Parav Pandit
2021-04-06 17:04 ` [PATCH linux-next v2 13/14] vdpa/mlx5: Fix suspend/resume index restoration Parav Pandit
2021-04-07 7:25 ` Jason Wang
[not found] ` <20210407101612.GB207753@mtl-vdi-166.wap.labs.mlnx>
2021-04-07 13:38 ` Michael S. Tsirkin
2021-04-06 17:04 ` [PATCH linux-next v2 14/14] vdpa/mlx5: Fix wrong use of bit numbers Parav Pandit
2021-04-07 7:25 ` Jason Wang
2021-04-07 7:28 ` Parav Pandit
2021-04-07 7:28 ` [PATCH linux-next v2 00/14] vdpa: Enable user to set mac address, mtu Jason Wang
2021-04-08 3:45 ` Parav Pandit
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=fdc137cf-ad6a-5eec-01cf-52c0165b6229@redhat.com \
--to=jasowang@redhat.com \
--cc=elic@nvidia.com \
--cc=mst@redhat.com \
--cc=parav@nvidia.com \
--cc=virtualization@lists.linux-foundation.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).