[virtio-dev] Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-19 Thread Jason Wang
On 2018年04月20日 02:40, Michael S. Tsirkin wrote: On Tue, Apr 10, 2018 at 03:25:45PM +0800, Jason Wang wrote: One problem is that, different virtio ring compatible devices may have different device interfaces. That is to say, we will need different drivers in QEMU. It could be troublesome. And t

[virtio-dev] Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-19 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 11:28:07AM +0800, Tiwei Bie wrote: > On Thu, Apr 19, 2018 at 09:40:23PM +0300, Michael S. Tsirkin wrote: > > On Tue, Apr 10, 2018 at 03:25:45PM +0800, Jason Wang wrote: > > > > > > One problem is that, different virtio ring compatible devices > > > > > > may have different d

[virtio-dev] RE: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-19 Thread Liang, Cunming
> -Original Message- > From: Bie, Tiwei > Sent: Friday, April 20, 2018 11:28 AM > To: Michael S. Tsirkin > Cc: Jason Wang ; alex.william...@redhat.com; > ddut...@redhat.com; Duyck, Alexander H ; > virtio-dev@lists.oasis-open.org; linux-ker...@vger.kernel.org; > k...@vger.kernel.org; virt

[virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala wrote: > +static struct net_device *failover_get_bymac(u8 *mac, struct failover_ops > **ops) > +{ > + struct net_device *failover_dev; > + struct failover *failover; > + > + spin_lock(&failover_lock); > + list_for_each_ent

[virtio-dev] Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-19 Thread Tiwei Bie
On Thu, Apr 19, 2018 at 09:40:23PM +0300, Michael S. Tsirkin wrote: > On Tue, Apr 10, 2018 at 03:25:45PM +0800, Jason Wang wrote: > > > > > One problem is that, different virtio ring compatible devices > > > > > may have different device interfaces. That is to say, we will > > > > > need different

RE: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Liang, Cunming
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Friday, April 20, 2018 12:56 AM > To: Liang, Cunming > Cc: Paolo Bonzini ; Bie, Tiwei ; > jasow...@redhat.com; alex.william...@redhat.com; stefa...@redhat.com; > qemu-de...@nongnu.org; virtio-dev@lists.oasis

[virtio-dev] Re: [PATCH v7 net-next 3/4] virtio_net: Extend virtio to use VF datapath when available

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:03PM -0700, Sridhar Samudrala wrote: > @@ -3010,6 +3043,7 @@ static __init int virtio_net_driver_init(void) > ret = register_virtio_driver(&virtio_net_driver); > if (ret) > goto err_virtio; > + > return 0; > err_virtio: > cpuhp

[virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala wrote: > This provides a generic interface for paravirtual drivers to listen > for netdev register/unregister/link change events from pci ethernet > devices with the same MAC and takeover their datapath. The notifier and > event handling c

[virtio-dev] [PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework

2018-04-19 Thread Sridhar Samudrala
Use the registration/notification framework supported by the generic failover infrastructure. Signed-off-by: Sridhar Samudrala --- drivers/net/hyperv/Kconfig | 1 + drivers/net/hyperv/hyperv_net.h | 2 + drivers/net/hyperv/netvsc_drv.c | 208 ++-- 3 f

[virtio-dev] [PATCH net-next v7 0/4] Enable virtio_net to act as a standby for a passthru device

2018-04-19 Thread Sridhar Samudrala
The main motivation for this patch is to enable cloud service providers to provide an accelerated datapath to virtio-net enabled VMs in a transparent manner with no/minimal guest userspace changes. This also enables hypervisor controlled live migration to be supported with VMs that have direct att

[virtio-dev] [PATCH v7 net-next 3/4] virtio_net: Extend virtio to use VF datapath when available

2018-04-19 Thread Sridhar Samudrala
This patch enables virtio_net to switch over to a VF datapath when a VF netdev is present with the same MAC address. It allows live migration of a VM with a direct attached VF without the need to setup a bond/team between a VF and virtio net device in the guest. The hypervisor needs to enable only

[virtio-dev] [PATCH v7 net-next 1/4] virtio_net: Introduce VIRTIO_NET_F_STANDBY feature bit

2018-04-19 Thread Sridhar Samudrala
This feature bit can be used by hypervisor to indicate virtio_net device to act as a standby for another device with the same MAC address. VIRTIO_NET_F_STANDBY is defined as bit 62 as it is a device feature bit. Signed-off-by: Sridhar Samudrala --- drivers/net/virtio_net.c| 2 +- includ

[virtio-dev] [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-19 Thread Sridhar Samudrala
This provides a generic interface for paravirtual drivers to listen for netdev register/unregister/link change events from pci ethernet devices with the same MAC and takeover their datapath. The notifier and event handling code is based on the existing netvsc implementation. It exposes 2 sets of i

[virtio-dev] Re: [pci PATCH v7 0/5] Add support for unmanaged SR-IOV

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 03:54:49PM -0700, Alexander Duyck wrote: > On Thu, Mar 15, 2018 at 11:40 AM, Alexander Duyck > wrote: > > This series is meant to add support for SR-IOV on devices when the VFs are > > not managed by the kernel. Examples of recent patches attempting to do this > > include:

Re: [virtio-dev] [pci PATCH v7 2/5] virtio_pci: Add support for unmanaged SR-IOV on virtio_pci devices

2018-04-19 Thread Michael S. Tsirkin
On Tue, Apr 03, 2018 at 12:06:03PM -0700, Alexander Duyck wrote: > On Tue, Apr 3, 2018 at 11:27 AM, Michael S. Tsirkin wrote: > > On Tue, Apr 03, 2018 at 10:32:00AM -0700, Alexander Duyck wrote: > >> On Tue, Apr 3, 2018 at 6:12 AM, Michael S. Tsirkin wrote: > >> > On Fri, Mar 16, 2018 at 09:40:34

[virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Liang, Cunming
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Friday, April 20, 2018 1:01 AM > To: Liang, Cunming > Cc: Paolo Bonzini ; Bie, Tiwei ; > jasow...@redhat.com; alex.william...@redhat.com; stefa...@redhat.com; > qemu-de...@nongnu.org; virtio-dev@lists.oasis-

[virtio-dev] Re: [pci PATCH v7 0/5] Add support for unmanaged SR-IOV

2018-04-19 Thread Alexander Duyck
On Thu, Mar 15, 2018 at 11:40 AM, Alexander Duyck wrote: > This series is meant to add support for SR-IOV on devices when the VFs are > not managed by the kernel. Examples of recent patches attempting to do this > include: > virto - https://patchwork.kernel.org/patch/10241225/ > pci-stub - https:/

[virtio-dev] Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-19 Thread Michael S. Tsirkin
On Tue, Apr 10, 2018 at 03:25:45PM +0800, Jason Wang wrote: > > > > One problem is that, different virtio ring compatible devices > > > > may have different device interfaces. That is to say, we will > > > > need different drivers in QEMU. It could be troublesome. And > > > > that's what this patch

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 07:35:57PM +0200, Paolo Bonzini wrote: > On 19/04/2018 19:27, Michael S. Tsirkin wrote: > > > > That CONFIG_SMP here is clearly wrong but I don't really know what > > to set it to. Also, we probably should switch virtio_wmb to dma_XX > > barriers. > > > > That's actually e

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Paolo Bonzini
On 19/04/2018 19:27, Michael S. Tsirkin wrote: > > That CONFIG_SMP here is clearly wrong but I don't really know what > to set it to. Also, we probably should switch virtio_wmb to dma_XX > barriers. > > That's actually easy. Will try to do. Should it be dma_wmb() before updating the indices, and

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:59:39PM +0200, Paolo Bonzini wrote: > On 19/04/2018 18:52, Liang, Cunming wrote: > >>> Oh you are right. > >>> > >>> So it's only needed for non-intel platforms or when packets are > >>> in WC memory then. And I don't know whether dpdk ever puts > >>> packets in WC memor

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

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 04:52:20PM +, Liang, Cunming wrote: > > > > -Original Message- > > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > > Sent: Thursday, April 19, 2018 11:52 PM > > To: Michael S. Tsirkin ; Liang, Cunming > > > > Cc: Bie, Tiwei ; jasow...@redhat.com; > > alex.w

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Paolo Bonzini
On 19/04/2018 18:52, Liang, Cunming wrote: >>> Oh you are right. >>> >>> So it's only needed for non-intel platforms or when packets are >>> in WC memory then. And I don't know whether dpdk ever puts >>> packets in WC memory. >>> >>> I guess we'll cross this bridge when we get to it. >> Non-TSO a

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 04:24:29PM +, Liang, Cunming wrote: > > > > -Original Message- > > From: Michael S. Tsirkin [mailto:m...@redhat.com] > > Sent: Thursday, April 19, 2018 11:19 PM > > To: Paolo Bonzini > > Cc: Liang, Cunming ; Bie, Tiwei > > ; > > jasow...@redhat.com; alex.will

[virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Liang, Cunming
> -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Thursday, April 19, 2018 11:52 PM > To: Michael S. Tsirkin ; Liang, Cunming > > Cc: Bie, Tiwei ; jasow...@redhat.com; > alex.william...@redhat.com; stefa...@redhat.com; qemu-de...@nongnu.org; > virtio-dev@lis

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:07:07PM +0200, Paolo Bonzini wrote: > On 19/04/2018 17:59, Michael S. Tsirkin wrote: > > On Thu, Apr 19, 2018 at 05:51:51PM +0200, Paolo Bonzini wrote: > >> On 19/04/2018 17:19, Michael S. Tsirkin wrote: > - if we make it 1 when weak barriers are needed, the device a

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

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 05:52:23PM +0200, Paolo Bonzini wrote: > On 19/04/2018 17:42, Michael S. Tsirkin wrote: > >> A compiler barrier is enough on strongly-ordered memory platform. > >> As it doesn't re-order store, PCI device won't see a stale index > >> value. But a weakly-ordered memory needs

[virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Liang, Cunming
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Thursday, April 19, 2018 11:43 PM > To: Liang, Cunming > Cc: Bie, Tiwei ; jasow...@redhat.com; > alex.william...@redhat.com; pbonz...@redhat.com; stefa...@redhat.com; > qemu-de...@nongnu.org; virtio-dev@list

RE: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Liang, Cunming
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Thursday, April 19, 2018 11:19 PM > To: Paolo Bonzini > Cc: Liang, Cunming ; Bie, Tiwei > ; > jasow...@redhat.com; alex.william...@redhat.com; stefa...@redhat.com; > qemu-de...@nongnu.org; virtio-dev@lists.

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Paolo Bonzini
On 19/04/2018 17:59, Michael S. Tsirkin wrote: > On Thu, Apr 19, 2018 at 05:51:51PM +0200, Paolo Bonzini wrote: >> On 19/04/2018 17:19, Michael S. Tsirkin wrote: - if we make it 1 when weak barriers are needed, the device also needs to nack feature negotiation (not allow setting the FEATU

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 05:51:51PM +0200, Paolo Bonzini wrote: > On 19/04/2018 17:19, Michael S. Tsirkin wrote: > >> - if we make it 1 when weak barriers are needed, the device also needs > >> to nack feature negotiation (not allow setting the FEATURES_OK) if the > >> bit is not set by the driver.

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

2018-04-19 Thread Paolo Bonzini
On 19/04/2018 17:42, Michael S. Tsirkin wrote: >> A compiler barrier is enough on strongly-ordered memory platform. >> As it doesn't re-order store, PCI device won't see a stale index >> value. But a weakly-ordered memory needs sfence. > > Oh you are right. > > So it's only needed for non-intel p

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Paolo Bonzini
On 19/04/2018 17:19, Michael S. Tsirkin wrote: >> - if we make it 1 when weak barriers are needed, the device also needs >> to nack feature negotiation (not allow setting the FEATURES_OK) if the >> bit is not set by the driver. >> However, that is not enough. Live >> migration assumes that it is

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

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 12:43:42PM +, Liang, Cunming wrote: > > > > -Original Message- > > From: Bie, Tiwei > > Sent: Thursday, April 19, 2018 7:15 PM > > To: Michael S. Tsirkin > > Cc: jasow...@redhat.com; alex.william...@redhat.com; pbonz...@redhat.com; > > stefa...@redhat.com; qem

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 03:02:40PM +0200, Paolo Bonzini wrote: > On 19/04/2018 14:43, Liang, Cunming wrote: > >> 2. Memory barriers. Right now after updating the avail idx, > >> virtio does smp_wmb() and then the MMIO write. Normal hardware > >> drivers do wmb() which is an sfence. Can a PCI devic

Re: [virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Paolo Bonzini
On 19/04/2018 14:43, Liang, Cunming wrote: >> 2. Memory barriers. Right now after updating the avail idx, >> virtio does smp_wmb() and then the MMIO write. Normal hardware >> drivers do wmb() which is an sfence. Can a PCI device read bypass >> index write and see a stale index value? > > A compile

[virtio-dev] RE: [PATCH v3 6/6] vhost-user: support registering external host notifiers

2018-04-19 Thread Liang, Cunming
> -Original Message- > From: Bie, Tiwei > Sent: Thursday, April 19, 2018 7:15 PM > To: Michael S. Tsirkin > Cc: jasow...@redhat.com; alex.william...@redhat.com; pbonz...@redhat.com; > stefa...@redhat.com; qemu-de...@nongnu.org; virtio-dev@lists.oasis- > open.org; Liang, Cunming ; Daly, D

[virtio-dev] Re: [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 based host notifiers. A

Re: [virtio-dev] [PATCH] content: document hugetlb page allocation counts

2018-04-19 Thread Stefan Hajnoczi
On Wed, Apr 18, 2018 at 10:10:19AM -0700, Jonathan Helman wrote: > The Linux kernel exports the number of successful and failed > hugetlb page allocations via the virtio balloon driver. These > two counts need to be documented in this specification. > > Signed-off-by: Jonathan Helman > --- > con