mbox series

[v5,0/4] vhost: two fixes and used_memslots refactoring

Message ID 1515515942-33692-1-git-send-email-jianjay.zhou@huawei.com
Headers show
Series vhost: two fixes and used_memslots refactoring | expand

Message

Zhoujian (jay) Jan. 9, 2018, 4:39 p.m. UTC
v4 -> v5:
  Making the followed up device_add to fall back to userspace
  virtio when netdev_add fails if vhost force flag does not set.

Jay Zhou (4):
  vhost: remove assertion to prevent crash
  tap: do not close fd if only vhost failed to initialize
  vhost: fix memslot limit check
  vhost: used_memslots refactoring

 hw/virtio/vhost-backend.c         | 15 +++++++-
 hw/virtio/vhost-user.c            | 74 +++++++++++++++++++++++++++------------
 hw/virtio/vhost.c                 | 30 +++++++++-------
 include/hw/virtio/vhost-backend.h |  6 ++--
 net/tap.c                         | 25 +++++++++----
 5 files changed, 104 insertions(+), 46 deletions(-)

--
1.8.3.1

Comments

Igor Mammedov Jan. 11, 2018, 1:05 p.m. UTC | #1
On Wed, 10 Jan 2018 00:39:02 +0800
Jay Zhou <jianjay.zhou@huawei.com> wrote:

Jay,
considering how non trivial touched code is, would you mind
first adding 'make check' testcases for success/failure paths
that you are touching?
It would help with merging and ensure that future changes to
vhost won't break memslots handling.

> v4 -> v5:
>   Making the followed up device_add to fall back to userspace
>   virtio when netdev_add fails if vhost force flag does not set.
> 
> Jay Zhou (4):
>   vhost: remove assertion to prevent crash
>   tap: do not close fd if only vhost failed to initialize
>   vhost: fix memslot limit check
>   vhost: used_memslots refactoring
> 
>  hw/virtio/vhost-backend.c         | 15 +++++++-
>  hw/virtio/vhost-user.c            | 74 +++++++++++++++++++++++++++------------
>  hw/virtio/vhost.c                 | 30 +++++++++-------
>  include/hw/virtio/vhost-backend.h |  6 ++--
>  net/tap.c                         | 25 +++++++++----
>  5 files changed, 104 insertions(+), 46 deletions(-)
> 
> --
> 1.8.3.1
> 
>
Zhoujian (jay) Jan. 11, 2018, 1:55 p.m. UTC | #2
Hi Igor,

> -----Original Message-----
> From: Igor Mammedov [mailto:imammedo@redhat.com]
> Sent: Thursday, January 11, 2018 9:05 PM
> To: Zhoujian (jay) <jianjay.zhou@huawei.com>
> Cc: qemu-devel@nongnu.org; mst@redhat.com; Huangweidong (C)
> <weidong.huang@huawei.com>; wangxin (U) <wangxinxin.wang@huawei.com>; Gonglei
> (Arei) <arei.gonglei@huawei.com>; Liuzhe (Ahriy, Euler) <liuzhe13@huawei.com>
> Subject: Re: [PATCH v5 0/4] vhost: two fixes and used_memslots refactoring
> 
> On Wed, 10 Jan 2018 00:39:02 +0800
> Jay Zhou <jianjay.zhou@huawei.com> wrote:
> 
> Jay,
> considering how non trivial touched code is, would you mind first adding
> 'make check' testcases for success/failure paths that you are touching?
> It would help with merging and ensure that future changes to vhost won't
> break memslots handling.

Will look into the testcases. Maybe it would take some time since I'm not
very familiar with them.

Regards,
Jay

> 
> > v4 -> v5:
> >   Making the followed up device_add to fall back to userspace
> >   virtio when netdev_add fails if vhost force flag does not set.
> >
> > Jay Zhou (4):
> >   vhost: remove assertion to prevent crash
> >   tap: do not close fd if only vhost failed to initialize
> >   vhost: fix memslot limit check
> >   vhost: used_memslots refactoring
> >
> >  hw/virtio/vhost-backend.c         | 15 +++++++-
> >  hw/virtio/vhost-user.c            | 74 +++++++++++++++++++++++++++--------
> ----
> >  hw/virtio/vhost.c                 | 30 +++++++++-------
> >  include/hw/virtio/vhost-backend.h |  6 ++--
> >  net/tap.c                         | 25 +++++++++----
> >  5 files changed, 104 insertions(+), 46 deletions(-)
> >
> > --
> > 1.8.3.1
> >
> >
Michael S. Tsirkin Jan. 11, 2018, 7:55 p.m. UTC | #3
On Thu, Jan 11, 2018 at 01:55:38PM +0000, Zhoujian (jay) wrote:
> Hi Igor,
> 
> > -----Original Message-----
> > From: Igor Mammedov [mailto:imammedo@redhat.com]
> > Sent: Thursday, January 11, 2018 9:05 PM
> > To: Zhoujian (jay) <jianjay.zhou@huawei.com>
> > Cc: qemu-devel@nongnu.org; mst@redhat.com; Huangweidong (C)
> > <weidong.huang@huawei.com>; wangxin (U) <wangxinxin.wang@huawei.com>; Gonglei
> > (Arei) <arei.gonglei@huawei.com>; Liuzhe (Ahriy, Euler) <liuzhe13@huawei.com>
> > Subject: Re: [PATCH v5 0/4] vhost: two fixes and used_memslots refactoring
> > 
> > On Wed, 10 Jan 2018 00:39:02 +0800
> > Jay Zhou <jianjay.zhou@huawei.com> wrote:
> > 
> > Jay,
> > considering how non trivial touched code is, would you mind first adding
> > 'make check' testcases for success/failure paths that you are touching?
> > It would help with merging and ensure that future changes to vhost won't
> > break memslots handling.
> 
> Will look into the testcases. Maybe it would take some time since I'm not
> very familiar with them.
> 
> Regards,
> Jay


ok can you repost whatever's ready please? And please use proper
threading (e.g. generated with git format-patch --thread=shallow).


> > 
> > > v4 -> v5:
> > >   Making the followed up device_add to fall back to userspace
> > >   virtio when netdev_add fails if vhost force flag does not set.
> > >
> > > Jay Zhou (4):
> > >   vhost: remove assertion to prevent crash
> > >   tap: do not close fd if only vhost failed to initialize
> > >   vhost: fix memslot limit check
> > >   vhost: used_memslots refactoring
> > >
> > >  hw/virtio/vhost-backend.c         | 15 +++++++-
> > >  hw/virtio/vhost-user.c            | 74 +++++++++++++++++++++++++++--------
> > ----
> > >  hw/virtio/vhost.c                 | 30 +++++++++-------
> > >  include/hw/virtio/vhost-backend.h |  6 ++--
> > >  net/tap.c                         | 25 +++++++++----
> > >  5 files changed, 104 insertions(+), 46 deletions(-)
> > >
> > > --
> > > 1.8.3.1
> > >
> > >
Michael S. Tsirkin Jan. 11, 2018, 8:13 p.m. UTC | #4
On Thu, Jan 11, 2018 at 02:05:20PM +0100, Igor Mammedov wrote:
> On Wed, 10 Jan 2018 00:39:02 +0800
> Jay Zhou <jianjay.zhou@huawei.com> wrote:
> 
> Jay,
> considering how non trivial touched code is, would you mind
> first adding 'make check' testcases for success/failure paths
> that you are touching?
> It would help with merging and ensure that future changes to
> vhost won't break memslots handling.

Which tests would you like this to be added to?

> > v4 -> v5:
> >   Making the followed up device_add to fall back to userspace
> >   virtio when netdev_add fails if vhost force flag does not set.
> > 
> > Jay Zhou (4):
> >   vhost: remove assertion to prevent crash
> >   tap: do not close fd if only vhost failed to initialize
> >   vhost: fix memslot limit check
> >   vhost: used_memslots refactoring
> > 
> >  hw/virtio/vhost-backend.c         | 15 +++++++-
> >  hw/virtio/vhost-user.c            | 74 +++++++++++++++++++++++++++------------
> >  hw/virtio/vhost.c                 | 30 +++++++++-------
> >  include/hw/virtio/vhost-backend.h |  6 ++--
> >  net/tap.c                         | 25 +++++++++----
> >  5 files changed, 104 insertions(+), 46 deletions(-)
> > 
> > --
> > 1.8.3.1
> > 
> >
Zhoujian (jay) Jan. 12, 2018, 1:41 a.m. UTC | #5
> -----Original Message-----
> From: Michael S. Tsirkin [mailto:mst@redhat.com]
> Sent: Friday, January 12, 2018 3:56 AM
> To: Zhoujian (jay) <jianjay.zhou@huawei.com>
> Cc: Igor Mammedov <imammedo@redhat.com>; qemu-devel@nongnu.org; Huangweidong
> (C) <weidong.huang@huawei.com>; wangxin (U) <wangxinxin.wang@huawei.com>;
> Gonglei (Arei) <arei.gonglei@huawei.com>; Liuzhe (Ahriy, Euler)
> <liuzhe13@huawei.com>
> Subject: Re: [PATCH v5 0/4] vhost: two fixes and used_memslots refactoring
> 
> On Thu, Jan 11, 2018 at 01:55:38PM +0000, Zhoujian (jay) wrote:
> > Hi Igor,
> >
> > > -----Original Message-----
> > > From: Igor Mammedov [mailto:imammedo@redhat.com]
> > > Sent: Thursday, January 11, 2018 9:05 PM
> > > To: Zhoujian (jay) <jianjay.zhou@huawei.com>
> > > Cc: qemu-devel@nongnu.org; mst@redhat.com; Huangweidong (C)
> > > <weidong.huang@huawei.com>; wangxin (U)
> > > <wangxinxin.wang@huawei.com>; Gonglei
> > > (Arei) <arei.gonglei@huawei.com>; Liuzhe (Ahriy, Euler)
> > > <liuzhe13@huawei.com>
> > > Subject: Re: [PATCH v5 0/4] vhost: two fixes and used_memslots
> > > refactoring
> > >
> > > On Wed, 10 Jan 2018 00:39:02 +0800
> > > Jay Zhou <jianjay.zhou@huawei.com> wrote:
> > >
> > > Jay,
> > > considering how non trivial touched code is, would you mind first
> > > adding 'make check' testcases for success/failure paths that you are
> touching?
> > > It would help with merging and ensure that future changes to vhost
> > > won't break memslots handling.
> >
> > Will look into the testcases. Maybe it would take some time since I'm
> > not very familiar with them.
> >
> > Regards,
> > Jay
> 
> 
> ok can you repost whatever's ready please? And please use proper threading
> (e.g. generated with git format-patch --thread=shallow).
> 

Will send a v6 version soon.

PS: Considering vhost memslots series and the patch "tap: do not close fd
if only vhost failed to initialize" are two separate issues, will send
them separately.

Regards,
Jay

> > >
> > > > v4 -> v5:
> > > >   Making the followed up device_add to fall back to userspace
> > > >   virtio when netdev_add fails if vhost force flag does not set.
> > > >
> > > > Jay Zhou (4):
> > > >   vhost: remove assertion to prevent crash
> > > >   tap: do not close fd if only vhost failed to initialize
> > > >   vhost: fix memslot limit check
> > > >   vhost: used_memslots refactoring
> > > >
> > > >  hw/virtio/vhost-backend.c         | 15 +++++++-
> > > >  hw/virtio/vhost-user.c            | 74 +++++++++++++++++++++++++++----
> ----
> > > ----
> > > >  hw/virtio/vhost.c                 | 30 +++++++++-------
> > > >  include/hw/virtio/vhost-backend.h |  6 ++--
> > > >  net/tap.c                         | 25 +++++++++----
> > > >  5 files changed, 104 insertions(+), 46 deletions(-)
> > > >
> > > > --
> > > > 1.8.3.1
> > > >
> > > >
Igor Mammedov Jan. 12, 2018, 9:18 a.m. UTC | #6
On Thu, 11 Jan 2018 22:13:25 +0200
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Thu, Jan 11, 2018 at 02:05:20PM +0100, Igor Mammedov wrote:
> > On Wed, 10 Jan 2018 00:39:02 +0800
> > Jay Zhou <jianjay.zhou@huawei.com> wrote:
> > 
> > Jay,
> > considering how non trivial touched code is, would you mind
> > first adding 'make check' testcases for success/failure paths
> > that you are touching?
> > It would help with merging and ensure that future changes to
> > vhost won't break memslots handling.  
> 
> Which tests would you like this to be added to?
At least a test for, so it won't regress unnoticed in future
 1st: [PATCH v5 3/4] vhost: fix memslot limit check
 2nd: limit check failure triggered when DIMM module hotplugged

PS:
It's fine if tests will be another series on top of this one.

> 
> > > v4 -> v5:
> > >   Making the followed up device_add to fall back to userspace
> > >   virtio when netdev_add fails if vhost force flag does not set.
> > > 
> > > Jay Zhou (4):
> > >   vhost: remove assertion to prevent crash
> > >   tap: do not close fd if only vhost failed to initialize
> > >   vhost: fix memslot limit check
> > >   vhost: used_memslots refactoring
> > > 
> > >  hw/virtio/vhost-backend.c         | 15 +++++++-
> > >  hw/virtio/vhost-user.c            | 74 +++++++++++++++++++++++++++------------
> > >  hw/virtio/vhost.c                 | 30 +++++++++-------
> > >  include/hw/virtio/vhost-backend.h |  6 ++--
> > >  net/tap.c                         | 25 +++++++++----
> > >  5 files changed, 104 insertions(+), 46 deletions(-)
> > > 
> > > --
> > > 1.8.3.1
> > > 
> > >