Re: [Qemu-devel] [PATCH] vhost-user: fix reconnection support for host notifier

2019-06-06 Thread Tiwei Bie
Hi, On Thu, Jun 06, 2019 at 03:30:29PM +0200, Marc-André Lureau wrote: > Hi > > On Fri, Apr 26, 2019 at 8:32 AM Tiwei Bie wrote: > > > > We need to destroy the host notifiers when cleaning up > > the backend. Otherwise, some resources are not released > > after

[Qemu-devel] [RFC] vhost-user: don't ignore CTRL_VLAN feature

2019-06-10 Thread Tiwei Bie
gnore qemu-only features") Cc: qemu-sta...@nongnu.org Signed-off-by: Tiwei Bie --- It's not clear in the spec that, whether vlan filtering is also best-effort: https://github.com/oasis-tcs/virtio-spec/blob/37057052e7/content.tex#L3372 hw/net/vhost_net.c | 2 ++ 1 file changed, 2 insertion

Re: [Qemu-devel] [RFC] vhost-user: don't ignore CTRL_VLAN feature

2019-06-11 Thread Tiwei Bie
On Tue, Jun 11, 2019 at 03:22:47PM +0800, Jason Wang wrote: > > On 2019/6/11 下午2:51, Tiwei Bie wrote: > > The VIRTIO_NET_F_CTRL_VLAN feature requires the support of > > vhost-user backend. But it will be advertised to guest driver > > as long as it's enabled by

Re: [Qemu-devel] [RFC] vhost-user: don't ignore CTRL_VLAN feature

2019-06-11 Thread Tiwei Bie
On Tue, Jun 11, 2019 at 10:10:14AM -0400, Michael S. Tsirkin wrote: > On Tue, Jun 11, 2019 at 02:51:37PM +0800, Tiwei Bie wrote: > > The VIRTIO_NET_F_CTRL_VLAN feature requires the support of > > vhost-user backend. But it will be advertised to guest driver > > as long as it&

[Qemu-devel] [PATCH v1 1/6] vhost-user: support receiving file descriptors in slave_read

2018-01-24 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- hw/virtio/vhost-user.c | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 093675ed98..e7108138fd 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost

[Qemu-devel] [PATCH v1 2/6] vhost-user: introduce shared vhost-user state

2018-01-24 Thread Tiwei Bie
When multi-queue is enabled for virtio-net, each virtio queue pair will have a vhost_dev, and the only thing they share currently is the chardev. This patch introduces a vhost-user state structure which will be shared by all virtio queue pairs of the same virtio device. Signed-off-by: Tiwei Bie

[Qemu-devel] [PATCH v1 3/6] virtio: support adding sub-regions for notify region

2018-01-24 Thread Tiwei Bie
Provide APIs to support querying whether the page-per-vq is enabled and adding sub-regions for notify region. Signed-off-by: Tiwei Bie --- Makefile.target| 4 hw/virtio/virtio-pci.c | 48 ++ hw/virtio/virtio-pci.h | 5

[Qemu-devel] [PATCH v1 5/6] vfio: remove DPRINTF() definition from vfio-common.h

2018-01-24 Thread Tiwei Bie
This macro isn't used by any VFIO code. And its name is too generic. The vfio-common.h (in include/hw/vfio) can be included by other modules in QEMU. It can introduce conflicts. Signed-off-by: Tiwei Bie --- include/hw/vfio/vfio-common.h | 9 - 1 file changed, 9 deletions(-) diff

[Qemu-devel] [PATCH v1 0/6] Extend vhost-user to support VFIO based accelerators

2018-01-24 Thread Tiwei Bie
e in cover letter (Jason) - Move PCI specific stuffs out of vhost-user (Jason) - Handle the virtual IOMMU case (Jason) - Move VFIO group management code into vfio/common.c (Alex) - Various refinements; (approximately sorted by comment posting time) Tiwei Bie (6): vhost-user: support receiving file de

[Qemu-devel] [PATCH v1 4/6] vfio: support getting VFIOGroup from groupfd

2018-01-24 Thread Tiwei Bie
Add an API to support getting VFIOGroup from groupfd. When groupfd is shared by another process, the VFIOGroup may not have its container and address space in QEMU. Besides, add a reference counter to better support getting VFIOGroup multiple times. Signed-off-by: Tiwei Bie --- hw/vfio

[Qemu-devel] [PATCH v1 6/6] vhost-user: add VFIO based accelerators support

2018-01-24 Thread Tiwei Bie
d can't support dynamic mapping well. Once this problem is solved in vhost-user, virtual IOMMU can be supported by accelerators too, and the IOMMU feature bit checking in this patch can be removed. Signed-off-by: Tiwei Bie --- docs/interop/vhost-user.txt| 57 hw/virti

[Qemu-devel] [PATCH] virtio-balloon: unref the memory region before continuing

2018-01-24 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- hw/virtio/virtio-balloon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 14e08d20d0..f2104bfcef 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -234,6 +234,7 @@ static

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v1 6/6] vhost-user: add VFIO based accelerators support

2018-01-25 Thread Tiwei Bie
t also exists for vfio (hw/vfio in QEMU). If QEMU needs to trap all the map/unmap events, the data path performance couldn't be high. If we want to thoroughly fix this issue especially for vfio (hw/vfio in QEMU), we need to have the offload path Jason mentioned in QEMU. And I think accelerators

Re: [Qemu-devel] [RFC 3/3] vhost-user: add VFIO based accelerators support

2018-01-16 Thread Tiwei Bie
On Tue, Jan 16, 2018 at 10:23:39AM -0700, Alex Williamson wrote: > On Fri, 22 Dec 2017 14:41:51 +0800 > Tiwei Bie wrote: > > > Signed-off-by: Tiwei Bie > > --- > > docs/interop/vhost-user.txt| 57 ++ > > hw/vfio/common.c | 2 +- > >

[Qemu-devel] [RFC v2 0/4] Supporting programming IOMMU in QEMU (vDPA/vhost-user)

2018-09-18 Thread Tiwei Bie
_PID" More details can be found from the patches. Thanks! RFC -> RFC v2: - Share VFIO container fd instead of group fd to QEMU; - Extend libvhost-user and vhost-user-bridge for testing; Tiwei Bie (4): vfio: support creating VFIOContainer directly vhost-user: support programming VFIO

[Qemu-devel] [RFC v2 1/4] vfio: support creating VFIOContainer directly

2018-09-18 Thread Tiwei Bie
that process wants to do the IOMMU programming based on a QMEU device's DMA address space. Signed-off-by: Tiwei Bie --- hw/vfio/common.c | 164 +- hw/vfio/trace-events | 2 + include/hw/vfio/vfio-common.h | 9 ++ 3 files changed, 174

[Qemu-devel] [RFC v2 2/4] vhost-user: support programming VFIO container in master

2018-09-18 Thread Tiwei Bie
ssage to ask master to do the IOMMU programming in QEMU for the vDPA device in backend. Signed-off-by: Tiwei Bie --- docs/interop/vhost-user.txt| 21 hw/virtio/vhost-user.c | 45 ++ include/hw/virtio/vhost-user.h | 2 ++ 3 files change

[Qemu-devel] [RFC v2 4/4] vhost-user-bridge: support VFIO container message

2018-09-18 Thread Tiwei Bie
This patch introduces the VFIO container message support in vhost-user-bridge. A new option (-G) is added to set the VFIO container for the vhost device. This is mainly used to test the VFIO container message implementation in vhost user. Signed-off-by: Tiwei Bie --- tests/vhost-user-bridge.c

[Qemu-devel] [RFC v2 3/4] libvhost-user: support VFIO container message

2018-09-18 Thread Tiwei Bie
This patch introduces the VFIO container message support in libvhost-user. A new API is added to support setting the VFIO container for the vhost device. Signed-off-by: Tiwei Bie --- contrib/libvhost-user/libvhost-user.c | 29 ++- contrib/libvhost-user/libvhost-user.h

Re: [Qemu-devel] [RFC v3 00/12] packed ring virtio-net userspace backend support

2018-11-21 Thread Tiwei Bie
Hi Wei, FYI, the latest packed ring series for guest driver doesn't set the _F_NEXT bit for indirect descriptors any more. So below hack in guest driver is needed to make it work with this series: diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index cd7e755484e3..42faea7

Re: [Qemu-devel] [PATCH v3 0/6] Extend vhost-user to support registering external host notifiers

2018-05-15 Thread Tiwei Bie
On Wed, May 16, 2018 at 04:41:48AM +0300, Michael S. Tsirkin wrote: > On Thu, Apr 12, 2018 at 11:12:26PM +0800, Tiwei Bie wrote: > > The original subject is: Extend vhost-user to support VFIO based > > accelerators > > > > Update notes > > > >

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v3 3/6] vhost-user: support receiving file descriptors in slave_read

2018-05-23 Thread Tiwei Bie
On Thu, May 24, 2018 at 12:25:23AM +0300, Michael S. Tsirkin wrote: > On Thu, Apr 12, 2018 at 11:12:29PM +0800, Tiwei Bie wrote: > > Signed-off-by: Tiwei Bie > > > Thinking about it, I think we should add a protocol > feature for this. This way remote can find out whethe

Re: [Qemu-devel] [PATCH v3 2/6] vhost-user: introduce shared vhost-user state

2018-05-23 Thread Tiwei Bie
On Wed, May 23, 2018 at 06:43:29PM +0300, Michael S. Tsirkin wrote: > On Wed, May 23, 2018 at 06:36:05PM +0300, Michael S. Tsirkin wrote: > > On Wed, May 23, 2018 at 04:44:51PM +0300, Michael S. Tsirkin wrote: > > > On Thu, Apr 12, 2018 at 11:12:28PM +0800, Tiwei Bie wrote:

Re: [Qemu-devel] [PATCH v3 2/6] vhost-user: introduce shared vhost-user state

2018-05-23 Thread Tiwei Bie
On Thu, May 24, 2018 at 07:21:01AM +0800, Tiwei Bie wrote: > On Wed, May 23, 2018 at 06:43:29PM +0300, Michael S. Tsirkin wrote: > > On Wed, May 23, 2018 at 06:36:05PM +0300, Michael S. Tsirkin wrote: > > > On Wed, May 23, 2018 at 04:44:51PM +0300, Michael S. Tsirkin wrote: >

Re: [Qemu-devel] [PATCH v3 2/6] vhost-user: introduce shared vhost-user state

2018-05-24 Thread Tiwei Bie
On Thu, May 24, 2018 at 10:24:40AM +0800, Tiwei Bie wrote: [...] > > > + > > > qemu_purge_queued_packets(nc); > > > } > > > > > > @@ -341,7 +342,6 @@ err: > > > if (user) { > > > vhost_user_cleanup(user); &

[Qemu-devel] [PATCH 0/6] Support host notifiers in vhost-user

2018-05-24 Thread Tiwei Bie
.html Best regards, Tiwei Bie Tiwei Bie (6): vhost: allow backends to filter memory sections vhost-user: allow slave to send fds via slave channel vhost-user: introduce shared vhost-user state vhost-user: support registering external host notifiers libvhost-user: support host notifier

[Qemu-devel] [PATCH 4/6] vhost-user: support registering external host notifiers

2018-05-24 Thread Tiwei Bie
This patch introduces VHOST_USER_PROTOCOL_F_HOST_NOTIFIER. With this feature negotiated, vhost-user backend can register memory region based host notifiers. And it will allow the guest driver in the VM to notify the hardware accelerator at the vhost-user backend directly. Signed-off-by: Tiwei Bie

[Qemu-devel] [PATCH 3/6] vhost-user: introduce shared vhost-user state

2018-05-24 Thread Tiwei Bie
-by: Tiwei Bie Signed-off-by: Michael S. Tsirkin --- backends/cryptodev-vhost-user.c | 20 - hw/block/vhost-user-blk.c | 22 ++- hw/scsi/vhost-user-scsi.c | 20 - hw/virtio/Makefile.objs | 2 +- hw/virtio/vhost-stub.c

[Qemu-devel] [PATCH 1/6] vhost: allow backends to filter memory sections

2018-05-24 Thread Tiwei Bie
This patch introduces a vhost op for vhost backends to allow them to filter the memory sections that they can handle. Signed-off-by: Tiwei Bie --- hw/virtio/vhost-user.c| 11 +++ hw/virtio/vhost.c | 9 +++-- include/hw/virtio/vhost-backend.h | 4 3

[Qemu-devel] [PATCH 2/6] vhost-user: allow slave to send fds via slave channel

2018-05-24 Thread Tiwei Bie
Introduce VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD protocol feature to allow slave to send at most 8 descriptors in each message to master via ancillary data using the slave channel. Suggested-by: Michael S. Tsirkin Signed-off-by: Tiwei Bie --- docs/interop/vhost-user.txt | 5 + hw/virtio

[Qemu-devel] [PATCH 5/6] libvhost-user: support host notifier

2018-05-24 Thread Tiwei Bie
This patch introduces the host notifier support in libvhost-user. A new API is added to support setting host notifier for each queue. Signed-off-by: Tiwei Bie --- contrib/libvhost-user/libvhost-user.c | 81 --- contrib/libvhost-user/libvhost-user.h | 32 +++ 2

[Qemu-devel] [PATCH 6/6] vhost-user-bridge: support host notifier

2018-05-24 Thread Tiwei Bie
This patch introduces the host notifier support in vhost-user-bridge. A new option (-H) is added to use the host notifier. This is mainly used to test the host notifier implementation in vhost user. Signed-off-by: Tiwei Bie --- tests/vhost-user-bridge.c | 98

Re: [Qemu-devel] [PATCH v3 2/6] vhost-user: introduce shared vhost-user state

2018-05-24 Thread Tiwei Bie
On Thu, May 24, 2018 at 10:24:40AM +0800, Tiwei Bie wrote: > On Thu, May 24, 2018 at 07:21:01AM +0800, Tiwei Bie wrote: > > On Wed, May 23, 2018 at 06:43:29PM +0300, Michael S. Tsirkin wrote: > > > On Wed, May 23, 2018 at 06:36:05PM +0300, Michael S. Tsirkin wrote: > > >

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v3 2/6] vhost-user: introduce shared vhost-user state

2018-05-24 Thread Tiwei Bie
On Thu, May 24, 2018 at 04:55:04PM +0300, Michael S. Tsirkin wrote: > On Thu, May 24, 2018 at 06:59:36PM +0800, Tiwei Bie wrote: > > On Thu, May 24, 2018 at 10:24:40AM +0800, Tiwei Bie wrote: > > > On Thu, May 24, 2018 at 07:21:01AM +0800, Tiwei Bie wrote: > > > >

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v3 3/6] vhost-user: support receiving file descriptors in slave_read

2018-05-24 Thread Tiwei Bie
On Thu, May 24, 2018 at 04:48:09PM +0300, Michael S. Tsirkin wrote: > On Thu, May 24, 2018 at 07:12:15AM +0800, Tiwei Bie wrote: > > On Thu, May 24, 2018 at 12:25:23AM +0300, Michael S. Tsirkin wrote: > > > On Thu, Apr 12, 2018 at 11:12:29PM +0800, Tiwei Bie wrote: > > >

Re: [Qemu-devel] [PATCH v3 2/6] vhost-user: introduce shared vhost-user state

2018-05-24 Thread Tiwei Bie
On Thu, May 24, 2018 at 05:30:45PM +0300, Michael S. Tsirkin wrote: > On Thu, May 24, 2018 at 06:59:36PM +0800, Tiwei Bie wrote: > > On Thu, May 24, 2018 at 10:24:40AM +0800, Tiwei Bie wrote: > > > On Thu, May 24, 2018 at 07:21:01AM +0800, Tiwei Bie wrote: > > > >

Re: [Qemu-devel] [PATCH 4/6] vhost-user: support registering external host notifiers

2018-05-24 Thread Tiwei Bie
On Thu, May 24, 2018 at 06:49:47PM +0300, Michael S. Tsirkin wrote: > On Thu, May 24, 2018 at 06:33:34PM +0800, Tiwei Bie wrote: > > This patch introduces VHOST_USER_PROTOCOL_F_HOST_NOTIFIER. > > With this feature negotiated, vhost-user backend can register > > memory region

Re: [Qemu-devel] [PATCH 4/6] vhost-user: support registering external host notifiers

2018-05-24 Thread Tiwei Bie
On Thu, May 24, 2018 at 07:15:24PM +0300, Michael S. Tsirkin wrote: > On Fri, May 25, 2018 at 12:05:50AM +0800, Tiwei Bie wrote: > > On Thu, May 24, 2018 at 06:49:47PM +0300, Michael S. Tsirkin wrote: > > > On Thu, May 24, 2018 at 06:33:34PM +0800, Tiwei Bie wrote: > > &

[Qemu-devel] [PATCH v2 4/5] libvhost-user: support host notifier

2018-05-25 Thread Tiwei Bie
This patch introduces the host notifier support in libvhost-user. A new API is added to support setting host notifier for each queue. Signed-off-by: Tiwei Bie --- contrib/libvhost-user/libvhost-user.c | 80 --- contrib/libvhost-user/libvhost-user.h | 31 +++ 2

[Qemu-devel] [PATCH v2 5/5] vhost-user-bridge: support host notifier

2018-05-25 Thread Tiwei Bie
This patch introduces the host notifier support in vhost-user-bridge. A new option (-H) is added to use the host notifier. This is mainly used to test the host notifier implementation in vhost user. Signed-off-by: Tiwei Bie --- tests/vhost-user-bridge.c | 98

[Qemu-devel] [PATCH v2 0/5] Support host notifiers in vhost-user

2018-05-25 Thread Tiwei Bie
ser, only save VhostUserState in queue index 0, i.e. where `chr` is saved; - In PATCH 4/5, check VHOST_USER_PROTOCOL_F_HOST_NOTIFIER before sending msg (including fd) to master; (MST) Tiwei Bie (5): vhost: allow backends to filter memory sections vhost-user: introduce shared vhost-user st

[Qemu-devel] [PATCH v2 2/5] vhost-user: introduce shared vhost-user state

2018-05-25 Thread Tiwei Bie
-by: Tiwei Bie Signed-off-by: Michael S. Tsirkin --- backends/cryptodev-vhost-user.c | 20 +- hw/block/vhost-user-blk.c | 22 ++- hw/scsi/vhost-user-scsi.c | 20 +- hw/virtio/Makefile.objs | 2 +- hw/virtio/vhost-stub.c | 10

[Qemu-devel] [PATCH v2 3/5] vhost-user: support registering external host notifiers

2018-05-25 Thread Tiwei Bie
This patch introduces VHOST_USER_PROTOCOL_F_HOST_NOTIFIER. With this feature negotiated, vhost-user backend can register memory region based host notifiers. And it will allow the guest driver in the VM to notify the hardware accelerator at the vhost-user backend directly. Signed-off-by: Tiwei Bie

[Qemu-devel] [PATCH v2 1/5] vhost: allow backends to filter memory sections

2018-05-25 Thread Tiwei Bie
This patch introduces a vhost op for vhost backends to allow them to filter the memory sections that they can handle. Signed-off-by: Tiwei Bie --- hw/virtio/vhost-user.c| 11 +++ hw/virtio/vhost.c | 9 +++-- include/hw/virtio/vhost-backend.h | 4 3

Re: [Qemu-devel] [PATCH v2 3/5] vhost-user: support registering external host notifiers

2018-05-25 Thread Tiwei Bie
On Fri, May 25, 2018 at 07:26:05PM +0800, Jason Wang wrote: > On 2018年05月25日 19:04, Tiwei Bie wrote: [...] > > +static int vhost_user_slave_handle_vring_host_notifier(struct vhost_dev > > *dev, > > + VhostUse

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-09-12 Thread Tiwei Bie
his case, backend won't need to close any fd. But there is one problem that, it's hard to unmap the old mappings, especially when QEMU crashes. Do you have any suggestions? Thanks! Best regards, Tiwei Bie

[Qemu-devel] [PATCH] vhost: check region type before casting

2018-07-20 Thread Tiwei Bie
iommu: Add IOMMU index argument to notifier APIs") Cc: Peter Maydell Signed-off-by: Tiwei Bie --- hw/virtio/vhost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index b129cb9ddd..d4cb5894a8 100644 --- a/hw/virtio/vhost.c +++ b

[Qemu-devel] [RFC 1/3] vfio: split vfio_get_group() into small functions

2018-07-22 Thread Tiwei Bie
This patch splits vfio_get_group() into small functions. It makes it easier to implement other vfio_get_group*() functions in the future. Signed-off-by: Tiwei Bie --- hw/vfio/common.c | 83 1 file changed, 55 insertions(+), 28 deletions(-) diff

[Qemu-devel] [RFC 2/3] vfio: support getting VFIOGroup from groupfd

2018-07-22 Thread Tiwei Bie
This patch introduces an API to support getting VFIOGroup from groupfd. This is useful when the groupfd is opened and shared by another process via UNIX socket. Signed-off-by: Tiwei Bie --- hw/vfio/common.c | 44 +++ include/hw/vfio/vfio-common.h

[Qemu-devel] [RFC 0/3] Supporting programming IOMMU in QEMU (vDPA/vhost-user)

2018-07-22 Thread Tiwei Bie
o ask master to do IOMMU programming in QEMU for the vDPA device in backend. This is helpful to support vIOMMU in vDPA. Tiwei Bie (3): vfio: split vfio_get_group() into small functions vfio: support getting VFIOGroup from groupfd vhost-user: support programming VFIO group in master docs/interop/

[Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-07-22 Thread Tiwei Bie
ng in QEMU for the vDPA device in backend. Signed-off-by: Tiwei Bie --- docs/interop/vhost-user.txt| 16 ++ hw/virtio/vhost-user.c | 40 ++ include/hw/virtio/vhost-user.h | 2 ++ 3 files changed, 58 insertions(+) diff --git a/docs/interop/

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-07-23 Thread Tiwei Bie
On Mon, Jul 23, 2018 at 12:19:04PM +0300, Michael S. Tsirkin wrote: > On Mon, Jul 23, 2018 at 12:59:56PM +0800, Tiwei Bie wrote: [...] > > @@ -815,6 +816,21 @@ Slave message types > >This request should be sent only when > > VHOST_USER_PROTOCOL_F_HOST_NOTIFIER > &

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-07-23 Thread Tiwei Bie
On Mon, Jul 23, 2018 at 12:20:12PM +0300, Michael S. Tsirkin wrote: > On Mon, Jul 23, 2018 at 12:59:56PM +0800, Tiwei Bie wrote: [...] > > > > +static int vhost_user_slave_handle_vfio_group(struct vhost_dev *dev, > > + int *fd) &

[Qemu-devel] [PATCH 0/2] Support host notifier in libvhost-user and vhost-user-bridge

2018-04-26 Thread Tiwei Bie
t,id=char0,path=/tmp/vubr.sock \ -netdev type=vhost-user,id=net0,chardev=char0 \ -device virtio-net-pci,netdev=net0,page-per-vq=on More details can be found from the patches. Thanks! [1] http://lists.nongnu.org/archive/html/qemu-devel/2018-04/msg01779.html Tiwei Bie (2): libvhos

[Qemu-devel] [PATCH 1/2] libvhost-user: support host notifier

2018-04-26 Thread Tiwei Bie
This patch introduces the host notifier support in libvhost-user. A new API is added to support setting host notifier for each queue. Signed-off-by: Tiwei Bie --- contrib/libvhost-user/libvhost-user.c | 76 +++ contrib/libvhost-user/libvhost-user.h | 31

[Qemu-devel] [PATCH 2/2] vhost-user-bridge: support host notifier

2018-04-26 Thread Tiwei Bie
This patch introduces the host notifier support in vhost-user-bridge. A new option (-H) is added to use the host notifier. This is mainly used to test the host notifier implementation in vhost user. Signed-off-by: Tiwei Bie --- tests/vhost-user-bridge.c | 98

Re: [Qemu-devel] [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-05-02 Thread Tiwei Bie
On Thu, Apr 19, 2018 at 07:14:39PM +0800, Tiwei Bie wrote: > On Wed, Apr 18, 2018 at 07:34:06PM +0300, Michael S. Tsirkin wrote: > > On Thu, Apr 12, 2018 at 11:12:32PM +0800, Tiwei Bie wrote: > > > This patch introduces VHOST_USER_PROTOCOL_F_HOST_NOTIFIER. > > > With thi

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-07-26 Thread Tiwei Bie
On Thu, Jul 26, 2018 at 02:45:39PM -0600, Alex Williamson wrote: > On Mon, 23 Jul 2018 12:59:56 +0800 > Tiwei Bie wrote: > [...] > > > > +static int vhost_user_slave_handle_vfio_group(struct vhost_dev *dev, > > + int

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-07-30 Thread Tiwei Bie
On Fri, Jul 27, 2018 at 02:03:00PM -0600, Alex Williamson wrote: > On Fri, 27 Jul 2018 09:58:05 +0800 > Tiwei Bie wrote: > > > On Thu, Jul 26, 2018 at 02:45:39PM -0600, Alex Williamson wrote: > > > On Mon, 23 Jul 2018 12:59:56 +080

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-07-31 Thread Tiwei Bie
On Mon, Jul 30, 2018 at 12:30:58PM +0300, Michael S. Tsirkin wrote: > On Mon, Jul 30, 2018 at 04:10:04PM +0800, Tiwei Bie wrote: > > On Fri, Jul 27, 2018 at 02:03:00PM -0600, Alex Williamson wrote: > > > On Fri, 27 Jul 2018 09:58:05 +0800 > > > Tiwei Bie wrote: > >

Re: [Qemu-devel] [PATCH] vhost: check region type before casting

2018-08-01 Thread Tiwei Bie
Ping.. It seems that the final release for QEMU 3.0 will be out soon [1]. But this fix hasn't been merged yet. [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg06004.html Thanks, Tiwei On Fri, Jul 20, 2018 at 04:36:44PM +0800, Tiwei Bie wrote: > Check region type firs

Re: [Qemu-devel] [PATCH] vhost: check region type before casting

2018-08-01 Thread Tiwei Bie
On Wed, Aug 01, 2018 at 11:13:34AM +0100, Peter Maydell wrote: > On 1 August 2018 at 09:22, Tiwei Bie wrote: > > Ping.. > > > > It seems that the final release for QEMU 3.0 will be > > out soon [1]. But this fix hasn't been merged yet. > > > > [1] http

Re: [Qemu-devel] [PATCH v3 04/26] vhost-user: simplify vhost_user_init/vhost_user_cleanup

2018-06-21 Thread Tiwei Bie
) > return true; > } > > -VhostUserState *vhost_user_init(void) > +bool vhost_user_init(VhostUserState *user, CharBackend *chr, Error **errp) > { > return NULL; It would be better to return false. Best regards, Tiwei Bie > } [...]

Re: [Qemu-devel] [PATCH v3 04/26] vhost-user: simplify vhost_user_init/vhost_user_cleanup

2018-06-21 Thread Tiwei Bie
On Thu, Jun 21, 2018 at 02:48:08PM +0200, Marc-André Lureau wrote: > On Thu, Jun 21, 2018 at 2:33 PM, Tiwei Bie wrote: > > On Mon, Jun 18, 2018 at 06:17:07PM +0200, Marc-André Lureau wrote: > > [...] > >> diff --git a/hw/virtio/vhost-stub.c b/hw/virtio/vhost-stub

[Qemu-devel] [PATCH v2 3/6] virtio: support adding sub-regions for notify region

2018-03-19 Thread Tiwei Bie
Provide APIs to support querying whether the page-per-vq is enabled and adding sub-regions for notify region. Signed-off-by: Tiwei Bie --- Makefile.target| 4 hw/virtio/virtio-pci.c | 48 ++ hw/virtio/virtio-pci.h | 5

[Qemu-devel] [PATCH v2 2/6] vhost-user: introduce shared vhost-user state

2018-03-19 Thread Tiwei Bie
When multi-queue is enabled for virtio-net, each virtio queue pair will have a vhost_dev, and the only thing they share currently is the chardev. This patch introduces a vhost-user state structure which will be shared by all virtio queue pairs of the same virtio device. Signed-off-by: Tiwei Bie

[Qemu-devel] [PATCH v2 0/6] Extend vhost-user to support VFIO based accelerators

2018-03-19 Thread Tiwei Bie
O group management code into vfio/common.c (Alex) - Various refinements; (approximately sorted by comment posting time) Tiwei Bie (6): vhost-user: support receiving file descriptors in slave_read vhost-user: introduce shared vhost-user state virtio: support adding sub-regions for notify region

[Qemu-devel] [PATCH v2 1/6] vhost-user: support receiving file descriptors in slave_read

2018-03-19 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- hw/virtio/vhost-user.c | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 41ff5cff41..1ad6caa6a3 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost

[Qemu-devel] [PATCH v2 4/6] vfio: support getting VFIOGroup from groupfd

2018-03-19 Thread Tiwei Bie
Add an API to support getting VFIOGroup from groupfd. When groupfd is shared by another process, the VFIOGroup may not have its container and address space in QEMU. Besides, add a reference counter to better support getting VFIOGroup multiple times. Signed-off-by: Tiwei Bie --- hw/vfio

[Qemu-devel] [PATCH v2 5/6] vfio: remove DPRINTF() definition from vfio-common.h

2018-03-19 Thread Tiwei Bie
This macro isn't used by any VFIO code. And its name is too generic. The vfio-common.h (in include/hw/vfio) can be included by other modules in QEMU. It can introduce conflicts. Signed-off-by: Tiwei Bie --- include/hw/vfio/vfio-common.h | 9 - 1 file changed, 9 deletions(-) diff

[Qemu-devel] [PATCH v2 6/6] vhost-user: add VFIO based accelerators support

2018-03-19 Thread Tiwei Bie
e VMs. This commit extends vhost-user to better support connecting to e.g. a user-space switch that has an accelerator. Signed-off-by: Tiwei Bie --- docs/interop/vhost-user.txt| 57 hw/virtio/vhost-user.c | 198 + include/hw/virtio/

Re: [Qemu-devel] [virtio-dev] [RFC 0/3] Extend vhost-user to support VFIO based accelerators

2018-01-03 Thread Tiwei Bie
On Wed, Jan 03, 2018 at 10:34:36PM +0800, Jason Wang wrote: > On 2017年12月22日 14:41, Tiwei Bie wrote: > > This RFC patch set does some small extensions to vhost-user protocol > > to support VFIO based accelerators, and makes it possible to get the > > similar performance o

[Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-11 Thread Tiwei Bie
queries from backend. This is helpful when using a hardware accelerator which is not able to handle unknown IOVAs at the vhost-user backend. Signed-off-by: Tiwei Bie --- The idea of this patch is to let QEMU push all the IOTLBs to vhost-user backend without waiting for the queries from the backend

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-11 Thread Tiwei Bie
Hi Peter, On Wed, Apr 11, 2018 at 04:00:36PM +0800, Peter Xu wrote: > On Wed, Apr 11, 2018 at 03:20:27PM +0800, Tiwei Bie wrote: > > [...] > > > This is just a RFC for now. It seems that, it doesn't work > > as expected when guest is using kernel driver (To handle

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-11 Thread Tiwei Bie
On Wed, Apr 11, 2018 at 04:01:19PM +0800, Jason Wang wrote: > On 2018年04月11日 15:20, Tiwei Bie wrote: > > This patch introduces VHOST_USER_PROTOCOL_F_NEED_ALL_IOTLB > > feature for vhost-user. By default, vhost-user backend needs > > to query the IOTLBs from QEMU after

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-11 Thread Tiwei Bie
On Wed, Apr 11, 2018 at 04:37:16PM +0800, Peter Xu wrote: > On Wed, Apr 11, 2018 at 04:25:56PM +0800, Tiwei Bie wrote: > > On Wed, Apr 11, 2018 at 04:00:36PM +0800, Peter Xu wrote: > > > On Wed, Apr 11, 2018 at 03:20:27PM +0800, Tiwei Bie wrote: > > > > > > [..

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-11 Thread Tiwei Bie
On Wed, Apr 11, 2018 at 05:16:47PM +0800, Peter Xu wrote: > On Wed, Apr 11, 2018 at 04:55:25PM +0800, Tiwei Bie wrote: > > On Wed, Apr 11, 2018 at 04:37:16PM +0800, Peter Xu wrote: > > > On Wed, Apr 11, 2018 at 04:25:56PM +0800, Tiwei Bie wrote: > > > > On Wed, Ap

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-11 Thread Tiwei Bie
On Wed, Apr 11, 2018 at 04:22:21PM +0300, Michael S. Tsirkin wrote: > On Wed, Apr 11, 2018 at 03:20:27PM +0800, Tiwei Bie wrote: > > This patch introduces VHOST_USER_PROTOCOL_F_NEED_ALL_IOTLB > > feature for vhost-user. By default, vhost-user backend needs > > to query the I

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-11 Thread Tiwei Bie
On Thu, Apr 12, 2018 at 04:29:29AM +0300, Michael S. Tsirkin wrote: > On Thu, Apr 12, 2018 at 09:10:59AM +0800, Tiwei Bie wrote: > > On Wed, Apr 11, 2018 at 04:22:21PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Apr 11, 2018 at 03:20:27PM +0800, Tiwei Bie wrote: > > &

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-11 Thread Tiwei Bie
On Wed, Apr 11, 2018 at 08:37:17PM +0300, Michael S. Tsirkin wrote: > On Wed, Apr 11, 2018 at 04:38:53PM +0800, Tiwei Bie wrote: > > On Wed, Apr 11, 2018 at 04:01:19PM +0800, Jason Wang wrote: > > > On 2018年04月11日 15:20, Tiwei Bie wrote: > > &

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-11 Thread Tiwei Bie
On Thu, Apr 12, 2018 at 04:57:13AM +0300, Michael S. Tsirkin wrote: > On Thu, Apr 12, 2018 at 09:39:43AM +0800, Tiwei Bie wrote: > > On Thu, Apr 12, 2018 at 04:29:29AM +0300, Michael S. Tsirkin wrote: > > > On Thu, Apr 12, 2018 at 09:10:59AM +0800, Tiwei Bie wrote: > > >

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-12 Thread Tiwei Bie
On Thu, Apr 12, 2018 at 03:38:50PM +0800, Jason Wang wrote: > On 2018年04月12日 09:44, Tiwei Bie wrote: > > On Wed, Apr 11, 2018 at 08:37:17PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Apr 11, 2018 at 04:38:53PM +0800, Tiwei Bie wrote: > > > > On Wed, Apr 11, 2018 a

[Qemu-devel] [PATCH v3 1/6] vhost-user: add Net prefix to internal state structure

2018-04-12 Thread Tiwei Bie
We are going to introduce a shared vhost user state which will be named as 'VhostUserState'. So add 'Net' prefix to the existing internal state structure in the vhost-user netdev to avoid conflict. Signed-off-by: Tiwei Bie --- net/vhost-user.c | 38 +++---

[Qemu-devel] [PATCH v3 0/6] Extend vhost-user to support registering external host notifiers

2018-04-12 Thread Tiwei Bie
stuffs out of vhost-user (Jason) - Handle the virtual IOMMU case (Jason) - Move VFIO group management code into vfio/common.c (Alex) - Various refinements; (approximately sorted by comment posting time) Tiwei Bie (6): vhost-user: add Net prefix to internal state structure vhost-user: introduce

[Qemu-devel] [PATCH v3 4/6] virtio: support setting memory region based host notifier

2018-04-12 Thread Tiwei Bie
directly. Signed-off-by: Tiwei Bie --- hw/virtio/virtio-pci.c | 22 ++ hw/virtio/virtio.c | 13 + include/hw/virtio/virtio-bus.h | 2 ++ include/hw/virtio/virtio.h | 2 ++ 4 files changed, 39 insertions(+) diff --git a/hw/virtio/virtio-pci.c b

[Qemu-devel] [PATCH v3 5/6] vhost: allow backends to filter memory sections

2018-04-12 Thread Tiwei Bie
This patch introduces a vhost op for vhost backends to allow them to filter the memory sections that they can handle. Signed-off-by: Tiwei Bie --- hw/virtio/vhost-user.c| 11 +++ hw/virtio/vhost.c | 9 +++-- include/hw/virtio/vhost-backend.h | 4 3

[Qemu-devel] [PATCH v3 2/6] vhost-user: introduce shared vhost-user state

2018-04-12 Thread Tiwei Bie
-by: Tiwei Bie --- backends/cryptodev-vhost-user.c | 20 ++- hw/block/vhost-user-blk.c | 22 +++- hw/scsi/vhost-user-scsi.c | 20 ++- hw/virtio/Makefile.objs | 2 +- hw/virtio/vhost-stub.c | 10

[Qemu-devel] [PATCH v3 3/6] vhost-user: support receiving file descriptors in slave_read

2018-04-12 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- hw/virtio/vhost-user.c | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 91edd95453..9cea2c8c51 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost

[Qemu-devel] [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-12 Thread Tiwei Bie
This patch introduces VHOST_USER_PROTOCOL_F_HOST_NOTIFIER. With this feature negotiated, vhost-user backend can register memory region based host notifiers. And it will allow the guest driver in the VM to notify the hardware accelerator at the vhost-user backend directly. Signed-off-by: Tiwei Bie

Re: [Qemu-devel] [RFC] vhost-user: introduce F_NEED_ALL_IOTLB protocol feature

2018-04-16 Thread Tiwei Bie
On Mon, Apr 16, 2018 at 03:47:06PM +0800, Stefan Hajnoczi wrote: > On Wed, Apr 11, 2018 at 03:20:27PM +0800, Tiwei Bie wrote: > > This patch introduces VHOST_USER_PROTOCOL_F_NEED_ALL_IOTLB > > Naming suggestion: "PREFILL_IOTLB" instead of "NEED_ALL_IOTLB"

Re: [Qemu-devel] [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Tiwei Bie
On Wed, Apr 18, 2018 at 07:34:06PM +0300, Michael S. Tsirkin wrote: > On Thu, Apr 12, 2018 at 11:12:32PM +0800, Tiwei Bie wrote: > > This patch introduces VHOST_USER_PROTOCOL_F_HOST_NOTIFIER. > > With this feature negotiated, vhost-user backend can register > > memory region

[Qemu-devel] [RFC 1/3] vhost-user: support receiving file descriptors in slave_read

2017-12-21 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- hw/virtio/vhost-user.c | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 093675ed98..e7108138fd 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost

[Qemu-devel] [RFC 2/3] vhost-user: introduce shared vhost-user state

2017-12-21 Thread Tiwei Bie
When multi-queue is enabled for virtio-net, each virtio queue pair will have a vhost_dev, and the only thing they share currently is the chardev. This patch introduces a vhost-user state structure which will be shared by all virtio queue pairs of the same virtio device. Signed-off-by: Tiwei Bie

[Qemu-devel] [RFC 0/3] Extend vhost-user to support VFIO based accelerators

2017-12-21 Thread Tiwei Bie
ion details can be found from the last patch. There are some rough edges in this patch set (so this is a RFC patch set for now), but it's never too early to hear the thoughts from the community! So any comments and suggestions would be really appreciated! Tiwei Bie (3): vhost-user: su

[Qemu-devel] [RFC 3/3] vhost-user: add VFIO based accelerators support

2017-12-21 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- docs/interop/vhost-user.txt| 57 ++ hw/vfio/common.c | 2 +- hw/virtio/vhost-user.c | 381 - hw/virtio/vhost.c | 3 +- hw/virtio/virtio-pci.c | 8 - hw/virtio/virtio

Re: [Qemu-devel] [PATCH v2 0/6] Extend vhost-user to support VFIO based accelerators

2018-03-23 Thread Tiwei Bie
On Thu, Mar 22, 2018 at 04:55:39PM +0200, Michael S. Tsirkin wrote: > On Mon, Mar 19, 2018 at 03:15:31PM +0800, Tiwei Bie wrote: > > This patch set does some small extensions to vhost-user protocol > > to support VFIO based accelerators, and makes it possible to get > > the s

Re: [Qemu-devel] [PATCH v2 6/6] vhost-user: add VFIO based accelerators support

2018-03-27 Thread Tiwei Bie
On Thu, Mar 22, 2018 at 06:19:44PM +0200, Michael S. Tsirkin wrote: > On Mon, Mar 19, 2018 at 03:15:37PM +0800, Tiwei Bie wrote: [...] > > diff --git a/docs/interop/vhost-user.txt b/docs/interop/vhost-user.txt > > index cb3a7595aa..264a58a800 100644 > > --- a/docs/interop/vho

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v2 2/6] vhost-user: introduce shared vhost-user state

2018-03-27 Thread Tiwei Bie
On Thu, Mar 22, 2018 at 05:13:41PM +0200, Michael S. Tsirkin wrote: > On Mon, Mar 19, 2018 at 03:15:33PM +0800, Tiwei Bie wrote: > > @@ -22,7 +23,7 @@ > > > > typedef struct VhostUserState { > > NetClientState nc; > > -CharBackend chr; /* only qu

Re: [Qemu-devel] [virtio-dev] Re: [PATCH v2 5/6] vfio: remove DPRINTF() definition from vfio-common.h

2018-03-27 Thread Tiwei Bie
On Thu, Mar 22, 2018 at 05:15:30PM +0200, Michael S. Tsirkin wrote: > On Mon, Mar 19, 2018 at 03:15:36PM +0800, Tiwei Bie wrote: > > This macro isn't used by any VFIO code. And its name is > > too generic. The vfio-common.h (in include/hw/vfio) can > > be included by oth

Re: [Qemu-devel] [PATCH v2 3/6] virtio: support adding sub-regions for notify region

2018-03-27 Thread Tiwei Bie
On Thu, Mar 22, 2018 at 04:57:23PM +0200, Michael S. Tsirkin wrote: > On Mon, Mar 19, 2018 at 03:15:34PM +0800, Tiwei Bie wrote: [...] > > + > > +bool virtio_pci_page_per_vq_enabled(VirtIODevice *vdev) > > +{ > > +VirtIOPCIProxy *proxy = virtio_devi

  1   2   >