Skip to content

Commit

Permalink
Merge pull request openucx#6119 from brminich/topic/tag_offl_comp_v.1…
Browse files Browse the repository at this point in the history
….10.x

UCP/TAG: Fix offload completion with inlined data - v.1.10.x
  • Loading branch information
yosefe authored Jan 13, 2021
2 parents f2113c6 + c315f5c commit 06056ad
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ucp/tag/offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ UCS_PROFILE_FUNC_VOID(ucp_tag_offload_completed,

if (ucs_unlikely(inline_data != NULL)) {
status = ucp_request_recv_data_unpack(req, inline_data, length, 0, 1);
ucs_mpool_put_inline(req->recv.tag.rdesc);
ucp_tag_offload_release_buf(req);
} else if (req->recv.tag.rdesc != NULL) {
status = ucp_request_recv_data_unpack(req, req->recv.tag.rdesc + 1,
length, 0, 1);
Expand Down
28 changes: 28 additions & 0 deletions test/gtest/ucp/test_ucp_tag_offload.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,34 @@ UCS_TEST_P(test_ucp_tag_offload, connect)
e->connect(&receiver(), get_ep_params());
}

// Send small chunk of data to be scattered to CQE on the receiver. Post bigger
// chunk of memory for receive operation, so it would be posted to the HW.
UCS_TEST_P(test_ucp_tag_offload, eager_send_less, "RNDV_THRESH=inf",
"TM_THRESH=0", "TM_MAX_BB_SIZE=0")
{
activate_offload(sender());

uint8_t send_data = 0;
size_t length = 4 * UCS_KBYTE;
ucp_tag_t tag = 0x11;
std::vector<uint8_t> recvbuf(length);

request *rreq = recv_nb_exp(&recvbuf[0], length, ucp_dt_make_contig(1), tag,
UCP_TAG_MASK_FULL);

request *sreq = (request*)ucp_tag_send_nb(sender().ep(), &send_data,
sizeof(send_data),
ucp_dt_make_contig(1), tag,
send_callback);
if (UCS_PTR_IS_ERR(sreq)) {
ASSERT_UCS_OK(UCS_PTR_STATUS(sreq));
} else if (sreq != NULL) {
request_wait(sreq);
}

request_wait(rreq);
}

UCS_TEST_P(test_ucp_tag_offload, small_rndv, "RNDV_THRESH=0", "TM_THRESH=0")
{
activate_offload(sender());
Expand Down

0 comments on commit 06056ad

Please sign in to comment.