ucs_status_t uct_rc_verbs_ep_atomic_add64(uct_ep_h tl_ep, uint64_t add, uint64_t remote_addr, uct_rkey_t rkey) { 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_iface_send_desc_t *desc; /* TODO don't allocate descriptor - have dummy buffer */ UCT_RC_CHECK_RES(&iface->super, &ep->super); UCT_RC_IFACE_GET_TX_ATOMIC_ADD_DESC(&iface->super, &iface->verbs_common.short_desc_mp, desc); uct_rc_verbs_ep_atomic_post(ep, IBV_WR_ATOMIC_FETCH_AND_ADD, add, 0, remote_addr, rkey, desc, IBV_SEND_SIGNALED); return UCS_OK; }
static UCS_F_ALWAYS_INLINE ucs_status_t uct_rc_verbs_ep_atomic(uct_rc_verbs_ep_t *ep, int opcode, void *result, uint64_t compare_add, uint64_t swap, uint64_t remote_addr, uct_rkey_t rkey, uct_completion_t *comp) { uct_rc_verbs_iface_t *iface = ucs_derived_of(ep->super.super.super.iface, uct_rc_verbs_iface_t); uct_rc_iface_send_desc_t *desc; UCT_RC_CHECK_RES(&iface->super, &ep->super); UCT_RC_IFACE_GET_TX_ATOMIC_DESC(&iface->super, &iface->verbs_common.short_desc_mp, desc, iface->super.config.atomic64_handler, result, comp); uct_rc_verbs_ep_atomic_post(ep, opcode, compare_add, swap, remote_addr, rkey, desc, IBV_SEND_SIGNALED); return UCS_INPROGRESS; }
ucs_status_t uct_rc_verbs_ep_atomic_add64(uct_ep_h tl_ep, uint64_t add, uint64_t remote_addr, uct_rkey_t rkey) { 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_iface_send_desc_t *desc; /* TODO don't allocate descriptor - have dummy buffer */ UCT_RC_VERBS_CHECK_RES(iface, ep); UCT_RC_IFACE_GET_TX_DESC(&iface->super, iface->short_desc_mp, desc); desc->super.handler = (uct_rc_send_handler_t)ucs_mpool_put; uct_rc_verbs_ep_atomic_post(ucs_derived_of(tl_ep, uct_rc_verbs_ep_t), IBV_WR_ATOMIC_FETCH_AND_ADD, add, 0, remote_addr, rkey, desc, IBV_SEND_SIGNALED); return UCS_OK; }
ucs_status_t uct_rc_verbs_ep_atomic64_post(uct_ep_h tl_ep, unsigned opcode, uint64_t value, uint64_t remote_addr, uct_rkey_t rkey) { 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_iface_send_desc_t *desc; if (opcode != UCT_ATOMIC_OP_ADD) { return UCS_ERR_UNSUPPORTED; } /* TODO don't allocate descriptor - have dummy buffer */ UCT_RC_CHECK_RES(&iface->super, &ep->super); UCT_RC_IFACE_GET_TX_ATOMIC_DESC(&iface->super, &iface->short_desc_mp, desc); uct_rc_verbs_ep_atomic_post(ep, IBV_WR_ATOMIC_FETCH_AND_ADD, value, 0, remote_addr, rkey, desc, IBV_SEND_SIGNALED); return UCS_OK; }
static UCS_F_ALWAYS_INLINE ucs_status_t uct_rc_verbs_ep_atomic(uct_rc_verbs_ep_t *ep, int opcode, void *result, uint64_t compare_add, uint64_t swap, uint64_t remote_addr, uct_rkey_t rkey, uct_completion_t *comp) { uct_rc_verbs_iface_t *iface = ucs_derived_of(ep->super.super.super.iface, uct_rc_verbs_iface_t); uct_rc_iface_send_desc_t *desc; UCT_CHECK_PARAM(comp != NULL, "completion must be non-NULL"); UCT_RC_VERBS_CHECK_RES(iface, ep); UCT_RC_IFACE_GET_TX_DESC(&iface->super, iface->short_desc_mp, desc); desc->super.handler = iface->config.atomic64_handler; desc->super.result = result; desc->super.user_comp = comp; uct_rc_verbs_ep_atomic_post(ep, opcode, compare_add, swap, remote_addr, rkey, desc, IBV_SEND_SIGNALED); return UCS_INPROGRESS; }