[WSD] Make QP destruction asynchronous to speed up socket closure.
[mirror/winof/.git] / ulp / wsd / user / ibsp_iblow.c
index a01c3af..1acd063 100644 (file)
@@ -873,23 +873,18 @@ ib_destroy_socket(
 \r
        if( socket_info->qp )\r
        {\r
 \r
        if( socket_info->qp )\r
        {\r
-               status = ib_destroy_qp( socket_info->qp, ib_sync_destroy );\r
-               if( status )\r
+               cl_atomic_inc( &socket_info->ref_cnt );\r
+               status = ib_destroy_qp( socket_info->qp, deref_socket_info );\r
+               if( status != IB_SUCCESS )\r
                {\r
                {\r
-                       IBSP_ERROR( ("ib_destroy_qp failed (%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_destroy_qp returned %s\n",\r
+                               ib_get_err_str( status )) );\r
+                       deref_socket_info( socket_info );\r
                }\r
                }\r
-               else\r
-               {\r
-                       IBSP_TRACE( IBSP_DBG_WQ,\r
-                               ("%s():%d:0x%x:0x%x: ib_destroy_qp() finished\n", __FUNCTION__,\r
-                               __LINE__, GetCurrentProcessId(), GetCurrentThreadId()) );\r
-\r
-                       socket_info->qp = NULL;\r
 \r
 \r
-                       STAT_DEC( qp_num );\r
+               ib_release_cq_tinfo( socket_info->cq_tinfo );\r
 \r
 \r
-                       ib_release_cq_tinfo( socket_info->cq_tinfo );\r
-               }\r
+               socket_info->qp = NULL;\r
        }\r
 \r
        IBSP_EXIT( IBSP_DBG_EP );\r
        }\r
 \r
        IBSP_EXIT( IBSP_DBG_EP );\r
@@ -938,6 +933,7 @@ ib_create_socket(
                &socket_info->qp );\r
        if( status )\r
        {\r
                &socket_info->qp );\r
        if( status )\r
        {\r
+               ib_release_cq_tinfo( socket_info->cq_tinfo );\r
                IBSP_ERROR_EXIT(\r
                        ("ib_create_qp returned %s\n", ib_get_err_str( status )) );\r
                return WSAENOBUFS;\r
                IBSP_ERROR_EXIT(\r
                        ("ib_create_qp returned %s\n", ib_get_err_str( status )) );\r
                return WSAENOBUFS;\r