Skip to content

Commit fd11c98

Browse files
committed
librdmacm: Add rsocket to connect service on success too
Previously we only added it when rconnect() returned EINPROGRESS. Now also add when connect succeeds so the progress thread can drive state and handle disconnects. Signed-off-by: Batsheva Black <bblack@nvidia.com>
1 parent 0228cc3 commit fd11c98

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

librdmacm/rsocket.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,9 +1727,11 @@ int rconnect(int socket, const struct sockaddr *addr, socklen_t addrlen)
17271727
if (rs->type == SOCK_STREAM) {
17281728
memcpy(&rs->cm_id->route.addr.dst_addr, addr, addrlen);
17291729
ret = rs_do_connect(rs);
1730-
if (ret == -1 && errno == EINPROGRESS) {
1730+
if (ret == 0 || (ret == -1 && errno == EINPROGRESS)) {
17311731
save_errno = errno;
1732-
/* The app can still drive the CM state on failure */
1732+
/* Add rsocket to internal thread that drives CM progress
1733+
* so the app can drive state and respond to disconnect requests.
1734+
*/
17331735
rs_notify_svc(&connect_svc, rs, RS_SVC_ADD_CM);
17341736
errno = save_errno;
17351737
}

0 commit comments

Comments
 (0)