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. -- Doug Ledford <dledford@xxxxxxxxxx> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Attachment:
signature.asc
Description: This is a digitally signed message part