@@ -23,7 +23,7 @@ int ibv_get_srq_num(struct ibv_srq *srq, uint32_t *srq_num);
# DESCRIPTION
-**ibv_get_srq_num()** return srq number associated with the given shared
+**ibv_get_srq_num()** return srq number associated with the given XRC shared
receive queue The argument *srq* is an ibv_srq struct, as defined in
<infiniband/verbs.h>. *srq_num* is an output parameter that holds the returned
srq number.
@@ -2898,8 +2898,12 @@ int mlx5_get_srq_num(struct ibv_srq *srq, uint32_t *srq_num)
{
struct mlx5_srq *msrq = to_msrq(srq);
+ /* May be used by DC users in addition to XRC ones, as there is no
+ * indication on the SRQ for DC usage we can't force the above check.
+ * Even DC users are encouraged to use mlx5dv_init_obj() to get
+ * the SRQN.
+ */
*srq_num = msrq->srqn;
-
return 0;
}
Fix ibv_get_srq_num() man page to mention that it's applicable only when the given SRQ is an XRC as defined by its specification. Signed-off-by: Yishai Hadas <yishaih@mellanox.com> --- libibverbs/man/ibv_get_srq_num.3.md | 2 +- providers/mlx5/verbs.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)