]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[WinOF] match trunk @ 1535
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Aug 2008 17:14:20 +0000 (17:14 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Aug 2008 17:14:20 +0000 (17:14 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@1536 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

branches/WOF2-0/trunk/core/al/user/ual_av.c
branches/WOF2-0/trunk/hw/mlx4/user/hca/mlx4.c
branches/WOF2-0/trunk/hw/mlx4/user/hca/verbs.h

index 24669abfe354a09498a68f6c3ac4bd2be6289c50..8ce7f34e36d4cbdc19d1f61664ef70f2ef348baa 100644 (file)
@@ -58,6 +58,16 @@ ual_get_gid_index(
        uint16_t                        i;\r
 \r
        ci_ca_lock_attr( p_ci_ca );\r
+\r
+       // sanity check\r
+       if (port_num == 0 || port_num > p_ci_ca->p_user_attr->num_ports)\r
+       {\r
+               AL_PRINT(TRACE_LEVEL_WARNING ,AL_DBG_AV,\r
+                       ("UAL_GET_GID_INDEX: invalid port number specified (%d)\n", port_num) );\r
+               status = IB_INVALID_PORT;\r
+               goto out;\r
+       }\r
+\r
        p_port_attr = &p_ci_ca->p_user_attr->p_port_attr[port_num];\r
        for( i = 0; i < p_port_attr->num_gids; i++ )\r
        {\r
@@ -68,6 +78,8 @@ ual_get_gid_index(
                        break;\r
                }\r
        }\r
+\r
+out:\r
        ci_ca_unlock_attr( p_ci_ca );\r
 \r
        return status;\r
index 488d5d1e067a329b7cc1fa6e6c4853c343c0c4ab..2a0f136fe07e206f3c4ec87d9c84106d7e4e64bd 100644 (file)
@@ -78,10 +78,6 @@ struct ibv_context * mlx4_alloc_context()
        if (!context->db_list_mutex)\r
                goto err_db_mutex;\r
 \r
-       context->ibv_ctx.mutex = CreateMutex(NULL, FALSE, NULL);\r
-       if (!context->ibv_ctx.mutex)\r
-               goto err_ctx_mutex;\r
-\r
        if (cl_spinlock_init(&context->uar_lock))\r
                goto err_uar_spinlock;\r
 \r
@@ -93,8 +89,6 @@ struct ibv_context * mlx4_alloc_context()
 err_bf_spinlock:\r
        cl_spinlock_destroy(&context->uar_lock);\r
 err_uar_spinlock:\r
-       CloseHandle(context->ibv_ctx.mutex);\r
-err_ctx_mutex:\r
        CloseHandle(context->db_list_mutex);\r
 err_db_mutex:\r
 #ifdef XRC_SUPPORT\r
@@ -168,7 +162,6 @@ void mlx4_free_context(struct ibv_context *ctx)
 \r
        cl_spinlock_destroy(&context->bf_lock);\r
        cl_spinlock_destroy(&context->uar_lock);\r
-       CloseHandle(context->ibv_ctx.mutex);\r
        CloseHandle(context->db_list_mutex);\r
 #ifdef XRC_SUPPORT\r
        CloseHandle(context->xrc_srq_table_mutex);\r
index 85c9551ed62444242d3d976b5e1d9dfb1d3c11f4..9f7f2c143b339b9580717be4402d3d9e9546fb11 100644 (file)
@@ -210,7 +210,6 @@ struct ibv_ah {
 \r
 struct ibv_context {\r
        int                             page_size;\r
-       pthread_mutex_t mutex;\r
 };\r
 \r
 \r