Skip to content

Commit

Permalink
prov/tcp: Fix FI_MULTI_RECV not set on error
Browse files Browse the repository at this point in the history
When multiple multi-recv buffers are posted, FI_MULTI_RECV would
only be set on error if an mrecv entry was already created,
meaning the buffer would have already been in-use. If the buffer
has not been used yet and a cancelation for this buffer has been
processed, correctly set FI_MULTI_RECV when reporting the error,
indicating that the buffer is no longer in use.

Signed-off-by: Jerome Soumagne <[email protected]>
  • Loading branch information
soumagne authored and j-xiong committed Jan 27, 2025
1 parent b280fc0 commit 9024dab
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions prov/tcp/src/xnet_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,15 @@ void xnet_report_error(struct xnet_xfer_entry *xfer_entry, int err)

err_entry.flags = xfer_entry->cq_flags & ~FI_COMPLETION;
if (err_entry.flags & FI_RECV) {
if (xfer_entry->ctrl_flags & XNET_MULTI_RECV &&
xfer_entry->mrecv) {
xfer_entry->mrecv->ref_cnt--;
if (!xfer_entry->mrecv->ref_cnt) {
if (xfer_entry->ctrl_flags & XNET_MULTI_RECV) {
if (xfer_entry->mrecv) {
xfer_entry->mrecv->ref_cnt--;
if (!xfer_entry->mrecv->ref_cnt) {
err_entry.flags |= FI_MULTI_RECV;
free(xfer_entry->mrecv);
}
} else
err_entry.flags |= FI_MULTI_RECV;
free(xfer_entry->mrecv);
}
}
xnet_get_cq_info(xfer_entry, &err_entry.flags, &err_entry.data,
&err_entry.tag);
Expand Down

0 comments on commit 9024dab

Please sign in to comment.