]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[WSD] Added missing connection tracking calls, fixed IP address map usage
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 27 Sep 2005 00:08:26 +0000 (00:08 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 27 Sep 2005 00:08:26 +0000 (00:08 +0000)
to prevent underflow/overflow during key comparisson which could result in
items being unreachable when tree is subsequently rotated, and minor code
cleanup in PnP and SA query code

Signed-off-by: Fab Tillier (ftillier@silverstorm.com)
git-svn-id: svn://openib.tc.cornell.edu/gen1@84 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

20 files changed:
trunk/core/bus/kernel/ib_bus.inf
trunk/hw/mt23108/kernel/infinihost.inf
trunk/inc/complib/cl_qlist.h
trunk/inc/iba/ib_types.h
trunk/inc/ics_ver.h
trunk/tests/alts/kernel/alts.inf
trunk/tests/alts/registermemregion.c
trunk/tests/alts/user/alts_main.c
trunk/tests/dirs
trunk/tools/vstat/dirs
trunk/tools/vstat/user/makefile
trunk/tools/vstat/user/vstat.rc
trunk/tools/vstat/user/vstat_main.c
trunk/ulp/ipoib/kernel/netipoib.inf
trunk/ulp/srp/dirs
trunk/ulp/srp/kernel/ib_srp.inf
trunk/ulp/wsd/user/ibsp_iblow.c
trunk/ulp/wsd/user/ibsp_ip.c
trunk/ulp/wsd/user/ibsp_pnp.c
trunk/ulp/wsd/user/ibspstruct.h

index 46d82132167e4d990b6718ca60024ba02f228ffc..55a51bf08a851be4ba1e8cc26f592ced02eb76b9 100644 (file)
@@ -7,7 +7,7 @@ Class=System
 ClassGuid={4D36E97D-E325-11CE-BFC1-08002BE10318}\r
 Provider=%SST%\r
 CatalogFile=ibbus.cat\r
-DriverVer=07/28/2005,3.0.0034.0\r
+DriverVer=09/01/2005,3.0.0036.0\r
 \r
 \r
 ; ================= Device Install section =====================\r
index 377e1d9627cd37b0fadcc67571577578f307e50c..938c29bfe8ff006d696680ae52c964f1af0a490b 100644 (file)
@@ -7,7 +7,7 @@ Class=InfiniBandHca
 ClassGUID=%HcaClassGuid%\r
 Provider=%SST%\r
 CatalogFile=infiniserv.cat\r
-DriverVer=07/28/2005,3.0.0034.0\r
+DriverVer=09/01/2005,3.0.0036.0\r
 \r
 ; ================= Destination directory section =====================\r
 \r
index 2646b29f328355f57f6db2aff55be69f3c980b66..cd8065ed2444b0c8e055a4d1c2b4c5c5eb4c1b4b 100644 (file)
@@ -571,9 +571,6 @@ cl_qlist_next(
 {\r
        /* CL_ASSERT that a non-null pointer is provided. */\r
        CL_ASSERT( p_list_item );\r
-       /* CL_ASSERT that the list was initialized. */\r
-       CL_ASSERT( p_list_item->p_list );\r
-       CL_ASSERT( p_list_item->p_list->state == CL_INITIALIZED );\r
 \r
        /* Return the next item. */\r
        return( p_list_item->p_next );\r
@@ -611,8 +608,6 @@ cl_qlist_prev(
 {\r
        /* CL_ASSERT that a non-null pointer is provided. */\r
        CL_ASSERT( p_list_item );\r
-       /* CL_ASSERT that the list was initialized. */\r
-       CL_ASSERT( p_list_item->p_list->state == CL_INITIALIZED );\r
 \r
        /* Return the previous item. */\r
        return( p_list_item->p_prev );\r
index 2dfbbc9b72f6f1a94e78899a902bb81d03c0e898..e31965392b343cf75642f38bb0aae23a7928b207 100644 (file)
@@ -4939,15 +4939,9 @@ typedef struct _ib_vl_arb_table_record
 #include <complib/cl_packoff.h>\r
 /************/\r
 \r
-/****s* IBA Base: Types/ib_grh_t\r
-* NAME\r
-*      ib_grh_t\r
-*\r
-* DESCRIPTION\r
-*      Global route header information received with unreliable datagram messages\r
-*\r
-* SYNOPSIS\r
-*/\r
+/*\r
+ *     Global route header information received with unreliable datagram messages\r
+ */\r
 #include <complib/cl_packon.h>\r
 typedef struct _ib_grh\r
 {\r
@@ -4960,7 +4954,6 @@ typedef struct _ib_grh
 \r
 }      PACK_SUFFIX ib_grh_t;\r
 #include <complib/cl_packoff.h>\r
-/************/\r
 \r
 /****f* IBA Base: Types/ib_grh_get_ver_class_flow\r
 * NAME\r
index 759ddd42ef588edddd888b47ed768f61a01bd9a5..834667ec986604b9cfcda3bd2ec95d75d4e3a957 100644 (file)
@@ -42,7 +42,7 @@
 #endif\r
 \r
 #ifndef VER_FILEBUILD\r
-#define VER_FILEBUILD                          32\r
+#define VER_FILEBUILD                          36\r
 #endif\r
 \r
 #ifndef VER_FILEREV\r
index 8c6b7818e937e9a9fb153f1bc0e5c071a0004978..fab4fe0594ba3371727513a9d90545d6c22c2d6c 100644 (file)
@@ -26,7 +26,7 @@ Class=InfiniBandHca
 ClassGUID=%HcaClassGuid%\r
 Provider=%Vendor%\r
 CatalogFile=infiniserv.cat\r
-DriverVer=07/28/2005,3.0.0034.0\r
+DriverVer=09/01/2005,3.0.0036.0\r
 \r
 ; ================= Destination directory section =====================\r
 \r
index ca3ff6e7565041b0d531a35fd9733a34bb0c28d2..dee9813b7ed59f402453006650efa2f762caa6bb 100644 (file)
@@ -147,24 +147,6 @@ al_test_register_mem(
                        break;\r
                }\r
 \r
-               if(alts_mr_attr.lkey !=  lkey || alts_mr_attr.rkey !=  rkey)\r
-               {\r
-                       \r
-                       ALTS_PRINT( ALTS_DBG_ERROR,\r
-                               ("ib_query_mr failed lkey rkey different from reg\n"));\r
-                       ALTS_PRINT( ALTS_DBG_ERROR,\r
-                               ("\t\t reg-lkey = %x  query-lkey %x reg-rkey%x query-rkey%x\n" ,\r
-                               alts_mr_attr.lkey , lkey , alts_mr_attr.rkey ,  rkey));\r
-                       alts_close_ca(h_ca);\r
-                       ib_status = IB_INVALID_LKEY;\r
-                       break;\r
-                       \r
-               }\r
-\r
-               ALTS_PRINT( ALTS_DBG_ERROR,\r
-                       ("ib_query_mr passed\n"\r
-                       "\t\t lkey = %x    rkey%x query-rkey%x\n" ,\r
-                        lkey, rkey));\r
                /*\r
                 * Re-register the memeory region\r
                 */\r
@@ -176,8 +158,6 @@ al_test_register_mem(
                {\r
                        ALTS_PRINT( ALTS_DBG_ERROR,\r
                                ("ib_rereg_mem failed status = %s\n", ib_get_err_str(ib_status)) );\r
-                       alts_close_ca(h_ca);\r
-                       break;\r
                }\r
 \r
                ALTS_PRINT( ALTS_DBG_ERROR,\r
index d7dd1fdfa2728a6c3d12e89c81e6fffd14049ee9..ef97cc39a111795ff7c1aec5654f4a92b54e2508 100644 (file)
@@ -212,7 +212,9 @@ ib_api_status_t ib_status = IB_ERROR;
                ib_status = al_test_create_mem_window();\r
                break;\r
        case RegisterSharedMemRegion:\r
-               ib_status = al_test_register_shared_mem();\r
+               CL_PRINT( ALTS_DBG_VERBOSE, alts_dbg_lvl,\r
+                       ("altsapp: RegisterSharedMemRegion not implemented.\n") );\r
+               ib_status = IB_SUCCESS;\r
                break;\r
        case MultiSend:\r
                ib_status = al_test_multi_send_recv();\r
index c6d5952581f3abe9a7e5d7d74e6f254f8b85d236..63b7b0601016d31e63d5fb677de1f14a5243ea83 100644 (file)
@@ -1,4 +1,6 @@
 DIRS=\\r
        alts    \\r
        cmtest  \\r
-       wsd\r
+       srp             \\r
+       wsd             \\r
+       limits\r
index 5a7e8b31b0b07e3751c3a29a494f648ee8ae5130..389156fd2c7f52c1116a6639091f56ab1aeadffc 100644 (file)
@@ -1,2 +1,2 @@
-DIRS=\
-       user
+DIRS=\\r
+       user\r
index 58189757d61c2c805ec47a954e17e83d8f54e0bd..9c985f57bc6a7c054e47a7b8a63af4dca9ce53dd 100644 (file)
@@ -1,7 +1,7 @@
-#
-# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
-# file to this component.  This file merely indirects to the real make file
-# that is shared by all the driver components of the Windows NT DDK
-#
-
-!INCLUDE $(NTMAKEENV)\makefile.def
+#\r
+# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source\r
+# file to this component.  This file merely indirects to the real make file\r
+# that is shared by all the driver components of the Windows NT DDK\r
+#\r
+\r
+!INCLUDE $(NTMAKEENV)\makefile.def\r
index 0bd0bfcf0824c95b12056cceddf056f9fe90d06b..717ac828fd4d1a2fdecccc2b6e18f6c4cdcc372d 100644 (file)
@@ -1,47 +1,47 @@
-/*
- * Copyright (c) 2005 Mellanox Technologies.  All rights reserved.
- *
- * This software is available to you under the OpenIB.org BSD license
- * below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * $Id$
- */
-
-
-#include <ics_ver.h>
-
-#define VER_FILETYPE                           VFT_APP
-#define VER_FILESUBTYPE                                VFT2_UNKNOWN
-
-#ifdef _DEBUG_
-#define VER_FILEDESCRIPTION_STR                "HCA Status Report Application (Debug)"
-#else
-#define VER_FILEDESCRIPTION_STR                "HCA Status Report Application"
-#endif
-
-#define VER_INTERNALNAME_STR           "vstat.exe"
-#define VER_ORIGINALFILENAME_STR       "vstat.exe"
-
-#include <common.ver>
+/*\r
+ * Copyright (c) 2005 Mellanox Technologies.  All rights reserved.\r
+ *\r
+ * This software is available to you under the OpenIB.org BSD license\r
+ * below:\r
+ *\r
+ *     Redistribution and use in source and binary forms, with or\r
+ *     without modification, are permitted provided that the following\r
+ *     conditions are met:\r
+ *\r
+ *      - Redistributions of source code must retain the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer.\r
+ *\r
+ *      - Redistributions in binary form must reproduce the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer in the documentation and/or other materials\r
+ *        provided with the distribution.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ *\r
+ * $Id$\r
+ */\r
+\r
+\r
+#include <ics_ver.h>\r
+\r
+#define VER_FILETYPE                           VFT_APP\r
+#define VER_FILESUBTYPE                                VFT2_UNKNOWN\r
+\r
+#ifdef _DEBUG_\r
+#define VER_FILEDESCRIPTION_STR                "HCA Status Report Application (Debug)"\r
+#else\r
+#define VER_FILEDESCRIPTION_STR                "HCA Status Report Application"\r
+#endif\r
+\r
+#define VER_INTERNALNAME_STR           "vstat.exe"\r
+#define VER_ORIGINALFILENAME_STR       "vstat.exe"\r
+\r
+#include <common.ver>\r
index bbcb40f493aabe042d85587f3a9bf4e93ff1583b..93eb64a0583a677a72d1a3061c48d81d2791c469 100644 (file)
@@ -106,36 +106,13 @@ void printPortLinkState(int portState){ //TODO: check that these are all the opt
 }\r
 \r
 \r
-\r
-void printPortMTU(int mtu){ //TODO: check that these are all the options and that they are correct\r
-       switch(mtu){\r
-               case 1:\r
-                       printf("\t\tmax_mtu=256\n");\r
-                       break;\r
-               case 2:\r
-                       printf("\t\tmax_mtu=512\n");\r
-                       break;\r
-               case 3:\r
-                       printf("\t\tmax_mtu=1024\n");\r
-                       break;\r
-               case 4:\r
-                       printf("\t\tmax_mtu=2048\n");\r
-                       break;\r
-               case 5:\r
-                       printf("\t\tmax_mtu=4096\n");\r
-                       break;\r
-               default:\r
-                       printf("\t\tmax_mtu=UNKNOWN\n"); \r
-       }\r
-}\r
-\r
 void printPortInfo(ib_port_attr_t* portPtr, BOOLEAN fullPrint){\r
        printf("\t\tport=%d\n", portPtr->port_num);\r
        printPortLinkState(portPtr->link_state);\r
        printf("\t\tsm_lid=0x%04x\n", cl_ntoh16(portPtr->sm_lid));\r
        printf("\t\tport_lid=0x%04x\n", cl_ntoh16(portPtr->lid));\r
        printf("\t\tport_lmc=0x%x\n", portPtr->lmc);\r
-       printPortMTU(portPtr->mtu);\r
+       printf("\t\tmax_mtu=%d\n", portPtr->mtu);\r
        if(fullPrint){\r
                printf("\t\tmax_msg_sz=0x%x     (Max message size)\n", portPtr->max_msg_size);\r
                printf("\t\tcapability_mask=TBD\n");\r
index d1f89c9d959e76aea23e2390295ddc0e50b7b861..d651c0e42892b53ae352b285242fb462cd62517d 100644 (file)
@@ -7,7 +7,7 @@ Class       = Net
 ClassGUID   = {4d36e972-e325-11ce-bfc1-08002be10318}\r
 Provider    = %SST%\r
 CatalogFile = netipoib.cat\r
-DriverVer=05/10/2005,3.0.0031.0\r
+DriverVer=09/01/2005,3.0.0036.0\r
 \r
 [Manufacturer]\r
 %SST%       = SST,ntx86,ntamd64,ntia64\r
index ed41dcf407f9f3e6e885f3024236d66b4100297b..ddf0ed7df3543dba244a417789c55225e1b97de4 100644 (file)
@@ -1,2 +1,3 @@
 DIRS=\\r
+       user    \\r
        kernel\r
index 197f53750bb5aaf0e2656d1dfeae3d74f3839a7c..6c68d6f35c616dbb95843fd6ade3f3ad7c63888b 100644 (file)
@@ -7,7 +7,7 @@ Class=SCSIAdapter
 ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318}\r
 Provider=%SST%\r
 CatalogFile=ibsrp.cat\r
-DriverVer=06/20/2005,3.0.0033.0\r
+DriverVer=09/01/2005,3.0.0036.0\r
 \r
 \r
 ; ================= Device Install section =====================\r
index ab14d893c9f71559ddb1ac5cc0981bbd33ade8fa..88720811e1a2ce9e53ed02b0d544f0eaa7738397 100644 (file)
@@ -1302,11 +1302,11 @@ shutdown_and_destroy_socket_info(
                break;\r
 \r
        case IBSP_CONNECT:\r
-               // TODO\r
+               ibsp_conn_remove( socket_info );\r
                break;\r
 \r
        case IBSP_ACCEPT:\r
-               // TODO\r
+               ibsp_conn_remove( socket_info );\r
                break;\r
 \r
        case IBSP_LISTEN:\r
@@ -1315,6 +1315,10 @@ shutdown_and_destroy_socket_info(
        case IBSP_CONNECTED:\r
                {\r
                        struct disconnect_reason reason;\r
+\r
+                       /* We changed the state - remove from connection map. */\r
+                       ibsp_conn_remove( socket_info );\r
+\r
                        memset( &reason, 0, sizeof(reason) );\r
                        reason.type = DISC_SHUTDOWN;\r
                        ib_disconnect( socket_info, &reason );\r
index 5461946e1231fc63597079fc664918a1e3c2b9aa..27f547f7434b73284dea7e3326667db5bd906b4c 100644 (file)
@@ -57,15 +57,18 @@ ip_cmp(
        p_ip1 = (struct ibsp_ip_addr*)p_key1;\r
        p_ip2 = (struct ibsp_ip_addr*)p_key2;\r
 \r
-       if( p_ip1->ip_addr.S_un.S_addr != p_ip2->ip_addr.S_un.S_addr )\r
-               return p_ip1->ip_addr.S_un.S_addr - p_ip2->ip_addr.S_un.S_addr;\r
+       if( p_ip1->ip_addr.S_un.S_addr < p_ip2->ip_addr.S_un.S_addr )\r
+               return -1;\r
+       else if( p_ip1->ip_addr.S_un.S_addr > p_ip2->ip_addr.S_un.S_addr )\r
+               return 1;\r
 \r
-       /* IP addresses differ.  See if we need a port match too. */\r
+       /* IP addresses match.  See if we need a port match too. */\r
        if( !p_ip1->p_port || !p_ip2->p_port )\r
                return 0;\r
 \r
        /* We need a port match too. */\r
-       return ((intn_t)p_ip1->p_port) - ((intn_t)p_ip2->p_port);\r
+       return cl_memcmp(\r
+               &p_ip1->p_port->guid, &p_ip2->p_port->guid, sizeof(net64_t) );\r
 }\r
 \r
 \r
@@ -76,7 +79,6 @@ query_ip_address_callback(
        struct ip_query_context         *query_context =\r
                (struct ip_query_context * __ptr64)p_query_rec->query_context;\r
        cl_fmap_item_t                          *p_item;\r
-       ib_api_status_t                         status;\r
 \r
        CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
        CL_TRACE( IBSP_DBG_HW, gdbg_lvl,\r
@@ -96,7 +98,7 @@ query_ip_address_callback(
 \r
                        ip_addr =\r
                                HeapAlloc( g_ibsp.heap, HEAP_ZERO_MEMORY, sizeof(struct ibsp_ip_addr) );\r
-                       if( ip_addr == NULL )\r
+                       if( !ip_addr )\r
                        {\r
                                CL_EXIT_ERROR( IBSP_DBG_HW, gdbg_lvl, ("no memory\n") );\r
                                break;\r
@@ -129,14 +131,7 @@ query_ip_address_callback(
        }\r
 \r
        if( p_query_rec->p_result_mad )\r
-       {\r
-               status = ib_put_mad( p_query_rec->p_result_mad );\r
-               if( status != IB_SUCCESS )\r
-               {\r
-                       CL_ERROR( IBSP_DBG_HW, gdbg_lvl,\r
-                               ("ib_put_mad failed (%d)\n", status) );\r
-               }\r
-       }\r
+               ib_put_mad( p_query_rec->p_result_mad );\r
 \r
        CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
 }\r
@@ -181,7 +176,7 @@ query_ip_address(
        user_query.p_attr = &service_record;\r
 \r
        memset( &service_record, 0, sizeof(service_record) );\r
-       service_record.service_pkey = cl_hton16( IB_DEFAULT_PKEY );\r
+       service_record.service_pkey = IB_DEFAULT_PKEY;\r
        ib_gid_set_default( &service_record.service_gid, p_port->guid );\r
        service_record.service_lease = 0xFFFFFFFF;\r
        strcpy( (void *)service_record.service_name, ATS_NAME );\r
@@ -337,39 +332,34 @@ query_guid_callback(
        struct query_guid_context *query_context =\r
                (struct query_guid_context * __ptr64)p_query_rec->query_context;\r
        ib_service_record_t *service_record;\r
-       ib_api_status_t status;\r
 \r
        CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
        CL_TRACE( IBSP_DBG_HW, gdbg_lvl,\r
                ("status is %d, count is %d\n", p_query_rec->status,\r
                p_query_rec->result_cnt) );\r
 \r
-       query_context->status = p_query_rec->status;\r
-\r
-       if( p_query_rec->status == IB_SUCCESS )\r
+       if( p_query_rec->status == IB_SUCCESS && p_query_rec->result_cnt )\r
        {\r
-               //CL_ASSERT(p_query_rec->result_cnt == 1);\r
+               query_context->status = IB_SUCCESS;\r
 \r
                service_record = ib_get_query_svc_rec( p_query_rec->p_result_mad, 0 );\r
 \r
                CL_ASSERT( service_record != NULL );\r
 \r
-               /* Copy the GUID */\r
                query_context->guid = ib_gid_get_guid( &service_record->service_gid );\r
        }\r
-\r
-       if( p_query_rec->status == IB_SUCCESS || p_query_rec->status == IB_REMOTE_ERROR )\r
+       else\r
        {\r
-               status = ib_put_mad( p_query_rec->p_result_mad );\r
-               if( status != IB_SUCCESS )\r
-               {\r
-                       CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("ib_put_mad failed (%d)\n", status) );\r
-               }\r
+               query_context->status = IB_ERROR;\r
        }\r
 \r
+       if( p_query_rec->p_result_mad )\r
+               ib_put_mad( p_query_rec->p_result_mad );\r
+\r
        CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
 }\r
 \r
+\r
 /* Synchronously query the SA for a GUID. Return 0 on success. */\r
 int\r
 query_guid_address(\r
@@ -467,12 +457,12 @@ query_pr_callback(
        CL_ENTER( IBSP_DBG_HW, gdbg_lvl );\r
        CL_TRACE( IBSP_DBG_HW, gdbg_lvl, ("status is %d\n", p_query_rec->status) );\r
 \r
-       query_context->status = p_query_rec->status;\r
-\r
-       if( p_query_rec->status == IB_SUCCESS )\r
+       if( p_query_rec->status == IB_SUCCESS && p_query_rec->result_cnt )\r
        {\r
                ib_path_rec_t *path_rec;\r
 \r
+               query_context->status = IB_SUCCESS;\r
+\r
                path_rec = ib_get_query_path_rec( p_query_rec->p_result_mad, 0 );\r
 \r
                CL_ASSERT( path_rec );\r
@@ -480,16 +470,14 @@ query_pr_callback(
                /* Copy the path record */\r
                *query_context->path_rec = *path_rec;\r
        }\r
-\r
-       if( p_query_rec->status == IB_SUCCESS || p_query_rec->status == IB_REMOTE_ERROR )\r
+       else\r
        {\r
-               status = ib_put_mad( p_query_rec->p_result_mad );\r
-               if( status != IB_SUCCESS )\r
-               {\r
-                       CL_ERROR( IBSP_DBG_HW, gdbg_lvl, ("ib_put_mad failed (%d)\n", status) );\r
-               }\r
+               query_context->status = IB_ERROR;\r
        }\r
 \r
+       if( p_query_rec->p_result_mad )\r
+               status = ib_put_mad( p_query_rec->p_result_mad );\r
+\r
        CL_EXIT( IBSP_DBG_HW, gdbg_lvl );\r
 }\r
 \r
index eb3292faf4e3311fc09d98962171a07430e04351..f880b017b64b321592ff49a20cc6823b40e64b12 100644 (file)
@@ -154,9 +154,10 @@ pnp_ca_remove(
        cl_spinlock_acquire( &hca->port_lock );\r
        while( cl_qlist_count( &hca->port_list ) )\r
        {\r
-               p_item = cl_qlist_head( &hca->port_list );\r
-               /* pnp_port_remove removes the port from the HCA's ports list. */\r
-               pnp_port_remove( PARENT_STRUCT(p_item, struct ibsp_port, item) );\r
+               p_item = cl_qlist_remove_head( &hca->port_list );\r
+\r
+               HeapFree( g_ibsp.heap, 0,\r
+                       PARENT_STRUCT(p_item, struct ibsp_port, item) );\r
        }\r
        cl_spinlock_release( &hca->port_lock );\r
 \r
@@ -232,7 +233,6 @@ pnp_port_add(
        port->guid = p_port_rec->p_port_attr->port_guid;\r
        port->port_num = p_port_rec->p_port_attr->port_num;\r
        port->hca = hca;\r
-       cl_spinlock_init( &port->mutex );\r
 \r
        cl_spinlock_acquire( &hca->port_lock );\r
        cl_qlist_insert_tail( &hca->port_list, &port->item );\r
@@ -261,9 +261,6 @@ pnp_port_remove(
        cl_qlist_remove_item( &port->hca->port_list, &port->item );\r
        cl_spinlock_release( &port->hca->port_lock );\r
 \r
-       cl_spinlock_destroy( &port->mutex );\r
-\r
-       /* Free it */\r
        HeapFree( g_ibsp.heap, 0, port );\r
 \r
 done:\r
index 0172a8407ba324368ae3088bcc75a0adf67677bb..5cde26f6c26b1a5991eeba7ba3de48de9821b86d 100644 (file)
@@ -391,7 +391,6 @@ struct ibsp_ip_addr
 struct ibsp_port\r
 {\r
        cl_list_item_t item;\r
-       cl_spinlock_t mutex;\r
 \r
        struct ibsp_hca *hca;           /* HCA to which this port belong. */\r
 \r