From f78fe62d1c49fc1a343640c7f73ee6fa38e9a1ce Mon Sep 17 00:00:00 2001 From: Sergey Oblomov Date: Fri, 18 Dec 2020 10:47:11 +0200 Subject: [PATCH] RC_MLX5/IFACE: fixed assert - fixed issue in iface recv prepost when adaptive progress enabled - fixed assert: rc_mlx5_common.c:128 Assertion `rc_iface->rx.srq.available >= count' failed - don't try prepost recv twice --- src/uct/ib/rc/accel/rc_mlx5_common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/uct/ib/rc/accel/rc_mlx5_common.c b/src/uct/ib/rc/accel/rc_mlx5_common.c index 271cabc763f..8563087348d 100644 --- a/src/uct/ib/rc/accel/rc_mlx5_common.c +++ b/src/uct/ib/rc/accel/rc_mlx5_common.c @@ -114,6 +114,7 @@ unsigned uct_rc_mlx5_iface_srq_post_recv(uct_rc_mlx5_iface_common_t *iface) sizeof(struct mlx5_wqe_srq_next_seg)); ucs_assert(UCS_CIRCULAR_COMPARE16(srq->ready_idx, <=, srq->free_idx)); + ucs_assert(rc_iface->rx.srq.available > 0); wqe_index = srq->ready_idx; for (;;) { @@ -168,6 +169,12 @@ unsigned uct_rc_mlx5_iface_srq_post_recv(uct_rc_mlx5_iface_common_t *iface) void uct_rc_mlx5_iface_common_prepost_recvs(uct_rc_mlx5_iface_common_t *iface) { + /* prepost recvs only if quota available (recvs were not preposted + * before) */ + if (iface->super.rx.srq.quota == 0) { + return; + } + iface->super.rx.srq.available = iface->super.rx.srq.quota; iface->super.rx.srq.quota = 0; uct_rc_mlx5_iface_srq_post_recv(iface);