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: Reregister memh on CM switch. #7403

Merged
merged 1 commit into from
Sep 19, 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
1 change: 1 addition & 0 deletions src/ucp/proto/proto_am.inl
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ ucs_status_t ucp_do_am_zcopy_single(uct_pending_req_t *self, uint8_t am_id,
ucs_status_t status;

req->send.lane = ucp_ep_get_am_lane(ep);
ucp_send_request_add_reg_lane(req, req->send.lane);

status = ucp_am_zcopy_common(req, hdr, hdr_size, user_hdr_desc,
user_hdr_size, 0ul, iov, iovcnt, max_iov,
Expand Down
37 changes: 36 additions & 1 deletion test/gtest/ucp/test_ucp_sockaddr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ class test_ucp_sockaddr : public ucp_test {
m_test_addr.get_port());
EXPECT_EQ(m_test_addr, attr.local_sockaddr);
}

void one_sided_disconnect(entity &e, enum ucp_ep_close_mode mode) {
void *req = e.disconnect_nb(0, 0, mode);
ucs_time_t deadline = ucs::get_deadline();
Expand Down Expand Up @@ -1351,6 +1351,41 @@ UCS_TEST_P(test_ucp_sockaddr_different_tl_rsc, unset_devices_and_communicate)

UCP_INSTANTIATE_TEST_CASE_TLS(test_ucp_sockaddr_different_tl_rsc, all, "all")

class test_ucp_sockaddr_cm_switch : public test_ucp_sockaddr {
protected:
ucp_rsc_index_t get_num_cms()
petro-rudenko marked this conversation as resolved.
Show resolved Hide resolved
{
const ucp_worker_h worker = sender().worker();
ucp_rsc_index_t num_cm_cmpts = ucp_worker_num_cm_cmpts(worker);
ucp_rsc_index_t num_cms = 0;

for (ucp_rsc_index_t cm_idx = 0; cm_idx < num_cm_cmpts; ++cm_idx) {
if (worker->cms[cm_idx].cm != NULL) {
num_cms++;
}
}

return num_cms;
}

void check_cm_fallback()
{
if (get_num_cms() < 2) {
UCS_TEST_SKIP_R("No CM for fallback to");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can create one boolean function "have_two_cm_components()" and use the macro UCS_TEST_SKIP_COND_P

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To check the number of CM components needs worker. Function in macro instantiates before test, so worker is unavailable: https://github.com/openucx/ucx/blob/master/test/gtest/ucp/test_ucp_sockaddr.cc#L1359

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right

}
}
};

UCS_TEST_P(test_ucp_sockaddr_cm_switch,
rereg_memory_on_cm_switch,
"ZCOPY_THRESH=0", "TLS=rc",
"SOCKADDR_TLS_PRIORITY=rdmacm,tcp")
{
check_cm_fallback();
listen_and_communicate(false, SEND_DIRECTION_BIDI);
}

UCP_INSTANTIATE_TEST_CASE_TLS(test_ucp_sockaddr_cm_switch, all, "all")

class test_ucp_sockaddr_cm_private_data : public test_ucp_sockaddr {
protected:
Expand Down