Jason Wang
2020-Sep-07 10:53 UTC
[PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
----- Original Message -----> If the memory map changes before the driver status is > VIRTIO_CONFIG_S_DRIVER_OK, don't attempt to create resources because it > may fail. For example, if the VQ is not ready there is no point in > creating resources. > > Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") > Signed-off-by: Eli Cohen <elic at nvidia.com> > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c > b/drivers/vdpa/mlx5/net/mlx5_vnet.c > index 9df69d5efe8c..c89cd48a0aab 100644 > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > @@ -1645,6 +1645,9 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_net > *ndev, struct vhost_iotlb * > if (err) > goto err_mr; > > + if (!(ndev->mvdev.status & VIRTIO_CONFIG_S_DRIVER_OK)) > + return 0; > +I'm not sure I get this. It looks to me if set_map() is called before DRIVER_OK, we won't build any mapping? Thanks> restore_channels_info(ndev); > err = setup_driver(ndev); > if (err) > -- > 2.26.0 > >
Maybe Matching Threads
- [PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
- [PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
- [PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
- [PATCH v2] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
- [PATCH v3] vdpa/mlx5: should not activate virtq object when suspended