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

2021-01-28 Thread Jason Wang
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 navigate the iotlb in iotlb_translate() to avoid race conditions with any new additions/deletions of ranges from

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

2021-01-28 Thread Jason Wang
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 the hardware available and used indices. The driver failed to restore the used index which is added h

Re: [PATCH 1/2] vdpa/mlx5: Avoid unnecessary query virtqueue

2021-01-28 Thread Jason Wang
On 2021/1/28 下午9:41, Eli Cohen wrote: suspend_vq should only suspend the VQ on not save the current available index. This is done when a change of map occurs when the driver calls save_channel_info(). Signed-off-by: Eli Cohen Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_vnet.c

RE: [PATCH iproute2-next v2 2/2] vdpa: Add vdpa tool

2021-01-28 Thread Parav Pandit
Hi David, > From: Parav Pandit > Sent: Friday, January 29, 2021 12:13 AM [..] > --- > changelog: > v1->v2: > - added and used library helpers for socket communication > - added and used library functions for string processing helpers > - added and used library functions indent processing hel

[PATCH iproute2-next v2 2/2] vdpa: Add vdpa tool

2021-01-28 Thread Parav Pandit
vdpa tool is created to create, delete and query vdpa devices. examples: Show vdpa management device that supports creating, deleting vdpa devices. $ vdpa mgmtdev show vdpasim: supported_classes net $ vdpa mgmtdev show -jp { "show": { "vdpasim": { "supported_classes": [

[PATCH iproute2-next v2 1/2] Add kernel headers

2021-01-28 Thread Parav Pandit
Add kernel headers to commit from kernel tree [1]. 79991caf5202c7 ("vdpa_sim_net: Add support for user supported devices") [1] https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git branch: linux-next Signed-off-by: Parav Pandit --- include/uapi/linux/vdpa.h | 40 ++

[PATCH iproute2-next v2 0/2] Add vdpa device management tool

2021-01-28 Thread Parav Pandit
Linux vdpa interface allows vdpa device management functionality. This includes adding, removing, querying vdpa devices. vdpa interface also includes showing supported management devices which support such operations. This patchset includes kernel uapi headers and a vdpa tool. examples: $ vdpa

Re: [RFC PATCH v3 00/13] virtio/vsock: introduce SOCK_SEQPACKET support

2021-01-28 Thread Stefano Garzarella
Hi Arseny, I reviewed a part, tomorrow I hope to finish the other patches. Just a couple of comments in the TODOs below. On Mon, Jan 25, 2021 at 02:09:00PM +0300, Arseny Krasnov wrote: This patchset impelements support of SOCK_SEQPACKET for virtio transport. As SOCK_SEQPACKET gu

Re: [RFC PATCH v3 05/13] af_vsock: rest of SEQPACKET support

2021-01-28 Thread Stefano Garzarella
On Mon, Jan 25, 2021 at 02:13:18PM +0300, Arseny Krasnov wrote: This does rest of SOCK_SEQPACKET support: 1) Adds socket ops for SEQPACKET type. 2) Allows to create socket with SEQPACKET type. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/af_vsock.c | 71 ++

Re: [RFC PATCH v3 03/13] af_vsock: implement SEQPACKET rx loop

2021-01-28 Thread Stefano Garzarella
On Mon, Jan 25, 2021 at 02:12:36PM +0300, Arseny Krasnov wrote: This adds receive loop for SEQPACKET. It looks like receive loop for SEQPACKET, but there is a little bit difference: 1) It doesn't call notify callbacks. 2) It doesn't care about 'SO_SNDLOWAT' and 'SO_RCVLOWAT' values, because the

Re: [RFC PATCH v3 02/13] af_vsock: prepare 'vsock_connectible_recvmsg()'

2021-01-28 Thread Stefano Garzarella
On Mon, Jan 25, 2021 at 02:11:57PM +0300, Arseny Krasnov wrote: This prepares 'vsock_connectible_recvmg()' to call SEQPACKET receive loop: 1) Some shared check left in this function, then socket type specific receive loop is called. 2) Stream receive loop is moved to separate function. Signed-

Re: [RFC PATCH v3 01/13] af_vsock: prepare for SOCK_SEQPACKET support

2021-01-28 Thread Stefano Garzarella
I think the patch title should be more explicit, so something like vsock: generalize function to manage connectible sockets On Mon, Jan 25, 2021 at 02:11:28PM +0300, Arseny Krasnov wrote: This prepares af_vsock.c for SEQPACKET support: 1) As both stream and seqpacket sockets are connection orie

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

2021-01-28 Thread Stefano Garzarella
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 calling vringh_kiov_cleanup() when we finished to handle

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

2021-01-28 Thread Stefano Garzarella
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] --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdp

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

2021-01-28 Thread Stefano Garzarella
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 --- v2: - rebased on top of other changes (dev_attr, get_config(), notify(), etc.) - memset to 0 the config structure in v

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

2021-01-28 Thread Stefano Garzarella
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 ssize_t variables in dev_err() - removed unnecessary new

[PATCH RFC v2 07/10] vdpa: Remove the restriction that only supports virtio-net devices

2021-01-28 Thread Stefano Garzarella
From: Xie Yongji With VDUSE, we should be able to support all kinds of virtio devices. Signed-off-by: Xie Yongji --- drivers/vhost/vdpa.c | 28 ++-- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index ef688c8c

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

2021-01-28 Thread Stefano Garzarella
This new helper returns the total number of bytes covered by a vringh_kiov. Suggested-by: Jason Wang Signed-off-by: Stefano Garzarella --- include/linux/vringh.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/linux/vringh.h b/include/linux/vringh.h index 755211ebd195..

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

2021-01-28 Thread Stefano Garzarella
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 vringh_kiov_advance(). Signed-off-by: Stefano Garzarella --- include

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

2021-01-28 Thread Stefano Garzarella
__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 --- drivers/vhost/vringh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH RFC v2 01/10] vdpa_sim: use iova module to allocate IOVA addresses

2021-01-28 Thread Stefano Garzarella
The identical mapping used until now created issues when mapping different virtual pages with the same physical address. To solve this issue, we can use the iova module, to handle the IOVA allocation. For simplicity we use an IOVA allocator with byte granularity. We add two new functions, vdpasim_

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

2021-01-28 Thread Stefano Garzarella
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 navigate the iotlb in iotlb_translate() to avoid race conditions with any new additions/deletions of ranges from the ioltb. Signed-off-by: Stefano Garzarella ---

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

2021-01-28 Thread Stefano Garzarella
v1: https://lore.kernel.org/lkml/93f207c0-61e6-3696-f218-e7d7ea9a7...@redhat.com/ This series is the second part of the v1 linked above. The first part with refactoring of vdpa_sim has already been merged. The patches are based on Max Gurtovoy's work and extend the block simulator to have a ramd

Re: [PATCH v7 45/72] x86/entry/64: Add entry code for #VC handler

2021-01-28 Thread Joerg Roedel
Hello Lai, On Sun, Jan 24, 2021 at 10:11:14PM +0800, Lai Jiangshan wrote: > > + > > + /* > > +* No need to switch back to the IST stack. The current stack is > > either > > +* identical to the stack in the IRET frame or the VC fall-back > > stack, > > +* so it is de