Skip to content

Commit

Permalink
Merge pull request #6167 from dmitrygx/topic/uct/ib_handle_multi_canc…
Browse files Browse the repository at this point in the history
…el_v1_10

UCT/IB/RC: Handle multiple flush cancel w/o completion [v1.10.x]
  • Loading branch information
yosefe authored Jan 22, 2021
2 parents 0427865 + f25cd86 commit 567e3ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/uct/ib/rc/accel/rc_mlx5_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ ucs_status_t uct_rc_mlx5_ep_flush(uct_ep_h tl_ep, unsigned flags,
UCT_RC_MLX5_EP_DECL(tl_ep, iface, ep);
uct_ib_mlx5_md_t *md = ucs_derived_of(iface->super.super.super.md,
uct_ib_mlx5_md_t);
int already_canceled = ep->super.flags & UCT_RC_EP_FLAG_FLUSH_CANCEL;
ucs_status_t status;
uint16_t sn;

Expand All @@ -585,7 +586,7 @@ ucs_status_t uct_rc_mlx5_ep_flush(uct_ep_h tl_ep, unsigned flags,
sn = ep->tx.wq.sig_pi;
}

if (ucs_unlikely(flags & UCT_FLUSH_FLAG_CANCEL)) {
if (ucs_unlikely((flags & UCT_FLUSH_FLAG_CANCEL) && !already_canceled)) {
status = uct_ib_mlx5_modify_qp_state(md, &ep->tx.wq.super, IBV_QPS_ERR);
if (status != UCS_OK) {
return status;
Expand Down
1 change: 0 additions & 1 deletion src/uct/ib/rc/base/rc_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ ucs_status_t uct_rc_ep_flush(uct_rc_ep_t *ep, int16_t max_available,

if (ucs_unlikely(flags & UCT_FLUSH_FLAG_CANCEL)) {
ucs_assert(ucs_arbiter_group_is_empty(&ep->arb_group));
ucs_assert(!(ep->flags & UCT_RC_EP_FLAG_FLUSH_CANCEL));
ep->flags |= UCT_RC_EP_FLAG_FLUSH_CANCEL;
}

Expand Down
5 changes: 3 additions & 2 deletions src/uct/ib/rc/verbs/rc_verbs_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ ucs_status_t uct_rc_verbs_ep_flush(uct_ep_h tl_ep, unsigned flags,
uct_completion_t *comp)
{
uct_rc_verbs_iface_t *iface = ucs_derived_of(tl_ep->iface, uct_rc_verbs_iface_t);
uct_rc_verbs_ep_t *ep = ucs_derived_of(tl_ep, uct_rc_verbs_ep_t);
uct_rc_verbs_ep_t *ep = ucs_derived_of(tl_ep, uct_rc_verbs_ep_t);
int already_canceled = ep->super.flags & UCT_RC_EP_FLAG_FLUSH_CANCEL;
ucs_status_t status;

status = uct_rc_ep_flush(&ep->super, iface->config.tx_max_wr, flags);
Expand All @@ -427,7 +428,7 @@ ucs_status_t uct_rc_verbs_ep_flush(uct_ep_h tl_ep, unsigned flags,
uct_rc_verbs_ep_post_flush(ep, IBV_SEND_SIGNALED);
}

if (ucs_unlikely(flags & UCT_FLUSH_FLAG_CANCEL)) {
if (ucs_unlikely((flags & UCT_FLUSH_FLAG_CANCEL) && !already_canceled)) {
status = uct_ib_modify_qp(ep->qp, IBV_QPS_ERR);
if (status != UCS_OK) {
return status;
Expand Down

0 comments on commit 567e3ed

Please sign in to comment.