diff mbox series

[vhost,18/23] vdpa/mlx5: Forward error in suspend/resume device

Message ID 20240617-stage-vdpa-vq-precreate-v1-18-8c0483f0ca2a@nvidia.com (mailing list archive)
State Superseded
Headers show
Series vdpa/mlx5: Pre-create HW VQs to reduce LM downtime | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Dragos Tatulea June 17, 2024, 3:07 p.m. UTC
Start using the suspend/resume_vq() error return codes previously added.

Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
---
 drivers/vdpa/mlx5/net/mlx5_vnet.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Zhu Yanjun June 23, 2024, 11:19 a.m. UTC | #1
在 2024/6/17 23:07, Dragos Tatulea 写道:
> Start using the suspend/resume_vq() error return codes previously added.
> 
> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
> ---
>   drivers/vdpa/mlx5/net/mlx5_vnet.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index f5d5b25cdb01..0e1c1b7ff297 100644
> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> @@ -3436,22 +3436,25 @@ static int mlx5_vdpa_suspend(struct vdpa_device *vdev)
>   {
>   	struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
>   	struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
> +	int err;

Reverse Christmas Tree?

Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>

Zhu Yanjun
>   
>   	mlx5_vdpa_info(mvdev, "suspending device\n");
>   
>   	down_write(&ndev->reslock);
>   	unregister_link_notifier(ndev);
> -	suspend_vqs(ndev);
> +	err = suspend_vqs(ndev);
>   	mlx5_vdpa_cvq_suspend(mvdev);
>   	mvdev->suspended = true;
>   	up_write(&ndev->reslock);
> -	return 0;
> +
> +	return err;
>   }
>   
>   static int mlx5_vdpa_resume(struct vdpa_device *vdev)
>   {
>   	struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
>   	struct mlx5_vdpa_net *ndev;
> +	int err;
>   
>   	ndev = to_mlx5_vdpa_ndev(mvdev);
>   
> @@ -3459,10 +3462,11 @@ static int mlx5_vdpa_resume(struct vdpa_device *vdev)
>   
>   	down_write(&ndev->reslock);
>   	mvdev->suspended = false;
> -	resume_vqs(ndev);
> +	err = resume_vqs(ndev);
>   	register_link_notifier(ndev);
>   	up_write(&ndev->reslock);
> -	return 0;
> +
> +	return err;
>   }
>   
>   static int mlx5_set_group_asid(struct vdpa_device *vdev, u32 group,
>
Dragos Tatulea June 26, 2024, 9:28 a.m. UTC | #2
On Sun, 2024-06-23 at 19:19 +0800, Zhu Yanjun wrote:
> 在 2024/6/17 23:07, Dragos Tatulea 写道:
> > Start using the suspend/resume_vq() error return codes previously added.
> > 
> > Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
> > Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
> > ---
> >   drivers/vdpa/mlx5/net/mlx5_vnet.c | 12 ++++++++----
> >   1 file changed, 8 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> > index f5d5b25cdb01..0e1c1b7ff297 100644
> > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> > @@ -3436,22 +3436,25 @@ static int mlx5_vdpa_suspend(struct vdpa_device *vdev)
> >   {
> >   	struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
> >   	struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
> > +	int err;
> 
> Reverse Christmas Tree?
Would have fixed the code if it would have been part of the patch. But it isn't.

> 
> Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> 
Thanks!

> Zhu Yanjun
> >   
> >   	mlx5_vdpa_info(mvdev, "suspending device\n");
> >   
> >   	down_write(&ndev->reslock);
> >   	unregister_link_notifier(ndev);
> > -	suspend_vqs(ndev);
> > +	err = suspend_vqs(ndev);
> >   	mlx5_vdpa_cvq_suspend(mvdev);
> >   	mvdev->suspended = true;
> >   	up_write(&ndev->reslock);
> > -	return 0;
> > +
> > +	return err;
> >   }
> >   
> >   static int mlx5_vdpa_resume(struct vdpa_device *vdev)
> >   {
> >   	struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
> >   	struct mlx5_vdpa_net *ndev;
> > +	int err;
> >   
> >   	ndev = to_mlx5_vdpa_ndev(mvdev);
> >   
> > @@ -3459,10 +3462,11 @@ static int mlx5_vdpa_resume(struct vdpa_device *vdev)
> >   
> >   	down_write(&ndev->reslock);
> >   	mvdev->suspended = false;
> > -	resume_vqs(ndev);
> > +	err = resume_vqs(ndev);
> >   	register_link_notifier(ndev);
> >   	up_write(&ndev->reslock);
> > -	return 0;
> > +
> > +	return err;
> >   }
> >   
> >   static int mlx5_set_group_asid(struct vdpa_device *vdev, u32 group,
> > 
>
diff mbox series

Patch

diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index f5d5b25cdb01..0e1c1b7ff297 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -3436,22 +3436,25 @@  static int mlx5_vdpa_suspend(struct vdpa_device *vdev)
 {
 	struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
 	struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
+	int err;
 
 	mlx5_vdpa_info(mvdev, "suspending device\n");
 
 	down_write(&ndev->reslock);
 	unregister_link_notifier(ndev);
-	suspend_vqs(ndev);
+	err = suspend_vqs(ndev);
 	mlx5_vdpa_cvq_suspend(mvdev);
 	mvdev->suspended = true;
 	up_write(&ndev->reslock);
-	return 0;
+
+	return err;
 }
 
 static int mlx5_vdpa_resume(struct vdpa_device *vdev)
 {
 	struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
 	struct mlx5_vdpa_net *ndev;
+	int err;
 
 	ndev = to_mlx5_vdpa_ndev(mvdev);
 
@@ -3459,10 +3462,11 @@  static int mlx5_vdpa_resume(struct vdpa_device *vdev)
 
 	down_write(&ndev->reslock);
 	mvdev->suspended = false;
-	resume_vqs(ndev);
+	err = resume_vqs(ndev);
 	register_link_notifier(ndev);
 	up_write(&ndev->reslock);
-	return 0;
+
+	return err;
 }
 
 static int mlx5_set_group_asid(struct vdpa_device *vdev, u32 group,