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

2018-04-10 Thread Samudrala, Sridhar
On 4/10/2018 11:03 PM, Jiri Pirko wrote: Tue, Apr 10, 2018 at 05:59:02PM CEST, sridhar.samudr...@intel.com wrote: On 4/10/2018 8:43 AM, Jiri Pirko wrote: Tue, Apr 10, 2018 at 05:27:48PM CEST, sridhar.samudr...@intel.com wrote: On 4/10/2018 8:22 AM, Jiri Pirko wrote: Tue, Apr 10, 2018 at 05:13

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

2018-04-10 Thread Jiri Pirko
Tue, Apr 10, 2018 at 05:59:02PM CEST, sridhar.samudr...@intel.com wrote: >On 4/10/2018 8:43 AM, Jiri Pirko wrote: >> Tue, Apr 10, 2018 at 05:27:48PM CEST, sridhar.samudr...@intel.com wrote: >> > On 4/10/2018 8:22 AM, Jiri Pirko wrote: >> > > Tue, Apr 10, 2018 at 05:13:40PM CEST, sridhar.samudr...@i

Re: [PATCH v3 0/2] vhost: fix vhost_vq_access_ok() log check

2018-04-10 Thread Jason Wang
On 2018年04月11日 10:35, Stefan Hajnoczi wrote: v3: * Rebased onto net/master and resolved conflict [DaveM] v2: * Rewrote the conditional to make the vq access check clearer [Linus] * Added Patch 2 to make the return type consistent and harder to misuse [Linus] The first patch fixes the v

Re: [virtio-dev] Re: [PATCH v2] virtio_balloon: export hugetlb page allocation counts

2018-04-10 Thread Jason Wang
On 2018年04月10日 05:11, Jonathan Helman wrote: On 03/22/2018 07:38 PM, Jason Wang wrote: On 2018年03月22日 11:10, Michael S. Tsirkin wrote: On Thu, Mar 22, 2018 at 09:52:18AM +0800, Jason Wang wrote: On 2018年03月20日 12:26, Jonathan Helman wrote: On Mar 19, 2018, at 7:31 PM, Jason Wang  wrote:

[PATCH v3 1/2] vhost: fix vhost_vq_access_ok() log check

2018-04-10 Thread Stefan Hajnoczi
Commit d65026c6c62e7d9616c8ceb5a53b68bcdc050525 ("vhost: validate log when IOTLB is enabled") introduced a regression. The logic was originally: if (vq->iotlb) return 1; return A && B; After the patch the short-circuit logic for A was inverted: if (A || vq->iotlb) return A;

[PATCH v3 2/2] vhost: return bool from *_access_ok() functions

2018-04-10 Thread Stefan Hajnoczi
Currently vhost *_access_ok() functions return int. This is error-prone because there are two popular conventions: 1. 0 means failure, 1 means success 2. -errno means failure, 0 means success Although vhost mostly uses #1, it does not do so consistently. umem_access_ok() uses #2. This patch cha

[PATCH v3 0/2] vhost: fix vhost_vq_access_ok() log check

2018-04-10 Thread Stefan Hajnoczi
v3: * Rebased onto net/master and resolved conflict [DaveM] v2: * Rewrote the conditional to make the vq access check clearer [Linus] * Added Patch 2 to make the return type consistent and harder to misuse [Linus] The first patch fixes the vhost virtqueue access check which was recently broken

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

2018-04-10 Thread Jason Wang
On 2018年04月10日 22:23, Liang, Cunming wrote: -Original Message- From: Michael S. Tsirkin [mailto:m...@redhat.com] Sent: Tuesday, April 10, 2018 9:36 PM To: Liang, Cunming Cc: Paolo Bonzini; Bie, Tiwei; Jason Wang;alex.william...@redhat.com; ddut...@redhat.com; Duyck, Alexander H; virtio-

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

2018-04-10 Thread Jason Wang
On 2018年04月10日 17:23, Liang, Cunming wrote: -Original Message- From: Paolo Bonzini [mailto:pbonz...@redhat.com] Sent: Tuesday, April 10, 2018 3:52 PM To: Bie, Tiwei ; Jason Wang Cc: m...@redhat.com; alex.william...@redhat.com; ddut...@redhat.com; Duyck, Alexander H ; virtio-dev@lists

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

2018-04-10 Thread Stefan Hajnoczi
On Tue, Apr 10, 2018 at 09:23:53AM +, Liang, Cunming wrote: > If QEMU is going to build a user space driver framework there, we're open > mind on that, even leveraging DPDK as the underlay library. Looking forward > to more others' comments from community. There is already an NVMe VFIO drive

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

2018-04-10 Thread Tian, Kevin
> From: Liang, Cunming > Sent: Tuesday, April 10, 2018 10:24 PM > [...] > > > > As others said, we do not need to go overeboard. A couple of small > vendor- > > specific quirks in qemu isn't a big deal. > > It's quite challenge to identify it's small or not, there's no uniform metric. > > It's o

Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework

2018-04-10 Thread Michael S. Tsirkin
On Tue, Apr 10, 2018 at 02:26:08PM -0700, Stephen Hemminger wrote: > On Tue, 10 Apr 2018 11:59:50 -0700 > Sridhar Samudrala wrote: > > > Use the registration/notification framework supported by the generic > > bypass infrastructure. > > > > Signed-off-by: Sridhar Samudrala > > --- > > Thanks f

Re: [PATCH v2 0/2] vhost: fix vhost_vq_access_ok() log check

2018-04-10 Thread Stefan Hajnoczi
On Tue, Apr 10, 2018 at 10:50:43AM -0400, David Miller wrote: > From: Jason Wang > Date: Tue, 10 Apr 2018 14:40:10 +0800 > > > On 2018年04月10日 13:26, Stefan Hajnoczi wrote: > >> v2: > >> * Rewrote the conditional to make the vq access check clearer [Linus] > >> * Added Patch 2 to make the retu

Re: [PATCH v29 1/4] mm: support reporting free page blocks

2018-04-10 Thread Wei Wang
On 04/11/2018 07:25 AM, Michael S. Tsirkin wrote: On Tue, Apr 10, 2018 at 01:54:29PM -0700, Andrew Morton wrote: On Tue, 10 Apr 2018 21:19:31 +0300 "Michael S. Tsirkin" wrote: Andrew, were your questions answered? If yes could I bother you for an ack on this? Still not very happy that read

Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework

2018-04-10 Thread Stephen Hemminger
On Tue, 10 Apr 2018 16:44:47 -0700 Siwei Liu wrote: > On Tue, Apr 10, 2018 at 4:28 PM, Michael S. Tsirkin wrote: > > On Tue, Apr 10, 2018 at 02:26:08PM -0700, Stephen Hemminger wrote: > >> On Tue, 10 Apr 2018 11:59:50 -0700 > >> Sridhar Samudrala wrote: > >> > >> > Use the registration/noti

Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework

2018-04-10 Thread Siwei Liu
On Tue, Apr 10, 2018 at 4:28 PM, Michael S. Tsirkin wrote: > On Tue, Apr 10, 2018 at 02:26:08PM -0700, Stephen Hemminger wrote: >> On Tue, 10 Apr 2018 11:59:50 -0700 >> Sridhar Samudrala wrote: >> >> > Use the registration/notification framework supported by the generic >> > bypass infrastructure

Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework

2018-04-10 Thread Michael S. Tsirkin
On Tue, Apr 10, 2018 at 02:26:08PM -0700, Stephen Hemminger wrote: > On Tue, 10 Apr 2018 11:59:50 -0700 > Sridhar Samudrala wrote: > > > Use the registration/notification framework supported by the generic > > bypass infrastructure. > > > > Signed-off-by: Sridhar Samudrala > > --- > > Thanks f

Re: [PATCH v29 1/4] mm: support reporting free page blocks

2018-04-10 Thread Michael S. Tsirkin
On Tue, Apr 10, 2018 at 01:54:29PM -0700, Andrew Morton wrote: > On Tue, 10 Apr 2018 21:19:31 +0300 "Michael S. Tsirkin" > wrote: > > > > > Andrew, were your questions answered? If yes could I bother you for an ack > > on this? > > > > Still not very happy that readers are told that "this fu

Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework

2018-04-10 Thread Samudrala, Sridhar
On 4/10/2018 2:26 PM, Stephen Hemminger wrote: On Tue, 10 Apr 2018 11:59:50 -0700 Sridhar Samudrala wrote: Use the registration/notification framework supported by the generic bypass infrastructure. Signed-off-by: Sridhar Samudrala --- Thanks for doing this. Your current version has couple

Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework

2018-04-10 Thread Stephen Hemminger
On Tue, 10 Apr 2018 11:59:50 -0700 Sridhar Samudrala wrote: > Use the registration/notification framework supported by the generic > bypass infrastructure. > > Signed-off-by: Sridhar Samudrala > --- Thanks for doing this. Your current version has couple show stopper issues. First, the slave

Re: [PATCH v29 1/4] mm: support reporting free page blocks

2018-04-10 Thread Andrew Morton
On Tue, 10 Apr 2018 21:19:31 +0300 "Michael S. Tsirkin" wrote: > > Andrew, were your questions answered? If yes could I bother you for an ack on > this? > Still not very happy that readers are told that "this function may sleep" when it clearly doesn't do so. If we wish to be able to change

[RFC PATCH net-next v6 2/4] net: Introduce generic bypass module

2018-04-10 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

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

2018-04-10 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

[RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework

2018-04-10 Thread Sridhar Samudrala
Use the registration/notification framework supported by the generic bypass 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 fil

[RFC PATCH net-next v6 1/4] virtio_net: Introduce VIRTIO_NET_F_BACKUP feature bit

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

[RFC PATCH net-next v6 0/4] Enable virtio_net to act as a backup for a passthru device

2018-04-10 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

Re: [PATCH v29 1/4] mm: support reporting free page blocks

2018-04-10 Thread Michael S. Tsirkin
On Mon, Mar 26, 2018 at 02:22:54PM -0700, Andrew Morton wrote: > On Mon, 26 Mar 2018 10:39:51 +0800 Wei Wang wrote: > > > This patch adds support to walk through the free page blocks in the > > system and report them via a callback function. Some page blocks may > > leave the free list after zone

Re: [virtio-dev] [RFC] virtio-iommu version 0.6

2018-04-10 Thread Jean-Philippe Brucker
On 22/03/18 09:44, Tian, Kevin wrote: >> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] >> Sent: Wednesday, March 21, 2018 9:14 PM >> >> Hi Kevin, >> >> Thanks for the comments >> >> On 19/03/18 10:03, Tian, Kevin wrote: >>> BYPASS feature bit is not covered in "2.3.1/2.3.2/2.3.

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

2018-04-10 Thread Samudrala, Sridhar
On 4/10/2018 8:43 AM, Jiri Pirko wrote: Tue, Apr 10, 2018 at 05:27:48PM CEST, sridhar.samudr...@intel.com wrote: On 4/10/2018 8:22 AM, Jiri Pirko wrote: Tue, Apr 10, 2018 at 05:13:40PM CEST, sridhar.samudr...@intel.com wrote: On 4/10/2018 3:55 AM, Jiri Pirko wrote: Mon, Apr 09, 2018 at 08:47:

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

2018-04-10 Thread Siwei Liu
On Tue, Apr 10, 2018 at 8:43 AM, Jiri Pirko wrote: > Tue, Apr 10, 2018 at 05:27:48PM CEST, sridhar.samudr...@intel.com wrote: >>On 4/10/2018 8:22 AM, Jiri Pirko wrote: >>> Tue, Apr 10, 2018 at 05:13:40PM CEST, sridhar.samudr...@intel.com wrote: >>> > On 4/10/2018 3:55 AM, Jiri Pirko wrote: >>> > >

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

2018-04-10 Thread Jiri Pirko
Tue, Apr 10, 2018 at 05:27:48PM CEST, sridhar.samudr...@intel.com wrote: >On 4/10/2018 8:22 AM, Jiri Pirko wrote: >> Tue, Apr 10, 2018 at 05:13:40PM CEST, sridhar.samudr...@intel.com wrote: >> > On 4/10/2018 3:55 AM, Jiri Pirko wrote: >> > > Mon, Apr 09, 2018 at 08:47:06PM CEST, sridhar.samudr...@i

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

2018-04-10 Thread Samudrala, Sridhar
On 4/10/2018 8:22 AM, Jiri Pirko wrote: Tue, Apr 10, 2018 at 05:13:40PM CEST, sridhar.samudr...@intel.com wrote: On 4/10/2018 3:55 AM, Jiri Pirko wrote: Mon, Apr 09, 2018 at 08:47:06PM CEST, sridhar.samudr...@intel.com wrote: On 4/9/2018 1:07 AM, Jiri Pirko wrote: Sat, Apr 07, 2018 at 12:59:1

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

2018-04-10 Thread Jiri Pirko
Tue, Apr 10, 2018 at 05:13:40PM CEST, sridhar.samudr...@intel.com wrote: >On 4/10/2018 3:55 AM, Jiri Pirko wrote: >> Mon, Apr 09, 2018 at 08:47:06PM CEST, sridhar.samudr...@intel.com wrote: >> > On 4/9/2018 1:07 AM, Jiri Pirko wrote: >> > > Sat, Apr 07, 2018 at 12:59:14AM CEST, sridhar.samudr...@in

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

2018-04-10 Thread Samudrala, Sridhar
On 4/10/2018 3:55 AM, Jiri Pirko wrote: Mon, Apr 09, 2018 at 08:47:06PM CEST, sridhar.samudr...@intel.com wrote: On 4/9/2018 1:07 AM, Jiri Pirko wrote: Sat, Apr 07, 2018 at 12:59:14AM CEST, sridhar.samudr...@intel.com wrote: On 4/6/2018 5:48 AM, Jiri Pirko wrote: Thu, Apr 05, 2018 at 11:08:22

Re: [PATCH v2 0/2] vhost: fix vhost_vq_access_ok() log check

2018-04-10 Thread David Miller
From: Jason Wang Date: Tue, 10 Apr 2018 14:40:10 +0800 > On 2018年04月10日 13:26, Stefan Hajnoczi wrote: >> v2: >> * Rewrote the conditional to make the vq access check clearer [Linus] >> * Added Patch 2 to make the return type consistent and harder to misuse >> * [Linus] >> >> The first patch

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

2018-04-10 Thread Liang, Cunming
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Tuesday, April 10, 2018 9:36 PM > To: Liang, Cunming > Cc: Paolo Bonzini ; Bie, Tiwei ; > Jason Wang ; alex.william...@redhat.com; > ddut...@redhat.com; Duyck, Alexander H ; > virtio-...@lists.oasis-open.org

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

2018-04-10 Thread Michael S. Tsirkin
On Tue, Apr 10, 2018 at 09:23:53AM +, Liang, Cunming wrote: > > > > -Original Message- > > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > > Sent: Tuesday, April 10, 2018 3:52 PM > > To: Bie, Tiwei ; Jason Wang > > Cc: m...@redhat.com; alex.william...@redhat.com; ddut...@redhat.co

Re: [PATCH v2 2/2] vhost: return bool from *_access_ok() functions

2018-04-10 Thread Michael S. Tsirkin
On Tue, Apr 10, 2018 at 01:26:30PM +0800, Stefan Hajnoczi wrote: > Currently vhost *_access_ok() functions return int. This is error-prone > because there are two popular conventions: > > 1. 0 means failure, 1 means success > 2. -errno means failure, 0 means success > > Although vhost mostly use

Re: [PATCH v2 1/2] vhost: fix vhost_vq_access_ok() log check

2018-04-10 Thread Michael S. Tsirkin
On Tue, Apr 10, 2018 at 04:22:35PM +0300, Michael S. Tsirkin wrote: > On Tue, Apr 10, 2018 at 01:26:29PM +0800, Stefan Hajnoczi wrote: > > Commit d65026c6c62e7d9616c8ceb5a53b68bcdc050525 ("vhost: validate log > > when IOTLB is enabled") introduced a regression. The logic was > > originally: > > >

Re: [PATCH v2 1/2] vhost: fix vhost_vq_access_ok() log check

2018-04-10 Thread Michael S. Tsirkin
On Tue, Apr 10, 2018 at 01:26:29PM +0800, Stefan Hajnoczi wrote: > Commit d65026c6c62e7d9616c8ceb5a53b68bcdc050525 ("vhost: validate log > when IOTLB is enabled") introduced a regression. The logic was > originally: > > if (vq->iotlb) > return 1; > return A && B; > > After the patch th

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

2018-04-10 Thread Jiri Pirko
Mon, Apr 09, 2018 at 08:47:06PM CEST, sridhar.samudr...@intel.com wrote: >On 4/9/2018 1:07 AM, Jiri Pirko wrote: >> Sat, Apr 07, 2018 at 12:59:14AM CEST, sridhar.samudr...@intel.com wrote: >> > On 4/6/2018 5:48 AM, Jiri Pirko wrote: >> > > Thu, Apr 05, 2018 at 11:08:22PM CEST, sridhar.samudr...@int

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

2018-04-10 Thread Liang, Cunming
> -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Tuesday, April 10, 2018 3:52 PM > To: Bie, Tiwei ; Jason Wang > Cc: m...@redhat.com; alex.william...@redhat.com; ddut...@redhat.com; > Duyck, Alexander H ; virtio-dev@lists.oasis- > open.org; linux-ker...@vge

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

2018-04-10 Thread Paolo Bonzini
On 10/04/2018 06:57, Tiwei Bie wrote: >> So you just move the abstraction layer from qemu to kernel, and you still >> need different drivers in kernel for different device interfaces of >> accelerators. This looks even more complex than leaving it in qemu. As you >> said, another idea is to impleme

Re: [RFC] vhost: introduce mdev based hardware vhost backend

2018-04-10 Thread Jason Wang
On 2018年04月10日 12:57, Tiwei Bie wrote: On Tue, Apr 10, 2018 at 10:52:52AM +0800, Jason Wang wrote: On 2018年04月02日 23:23, Tiwei Bie wrote: This patch introduces a mdev (mediated device) based hardware vhost backend. This backend is an abstraction of the various hardware vhost accelerators (pot