Skip to content

Commit

Permalink
prov/cxi: Define domain emit idc amo
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 24, 2024
1 parent 263614e commit dc5cc7f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions prov/cxi/include/cxip.h
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,11 @@ int cxip_domain_emit_idc_put(struct cxip_domain *dom, uint16_t vni,
int cxip_domain_emit_dma(struct cxip_domain *dom, uint16_t vni,
enum cxi_traffic_class tc, struct c_full_dma_cmd *dma,
uint64_t flags);
int cxip_domain_emit_idc_amo(struct cxip_domain *dom, uint16_t vni,
enum cxi_traffic_class tc,
const struct c_cstate_cmd *c_state,
const struct c_idc_amo_cmd *amo, uint64_t flags,
bool fetching, bool flush);

static inline bool cxip_domain_mr_cache_enabled(struct cxip_domain *dom)
{
Expand Down
36 changes: 36 additions & 0 deletions prov/cxi/src/cxip_dom.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,42 @@ int cxip_domain_emit_dma(struct cxip_domain *dom, uint16_t vni,
return ret;
}

int cxip_domain_emit_idc_amo(struct cxip_domain *dom, uint16_t vni,
enum cxi_traffic_class tc,
const struct c_cstate_cmd *c_state,
const struct c_idc_amo_cmd *amo, uint64_t flags,
bool fetching, bool flush)
{
int ret;
struct cxip_domain_cmdq *cmdq;

ofi_genlock_lock(&dom->cmdq_lock);

ret = cxip_domain_find_cmdq(dom, vni, tc, &cmdq);
if (ret) {
CXIP_WARN("Failed to find command queue: %d\n", ret);
goto out_unlock;
}

ret = cxip_cmdq_emic_idc_amo(cmdq->cmdq, c_state, amo, flags,
fetching, flush);
if (ret) {
CXIP_WARN("Failed to emit idc_amo: %d\n", ret);
goto out_unlock;
}

cxi_cq_ring(cmdq->cmdq->dev_cmdq);

ofi_genlock_unlock(&dom->cmdq_lock);

return FI_SUCCESS;

out_unlock:
ofi_genlock_unlock(&dom->cmdq_lock);

return ret;
}

/*
* cxip_domain_req_alloc() - Allocate a domain control buffer ID
*/
Expand Down

0 comments on commit dc5cc7f

Please sign in to comment.