Re: [PATCH rdma-core 1/1] mlx5: Account for at least 1 medium bfreg in low_lat_uuars check

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

 



On Fri, Apr 27, 2018 at 01:49:55PM -0400, Doug Ledford wrote:
> On Mon, 2018-04-23 at 17:58 +0000, Rohit Zambre wrote:
> > The calculation of need_uuar_lock rightly accounts for at least 1 medium
> > bfreg. However, the user can wrongly request for all but one uuars to be
> > low latency uuars.
> >
> > For example, setting MLX5_TOTAL_UUARS=16 and MLX5_NUM_LOW_LAT_UUARS=15
> > doesn't throw any error but the user gets only 14 low latency uuars;
> > need_lock for bf_1 evaluates to 1. In this case, the first QP of the
> > context is mapped to bf_1 which is not a low latency uuar.
> >
> > Signed-off-by: Rohit Zambre <rzambre@xxxxxxx>
> > ---
> >  providers/mlx5/mlx5.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c
> > index 5590241..2a09a95 100644
> > --- a/providers/mlx5/mlx5.c
> > +++ b/providers/mlx5/mlx5.c
> > @@ -1026,7 +1026,8 @@ static struct verbs_context *mlx5_alloc_context(struct ibv_device *ibdev,
> >  		goto err_free;
> >  	}
> >
> > -	if (low_lat_uuars > tot_uuars - 1) {
> > +	/* account for at least 1 med bfreg and the 0th uuar */
> > +	if (low_lat_uuars > tot_uuars - 2) {
> >  		errno = ENOMEM;
> >  		goto err_free;
> >  	}
>
> It would be nice if someone from Mellanox who knows the hardware in more
> detail would confirm this and the matching fix for the kernel.

Thanks Doug for waiting to us, we started to look on it before weekend,
but didn't finish. Yishai will try his best to answer today.

Thanks

>
> --
> Doug Ledford <dledford@xxxxxxxxxx>
>     GPG KeyID: B826A3330E572FDD
>     Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD


Attachment: signature.asc
Description: PGP signature


[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