Re: [PATCH 2/2] vdpa/mlx5: Restore the hardware used index after change map

2021-01-31 Thread Jason Wang
On 2021/2/1 下午2:38, Eli Cohen wrote: On Mon, Feb 01, 2021 at 02:00:35PM +0800, Jason Wang wrote: On 2021/2/1 下午1:52, Eli Cohen wrote: On Mon, Feb 01, 2021 at 11:36:23AM +0800, Jason Wang wrote: On 2021/2/1 上午2:55, Eli Cohen wrote: On Fri, Jan 29, 2021 at 11:49:45AM +0800, Jason Wang wrote:

Re: [PATCH RFC v2 02/10] vringh: add 'iotlb_lock' to synchronize iotlb accesses

2021-01-31 Thread Jason Wang
On 2021/1/29 下午5:18, Stefano Garzarella wrote: On Fri, Jan 29, 2021 at 03:43:40PM +0800, Jason Wang wrote: On 2021/1/28 下午10:41, Stefano Garzarella wrote: Usually iotlb accesses are synchronized with a spinlock. Let's request it as a new parameter in vringh_set_iotlb() and hold it when we

Re: [RFC 09/10] vhost: Route guest->host notification through shadow virtqueue

2021-01-31 Thread Jason Wang
On 2021/1/30 上午4:54, Eugenio Pérez wrote: Shadow virtqueue notifications forwarding is disabled when vhost_dev stops. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 5 ++ include/hw/virtio/vhost.h | 4 + hw/virtio/vhost-shadow-virtqueue.c | 123

Re: [RFC 05/10] vhost: Add vhost_dev_from_virtio

2021-01-31 Thread Jason Wang
On 2021/1/30 上午4:54, Eugenio Pérez wrote: Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost.h | 1 + hw/virtio/vhost.c | 17 + 2 files changed, 18 insertions(+) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index 4a8bc75415..fca076e3f0

Re: [RFC 03/10] virtio: Add virtio_queue_get_idx

2021-01-31 Thread Jason Wang
On 2021/1/30 上午4:54, Eugenio Pérez wrote: Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio.h | 2 ++ hw/virtio/virtio.c | 5 + 2 files changed, 7 insertions(+) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 9988c6d5c9..9013c03424 100644 ---

Re: [PATCH RFC v2 10/10] vdpa_sim_blk: handle VIRTIO_BLK_T_GET_ID

2021-01-31 Thread Jason Wang
On 2021/1/28 下午10:41, Stefano Garzarella wrote: Handle VIRTIO_BLK_T_GET_ID request, always answering the "vdpa_blk_sim" string. Signed-off-by: Stefano Garzarella --- v2: - made 'vdpasim_blk_id' static [Jason] Acked-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 15

Re: [PATCH RFC v2 09/10] vdpa_sim_blk: implement ramdisk behaviour

2021-01-31 Thread Jason Wang
On 2021/1/28 下午10:41, Stefano Garzarella wrote: The previous implementation wrote only the status of each request. This patch implements a more accurate block device simulator, providing a ramdisk-like behavior. Signed-off-by: Stefano Garzarella --- v2: - used %zd %zx to print size_t and

Re: [PATCH 2/2] vdpa/mlx5: Restore the hardware used index after change map

2021-01-31 Thread Jason Wang
On 2021/2/1 下午1:52, Eli Cohen wrote: On Mon, Feb 01, 2021 at 11:36:23AM +0800, Jason Wang wrote: On 2021/2/1 上午2:55, Eli Cohen wrote: On Fri, Jan 29, 2021 at 11:49:45AM +0800, Jason Wang wrote: On 2021/1/28 下午9:41, Eli Cohen wrote: When a change of memory map occurs, the hardware resources

Re: [PATCH RFC v2 08/10] vdpa: add vdpa simulator for block device

2021-01-31 Thread Jason Wang
On 2021/1/28 下午10:41, Stefano Garzarella wrote: From: Max Gurtovoy This will allow running vDPA for virtio block protocol. Signed-off-by: Max Gurtovoy [sgarzare: various cleanups/fixes] Signed-off-by: Stefano Garzarella Acked-by: Jason Wang --- v2: - rebased on top of other changes

Re: [PATCH RFC v2 06/10] vdpa_sim: cleanup kiovs in vdpasim_free()

2021-01-31 Thread Jason Wang
On 2021/1/28 下午10:41, Stefano Garzarella wrote: vringh_getdesc_iotlb() allocates memory to store the kvec, that is freed with vringh_kiov_cleanup(). vringh_getdesc_iotlb() is able to reuse a kvec previously allocated, so in order to avoid to allocate the kvec for each request, we are not

Re: [PATCH RFC v2 05/10] vringh: add vringh_kiov_length() helper

2021-01-31 Thread Jason Wang
On 2021/1/28 下午10:41, Stefano Garzarella wrote: This new helper returns the total number of bytes covered by a vringh_kiov. Suggested-by: Jason Wang Signed-off-by: Stefano Garzarella Acked-by: Jason Wang --- include/linux/vringh.h | 11 +++ 1 file changed, 11 insertions(+)

Re: [PATCH RFC v2 04/10] vringh: implement vringh_kiov_advance()

2021-01-31 Thread Jason Wang
On 2021/1/28 下午10:41, Stefano Garzarella wrote: In some cases, it may be useful to provide a way to skip a number of bytes in a vringh_kiov. Let's implement vringh_kiov_advance() for this purpose, reusing the code from vringh_iov_xfer(). We replace that code calling the new

Re: [PATCH RFC v2 03/10] vringh: reset kiov 'consumed' field in __vringh_iov()

2021-01-31 Thread Jason Wang
On 2021/1/28 下午10:41, Stefano Garzarella wrote: __vringh_iov() overwrites the contents of riov and wiov, in fact it resets the 'i' and 'used' fields, but also the consumed field should be reset to avoid an inconsistent state. Signed-off-by: Stefano Garzarella I had a question(I remember we

Re: [PATCH 2/2] vdpa/mlx5: Restore the hardware used index after change map

2021-01-31 Thread Jason Wang
On 2021/2/1 上午2:55, Eli Cohen wrote: On Fri, Jan 29, 2021 at 11:49:45AM +0800, Jason Wang wrote: On 2021/1/28 下午9:41, Eli Cohen wrote: When a change of memory map occurs, the hardware resources are destroyed and then re-created again with the new memory map. In such case, we need to restore