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

UCT/TCP: Add assert to check that don't send CM data when connected #4559

Merged
merged 1 commit into from
Dec 13, 2019
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
2 changes: 1 addition & 1 deletion src/uct/tcp/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ typedef enum uct_tcp_ep_conn_state {
* to `UCT_TCP_EP_CONN_STATE_CONNECTED` state upon receiving this message.
* All AM operations return `UCS_ERR_NO_RESOURCE` error to a caller. */
UCT_TCP_EP_CONN_STATE_WAITING_REQ,
/* EP is connected to a peer and them can comunicate with each other. */
/* EP is connected to a peer and they can communicate with each other. */
UCT_TCP_EP_CONN_STATE_CONNECTED
} uct_tcp_ep_conn_state_t;

Expand Down
3 changes: 3 additions & 0 deletions src/uct/tcp/tcp_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ ucs_status_t uct_tcp_cm_send_event(uct_tcp_ep_t *ep, uct_tcp_cm_conn_event_t eve
UCT_TCP_CM_CONN_ACK |
UCT_TCP_CM_CONN_WAIT_REQ)),
"ep=%p", ep);
ucs_assertv(!(ep->ctx_caps & UCS_BIT(UCT_TCP_EP_CTX_TYPE_TX)) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

why ||, not &&?

Copy link
Member Author

Choose a reason for hiding this comment

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

if it does not have TX capability (i.e. only RX capability) and it is in CONNECTED state, it has to be able to send CM REQ event to a peer in order to set RX capability for the peer

(ep->conn_state != UCT_TCP_EP_CONN_STATE_CONNECTED),
"ep=%p", ep);

pkt_length = sizeof(*pkt_hdr);
if (event == UCT_TCP_CM_CONN_REQ) {
Expand Down
1 change: 1 addition & 0 deletions src/uct/tcp/tcp_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ ucs_status_t uct_tcp_ep_create(const uct_ep_params_t *params,
ep = uct_tcp_cm_search_ep(iface, &dest_addr,
UCT_TCP_EP_CTX_TYPE_RX);
if (ep) {
ucs_assert(!(ep->ctx_caps & UCS_BIT(UCT_TCP_EP_CTX_TYPE_TX)));
/* Found EP with RX ctx, try to send the connection request
* to the remote peer, if it successful - assign TX to this EP
* and return the EP to the user, otherwise - destroy this EP
Expand Down