Re: [PATCH V6 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-10-30 Thread Jason Wang
On 2019/10/31 上午5:23, Christoph Hellwig wrote: On Wed, Oct 30, 2019 at 02:44:44PM +0800, Jason Wang wrote: This sample driver creates mdev device that simulate virtio net device over virtio mdev transport. The device is implemented through vringh and workqueue. A device specific dma ops is to

Re: [RFC] vhost_mdev: add network control vq support

2019-10-30 Thread Jason Wang
On 2019/10/30 下午7:54, Tiwei Bie wrote: On Wed, Oct 30, 2019 at 03:04:37PM +0800, Jason Wang wrote: On 2019/10/30 下午2:17, Tiwei Bie wrote: On Tue, Oct 29, 2019 at 06:51:32PM +0800, Jason Wang wrote: On 2019/10/29 下午6:17, Tiwei Bie wrote: This patch adds the network control vq support in

Re: [PATCH V6 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-10-30 Thread Christoph Hellwig
On Wed, Oct 30, 2019 at 02:44:44PM +0800, Jason Wang wrote: > This sample driver creates mdev device that simulate virtio net device > over virtio mdev transport. The device is implemented through vringh > and workqueue. A device specific dma ops is to make sure HVA is used > directly as the IOVA.

Re: read_barrier_depends() usage in vhost.c

2019-10-30 Thread Will Deacon
Hi Jason, On Mon, Oct 21, 2019 at 01:48:53PM +0800, Jason Wang wrote: > On 2019/10/19 上午4:58, Will Deacon wrote: > > Staring at the code some more, my best bet at the moment > > is that the load of 'indirect->addr' is probably the one to worry about, > > since it's part of the vring and can be

RE: [PATCH net-next 11/14] vsock: add multi-transports support

2019-10-30 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > > +/* Assign a transport to a socket and call the .init transport callback. > > + * > > + * Note: for stream socket this must be called when vsk->remote_addr > > +is set > > + * (e.g. during the connect() or when a connection request on a >

RE: [PATCH net-next 09/14] vsock: move vsock_insert_unbound() in the vsock_create()

2019-10-30 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM > Subject: [PATCH net-next 09/14] vsock: move vsock_insert_unbound() in the > vsock_create() > > vsock_insert_unbound() was called only when 'sock' parameter of > __vsock_create() was not null.

RE: [PATCH net-next 08/14] vsock: add vsock_create_connected() called by transports

2019-10-30 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM > Subject: [PATCH net-next 08/14] vsock: add vsock_create_connected() called > by transports > > All transports call __vsock_create() with the same parameters, > most of them depending on the

RE: [PATCH net-next 07/14] vsock: handle buffer_size sockopts in the core

2019-10-30 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM > Subject: [PATCH net-next 07/14] vsock: handle buffer_size sockopts in the > core > > virtio_transport and vmci_transport handle the buffer_size sockopts in a > very similar way. > > In order to

[PATCH 0/3] virtiofs: Small Cleanups for 5.5

2019-10-30 Thread Vivek Goyal
Hi Miklos, Here are few small cleanups for virtiofs for 5.5. I had received some comments from Michael Tsirkin on original virtiofs patches and these cleanups are result of these comments. Thanks Vivek Vivek Goyal (3): virtiofs: Use a common function to send forget virtiofs: Do not send

[PATCH 3/3] virtiofs: Use completions while waiting for queue to be drained

2019-10-30 Thread Vivek Goyal
While we wait for queue to finish draining, use completions instead of uslee_range(). This is better way of waiting for event. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 39 +-- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git

[PATCH 1/3] virtiofs: Use a common function to send forget

2019-10-30 Thread Vivek Goyal
Currently we are duplicating logic to send forgets at two places. Consolidate the code by calling one helper function. This also uses virtqueue_add_outbuf() instead of virtqueue_add_sgs(). Former is simpler to call. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 150

[PATCH 2/3] virtiofs: Do not send forget request "struct list_head" element

2019-10-30 Thread Vivek Goyal
We are sending whole of virtio_fs_foreget struct to the other end over virtqueue. Other end does not need to see elements like "struct list". That's internal detail of guest kernel. Fix it. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 17 - 1 file changed, 12

RE: [PATCH net-next 06/14] vsock: add 'struct vsock_sock *' param to vsock_core_get_transport()

2019-10-30 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM > Subject: [PATCH net-next 06/14] vsock: add 'struct vsock_sock *' param to > vsock_core_get_transport() > > Since now the 'struct vsock_sock' object contains a pointer to the transport, > this

RE: [PATCH net-next 04/14] vsock: add 'transport' member in the struct vsock_sock

2019-10-30 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM > Subject: [PATCH net-next 04/14] vsock: add 'transport' member in the struct > vsock_sock > > As a preparation to support multiple transports, this patch adds the > 'transport' member at the

RE: [PATCH net-next 02/14] vsock: remove vm_sockets_get_local_cid()

2019-10-30 Thread Jorgen Hansen via Virtualization
> -Original Message- > From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM > To: net...@vger.kernel.org > Subject: [PATCH net-next 02/14] vsock: remove vm_sockets_get_local_cid() > > vm_sockets_get_local_cid() is only used in

RE: [PATCH net-next 03/14] vsock: remove include/linux/vm_sockets.h file

2019-10-30 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM > Subject: [PATCH net-next 03/14] vsock: remove include/linux/vm_sockets.h > file > > This header file now only includes the "uapi/linux/vm_sockets.h". > We can include directly it when needed. >

RE: [PATCH net-next 01/14] vsock/vmci: remove unused VSOCK_DEFAULT_CONNECT_TIMEOUT

2019-10-30 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM > Subject: [PATCH net-next 01/14] vsock/vmci: remove unused > VSOCK_DEFAULT_CONNECT_TIMEOUT > > The VSOCK_DEFAULT_CONNECT_TIMEOUT definition was introduced with > commit d021c344051af ("VSOCK:

Re: [RFC] vhost_mdev: add network control vq support

2019-10-30 Thread Tiwei Bie
On Wed, Oct 30, 2019 at 03:04:37PM +0800, Jason Wang wrote: > On 2019/10/30 下午2:17, Tiwei Bie wrote: > > On Tue, Oct 29, 2019 at 06:51:32PM +0800, Jason Wang wrote: > >> On 2019/10/29 下午6:17, Tiwei Bie wrote: > >>> This patch adds the network control vq support in vhost-mdev. > >>> A vhost-mdev

Re: [PATCH] iommu/virtio: Remove unused variable

2019-10-30 Thread Joerg Roedel
On Fri, Oct 25, 2019 at 01:13:40PM -0300, Cristiane Naves wrote: > Remove the variable of return. Issue found by > coccicheck(scripts/coccinelle/misc/returnvar.cocci) > > Signed-off-by: Cristiane Naves > --- > drivers/iommu/virtio-iommu.c | 3 +-- > 1 file changed, 1 insertion(+), 2

Re: [PATCH v3] vhost: introduce mdev based hardware backend

2019-10-30 Thread Jason Wang
On 2019/10/30 下午1:52, Tiwei Bie wrote: > On Wed, Oct 30, 2019 at 09:55:57AM +0800, Jason Wang wrote: >> On 2019/10/29 下午6:07, Tiwei Bie wrote: >>> This patch introduces a mdev based hardware vhost backend. >>> This backend is built on top of the same abstraction used >>> in virtio-mdev and

Re: [RFC] vhost_mdev: add network control vq support

2019-10-30 Thread Jason Wang
On 2019/10/30 下午2:17, Tiwei Bie wrote: > On Tue, Oct 29, 2019 at 06:51:32PM +0800, Jason Wang wrote: >> On 2019/10/29 下午6:17, Tiwei Bie wrote: >>> This patch adds the network control vq support in vhost-mdev. >>> A vhost-mdev specific op is introduced to allow parent drivers >>> to handle the

[PATCH V6 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework

2019-10-30 Thread Jason Wang
This sample driver creates mdev device that simulate virtio net device over virtio mdev transport. The device is implemented through vringh and workqueue. A device specific dma ops is to make sure HVA is used directly as the IOVA. This should be sufficient for kernel virtio driver to work. Only

[PATCH V6 5/6] virtio: introduce a mdev based transport

2019-10-30 Thread Jason Wang
This patch introduces a new mdev transport for virtio. This is used to use kernel virtio driver to drive the mediated device that is capable of populating virtqueue directly. A new virtio-mdev driver will be registered to the mdev bus, when a new virtio-mdev device is probed, it will register the

[PATCH V6 4/6] mdev: introduce virtio device and its device ops

2019-10-30 Thread Jason Wang
This patch implements basic support for mdev driver that supports virtio transport for kernel virtio driver. Signed-off-by: Jason Wang --- drivers/vfio/mdev/mdev_core.c| 20 drivers/vfio/mdev/mdev_private.h | 2 + include/linux/mdev.h | 6 ++

[PATCH V6 3/6] mdev: introduce device specific ops

2019-10-30 Thread Jason Wang
Currently, except for the create and remove, the rest of mdev_parent_ops is designed for vfio-mdev driver only and may not help for kernel mdev driver. With the help of class id, this patch introduces device specific callbacks inside mdev_device structure. This allows different set of callback to

[PATCH V6 2/6] modpost: add support for mdev class id

2019-10-30 Thread Jason Wang
Add support to parse mdev class id table. Reviewed-by: Parav Pandit Signed-off-by: Jason Wang --- drivers/vfio/mdev/vfio_mdev.c | 2 ++ scripts/mod/devicetable-offsets.c | 3 +++ scripts/mod/file2alias.c | 11 +++ 3 files changed, 16 insertions(+) diff --git

[PATCH V6 1/6] mdev: class id support

2019-10-30 Thread Jason Wang
Mdev bus only supports vfio driver right now, so it doesn't implement match method. But in the future, we may add drivers other than vfio, the first driver could be virtio-mdev. This means we need to add device class id support in bus match method to pair the mdev device and mdev driver correctly.

[PATCH V6 0/6] mdev based hardware virtio offloading support

2019-10-30 Thread Jason Wang
Hi all: There are hardwares that can do virtio datapath offloading while having its own control path. This path tries to implement a mdev based unified API to support using kernel virtio driver to drive those devices. This is done by introducing a new mdev transport for virtio (virtio_mdev) and

Re: [RFC] vhost_mdev: add network control vq support

2019-10-30 Thread Tiwei Bie
On Tue, Oct 29, 2019 at 06:51:32PM +0800, Jason Wang wrote: > On 2019/10/29 下午6:17, Tiwei Bie wrote: > > This patch adds the network control vq support in vhost-mdev. > > A vhost-mdev specific op is introduced to allow parent drivers > > to handle the network control commands come from userspace.