Skip to content

Commit

Permalink
mlx5: Use valid qp type to determine wqe buffer allocation type
Browse files Browse the repository at this point in the history
The library has env based setup (e.g HUGE_RC=y, etc) for the user to
provide directives/hints re how to allocate the WQE buffer per qp type.

Currently, the ibv qp instance is used for that, however, it's qp type
field is not initialized at the time mlx5_alloc_qp_buf is called.

As a result, the user hint/directive is ignored.

To fix that, pick the qp type from the provided attributes.

Note: this commit refers to the compatibility mode per QP type. The
default mode (i.e. MLX_QP_ALLOC_TYPE) which refers to all QP types,
works fine.

Signed-off-by: Or Gerlitz <ogerlitz@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
  • Loading branch information
Or Gerlitz authored and Yishai Hadas committed Mar 15, 2022
1 parent b061d2c commit 289fc09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion providers/mlx5/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ static int mlx5_alloc_qp_buf(struct ibv_context *context,
}

/* compatibility support */
qp_huge_key = qptype2key(qp->ibv_qp->qp_type);
qp_huge_key = qptype2key(attr->qp_type);
if (mlx5_use_huge(qp_huge_key))
default_alloc_type = MLX5_ALLOC_TYPE_HUGE;

Expand Down

0 comments on commit 289fc09

Please sign in to comment.