All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [RFC PATCH 01/10] vdpa: add get_config_size callback in vdpa_config_ops
Date: Thu, 4 Mar 2021 16:34:52 +0800	[thread overview]
Message-ID: <8a3f39ab-1cee-d0c3-e4d1-dc3ec492a763@redhat.com> (raw)
In-Reply-To: <20210302141516.oxsdb7jogrvu75yc@steredhat>


On 2021/3/2 10:15 下午, Stefano Garzarella wrote:
> On Tue, Mar 02, 2021 at 12:14:13PM +0800, Jason Wang wrote:
>>
>> On 2021/2/16 5:44 下午, Stefano Garzarella wrote:
>>> This new callback is used to get the size of the configuration space
>>> of vDPA devices.
>>>
>>> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
>>> ---
>>>  include/linux/vdpa.h              | 4 ++++
>>>  drivers/vdpa/ifcvf/ifcvf_main.c   | 6 ++++++
>>>  drivers/vdpa/mlx5/net/mlx5_vnet.c | 6 ++++++
>>>  drivers/vdpa/vdpa_sim/vdpa_sim.c  | 9 +++++++++
>>>  4 files changed, 25 insertions(+)
>>>
>>> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
>>> index 4ab5494503a8..fddf42b17573 100644
>>> --- a/include/linux/vdpa.h
>>> +++ b/include/linux/vdpa.h
>>> @@ -150,6 +150,9 @@ struct vdpa_iova_range {
>>>   * @set_status:            Set the device status
>>>   *                @vdev: vdpa device
>>>   *                @status: virtio device status
>>> + * @get_config_size:        Get the size of the configuration space
>>> + *                @vdev: vdpa device
>>> + *                Returns size_t: configuration size
>>
>>
>> Rethink about this, how much we could gain by introducing a dedicated 
>> ops here? E.g would it be simpler if we simply introduce a 
>> max_config_size to vdpa device?
>
> Mainly because in this way we don't have to add new parameters to the 
> vdpa_alloc_device() function.
>
> We do the same for example for 'get_device_id', 'get_vendor_id', 
> 'get_vq_num_max'. All of these are usually static, but we have ops.
> I think because it's easier to extend.
>
> I don't know if it's worth adding a new structure for these static 
> values at this point, like 'struct vdpa_config_params'.


Yes, that's the point. I think for any static values, it should be set 
during device allocation.

I'm fine with both.

Thanks


>
> Thanks,
> Stefano
>


WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [RFC PATCH 01/10] vdpa: add get_config_size callback in vdpa_config_ops
Date: Thu, 4 Mar 2021 16:34:52 +0800	[thread overview]
Message-ID: <8a3f39ab-1cee-d0c3-e4d1-dc3ec492a763@redhat.com> (raw)
In-Reply-To: <20210302141516.oxsdb7jogrvu75yc@steredhat>


On 2021/3/2 10:15 下午, Stefano Garzarella wrote:
> On Tue, Mar 02, 2021 at 12:14:13PM +0800, Jason Wang wrote:
>>
>> On 2021/2/16 5:44 下午, Stefano Garzarella wrote:
>>> This new callback is used to get the size of the configuration space
>>> of vDPA devices.
>>>
>>> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
>>> ---
>>>  include/linux/vdpa.h              | 4 ++++
>>>  drivers/vdpa/ifcvf/ifcvf_main.c   | 6 ++++++
>>>  drivers/vdpa/mlx5/net/mlx5_vnet.c | 6 ++++++
>>>  drivers/vdpa/vdpa_sim/vdpa_sim.c  | 9 +++++++++
>>>  4 files changed, 25 insertions(+)
>>>
>>> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
>>> index 4ab5494503a8..fddf42b17573 100644
>>> --- a/include/linux/vdpa.h
>>> +++ b/include/linux/vdpa.h
>>> @@ -150,6 +150,9 @@ struct vdpa_iova_range {
>>>   * @set_status:            Set the device status
>>>   *                @vdev: vdpa device
>>>   *                @status: virtio device status
>>> + * @get_config_size:        Get the size of the configuration space
>>> + *                @vdev: vdpa device
>>> + *                Returns size_t: configuration size
>>
>>
>> Rethink about this, how much we could gain by introducing a dedicated 
>> ops here? E.g would it be simpler if we simply introduce a 
>> max_config_size to vdpa device?
>
> Mainly because in this way we don't have to add new parameters to the 
> vdpa_alloc_device() function.
>
> We do the same for example for 'get_device_id', 'get_vendor_id', 
> 'get_vq_num_max'. All of these are usually static, but we have ops.
> I think because it's easier to extend.
>
> I don't know if it's worth adding a new structure for these static 
> values at this point, like 'struct vdpa_config_params'.


Yes, that's the point. I think for any static values, it should be set 
during device allocation.

I'm fine with both.

Thanks


>
> Thanks,
> Stefano
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2021-03-04  8:37 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16  9:44 [RFC PATCH 00/10] vdpa: get/set_config() rework Stefano Garzarella
2021-02-16  9:44 ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 01/10] vdpa: add get_config_size callback in vdpa_config_ops Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-03-02  4:14   ` Jason Wang
2021-03-02  4:14     ` Jason Wang
2021-03-02 14:15     ` Stefano Garzarella
2021-03-02 14:15       ` Stefano Garzarella
2021-03-04  8:34       ` Jason Wang [this message]
2021-03-04  8:34         ` Jason Wang
2021-03-05  8:38         ` Stefano Garzarella
2021-03-05  8:38           ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 02/10] vdpa: check vdpa_get_config() parameters and return bytes read Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 03/10] vdpa: add vdpa_set_config() helper Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 04/10] vdpa: remove param checks in the get/set_config callbacks Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 05/10] vdpa: remove WARN_ON() " Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 06/10] virtio_vdpa: use vdpa_set_config() Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 07/10] vhost/vdpa: " Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 08/10] vhost/vdpa: allow user space to pass buffers bigger than config space Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 09/10] vhost/vdpa: use get_config_size callback in vhost_vdpa_config_validate() Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-02-16  9:44 ` [RFC PATCH 10/10] vhost/vdpa: return configuration bytes read and written to user space Stefano Garzarella
2021-02-16  9:44   ` Stefano Garzarella
2021-03-02  4:05   ` Jason Wang
2021-03-02  4:05     ` Jason Wang
2021-03-02 14:06     ` Stefano Garzarella
2021-03-02 14:06       ` Stefano Garzarella
2021-03-04  8:31       ` Jason Wang
2021-03-04  8:31         ` Jason Wang
2021-03-05  8:37         ` Stefano Garzarella
2021-03-05  8:37           ` Stefano Garzarella
2021-03-08  3:59           ` Jason Wang
2021-03-08  3:59             ` Jason Wang
2021-03-01  8:17 ` [RFC PATCH 00/10] vdpa: get/set_config() rework Stefano Garzarella
2021-03-01  8:17   ` Stefano Garzarella

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=8a3f39ab-1cee-d0c3-e4d1-dc3ec492a763@redhat.com \
    --to=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=sgarzare@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.