virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Si-Wei Liu <si-wei.liu@oracle.com>
To: Eli Cohen <elic@nvidia.com>,
	mst@redhat.com, jasowang@redhat.com,
	virtualization@lists.linux-foundation.org
Cc: lvivier@redhat.com, eperezma@redhat.com
Subject: Re: [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features
Date: Tue, 11 Jan 2022 01:31:28 -0800	[thread overview]
Message-ID: <00619365-173b-bd2c-3a9f-c6d7084631fb@oracle.com> (raw)
In-Reply-To: <20220111072253.101884-1-elic@nvidia.com>



On 1/10/2022 11:22 PM, Eli Cohen wrote:
> Make sure the decision whether an index received trough a callback is
> valid or not consults the negotiated features.
>
> Signed-off-by: Eli Cohen <elic@nvidia.com>
Reviewed-by: Si-Wei Liu<si-wei.liu@oracle.com>

Is there more for this series? Subject says there're 4 patches in total?

> ---
>   drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index d1ff65065fb1..9eacfdb48434 100644
> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> @@ -133,10 +133,14 @@ struct mlx5_vdpa_virtqueue {
>   
>   static bool is_index_valid(struct mlx5_vdpa_dev *mvdev, u16 idx)
>   {
> -	if (unlikely(idx > mvdev->max_idx))
> -		return false;
> +	if (!(mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_MQ))) {
> +		if (!(mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ)))
> +			return idx < 2;
> +		else
> +			return idx < 3;
> +	}
>   
> -	return true;
> +	return idx <= mvdev->max_idx;
>   }
>   
>   struct mlx5_vdpa_net {

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

       reply	other threads:[~2022-01-11  9:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220111072253.101884-1-elic@nvidia.com>
2022-01-11  9:31 ` Si-Wei Liu [this message]
     [not found]   ` <20220111111617.GA156130@mtl-vdi-166.wap.labs.mlnx>
2022-01-11 12:09     ` [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features Michael S. Tsirkin
2022-01-11 12:10   ` Michael S. Tsirkin
2022-01-12  2:38     ` Jason Wang
2022-01-11 15:57 ` Michael S. Tsirkin
     [not found]   ` <20220111160357.GA168085@mtl-vdi-166.wap.labs.mlnx>
2022-01-11 16:54     ` 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=00619365-173b-bd2c-3a9f-c6d7084631fb@oracle.com \
    --to=si-wei.liu@oracle.com \
    --cc=elic@nvidia.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).