Skip to contentSkip to conversation

vhost: two fixes and used_memslots refactoring

PATCH Superseded Jay Zhou 3 participants 7 messages Jan 9, 2018 – Jan 12, 2018

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Jay Zhou

author
#0 lore raw

v5 cover vhost: two fixes and used_memslots refactoring

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

#1 lore raw

On Wed, 10 Jan 2018 00:39:02 +0800
Jay Zhou <[email protected]> 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.

Quoted 21 lines

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

#2 lore raw

Hi Igor,

Quoted 9 lines

-----Original Message-----
From: Igor Mammedov [mailto:[email protected]]
Sent: Thursday, January 11, 2018 9:05 PM
To: Zhoujian (jay) <[email protected]>
Cc: [email protected]; [email protected]; Huangweidong (C) <[email protected]>; wangxin (U) <[email protected]>; Gonglei (Arei) <[email protected]>; Liuzhe (Ahriy, Euler) <[email protected]>
Subject: Re: [PATCH v5 0/4] vhost: two fixes and used_memslots refactoring

Quoted 8 lines

On Wed, 10 Jan 2018 00:39:02 +0800
Jay Zhou <[email protected]> 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

Quoted 23 lines
Quoted 5 lines

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.

Quoted 8 lines

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 +++++++++++++++++++++++++++--------

----

Quoted 9 lines
 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

#3 lore raw
Quoted 20 lines · Zhoujian (jay)

Hi Igor,

Quoted 9 lines

-----Original Message-----
From: Igor Mammedov [mailto:[email protected]]
Sent: Thursday, January 11, 2018 9:05 PM
To: Zhoujian (jay) <[email protected]>
Cc: [email protected]; [email protected]; Huangweidong (C) <[email protected]>; wangxin (U) <[email protected]>; Gonglei (Arei) <[email protected]>; Liuzhe (Ahriy, Euler) <[email protected]>
Subject: Re: [PATCH v5 0/4] vhost: two fixes and used_memslots refactoring

Quoted 8 lines

On Wed, 10 Jan 2018 00:39:02 +0800
Jay Zhou <[email protected]> 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.

Quoted 5 lines

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).

Quoted 23 lines
Quoted 23 lines
Quoted 5 lines

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.

Quoted 8 lines

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 +++++++++++++++++++++++++++--------

----

Quoted 9 lines
 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

#4 lore raw
Quoted 40 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: Friday, January 12, 2018 3:56 AM
To: Zhoujian (jay) <[email protected]>
Cc: Igor Mammedov <[email protected]>; [email protected]; Huangweidong
(C) <[email protected]>; wangxin (U) <[email protected]>; Gonglei (Arei) <[email protected]>; Liuzhe (Ahriy, Euler) <[email protected]>
Subject: Re: [PATCH v5 0/4] vhost: two fixes and used_memslots refactoring

Quoted 20 lines · Zhoujian (jay)

Hi Igor,

Quoted 18 lines

-----Original Message-----
From: Igor Mammedov [mailto:[email protected]]
Sent: Thursday, January 11, 2018 9:05 PM
To: Zhoujian (jay) <[email protected]>
Cc: [email protected]; [email protected]; Huangweidong (C) <[email protected]>; wangxin (U) <[email protected]>; Gonglei
(Arei) <[email protected]>; Liuzhe (Ahriy, Euler) <[email protected]>
Subject: Re: [PATCH v5 0/4] vhost: two fixes and used_memslots refactoring

On Wed, 10 Jan 2018 00:39:02 +0800
Jay Zhou <[email protected]> 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?

Quoted 6 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 2 lines

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

Quoted 24 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

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.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

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 +++++++++++++++++++++++++++----

----

Quoted 10 lines
Quoted 10 lines

----

Quoted 9 lines
 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

#5 lore raw
In reply to Igor Mammedov
Quoted 9 lines · Igor Mammedov

On Wed, 10 Jan 2018 00:39:02 +0800
Jay Zhou <[email protected]> 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?

Quoted 21 lines
Quoted 21 lines

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

#6 lore raw
Quoted 4 lines · On Thu, 11 Jan 2018 22:13:25 +0200 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 3 lines · Igor Mammedov

On Wed, 10 Jan 2018 00:39:02 +0800
Jay Zhou <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines

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.

Quoted 22 lines
Quoted 22 lines
Quoted 22 lines

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