Re: [PATCH rdma-next 2/3] RDMA/mlx5: Allow DM allocation for sw_owner_v2 enabled devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 15, 2020 at 05:04:47PM -0300, Jason Gunthorpe wrote:
> On Thu, Sep 03, 2020 at 10:38:56AM +0300, Leon Romanovsky wrote:
> > From: Alex Vesker <valex@xxxxxxxxxx>
> >
> > sw_owner_v2 will replace sw_owner for future devices, this means
> > that if sw_owner_v2 is set sw_owner should be ignored and DM
> > allocation is required for sw_owner_v2 devices to function.
> >
> > Signed-off-by: Alex Vesker <valex@xxxxxxxxxx>
> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
> >  drivers/infiniband/hw/mlx5/main.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > index 99dbef0bccbc..8963b806ad19 100644
> > +++ b/drivers/infiniband/hw/mlx5/main.c
> > @@ -2343,7 +2343,9 @@ static inline int check_dm_type_support(struct mlx5_ib_dev *dev,
> >  			return -EPERM;
> >
> >  		if (!(MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, sw_owner) ||
> > -		      MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, sw_owner)))
> > +		      MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, sw_owner) ||
> > +		      MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, sw_owner_v2) ||
> > +		      MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, sw_owner_v2)))
> >  			return -EOPNOTSUPP;
>
> Shouldn't user space ask for MLX5_IB_UAPI_DM_TYPE_STEERING_SW_V2_ICM
> types too?

For sw_owner_v2 devices, we will return exactly same type of DM,
so there is no need for a new one. The change is to allow creation
of such DM in addition to existing sw_owner devices.


>
> What happens if old user space runs on a new device?

Old userspace will have sw_owner_v2 cap enabled and will get DM as before.
The patch diff is hard to read but the end result will be.
	if (!(MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, sw_owner) ||
	      MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, sw_owner) ||
	      MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, sw_owner_v2) ||
	      MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, sw_owner_v2)))
		return -EOPNOTSUPP;

DevX users are expected to check capabilities and be ready to work with missing ones.

Thanks

>
> Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux