]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[DAPL2] scm: CM linking to EP must be done before socket write in accept_user.
authorStan Smith <stan.smith@intel.com>
Wed, 10 Mar 2010 22:32:22 +0000 (22:32 +0000)
committerStan Smith <stan.smith@intel.com>
Wed, 10 Mar 2010 22:32:22 +0000 (22:32 +0000)
scm accept RTU was processing the conn object in the cr_thread
before the user accept thread bound the EP to the CM object.
The linking must be done before the socket write to insure
proper linking and state during accept_rtu processing.

Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1@2732 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

branches/WOF2-2/ulp/dapl2/dapl/openib_scm/cm.c

index 905e4f4c4487ce69cb17b13fb8144536494587c9..69f31818ef9980558e70ac81a776dd4024123d63 100644 (file)
@@ -1143,6 +1143,10 @@ dapli_socket_accept_usr(DAPL_EP * ep_ptr,
        cm_ptr->hca = ia_ptr->hca_ptr;\r
        cm_ptr->state = DCM_ACCEPTED;\r
 \r
+       /* Link CM to EP, already queued on work thread */\r
+       dapl_ep_link_cm(ep_ptr, cm_ptr);\r
+       cm_ptr->ep = ep_ptr;\r
+\r
        local.p_size = htons(p_size);\r
        iov[0].iov_base = (void *)&local;\r
        iov[0].iov_len = exp;\r
@@ -1160,6 +1164,8 @@ dapli_socket_accept_usr(DAPL_EP * ep_ptr,
                         strerror(errno), len, \r
                         inet_ntoa(((struct sockaddr_in *)\r
                                   &cm_ptr->msg.daddr.so)->sin_addr));\r
+               dapl_ep_unlink_cm(ep_ptr, cm_ptr);\r
+               cm_ptr->ep = NULL;\r
                goto bail;\r
        }\r
 \r
@@ -1176,9 +1182,6 @@ dapli_socket_accept_usr(DAPL_EP * ep_ptr,
 \r
        dapl_dbg_log(DAPL_DBG_TYPE_EP, " PASSIVE: accepted!\n");\r
 \r
-       /* Link CM to EP, already queued on work thread */\r
-       dapl_ep_link_cm(ep_ptr, cm_ptr);\r
-       cm_ptr->ep = ep_ptr;\r
        return DAT_SUCCESS;\r
 bail:\r
        /* schedule cleanup from workq */\r