Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/ucp/core/ucp_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,13 @@ void ucp_ep_flush_state_reset(ucp_ep_h ep)
flush_state->cmpl_sn = 0;
flush_state->mem_in_progress = 0;
ucs_hlist_head_init(&flush_state->reqs);
ucp_ep_update_flags(ep, UCP_EP_FLAG_FLUSH_STATE_VALID, 0);
ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_FLUSH_STATE_VALID, 0);
}

void ucp_ep_flush_state_invalidate(ucp_ep_h ep)
{
ucs_assert(ucs_hlist_is_empty(&ucp_ep_flush_state(ep)->reqs));
ucp_ep_update_flags(ep, 0, UCP_EP_FLAG_FLUSH_STATE_VALID);
ucp_ep_update_debug_flags(ep, 0, UCP_EP_FLAG_FLUSH_STATE_VALID);
}

/* Since release function resets EP ID to @ref UCS_PTR_MAP_KEY_INVALID and PTR
Expand Down
2 changes: 2 additions & 0 deletions src/ucp/core/ucp_ep.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ enum {
UCP_EP_FLAG_USER_DATA_PARAM = UCS_BIT(15),/* EP's user_data was passed via
@ref ucp_ep_params_t::user_data */

#if ENABLE_DEBUG_DATA || UCS_ENABLE_ASSERT
/* DEBUG bits */
UCP_EP_FLAG_CONNECT_REQ_SENT = UCS_BIT(16),/* DEBUG: Connection request was sent */
UCP_EP_FLAG_CONNECT_REP_SENT = UCS_BIT(17),/* DEBUG: Connection reply was sent */
Expand All @@ -129,6 +130,7 @@ enum {
UCP_EP_FLAG_DISCONNECT_CB_CALLED = UCS_BIT(25),/* DEBUG: Got disconnect notification */
UCP_EP_FLAG_CONNECT_WAIT_PRE_REQ = UCS_BIT(26) /* DEBUG: Connection pre-request needs to be
received from a peer */
#endif
};


Expand Down
10 changes: 10 additions & 0 deletions src/ucp/core/ucp_ep.inl
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ static UCS_F_ALWAYS_INLINE void ucp_ep_update_flags(
ep->flags = (ep->flags | ep_flags_add) & ~ep_flags_remove;
}

#if ENABLE_DEBUG_DATA || UCS_ENABLE_ASSERT
#define ucp_ep_update_debug_flags(_ep, _flags_add, _flags_remove) \
ucp_ep_update_flags(_ep, _flags_add, _flags_remove)
#else
#define ucp_ep_update_debug_flags(_ep, _flags_add, _flags_remove) \
do { \
(void)(_ep); \
} while (0)
#endif

static UCS_F_ALWAYS_INLINE ucs_ptr_map_key_t ucp_ep_remote_id(ucp_ep_h ep)
{
#if UCS_ENABLE_ASSERT
Expand Down
10 changes: 5 additions & 5 deletions src/ucp/wireup/wireup.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,17 @@ ucs_status_t ucp_wireup_msg_progress(uct_pending_req_t *self)

switch (req->send.wireup.type) {
case UCP_WIREUP_MSG_PRE_REQUEST:
ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_PRE_REQ_SENT, 0);
ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_PRE_REQ_SENT, 0);
break;
case UCP_WIREUP_MSG_REQUEST:
ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_REQ_SENT, 0);
ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_REQ_SENT, 0);
break;
case UCP_WIREUP_MSG_REPLY:
case UCP_WIREUP_MSG_REPLY_RECONFIG:
ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_REP_SENT, 0);
ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_REP_SENT, 0);
break;
case UCP_WIREUP_MSG_ACK:
ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_ACK_SENT, 0);
ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_ACK_SENT, 0);
break;
}

Expand Down Expand Up @@ -696,7 +696,7 @@ ucp_wireup_process_request(ucp_worker_h worker, ucp_ep_h ep,
if ((ep->flags & UCP_EP_FLAG_CONNECT_REQ_QUEUED) &&
(remote_uuid > worker->uuid)) {
ucs_trace("ep %p: ignoring simultaneous connect request", ep);
ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_REQ_IGNORED, 0);
ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_REQ_IGNORED, 0);
return;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/ucp/wireup/wireup_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ static unsigned ucp_cm_client_connect_progress(void *arg)
}

if (context->config.ext.cm_use_all_devices) {
ucp_ep->flags |= UCP_EP_FLAG_CONNECT_WAIT_PRE_REQ;
ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_CONNECT_WAIT_PRE_REQ, 0);
ucp_wireup_update_flags(ucp_ep, UCP_WIREUP_EP_FLAG_REMOTE_CONNECTED);
} else {
ucp_wireup_remote_connected(ucp_ep);
Expand Down Expand Up @@ -778,7 +778,7 @@ static void ucp_cm_client_connect_cb(uct_ep_h uct_cm_ep, void *arg,
UCT_CM_EP_CLIENT_CONNECT_ARGS_FIELD_STATUS)));
remote_data = connect_args->remote_data;
status = connect_args->status;
ucp_ep_update_flags(ucp_ep, UCP_EP_FLAG_CLIENT_CONNECT_CB, 0);
ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_CLIENT_CONNECT_CB, 0);

ucs_debug("ep %p flags 0x%x cfg_index %d: client connected status %s",
ucp_ep, ucp_ep->flags, ucp_ep->cfg_index,
Expand Down Expand Up @@ -949,7 +949,7 @@ static void ucp_cm_disconnect_cb(uct_ep_h uct_cm_ep, void *arg)
ucp_worker_h worker = ucp_ep->worker;
uct_ep_h uct_ep;

ucp_ep_update_flags(ucp_ep, UCP_EP_FLAG_DISCONNECT_CB_CALLED, 0);
ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_DISCONNECT_CB_CALLED, 0);
ucs_trace("ep %p flags 0x%x: remote disconnect callback invoked", ucp_ep,
ucp_ep->flags);

Expand Down Expand Up @@ -1393,7 +1393,7 @@ static void ucp_cm_server_conn_notify_cb(
UCT_CM_EP_SERVER_CONN_NOTIFY_ARGS_FIELD_STATUS);

status = notify_args->status;
ucp_ep_update_flags(ucp_ep, UCP_EP_FLAG_SERVER_NOTIFY_CB, 0);
ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_SERVER_NOTIFY_CB, 0);
ucs_trace("ep %p flags 0x%x: notify callback invoked, status %s", ucp_ep,
ucp_ep->flags, ucs_status_string(status));

Expand Down Expand Up @@ -1529,8 +1529,8 @@ void ucp_ep_cm_disconnect_cm_lane(ucp_ep_h ucp_ep)
ucs_assert(!(ucp_ep->flags & UCP_EP_FLAG_FAILED));
ucs_assert(ucp_ep_is_cm_local_connected(ucp_ep));

ucp_ep_update_flags(ucp_ep, UCP_EP_FLAG_DISCONNECTED_CM_LANE,
UCP_EP_FLAG_LOCAL_CONNECTED);
ucp_ep_update_flags(ucp_ep, 0, UCP_EP_FLAG_LOCAL_CONNECTED);
ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_DISCONNECTED_CM_LANE, 0);

/* Remove the client's connect_progress or the server's connect notify
* callbacks from the callbackq to make sure it won't be invoked after
Expand Down
2 changes: 2 additions & 0 deletions test/gtest/ucp/test_ucp_sockaddr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,7 @@ UCS_TEST_SKIP_COND_P(test_max_lanes, lanes_reconf, !cm_use_all_devices())
UCP_INSTANTIATE_TEST_CASE_TLS(test_max_lanes, rc, "rc")
UCP_INSTANTIATE_TEST_CASE_TLS(test_max_lanes, dc, "dc")

#if ENABLE_DEBUG_DATA || UCS_ENABLE_ASSERT
class test_ucp_sockaddr_wireup_fail : public test_ucp_sockaddr_wireup {
protected:
typedef enum {
Expand Down Expand Up @@ -1803,6 +1804,7 @@ UCS_TEST_P(test_ucp_sockaddr_wireup_fail_try_next_cm,
}

UCP_INSTANTIATE_ALL_TEST_CASE(test_ucp_sockaddr_wireup_fail_try_next_cm)
#endif


class test_ucp_sockaddr_different_tl_rsc : public test_ucp_sockaddr
Expand Down
Loading