Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-07-06 Thread Jason Wang
在 2021/7/7 上午1:07, Parav Pandit 写道: From: Jason Wang Sent: Monday, July 5, 2021 10:05 AM 在 2021/7/2 下午2:04, Parav Pandit 写道: From: Jason Wang Sent: Thursday, July 1, 2021 1:13 PM Actually it depends on what attributes is required for building the config. We can simply reuse the

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-07-06 Thread Parav Pandit
> From: Jason Wang > Sent: Monday, July 5, 2021 10:05 AM > > 在 2021/7/2 下午2:04, Parav Pandit 写道: > > > >> From: Jason Wang > >> Sent: Thursday, July 1, 2021 1:13 PM > >> > >> > >> Actually it depends on what attributes is required for building the config. > >> > >> We can simply reuse the

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-07-04 Thread Jason Wang
在 2021/7/2 下午2:04, Parav Pandit 写道: From: Jason Wang Sent: Thursday, July 1, 2021 1:13 PM Actually it depends on what attributes is required for building the config. We can simply reuse the existing virtio_net_config, if most of the fields are required. struct virtio_net_config_set {   

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-07-02 Thread Parav Pandit
> From: Jason Wang > Sent: Thursday, July 1, 2021 1:13 PM > > > Actually it depends on what attributes is required for building the config. > > We can simply reuse the existing virtio_net_config, if most of the fields are > required. > > struct virtio_net_config_set { >         __virtio64

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-07-01 Thread Jason Wang
在 2021/7/1 下午3:00, Parav Pandit 写道: From: Jason Wang Sent: Thursday, July 1, 2021 9:04 AM Just to clarify, if I understand this correctly, with the individual attribute, there's no need for the bit like xxx_is_valid? xxx_is_valid is not present in the get calls. It is also not present in

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-07-01 Thread Parav Pandit
> From: Jason Wang > Sent: Thursday, July 1, 2021 9:04 AM > >> Just to clarify, if I understand this correctly, with the individual > >> attribute, there's no need for the bit like xxx_is_valid? > > xxx_is_valid is not present in the get calls. > > It is also not present in UAPI set calls. > >

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-30 Thread Jason Wang
在 2021/6/30 下午2:03, Parav Pandit 写道: Hi Jason, From: Jason Wang Sent: Wednesday, June 30, 2021 10:02 AM It looks to we don't need the rest of fields in the virtio_net_config to build the config since they are all hardware attributes. Today it is only mac and max queues. Later on we may

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-30 Thread Parav Pandit
Hi Jason, > From: Jason Wang > Sent: Wednesday, June 30, 2021 10:02 AM > >> It looks to we don't need the rest of fields in the virtio_net_config > >> to build the config since they are all hardware attributes. > > Today it is only mac and max queues. Later on we may need to define rss >

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-29 Thread Jason Wang
在 2021/6/29 下午5:49, Parav Pandit 写道: Hi Jason, From: Jason Wang Sent: Tuesday, June 29, 2021 9:22 AM Pass the whole virtio_net_config and inform via side channel? That could be a method. I prefer the method to pass individual fields which has the clean code approach and full

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-29 Thread Jason Wang
在 2021/6/30 上午4:01, Michael S. Tsirkin 写道: On Tue, Jun 29, 2021 at 11:41:54AM +0800, Jason Wang wrote: 在 2021/6/29 上午6:39, Michael S. Tsirkin 写道: On Mon, Jun 28, 2021 at 01:03:20PM +0800, Jason Wang wrote: So I think we need solve them all, but netlink is probably the wrong layer, we need to

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-29 Thread Michael S. Tsirkin
On Tue, Jun 29, 2021 at 11:41:54AM +0800, Jason Wang wrote: > > 在 2021/6/29 上午6:39, Michael S. Tsirkin 写道: > > On Mon, Jun 28, 2021 at 01:03:20PM +0800, Jason Wang wrote: > > > So I think we need solve them all, but netlink is probably the wrong > > > layer, > > > we need to solve them at virtio

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-29 Thread Parav Pandit
Hi Jason, > From: Jason Wang > Sent: Tuesday, June 29, 2021 9:22 AM > >>> Pass the whole virtio_net_config and inform via side channel? > >> > >> That could be a method. > > I prefer the method to pass individual fields which has the clean code > approach and full flexibility. > > Clean code =

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-28 Thread Jason Wang
在 2021/6/28 下午6:56, Parav Pandit 写道: From: Jason Wang Sent: Monday, June 28, 2021 10:33 AM [..] I don't see why it needs typecast, virtio_net_config is also uABI, you can deference the fields directly. User wants set only the mac address of the config space. How do user space tell this?

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-28 Thread Jason Wang
在 2021/6/29 上午6:39, Michael S. Tsirkin 写道: On Mon, Jun 28, 2021 at 01:03:20PM +0800, Jason Wang wrote: So I think we need solve them all, but netlink is probably the wrong layer, we need to solve them at virtio level and let netlink a transport for them virtio uAPI/ABI. I'm not sure I follow.

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-28 Thread Michael S. Tsirkin
On Mon, Jun 28, 2021 at 01:03:20PM +0800, Jason Wang wrote: > So I think we need solve them all, but netlink is probably the wrong layer, > we need to solve them at virtio level and let netlink a transport for them > virtio uAPI/ABI. I'm not sure I follow. virtio defines VF to driver

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-28 Thread Parav Pandit
> From: Jason Wang > Sent: Monday, June 28, 2021 10:33 AM > [..] > >> > >> I don't see why it needs typecast, virtio_net_config is also uABI, > >> you can deference the fields directly. > >> > > User wants set only the mac address of the config space. How do user > space tell this? > > >

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-27 Thread Jason Wang
在 2021/6/25 下午2:45, Parav Pandit 写道: From: Jason Wang Sent: Friday, June 25, 2021 8:59 AM 在 2021/6/24 下午3:59, Parav Pandit 写道: From: Jason Wang Sent: Thursday, June 24, 2021 12:35 PM Consider we had a mature set of virtio specific uAPI for config space. It would be a burden if we need

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-25 Thread Parav Pandit
> From: Jason Wang > Sent: Friday, June 25, 2021 8:59 AM > > 在 2021/6/24 下午3:59, Parav Pandit 写道: > > > >> From: Jason Wang > >> Sent: Thursday, June 24, 2021 12:35 PM > >> > Consider we had a mature set of virtio specific uAPI for config space. > It would be a burden if we need an

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-24 Thread Jason Wang
在 2021/6/24 下午3:59, Parav Pandit 写道: From: Jason Wang Sent: Thursday, June 24, 2021 12:35 PM Consider we had a mature set of virtio specific uAPI for config space. It would be a burden if we need an unnecessary translation layer of netlink in the middle: [vDPA parent (virtio_net_config)]

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-24 Thread Parav Pandit
> From: Jason Wang > Sent: Thursday, June 24, 2021 12:35 PM > > >> Consider we had a mature set of virtio specific uAPI for config space. > >> It would be a burden if we need an unnecessary translation layer of > >> netlink in the middle: > >> > >> [vDPA parent (virtio_net_config)] <->

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-24 Thread Jason Wang
在 2021/6/24 下午2:29, Parav Pandit 写道: From: Jason Wang Sent: Thursday, June 24, 2021 11:13 AM 在 2021/6/23 下午12:22, Parav Pandit 写道: From: Jason Wang Sent: Wednesday, June 23, 2021 9:39 AM 在 2021/6/22 下午10:03, Parav Pandit 写道: Is it better to use a separate enum for net specific

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-24 Thread Parav Pandit
> From: Jason Wang > Sent: Thursday, June 24, 2021 11:13 AM > > 在 2021/6/23 下午12:22, Parav Pandit 写道: > > > >> From: Jason Wang > >> Sent: Wednesday, June 23, 2021 9:39 AM > >> > >> 在 2021/6/22 下午10:03, Parav Pandit 写道: > Is it better to use a separate enum for net specific attributes? >

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-23 Thread Jason Wang
在 2021/6/23 下午12:22, Parav Pandit 写道: From: Jason Wang Sent: Wednesday, June 23, 2021 9:39 AM 在 2021/6/22 下午10:03, Parav Pandit 写道: Is it better to use a separate enum for net specific attributes? Yes, because they are only net specific. I guess it is related to your below question.

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-22 Thread Parav Pandit
> From: Jason Wang > Sent: Wednesday, June 23, 2021 9:39 AM > > 在 2021/6/22 下午10:03, Parav Pandit 写道: > >> Is it better to use a separate enum for net specific attributes? > >> > > Yes, because they are only net specific. > > I guess it is related to your below question. > > > >> Another

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-22 Thread Jason Wang
在 2021/6/22 下午10:03, Parav Pandit 写道: Is it better to use a separate enum for net specific attributes? Yes, because they are only net specific. I guess it is related to your below question. Another question (sorry if it has been asked before). Can we simply return the config (binary) to the

RE: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-22 Thread Parav Pandit
> From: Jason Wang > Sent: Tuesday, June 22, 2021 12:50 PM > [..] > > { > > const struct vdpa_config_ops *ops = vdev->config; > > > > + mutex_lock(>cf_mutex); > > /* > > * Config accesses aren't supposed to trigger before features are set. > > * If it does happen we

Re: [PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-22 Thread Jason Wang
在 2021/6/17 上午3:11, Parav Pandit 写道: Introduce a command to query a device config layout. An example query of network vdpa device: $ vdpa dev add name bar mgmtdev vdpasim_net $ vdpa dev config show bar: mac 00:35:09:19:48:05 link up link_announce false mtu 1500 speed 0 duplex 0 $ vdpa dev

[PATCH linux-next v3 2/6] vdpa: Introduce query of device config layout

2021-06-16 Thread Parav Pandit
Introduce a command to query a device config layout. An example query of network vdpa device: $ vdpa dev add name bar mgmtdev vdpasim_net $ vdpa dev config show bar: mac 00:35:09:19:48:05 link up link_announce false mtu 1500 speed 0 duplex 0 $ vdpa dev config show -jp { "config": {