static UCS_F_ALWAYS_INLINE void uct_rc_verbs_ep_post_send(uct_rc_verbs_iface_t* iface, uct_rc_verbs_ep_t* ep, struct ibv_send_wr *wr, int send_flags) { struct ibv_send_wr *bad_wr; int ret; uct_rc_txqp_check(&ep->super.txqp); if (!(send_flags & IBV_SEND_SIGNALED)) { send_flags |= uct_rc_iface_tx_moderation(&iface->super, &ep->super.txqp, IBV_SEND_SIGNALED); } wr->send_flags = send_flags; wr->wr_id = uct_rc_txqp_unsignaled(&ep->super.txqp); uct_ib_log_post_send(&iface->super.super, ep->super.txqp.qp, wr, (wr->opcode == IBV_WR_SEND) ? uct_rc_ep_am_packet_dump : NULL); UCT_IB_INSTRUMENT_RECORD_SEND_WR_LEN("uct_rc_verbs_ep_post_send", wr); ret = ibv_post_send(ep->super.txqp.qp, wr, &bad_wr); if (ret != 0) { ucs_fatal("ibv_post_send() returned %d (%m)", ret); } uct_rc_verbs_txqp_posted(&ep->super.txqp, &ep->txcnt, &iface->super, send_flags & IBV_SEND_SIGNALED); }
static UCS_F_ALWAYS_INLINE void uct_rc_verbs_ep_post_send(uct_rc_verbs_iface_t* iface, uct_rc_verbs_ep_t* ep, struct ibv_send_wr *wr, int send_flags, int max_log_sge) { struct ibv_send_wr *bad_wr; int ret; uct_rc_txqp_check(&ep->super.txqp); if (!(send_flags & IBV_SEND_SIGNALED)) { send_flags |= uct_rc_iface_tx_moderation(&iface->super, &ep->super.txqp, IBV_SEND_SIGNALED); } if (wr->opcode == IBV_WR_RDMA_READ) { send_flags |= uct_rc_ep_atomic_fence(&iface->super, &ep->fi, IBV_SEND_FENCE); } wr->send_flags = send_flags; wr->wr_id = uct_rc_txqp_unsignaled(&ep->super.txqp); uct_ib_log_post_send(&iface->super.super, ep->super.txqp.qp, wr, max_log_sge, (wr->opcode == IBV_WR_SEND) ? uct_rc_ep_packet_dump : NULL); ret = ibv_post_send(ep->super.txqp.qp, wr, &bad_wr); if (ret != 0) { ucs_fatal("ibv_post_send() returned %d (%m)", ret); } uct_rc_verbs_txqp_posted(&ep->super.txqp, &ep->txcnt, &iface->super, send_flags & IBV_SEND_SIGNALED); }
static inline void uct_ud_verbs_iface_tx_data(uct_ud_verbs_iface_t *iface, uct_ud_verbs_ep_t *ep) { int UCS_V_UNUSED ret; struct ibv_send_wr *bad_wr; uct_ud_verbs_iface_fill_tx_wr(iface, ep, &iface->tx.wr_bcp, 0); UCT_UD_EP_HOOK_CALL_TX(&ep->super, (uct_ud_neth_t *)iface->tx.sge[0].addr); ret = ibv_post_send(iface->super.qp, &iface->tx.wr_bcp, &bad_wr); ucs_assertv(ret == 0, "ibv_post_send() returned %d (%m)", ret); uct_ib_log_post_send(iface->super.qp, &iface->tx.wr_bcp, NULL); }
static inline void uct_ud_verbs_iface_tx_inl(uct_ud_verbs_iface_t *iface, uct_ud_verbs_ep_t *ep, const void *buffer, unsigned length) { int UCS_V_UNUSED ret; struct ibv_send_wr *bad_wr; iface->tx.sge[1].addr = (uintptr_t)buffer; iface->tx.sge[1].length = length; uct_ud_verbs_iface_fill_tx_wr(iface, ep, &iface->tx.wr_inl, IBV_SEND_INLINE); UCT_UD_EP_HOOK_CALL_TX(&ep->super, (uct_ud_neth_t *)iface->tx.sge[0].addr); ret = ibv_post_send(iface->super.qp, &iface->tx.wr_inl, &bad_wr); ucs_assertv(ret == 0, "ibv_post_send() returned %d (%m)", ret); uct_ib_log_post_send(iface->super.qp, &iface->tx.wr_inl, NULL); }
static inline void uct_ud_verbs_ep_tx_skb(uct_ud_verbs_iface_t *iface, uct_ud_verbs_ep_t *ep, uct_ud_send_skb_t *skb, unsigned flags) { int UCS_V_UNUSED ret; struct ibv_send_wr *bad_wr; iface->tx.sge[0].lkey = skb->lkey; iface->tx.sge[0].length = skb->len; iface->tx.sge[0].addr = (uintptr_t)skb->neth; uct_ud_verbs_iface_fill_tx_wr(iface, ep, &iface->tx.wr_skb, flags); UCT_UD_EP_HOOK_CALL_TX(&ep->super, (uct_ud_neth_t *)iface->tx.sge[0].addr); ret = ibv_post_send(iface->super.qp, &iface->tx.wr_skb, &bad_wr); ucs_assertv(ret == 0, "ibv_post_send() returned %d (%m)", ret); uct_ib_log_post_send(&iface->super.super, iface->super.qp, &iface->tx.wr_skb, NULL); --iface->super.tx.available; }
static UCS_F_ALWAYS_INLINE void uct_rc_verbs_ep_post_send(uct_rc_verbs_iface_t* iface, uct_rc_verbs_ep_t* ep, struct ibv_send_wr *wr, int send_flags) { struct ibv_send_wr *bad_wr; int ret; if (!(send_flags & IBV_SEND_SIGNALED)) { send_flags |= uct_rc_iface_tx_moderation(&iface->super, &ep->super, IBV_SEND_SIGNALED); } wr->send_flags = send_flags; wr->wr_id = ep->super.unsignaled; uct_ib_log_post_send(ep->super.qp, wr, (wr->opcode == IBV_WR_SEND) ? uct_rc_ep_am_packet_dump : NULL); ret = ibv_post_send(ep->super.qp, wr, &bad_wr); if (ret != 0) { ucs_fatal("ibv_post_send() returned %d (%m)", ret); } uct_rc_verbs_ep_posted(ep, send_flags & IBV_SEND_SIGNALED); }