Skip to content

Commit

Permalink
prov/cxi: Define TXC idc msg wrapper func
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Ziemba <ian.ziemba@hpe.com>
  • Loading branch information
iziemba committed Jan 23, 2024
1 parent 1d3c7ac commit 0ea2990
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions prov/cxi/include/cxip.h
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,12 @@ int cxip_txc_emit_dma_amo(struct cxip_txc *txc, uint16_t vni,
struct cxip_cntr *trig_cntr, size_t trig_thresh,
struct c_dma_amo_cmd *amo, uint64_t flags,
bool fetching, bool flush);
int cxip_txc_emit_idc_msg(struct cxip_txc *txc, uint16_t vni,
enum cxi_traffic_class tc,
enum cxi_traffic_class_type tc_type,
const struct c_cstate_cmd *c_state,
const struct c_idc_msg_hdr *msg, const void *buf,
size_t len, uint64_t flags);

void cxip_txc_flush_msg_trig_reqs(struct cxip_txc *txc);

Expand Down
38 changes: 38 additions & 0 deletions prov/cxi/src/cxip_txc.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,3 +694,41 @@ int cxip_txc_emit_dma_amo(struct cxip_txc *txc, uint16_t vni,

return FI_SUCCESS;
}

int cxip_txc_emit_idc_msg(struct cxip_txc *txc, uint16_t vni,
enum cxi_traffic_class tc,
enum cxi_traffic_class_type tc_type,
const struct c_cstate_cmd *c_state,
const struct c_idc_msg_hdr *msg, const void *buf,
size_t len, uint64_t flags)
{
int ret;

if (!cxip_txc_can_emit_op(txc, c_state->event_success_disable))
return -FI_EAGAIN;

/* Ensure correct traffic class is used. */
ret = cxip_txq_cp_set(txc->tx_cmdq, vni, tc, tc_type);
if (ret) {
TXC_WARN(txc, "Failed to set traffic class: %d:%s\n", ret,
fi_strerror(-ret));
return ret;
}

ret = cxip_cmdq_emit_idc_msg(txc->tx_cmdq, c_state, msg, buf, len,
flags);
if (ret) {
TXC_WARN(txc, "Failed to emit idc_msg command: %d:%s\n", ret,
fi_strerror(-ret));
return ret;
}

/* Kick the command queue. */
cxip_txq_ring(txc->tx_cmdq, !!(flags & FI_MORE),
ofi_atomic_get32(&txc->otx_reqs));

if (!c_state->event_success_disable)
ofi_atomic_inc32(&txc->otx_reqs);

return FI_SUCCESS;
}

0 comments on commit 0ea2990

Please sign in to comment.