Re: [PATCH v2 03/17] vdpa_sim: remove hard-coded virtq count

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: From: Max Gurtovoy Add a new attribute that will define the number of virt queues to be created for the vdpasim device. Signed-off-by: Max Gurtovoy [sgarzare: replace kmalloc_array() with kcalloc()] Signed-off-by: Stefano Garzarella

Re: [PATCH v2 02/17] vdpa_sim: remove unnecessary headers inclusion

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: Some headers are not necessary, so let's remove them to do some cleaning. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 13 - 1 file changed, 13 deletions(-) diff --git

Re: [PATCH v2 08/17] vdpa_sim: add supported_features field in vdpasim_dev_attr

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: Introduce a new VDPASIM_FEATURES macro with the generic features supported by the vDPA simulator, and VDPASIM_NET_FEATURES macro with vDPA-net features. Add 'supported_features' field in vdpasim_dev_attr, to allow devices to specify their

Re: [PATCH v2 12/17] vdpa_sim: add get_config callback in vdpasim_dev_attr

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: The get_config callback can be used by the device to fill the config structure. The callback will be invoked in vdpasim_get_config() before copying bytes into caller buffer. Move vDPA-net config updates from vdpasim_set_features() in the new

Re: [PATCH v2 07/17] vdpa_sim: add device id field in vdpasim_dev_attr

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: Remove VDPASIM_DEVICE_ID macro and add 'id' field in vdpasim_dev_attr, that will be returned by vdpasim_get_device_id(). Use VIRTIO_ID_NET for vDPA-net simulator device id. Co-developed-by: Max Gurtovoy Signed-off-by: Max Gurtovoy

Re: [PATCH v4] vdpa: mlx5: fix vdpa/vhost dependencies

2020-11-29 Thread Jason Wang
On 2020/11/29 上午5:39, Randy Dunlap wrote: drivers/vdpa/mlx5/ uses vhost_iotlb*() interfaces, so select VHOST_IOTLB to make them be built. However, if VHOST_IOTLB is the only VHOST symbol that is set/enabled, the object file still won't be built because drivers/Makefile won't descend into

Re: [PATCH v2 06/17] vdpa_sim: add struct vdpasim_dev_attr for device attributes

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: vdpasim_dev_attr will contain device specific attributes. We starting moving the number of virtqueues (i.e. nvqs) to vdpasim_dev_attr. vdpasim_create() creates a new vDPA simulator following the device attributes defined in the vdpasim_dev_attr

Re: [PATCH v2 10/17] vdpa_sim: store parsed MAC address in a buffer

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: As preparation for the next patches, we store the MAC address, parsed during the vdpasim_create(), in a buffer that will be used to fill 'config' together with other configurations. Signed-off-by: Stefano Garzarella ---

Re: [PATCH v2 17/17] vdpa: split vdpasim to core and net modules

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: From: Max Gurtovoy Introduce new vdpa_sim_net and vdpa_sim (core) drivers. This is a preparation for adding a vdpa simulator module for block devices. Signed-off-by: Max Gurtovoy [sgarzare: various cleanups/fixes] Signed-off-by: Stefano

Re: [PATCH] vdpa: ifcvf: Use dma_set_mask_and_coherent to simplify code

2020-11-29 Thread Jason Wang
On 2020/11/29 下午8:54, Christophe JAILLET wrote: 'pci_set_dma_mask()' + 'pci_set_consistent_dma_mask()' can be replaced by an equivalent 'dma_set_mask_and_coherent()' which is much less verbose. While at it, fix a typo (s/confiugration/configuration) Signed-off-by: Christophe JAILLET ---

Re: [PATCH v2 09/17] vdpa_sim: add work_fn in vdpasim_dev_attr

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: Rename vdpasim_work() in vdpasim_net_work() and add it to the vdpasim_dev_attr structure. Co-developed-by: Max Gurtovoy Signed-off-by: Max Gurtovoy Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 7 +-- 1 file

Re: [PATCH v2 13/17] vdpa_sim: set vringh notify callback

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: Instead of calling the vq callback directly, we can leverage the vringh_notify() function, adding vdpasim_vq_notify() and setting it in the vringh notify callback. Suggested-by: Jason Wang Signed-off-by: Stefano Garzarella ---

Re: [PATCH] drivers: gpio: add virtio-gpio guest driver

2020-11-29 Thread Jonathan Neuschäfer
Hi, On Fri, Nov 27, 2020 at 07:30:03PM +0100, Enrico Weigelt, metux IT consult wrote: > Introducing new gpio driver for virtual GPIO devices via virtio. > > The driver allows routing gpio control into VM guests, eg. brigding > virtual gpios to specific host gpios, or attaching simulators for >

Re: [PATCH v2 01/17] vdpa: remove unnecessary 'default n' in Kconfig entries

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: 'default n' is not necessary since it is already the default when nothing is specified. Suggested-by: Jason Wang Signed-off-by: Stefano Garzarella Acked-by: Jason Wang --- drivers/vdpa/Kconfig | 3 --- 1 file changed, 3 deletions(-)

Re: [PATCH v2 05/17] vdpa_sim: rename vdpasim_config_ops variables

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: These variables stores generic callbacks used by the vDPA simulator core, so we can remove the 'net' word in their names. Co-developed-by: Max Gurtovoy Signed-off-by: Max Gurtovoy Signed-off-by: Stefano Garzarella ---

Re: [PATCH v2 04/17] vdpa_sim: remove the limit of IOTLB entries

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: The simulated devices can support multiple queues, so this limit should be defined according to the number of queues supported by the device. Since we are in a simulator, let's simply remove that limit. Suggested-by: Jason Wang Acked-by: Jason

Re: [PATCH v2 16/17] vdpa_sim: split vdpasim_virtqueue's iov field in out_iov and in_iov

2020-11-29 Thread Jason Wang
On 2020/11/26 下午10:49, Stefano Garzarella wrote: vringh_getdesc_iotlb() manages 2 iovs for writable and readable descriptors. This is very useful for the block device, where for each request we have both types of descriptor. Let's split the vdpasim_virtqueue's iov field in out_iov and in_iov

Re: [External] Re: [PATCH 0/7] Introduce vdpa management tool

2020-11-29 Thread Jason Wang
On 2020/11/27 下午1:52, Yongji Xie wrote: On Fri, Nov 27, 2020 at 11:53 AM Jason Wang > wrote: On 2020/11/12 下午2:39, Parav Pandit wrote: > This patchset covers user requirements for managing existing vdpa devices, > using a tool and its internal

Re: [PATCH] vdpa/mlx5: Use random MAC for the vdpa net instance

2020-11-29 Thread Michael S. Tsirkin
On Sun, Nov 29, 2020 at 08:43:51AM +0200, Eli Cohen wrote: > We should not try to use the VF MAC address as that is used by the > regular (e.g. mlx5_core) NIC implementation. Instead, use a random > generated MAC address. > > Suggested by: Cindy Lu > Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA

Re: [PATCH] drivers: gpio: add virtio-gpio guest driver

2020-11-29 Thread Michael S. Tsirkin
On Fri, Nov 27, 2020 at 07:30:03PM +0100, Enrico Weigelt, metux IT consult wrote: > diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h > index b052355ac7a3..85772c0bcb4b 100644 > --- a/include/uapi/linux/virtio_ids.h > +++ b/include/uapi/linux/virtio_ids.h > @@ -48,5

Re: [PATCH AUTOSEL 5.9 22/33] vhost scsi: add lun parser helper

2020-11-29 Thread Paolo Bonzini
On 29/11/20 05:13, Sasha Levin wrote: Which doesn't seem to be suitable for stable either...  Patch 3/5 in Why not? It was sent as a fix to Linus. Dunno, 120 lines of new code? Even if it's okay for an rc, I don't see why it is would be backported to stable releases and release it without

Re: [PATCH AUTOSEL 5.9 22/33] vhost scsi: add lun parser helper

2020-11-29 Thread Sasha Levin
On Sun, Nov 29, 2020 at 06:34:01PM +0100, Paolo Bonzini wrote: On 29/11/20 05:13, Sasha Levin wrote: Which doesn't seem to be suitable for stable either...  Patch 3/5 in Why not? It was sent as a fix to Linus. Dunno, 120 lines of new code? Even if it's okay for an rc, I don't see why it