Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/uct/ib/rc/base/rc_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ UCS_CLASS_INIT_FUNC(uct_rc_ep_t, uct_rc_iface_t *iface, uint32_t qp_num,
return status;
}

self->path_index = UCT_EP_PARAMS_GET_PATH_INDEX(params);
self->flags = 0;
self->path_index = UCT_EP_PARAMS_GET_PATH_INDEX(params);
self->flags = 0;
self->txqp_reserve = 0;

status = uct_rc_fc_init(&self->fc, iface UCS_STATS_ARG(self->super.stats));
if (status != UCS_OK) {
Expand Down Expand Up @@ -344,6 +345,7 @@ ucs_arbiter_cb_result_t uct_rc_ep_process_pending(ucs_arbiter_t *arbiter,

status = uct_rc_iface_invoke_pending_cb(iface, req);
if (status == UCS_OK) {
ep->txqp_reserve = 0;
return UCS_ARBITER_CB_RESULT_REMOVE_ELEM;
} else if (status == UCS_INPROGRESS) {
return UCS_ARBITER_CB_RESULT_NEXT_GROUP;
Expand Down
12 changes: 9 additions & 3 deletions src/uct/ib/rc/base/rc_ep.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ enum {
}

#define UCT_RC_CHECK_TXQP_RET(_iface, _ep, _ret) \
if (uct_rc_txqp_available(&(_ep)->txqp) <= 0) { \
UCT_RC_CHECK_TXQP_VALUE_RET(_iface, _ep, _ret, 0)

#define UCT_RC_CHECK_TXQP_VALUE_RET(_iface, _ep, _ret, _value) \
if (uct_rc_txqp_available(&(_ep)->txqp) <= (_value)) { \
(_ep)->txqp_reserve = ucs_max((_ep)->txqp_reserve, \
(uint16_t)(_value)); \
UCS_STATS_UPDATE_COUNTER((_ep)->txqp.stats, UCT_RC_TXQP_STAT_QP_FULL, 1); \
UCS_STATS_UPDATE_COUNTER((_ep)->super.stats, UCT_EP_STAT_NO_RES, 1); \
return _ret; \
Expand Down Expand Up @@ -219,6 +224,7 @@ struct uct_rc_ep {
uint32_t flush_rkey;
uct_rc_fc_t fc;
uint16_t atomic_mr_offset;
uint16_t txqp_reserve;
uint8_t path_index;
uint8_t flags;
};
Expand Down Expand Up @@ -346,8 +352,8 @@ static UCS_F_ALWAYS_INLINE int uct_rc_ep_has_tx_resources(uct_rc_ep_t *ep)
{
uct_rc_iface_t *iface = ucs_derived_of(ep->super.super.iface, uct_rc_iface_t);

return (uct_rc_txqp_available(&ep->txqp) > 0) &&
uct_rc_fc_has_resources(iface, &ep->fc);
return (uct_rc_txqp_available(&ep->txqp) > ep->txqp_reserve) &&
uct_rc_fc_has_resources(iface, &ep->fc);
}

static UCS_F_ALWAYS_INLINE void
Expand Down
Loading