Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCP/PROTO: Handle AM short failure correctly [v1.10.x] #6164

Merged
merged 1 commit into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions src/ucp/core/ucp_am.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,7 @@ static ucs_status_t ucp_am_contig_short(uct_pending_req_t *self)
req->send.msg_proto.am.header,
req->send.msg_proto.am.header_length,
req->send.buffer, req->send.length);
if (ucs_likely(status == UCS_OK)) {
ucp_request_complete_send(req, UCS_OK);
}

return status;
return ucp_am_short_handle_status_from_pending(req, status);
}

static ucs_status_t ucp_am_contig_short_reply(uct_pending_req_t *self)
Expand All @@ -584,11 +580,7 @@ static ucs_status_t ucp_am_contig_short_reply(uct_pending_req_t *self)
req->send.msg_proto.am.header,
req->send.msg_proto.am.header_length,
req->send.buffer, req->send.length);
if (ucs_likely(status == UCS_OK)) {
ucp_request_complete_send(req, UCS_OK);
}

return status;
return ucp_am_short_handle_status_from_pending(req, status);
}

static ucs_status_t ucp_am_bcopy_single(uct_pending_req_t *self)
Expand Down
11 changes: 11 additions & 0 deletions src/ucp/proto/proto_am.inl
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,17 @@ ucp_proto_ssend_ack_request_alloc(ucp_worker_h worker, ucs_ptr_map_key_t ep_id)
return req;
}

static UCS_F_ALWAYS_INLINE ucs_status_t
ucp_am_short_handle_status_from_pending(ucp_request_t *req, ucs_status_t status)
{
if (ucs_unlikely(status == UCS_ERR_NO_RESOURCE)) {
return UCS_ERR_NO_RESOURCE;
}

ucp_request_complete_send(req, status);
return UCS_OK;
}

static UCS_F_ALWAYS_INLINE ucs_status_t
ucp_am_bcopy_handle_status_from_pending(uct_pending_req_t *self, int multi,
int tag_sync, ucs_status_t status)
Expand Down
5 changes: 1 addition & 4 deletions src/ucp/stream/stream_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ static ucs_status_t ucp_stream_contig_am_short(uct_pending_req_t *self)
ucs_status_t status = ucp_stream_send_am_short(req->send.ep,
req->send.buffer,
req->send.length);
if (ucs_likely(status == UCS_OK)) {
ucp_request_complete_send(req, UCS_OK);
}
return status;
return ucp_am_short_handle_status_from_pending(req, status);
}

static size_t ucp_stream_pack_am_single_dt(void *dest, void *arg)
Expand Down
16 changes: 6 additions & 10 deletions src/ucp/tag/eager_snd.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,15 @@ static size_t ucp_tag_pack_eager_middle_dt(void *dest, void *arg)
static ucs_status_t ucp_tag_eager_contig_short(uct_pending_req_t *self)
{
ucp_request_t *req = ucs_container_of(self, ucp_request_t, send.uct);
ucp_ep_t *ep = req->send.ep;
ucp_ep_t *ep = req->send.ep;
ucs_status_t status;

req->send.lane = ucp_ep_get_am_lane(ep);
status = uct_ep_am_short(ep->uct_eps[req->send.lane], UCP_AM_ID_EAGER_ONLY,
req->send.msg_proto.tag.tag, req->send.buffer,
req->send.length);
if (status != UCS_OK) {
return status;
}

ucp_request_complete_send(req, UCS_OK);
return UCS_OK;
status = uct_ep_am_short(ep->uct_eps[req->send.lane],
UCP_AM_ID_EAGER_ONLY,
req->send.msg_proto.tag.tag, req->send.buffer,
req->send.length);
return ucp_am_short_handle_status_from_pending(req, status);
}

static ucs_status_t ucp_tag_eager_bcopy_single(uct_pending_req_t *self)
Expand Down