All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features
       [not found] <20220111072253.101884-1-elic@nvidia.com>
@ 2022-01-11  9:31 ` Si-Wei Liu
       [not found]   ` <20220111111617.GA156130@mtl-vdi-166.wap.labs.mlnx>
  2022-01-11 12:10   ` Michael S. Tsirkin
  2022-01-11 15:57 ` Michael S. Tsirkin
  1 sibling, 2 replies; 6+ messages in thread
From: Si-Wei Liu @ 2022-01-11  9:31 UTC (permalink / raw)
  To: Eli Cohen, mst, jasowang, virtualization; +Cc: lvivier, eperezma



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features
       [not found]   ` <20220111111617.GA156130@mtl-vdi-166.wap.labs.mlnx>
@ 2022-01-11 12:09     ` Michael S. Tsirkin
  0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2022-01-11 12:09 UTC (permalink / raw)
  To: Eli Cohen; +Cc: lvivier, virtualization, eperezma, Si-Wei Liu

On Tue, Jan 11, 2022 at 01:16:17PM +0200, Eli Cohen wrote:
> On Tue, Jan 11, 2022 at 01:31:28AM -0800, Si-Wei Liu wrote:
> > 
> > 
> > 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?
> 
> No,there were unrelated patches in my tree that went out.
> 
> Let me see if there are more patches for me to send and if I do, I will
> resend this in the previous one again.

Yea the series is malformed. Not a single thread, etc.


> > 
> > > ---
> > >   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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features
  2022-01-11  9:31 ` [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features Si-Wei Liu
       [not found]   ` <20220111111617.GA156130@mtl-vdi-166.wap.labs.mlnx>
@ 2022-01-11 12:10   ` Michael S. Tsirkin
  2022-01-12  2:38     ` Jason Wang
  1 sibling, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2022-01-11 12:10 UTC (permalink / raw)
  To: Si-Wei Liu; +Cc: lvivier, virtualization, eperezma, Eli Cohen

On Tue, Jan 11, 2022 at 01:31:28AM -0800, Si-Wei Liu wrote:
> 
> 
> 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?

OK so with this + 1/4 are we OK with v7 of the big patchset now?
I'm kind of beginning to worry it's rushed ...
Jason?


> > ---
> >   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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features
       [not found] <20220111072253.101884-1-elic@nvidia.com>
  2022-01-11  9:31 ` [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features Si-Wei Liu
@ 2022-01-11 15:57 ` Michael S. Tsirkin
       [not found]   ` <20220111160357.GA168085@mtl-vdi-166.wap.labs.mlnx>
  1 sibling, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2022-01-11 15:57 UTC (permalink / raw)
  To: Eli Cohen; +Cc: lvivier, virtualization, eperezma, si-wei.liu

On Tue, Jan 11, 2022 at 09:22:53AM +0200, Eli Cohen wrote:
> Make sure the decision whether an index received trough a callback is

through

> valid or not consults the negotiated features.
> 
> Signed-off-by: Eli Cohen <elic@nvidia.com>

Which commit does this fix?

> ---
>  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 {
> -- 
> 2.34.1

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features
       [not found]   ` <20220111160357.GA168085@mtl-vdi-166.wap.labs.mlnx>
@ 2022-01-11 16:54     ` Michael S. Tsirkin
  0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2022-01-11 16:54 UTC (permalink / raw)
  To: Eli Cohen; +Cc: lvivier, virtualization, eperezma, si-wei.liu

On Tue, Jan 11, 2022 at 06:03:57PM +0200, Eli Cohen wrote:
> On Tue, Jan 11, 2022 at 10:57:57AM -0500, Michael S. Tsirkin wrote:
> > On Tue, Jan 11, 2022 at 09:22:53AM +0200, Eli Cohen wrote:
> > > Make sure the decision whether an index received trough a callback is
> > 
> > through
> 
> Wil fix.
> 
> > 
> > > valid or not consults the negotiated features.
> > > 
> > > Signed-off-by: Eli Cohen <elic@nvidia.com>
> > 
> > Which commit does this fix?
> 
> No specific commit. It's just that I get called for VQ rellated
> callbacks (e.g. get_vq_state), after the device has been reset. So this
> patch provides protection against such cases. I hit this issue while
> testing locally.

To include in the commit log then.
The point of providing the fixes tag with the commit is that it's
then easier to figure out how do changes interact with each other.

> > 
> > > ---
> > >  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 {
> > > -- 
> > > 2.34.1
> > 

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features
  2022-01-11 12:10   ` Michael S. Tsirkin
@ 2022-01-12  2:38     ` Jason Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2022-01-12  2:38 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Laurent Vivier, virtualization, eperezma, Si-Wei Liu, Eli Cohen

On Tue, Jan 11, 2022 at 8:11 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Tue, Jan 11, 2022 at 01:31:28AM -0800, Si-Wei Liu wrote:
> >
> >
> > 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?
>
> OK so with this + 1/4 are we OK with v7 of the big patchset now?
> I'm kind of beginning to worry it's rushed ...
> Jason?

With Eli's new series [PATCH 0/4] Fixes to confing max virtqueues series

We are almost fine, Siwei promise to post other minor issues if necessary.

Thanks

>
>
> > > ---
> > >   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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-12  2:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220111072253.101884-1-elic@nvidia.com>
2022-01-11  9:31 ` [PATCH 2/4] vdpa/mlx5: Fix is_index_valid() to refer to features Si-Wei Liu
     [not found]   ` <20220111111617.GA156130@mtl-vdi-166.wap.labs.mlnx>
2022-01-11 12:09     ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.