[PATCH 09/40] vdpa: no repeat setting shadow_data

Si-Wei Liu posted 40 patches 11 months, 3 weeks ago
[PATCH 09/40] vdpa: no repeat setting shadow_data
Posted by Si-Wei Liu 11 months, 3 weeks ago
Since shadow_data is now shared in the parent data struct, it
just needs to be set only once by the first vq. This change
will make shadow_data independent of svq enabled state, which
can be optionally turned off when SVQ descritors and device
driver areas are all isolated to a separate address space.

Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
---
 net/vhost-vdpa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index c9bfc6f..2555897 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -387,13 +387,12 @@ static int vhost_vdpa_net_data_start(NetClientState *nc)
     if (s->always_svq ||
         migration_is_setup_or_active(migrate_get_current()->state)) {
         v->shadow_vqs_enabled = true;
-        v->shared->shadow_data = true;
     } else {
         v->shadow_vqs_enabled = false;
-        v->shared->shadow_data = false;
     }
 
     if (v->index == 0) {
+        v->shared->shadow_data = v->shadow_vqs_enabled;
         vhost_vdpa_net_data_start_first(s);
         return 0;
     }
-- 
1.8.3.1
Re: [PATCH 09/40] vdpa: no repeat setting shadow_data
Posted by Jason Wang 10 months, 2 weeks ago
On Fri, Dec 8, 2023 at 2:50 AM Si-Wei Liu <si-wei.liu@oracle.com> wrote:
>
> Since shadow_data is now shared in the parent data struct, it
> just needs to be set only once by the first vq. This change
> will make shadow_data independent of svq enabled state, which
> can be optionally turned off when SVQ descritors and device

Typo for descriptors.

> driver areas are all isolated to a separate address space.
>
> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks

> ---
>  net/vhost-vdpa.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index c9bfc6f..2555897 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -387,13 +387,12 @@ static int vhost_vdpa_net_data_start(NetClientState *nc)
>      if (s->always_svq ||
>          migration_is_setup_or_active(migrate_get_current()->state)) {
>          v->shadow_vqs_enabled = true;
> -        v->shared->shadow_data = true;
>      } else {
>          v->shadow_vqs_enabled = false;
> -        v->shared->shadow_data = false;
>      }
>
>      if (v->index == 0) {
> +        v->shared->shadow_data = v->shadow_vqs_enabled;
>          vhost_vdpa_net_data_start_first(s);
>          return 0;
>      }
> --
> 1.8.3.1
>
Re: [PATCH 09/40] vdpa: no repeat setting shadow_data
Posted by Eugenio Perez Martin 11 months, 3 weeks ago
On Thu, Dec 7, 2023 at 7:50 PM Si-Wei Liu <si-wei.liu@oracle.com> wrote:
>
> Since shadow_data is now shared in the parent data struct, it
> just needs to be set only once by the first vq. This change
> will make shadow_data independent of svq enabled state, which
> can be optionally turned off when SVQ descritors and device

descri *p* tors typo.

> driver areas are all isolated to a separate address space.
>
> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>

Can you send this separately so we make this series smaller?

Apart from the typo,

Reviewed-by: Eugenio Pérez <eperezma@redhat.com>

Thanks!

> ---
>  net/vhost-vdpa.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index c9bfc6f..2555897 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -387,13 +387,12 @@ static int vhost_vdpa_net_data_start(NetClientState *nc)
>      if (s->always_svq ||
>          migration_is_setup_or_active(migrate_get_current()->state)) {
>          v->shadow_vqs_enabled = true;
> -        v->shared->shadow_data = true;
>      } else {
>          v->shadow_vqs_enabled = false;
> -        v->shared->shadow_data = false;
>      }
>
>      if (v->index == 0) {
> +        v->shared->shadow_data = v->shadow_vqs_enabled;
>          vhost_vdpa_net_data_start_first(s);
>          return 0;
>      }
> --
> 1.8.3.1
>