public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat•com>
To: Eli Cohen <elic@nvidia•com>
Cc: Jason Wang <jasowang@redhat•com>, Cindy Lu <lulu@redhat•com>,
	virtualization@lists•linux-foundation.org,
	netdev <netdev@vger•kernel.org>
Subject: Re: [PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK
Date: Mon, 7 Sep 2020 07:34:00 -0400	[thread overview]
Message-ID: <20200907073319-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20200907075136.GA114876@mtl-vdi-166.wap.labs.mlnx>

On Mon, Sep 07, 2020 at 10:51:36AM +0300, Eli Cohen wrote:
> 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@nvidia•com>


Could you add a bit more data about the problem to the log?
To be more exact, what exactly happens right now?

> ---
>  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;
> +
>  	restore_channels_info(ndev);
>  	err = setup_driver(ndev);
>  	if (err)
> -- 
> 2.26.0


  parent reply	other threads:[~2020-09-07 11:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07  7:51 [PATCH] vdpa/mlx5: Setup driver only if VIRTIO_CONFIG_S_DRIVER_OK Eli Cohen
2020-09-07 10:53 ` Jason Wang
2020-09-07 11:03   ` Eli Cohen
2020-09-09  2:06     ` Jason Wang
2020-09-07 11:34 ` Michael S. Tsirkin [this message]
2020-09-07 11:43   ` Eli Cohen
2020-09-08 12:04     ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200907073319-mutt-send-email-mst@kernel.org \
    --to=mst@redhat$(echo .)com \
    --cc=elic@nvidia$(echo .)com \
    --cc=jasowang@redhat$(echo .)com \
    --cc=lulu@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=virtualization@lists$(echo .)linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox