Re: [PATCH rdma-next 2/3] RDMA/mlx5: Create ODP EQ only when ODP MR is created

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

 



On Thu, Mar 11, 2021 at 08:07:39PM -0400, Jason Gunthorpe wrote:
> On Thu, Mar 04, 2021 at 02:45:16PM +0200, Leon Romanovsky wrote:
> > -static int
> > -mlx5_ib_create_pf_eq(struct mlx5_ib_dev *dev, struct mlx5_ib_pf_eq *eq)
> > +int mlx5r_odp_create_eq(struct mlx5_ib_dev *dev, struct mlx5_ib_pf_eq *eq)
> >  {
> >  	struct mlx5_eq_param param = {};
> > -	int err;
> > +	int err = 0;
> >
> > +	if (eq->core)
> > +		return 0;
> > +
> > +	mutex_lock(&dev->odp_eq_mutex);
>
> The above if is locked wrong.

It is not wrong, but this is optimization for the case that will be always.

We are creating one ODP EQ for the whole life of the device. It means that
once it is created it will always exist and won't be destroyed till device
is destroyed. We don't need lock to check it.

We need lock only for first ODP EQ creation.

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