void tcpx_cq_report_success(struct util_cq *cq, struct tcpx_xfer_entry *xfer_entry) { uint64_t data = 0; uint64_t flags = 0; void *buf = NULL; size_t len = 0; flags = xfer_entry->flags; if (!(flags & FI_MULTI_RECV) && !(flags & FI_COMPLETION)) return; if (xfer_entry->hdr.base_hdr.flags & OFI_REMOTE_CQ_DATA) { flags |= FI_REMOTE_CQ_DATA; data = xfer_entry->hdr.cq_data_hdr.cq_data; } if ((flags & FI_MULTI_RECV) && (xfer_entry->rem_len >= xfer_entry->ep->min_multi_recv_size)) { buf = xfer_entry->mrecv_msg_start; len = xfer_entry->hdr.base_hdr.size - xfer_entry->hdr.base_hdr.payload_off; } else { flags &= ~FI_MULTI_RECV; } ofi_cq_write(cq, xfer_entry->context, flags, len, buf, data, 0); if (cq->wait) ofi_cq_signal(&cq->cq_fid); }
int mrail_cq_write_recv_comp(struct mrail_ep *mrail_ep, struct mrail_hdr *hdr, struct fi_cq_tagged_entry *comp, struct mrail_recv *recv) { FI_DBG(&mrail_prov, FI_LOG_CQ, "writing recv completion: length: %zu " "tag: 0x%" PRIx64 "\n", comp->len - sizeof(struct mrail_pkt), hdr->tag); return ofi_cq_write(mrail_ep->util_ep.rx_cq, recv->context, recv->comp_flags | (comp->flags & FI_REMOTE_CQ_DATA), comp->len - sizeof(struct mrail_pkt), NULL, comp->data, hdr->tag); }
static void report_pe_entry_completion(struct tcpx_pe_entry *pe_entry, int err) { struct fi_cq_err_entry err_entry; struct tcpx_ep *ep = pe_entry->ep; struct util_cq *cq = NULL; struct util_cntr *cntr = NULL; if (pe_entry->flags & TCPX_NO_COMPLETION) { return; } switch (pe_entry->msg_hdr.op_data) { case TCPX_OP_MSG_SEND: cq = ep->util_ep.tx_cq; cntr = ep->util_ep.tx_cntr; break; case TCPX_OP_MSG_RECV: cq = ep->util_ep.rx_cq; cntr = ep->util_ep.rx_cntr; break; default: return; } if (cq && err) { err_entry.op_context = pe_entry->context; err_entry.flags = pe_entry->flags; err_entry.len = 0; err_entry.buf = NULL; err_entry.data = pe_entry->msg_hdr.data; err_entry.tag = 0; err_entry.olen = 0; err_entry.err = err; err_entry.prov_errno = errno; err_entry.err_data = NULL; err_entry.err_data_size = 0; ofi_cq_write_error(cq, &err_entry); } else if (cq) { ofi_cq_write(cq, pe_entry->context, pe_entry->flags, 0, NULL, pe_entry->msg_hdr.data, 0); } if (cntr && err) { cntr->cntr_fid.ops->adderr(&cntr->cntr_fid, 1); }else if (cntr) { cntr->cntr_fid.ops->add(&cntr->cntr_fid, 1); } }
static inline int rxm_cq_tx_comp_write(struct rxm_ep *rxm_ep, uint64_t comp_flags, void *app_context, uint64_t flags) { if (flags & FI_COMPLETION) { int ret = ofi_cq_write(rxm_ep->util_ep.tx_cq, app_context, comp_flags, 0, NULL, 0, 0); if (OFI_UNLIKELY(ret)) { FI_WARN(&rxm_prov, FI_LOG_CQ, "Unable to report completion\n"); return ret; } rxm_cq_log_comp(comp_flags); } return 0; }