]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[IBBUS] fixed duplicate bus relations reporting, which also fixed the problem of...
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 6 Aug 2008 21:08:11 +0000 (21:08 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 6 Aug 2008 21:08:11 +0000 (21:08 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@1468 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

branches/winverbs/core/bus/kernel/bus_iou_mgr.c
branches/winverbs/core/bus/kernel/bus_pnp.c
branches/winverbs/core/bus/kernel/bus_port_mgr.c

index d53917406be3127af6f587ecb37057ae64b6ca2f..2db2fc78e20adad3fb2b62d3e58d77481baba470 100644 (file)
@@ -621,7 +621,7 @@ __iou_was_hibernated(
        bus_pdo_ext_t   *p_pdo_ext = NULL;\r
        size_t                  n_devs = 0;\r
        iou_mgr_t               *gp_iou_mgr = p_bfi->p_iou_mgr;\r
-       cl_qlist_t*             p_pdo_list = &gp_iou_mgr->iou_list;\r
+       cl_qlist_t              *p_pdo_list = &gp_iou_mgr->iou_list;\r
        iou_pnp_ctx_t   *p_ctx = p_pnp_rec->pnp_rec.context;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
@@ -659,7 +659,8 @@ __iou_was_hibernated(
                p_pdo_ext->h_ca = acquire_ca( p_pnp_rec->ca_guid );\r
                if( !p_pdo_ext->h_ca )\r
                {\r
-                       BUS_TRACE( BUS_DBG_ERROR, ("acquire_ca failed to find CA by guid %I64x\n",\r
+                       BUS_TRACE( BUS_DBG_ERROR,\r
+                               ("acquire_ca failed to find CA by guid %I64x\n",\r
                                p_pnp_rec->ca_guid ) );\r
                        status = IB_INVALID_GUID;\r
                }\r
@@ -707,8 +708,8 @@ iou_mgr_iou_add(
 \r
        p_bfi = get_set_bfi_by_ca_guid( p_pnp_rec->ca_guid );\r
        if ( !p_bfi ) {\r
-               BUS_PRINT( BUS_DBG_PNP,("%s() NULL p_bfi? ca_guid 0x%I64x\n",\r
-                                                               __FUNCTION__, p_pnp_rec->ca_guid ) );\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP,("%s() NULL p_bfi? ca_guid 0x%I64x\n",\r
+                                                                       __FUNCTION__, p_pnp_rec->ca_guid ) );\r
                return IB_ERROR;\r
        }\r
 \r
@@ -720,7 +721,7 @@ iou_mgr_iou_add(
                p_ctx = cl_zalloc( sizeof(*p_ctx) );\r
                if( !p_ctx )\r
                {\r
-                       BUS_PRINT(BUS_DBG_PNP, ("%s(%s) ca_guid 0x%I64x iou_guid(%I64x) "\r
+                       BUS_TRACE_EXIT(BUS_DBG_PNP, ("%s(%s) ca_guid %I64x iou_guid(%I64x) "\r
                                        "BAD alloc for PNP context\n", __FUNCTION__,\r
                                        p_bfi->whoami, p_bfi->ca_guid, p_pnp_rec->guid ));\r
 \r
@@ -819,12 +820,6 @@ iou_mgr_iou_add(
        IoInvalidateDeviceRelations(\r
                        p_iou_ext->pdo.h_ca->obj.p_ci_ca->verbs.p_hca_dev, BusRelations );\r
 \r
-#if 0 // XXX\r
-       /* Invalidate removal relations for the bus driver. */\r
-       IoInvalidateDeviceRelations(\r
-                       p_bfi->p_bus_ext->cl_ext.p_pdo, RemovalRelations );\r
-#endif\r
-\r
        BUS_EXIT( BUS_DBG_PNP );\r
 \r
        return IB_SUCCESS;\r
@@ -866,7 +861,7 @@ iou_mgr_iou_remove(
 \r
        gp_iou_mgr = p_bfi->p_iou_mgr;\r
 \r
-       /* Within the Bus fabric instance is the port extension; see\r
+       /* Within the PNP record's context is the IOU extension; see\r
         * was_hibernated().\r
         */\r
        p_ext = p_ctx->p_pdo_ext;\r
@@ -889,7 +884,7 @@ iou_mgr_iou_remove(
        cl_mutex_acquire( &gp_iou_mgr->pdo_mutex );\r
        if ( !p_ext->h_ca )\r
        {\r
-               BUS_TRACE( BUS_DBG_PNP, ("%s() NULL h_ca? p_ext %p\n",\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP, ("%s() NULL h_ca? p_ext %p\n",\r
                                        __FUNCTION__, p_ext ) );\r
                return;\r
        }\r
@@ -913,12 +908,6 @@ iou_mgr_iou_remove(
                                p_ext->cl_ext.vfptr_pnp_po->identity, p_ext, p_ext->b_present,\r
                                p_ext->b_reported_missing ) );\r
 \r
-#if 0 // XXX\r
-       /* Invalidate removal relations for the bus driver. */\r
-       IoInvalidateDeviceRelations( p_bfi->p_bus_ext->cl_ext.p_pdo,\r
-                                                                RemovalRelations );\r
-#endif\r
-\r
        /* Invalidate bus relations for the HCA. */\r
        IoInvalidateDeviceRelations(\r
                p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev, BusRelations );\r
index 8c2d61b71a3c6d87237d487c52859f7c7f125649..43c13e7a84d8906cf21e1e55907b0549d4053754 100644 (file)
@@ -153,9 +153,9 @@ static const cl_vfptr_pnp_po_t              vfptr_fdo_pnp = {
        cl_irp_skip,\r
        cl_irp_skip,\r
        cl_do_sync_pnp,\r
-       fdo_query_bus_relations /*cl_irp_ignore*/ ,\r
+       fdo_query_bus_relations,\r
        cl_irp_ignore,\r
-       cl_irp_skip     /*fdo_query_remove_relations now _bus_relations */ ,\r
+       cl_irp_skip,\r
        cl_irp_ignore,\r
        cl_irp_ignore,\r
        cl_irp_ignore,\r
@@ -191,7 +191,7 @@ bus_add_device(
        p_bfi = alloc_bfi( p_driver_obj, &ic );\r
        if ( !p_bfi )\r
        {\r
-               BUS_PRINT( BUS_DBG_PNP,\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP,\r
                        ("%s() Err - Exceeded MAX_BUS_FILTERS(%d)\n",MAX_BUS_FILTERS));\r
                return STATUS_UNSUCCESSFUL;\r
        }\r
@@ -209,7 +209,7 @@ bus_add_device(
                                                                 FILE_DEVICE_SECURE_OPEN, FALSE, &p_dev_obj );\r
                if( !NT_SUCCESS(status) )\r
                {\r
-                       BUS_TRACE_EXIT( BUS_DBG_ERROR, \r
+                       BUS_PRINT( BUS_DBG_ERROR, \r
                                ("Failed to create ControlDeviceObject, status %x.\n",status) );\r
                        goto bail;\r
                }\r
@@ -218,7 +218,7 @@ bus_add_device(
                if( !NT_SUCCESS(status) )\r
                {\r
                        IoDeleteDevice( p_dev_obj );\r
-                       BUS_TRACE_EXIT( BUS_DBG_ERROR,\r
+                       BUS_PRINT( BUS_DBG_ERROR,\r
                                ("Failed to create symlink for dos name.\n") );\r
                        goto bail;\r
                }\r
@@ -227,13 +227,12 @@ bus_add_device(
                status = IoCreateDevice( p_driver_obj, sizeof(bus_fdo_ext_t),\r
                                                                 NULL, FILE_DEVICE_BUS_EXTENDER,\r
                                                                 FILE_DEVICE_SECURE_OPEN, FALSE, &p_dev_obj );\r
-       }\r
-\r
-       if( !NT_SUCCESS(status) )\r
-       {\r
-               BUS_TRACE_EXIT( BUS_DBG_ERROR, \r
-                       ("Failed to create bus root FDO device.\n") );\r
-               goto bail;\r
+               if( !NT_SUCCESS(status) )\r
+               {\r
+                       BUS_PRINT( BUS_DBG_ERROR, \r
+                               ("Failed to create bus root FDO device.\n") );\r
+                       goto bail;\r
+               }\r
        }\r
 \r
        p_ext = p_dev_obj->DeviceExtension;\r
@@ -244,7 +243,7 @@ bus_add_device(
        if( !p_next_do )\r
        {\r
                IoDeleteDevice( p_dev_obj );\r
-               BUS_TRACE_EXIT( BUS_DBG_ERROR, ("IoAttachToDeviceStack failed.\n") );\r
+               BUS_PRINT( BUS_DBG_ERROR, ("IoAttachToDeviceStack failed.\n") );\r
                status = STATUS_NO_SUCH_DEVICE;\r
                goto bail;\r
        }\r
@@ -268,7 +267,7 @@ bus_add_device(
        {\r
                IoDetachDevice( p_ext->cl_ext.p_next_do );\r
                IoDeleteDevice( p_dev_obj );\r
-               BUS_TRACE_EXIT( BUS_DBG_ERROR, \r
+               BUS_PRINT( BUS_DBG_ERROR, \r
                        ("IoRegisterDeviceInterface for upper interface returned %08x\n",\r
                        status) );\r
                status = STATUS_NO_SUCH_DEVICE;\r
@@ -282,7 +281,7 @@ bus_add_device(
        {\r
                IoDetachDevice( p_ext->cl_ext.p_next_do );\r
                IoDeleteDevice( p_dev_obj );\r
-               BUS_TRACE_EXIT( BUS_DBG_ERROR, \r
+               BUS_PRINT( BUS_DBG_ERROR, \r
                        ("IoRegisterDeviceInterface for lower interface returned %08x\n",\r
                        status) );\r
                status = STATUS_NO_SUCH_DEVICE;\r
@@ -297,7 +296,7 @@ adxit:
        return STATUS_SUCCESS;\r
 \r
 bail:\r
-       BUS_PRINT( BUS_DBG_PNP, ("%s(%s) exit status %d\n",\r
+       BUS_PRINT( BUS_DBG_PNP, ("%s(%s) exit status 0x%x\n",\r
                                                                __FUNCTION__,p_bfi->whoami,status) );\r
        ic = free_bfi(p_bfi);\r
        /* if last Bus filter, then cleanup */\r
@@ -394,6 +393,7 @@ fdo_query_remove(
                OUT                             cl_irp_action_t* const  p_action )\r
 {\r
        bus_fdo_ext_t   *p_ext;\r
+       bus_filter_t    *p_bfi;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
@@ -402,7 +402,7 @@ fdo_query_remove(
        BUS_PRINT( BUS_DBG_PNP,\r
                ("%s() IRP_MN_QUERY_REMOVE_DEVICE %s @ %p refs CI %d AL %d\n", \r
                __FUNCTION__, p_ext->cl_ext.vfptr_pnp_po->identity, p_ext,\r
-               p_ext->n_ci_ifc_ref,p_ext->n_al_ifc_ref ) ); // XXX\r
+               p_ext->n_ci_ifc_ref,p_ext->n_al_ifc_ref ) );\r
 \r
        if( p_ext->n_ci_ifc_ref )\r
        {\r
@@ -421,9 +421,23 @@ fdo_query_remove(
                return STATUS_UNSUCCESSFUL;\r
        }\r
 \r
+       /* remove port & iou managers */        \r
+       p_bfi = p_ext->bus_filter;\r
+       CL_ASSERT( p_bfi );\r
+\r
+       //TODO: Fail outstanding I/O operations.\r
+\r
+       if ( p_ext->p_port_mgr && p_bfi->p_port_mgr )\r
+               cl_obj_destroy( &p_ext->p_port_mgr->obj );\r
+\r
+       if ( p_ext->p_iou_mgr && p_bfi->p_iou_mgr )\r
+               cl_obj_destroy( &p_ext->p_iou_mgr->obj );\r
+\r
+\r
        *p_action = IrpSkip;\r
        /* The FDO driver must set the status even when passing down. */\r
        p_irp->IoStatus.Status = STATUS_SUCCESS;\r
+\r
        BUS_EXIT( BUS_DBG_PNP );\r
        return STATUS_SUCCESS;\r
 }\r
@@ -448,16 +462,17 @@ fdo_release_resources(
        p_ext = p_dev_obj->DeviceExtension;\r
        ic = get_bfi_count();\r
 \r
+       p_bfi = p_ext->bus_filter;\r
+       CL_ASSERT( p_bfi );\r
+\r
        //TODO: Fail outstanding I/O operations.\r
 \r
-       if (p_ext->p_port_mgr)\r
+       if ( p_ext->p_port_mgr && p_bfi->p_port_mgr )\r
                cl_obj_destroy( &p_ext->p_port_mgr->obj );\r
 \r
-       if (p_ext->p_iou_mgr)\r
+       if ( p_ext->p_iou_mgr && p_bfi->p_iou_mgr )\r
                cl_obj_destroy( &p_ext->p_iou_mgr->obj );\r
 \r
-       p_bfi = p_ext->bus_filter;\r
-       CL_ASSERT( p_bfi );\r
        BUS_PRINT( BUS_DBG_PNP, ("%s() Releasing BusFilter %s\n",\r
                                                        __FUNCTION__, p_bfi->whoami ));\r
        if (p_bfi) {\r
@@ -530,70 +545,31 @@ fdo_query_capabilities(
 }\r
 \r
 \r
-#if 0 // XXX\r
-\r
 static NTSTATUS\r
-fdo_query_removal_relations(\r
+fdo_query_bus_relations(\r
        IN                                      DEVICE_OBJECT* const    p_dev_obj,\r
        IN                                      IRP* const                              p_irp, \r
                OUT                             cl_irp_action_t* const  p_action )\r
 {\r
        NTSTATUS                        status;\r
-       UNUSED_PARAM( p_dev_obj );\r
+       bus_fdo_ext_t           *p_ext;\r
+       bus_filter_t            *p_bfi;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
 \r
-       status = port_mgr_get_bus_relations( 0, p_irp );\r
-       if( status == STATUS_SUCCESS || \r
-               status == STATUS_NO_SUCH_DEVICE )\r
-       {\r
-               status = iou_mgr_get_bus_relations( 0, p_irp );\r
-       }\r
-       if( status == STATUS_NO_SUCH_DEVICE )\r
-               status = STATUS_SUCCESS;\r
+       p_ext = p_dev_obj->DeviceExtension;\r
 \r
-       switch( status )\r
+       if ( !p_ext->bus_filter )\r
        {\r
-       case STATUS_NO_SUCH_DEVICE:\r
-               *p_action = IrpSkip;\r
-               status = STATUS_SUCCESS;\r
-               break;\r
-\r
-       case STATUS_SUCCESS:\r
-               *p_action = IrpPassDown;\r
-               break;\r
-\r
-       default:\r
+               /* BFI has already been released */\r
                *p_action = IrpComplete;\r
-               break;\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP, ("%s() NULL BFI\n", __FUNCTION__) );\r
+               return STATUS_SUCCESS;\r
        }\r
 \r
-       BUS_EXIT( BUS_DBG_PNP );\r
-       return status;\r
-}\r
-#endif\r
-\r
-\r
-static NTSTATUS\r
-fdo_query_bus_relations(\r
-       IN                                      DEVICE_OBJECT* const    p_dev_obj,\r
-       IN                                      IRP* const                              p_irp, \r
-               OUT                             cl_irp_action_t* const  p_action )\r
-{\r
-       NTSTATUS                        status;\r
-       bus_fdo_ext_t           *p_ext;\r
-       bus_filter_t            *p_bfi;\r
-\r
-       BUS_ENTER( BUS_DBG_PNP );\r
-\r
-       p_ext = p_dev_obj->DeviceExtension;\r
-       CL_ASSERT( p_ext->bus_filter );\r
        p_bfi = p_ext->bus_filter;\r
        CL_ASSERT( p_bfi->magic == BFI_MAGIC );\r
 \r
-       BUS_PRINT( BUS_DBG_PNP, ("%s(%s) ca_guid %I64x\n",\r
-                                                       __FUNCTION__,p_bfi->whoami, p_bfi->ca_guid) );\r
-\r
        if ( p_bfi->ca_guid == 0ULL )\r
        {\r
                /* HCA not yet bound to a BFI slot (no PNP ADD event seen), no bus\r
@@ -647,8 +623,6 @@ al_ref_ifc(
        cl_atomic_inc( &p_ext->n_al_ifc_ref );\r
        ObReferenceObject( p_dev_obj );\r
 \r
-       BUS_PRINT( BUS_DBG_PNP, ("  %p->n_al_ifc_ref %d\n",\r
-                               p_ext,p_ext->n_al_ifc_ref )); // XXX\r
        BUS_EXIT( BUS_DBG_PNP );\r
 }\r
 \r
@@ -666,8 +640,6 @@ al_deref_ifc(
        cl_atomic_dec( &p_ext->n_al_ifc_ref );\r
        ObDereferenceObject( p_dev_obj );\r
 \r
-       BUS_PRINT( BUS_DBG_PNP, ("  %p->n_al_ifc_ref %d\n",\r
-                               p_ext,p_ext->n_al_ifc_ref )); // XXX\r
        BUS_EXIT( BUS_DBG_PNP );\r
 }\r
 \r
@@ -685,8 +657,6 @@ al_ref_ci_ifc(
        cl_atomic_inc( &p_ext->n_ci_ifc_ref );\r
        ObReferenceObject( p_dev_obj );\r
 \r
-       BUS_PRINT( BUS_DBG_PNP, ("  %p->n_ci_ifc_ref %d\n",\r
-                               p_ext,p_ext->n_ci_ifc_ref )); // XXX\r
        BUS_EXIT( BUS_DBG_PNP );\r
 }\r
 \r
@@ -704,8 +674,6 @@ al_deref_ci_ifc(
        cl_atomic_dec( &p_ext->n_ci_ifc_ref );\r
        ObDereferenceObject( p_dev_obj );\r
 \r
-       BUS_PRINT( BUS_DBG_PNP, ("  %p->n_ci_ifc_ref %d\n",\r
-                               p_ext,p_ext->n_ci_ifc_ref )); // XXX\r
        BUS_EXIT( BUS_DBG_PNP );\r
 }\r
 \r
@@ -869,22 +837,18 @@ __get_relations(
        IN              const   net64_t                                         ca_guid,\r
        IN                              IRP* const                                      p_irp )\r
 {\r
-       NTSTATUS                        status;\r
-\r
        BUS_ENTER( BUS_DBG_PNP );\r
+       UNUSED_PARAM( ca_guid );\r
+       UNUSED_PARAM( p_irp );\r
 \r
-       /* TODO: For IOUs, filter relations based on multi-HCA support. */\r
-       status = port_mgr_get_bus_relations( ca_guid, p_irp );\r
-       if( status == STATUS_SUCCESS || \r
-               status == STATUS_NO_SUCH_DEVICE )\r
-       {\r
-               status = iou_mgr_get_bus_relations( ca_guid, p_irp );\r
-       }\r
-       if( status == STATUS_NO_SUCH_DEVICE )\r
-               status = STATUS_SUCCESS;\r
+       /*\r
+        * Now that ibbus is in the same device stack as the HCA driver, skip\r
+        * returning relations here as ibbus has already done the deed.\r
+        * This interface remains to minimize changes to HCA drivers for now.\r
+        */\r
 \r
        BUS_EXIT( BUS_DBG_PNP );\r
-       return status;\r
+       return STATUS_SUCCESS;\r
 }\r
 \r
 \r
index 31837284ce0b3773104d4984c144e8e500d7161a..19891eeb4b44919b803cac09d000c7540af6dce9 100644 (file)
@@ -456,11 +456,6 @@ free_port_mgr(
                                        p_bfi->whoami, p_ext->cl_ext.vfptr_pnp_po->identity,\r
                                        p_ext->cl_ext.p_self_do, p_ext ) );\r
 \r
-               BUS_TRACE( BUS_DBG_PNP,("%s(%s) h_ca->obj.state %s refs %d\n",\r
-                                               __FUNCTION__, p_bfi->whoami,\r
-                                               get_obj_state_str(p_ext->h_ca->obj.state),\r
-                                               p_ext->h_ca->obj.ref_cnt)); // XXX\r
-\r
                IoDeleteDevice( p_ext->cl_ext.p_self_do );\r
        }\r
 \r
@@ -611,8 +606,7 @@ __port_was_hibernated(
        bus_pdo_ext_t   *p_pdo_ext = NULL;\r
        size_t                  n_devs = 0;\r
        port_mgr_t              *gp_port_mgr = p_bfi->p_port_mgr;\r
-       cl_qlist_t*             p_pdo_list = &gp_port_mgr->port_list;\r
-\r
+       cl_qlist_t              *p_pdo_list = &gp_port_mgr->port_list;\r
        port_pnp_ctx_t  *p_ctx = p_pnp_rec->pnp_rec.context;\r
 \r
        BUS_ENTER( BUS_DBG_PNP );\r
@@ -685,6 +679,7 @@ __port_was_hibernated(
        return status;\r
 }\r
 \r
+#if DBG\r
 \r
 void\r
 dump_pnp_port_rec( ib_pnp_port_rec_t*  pr )\r
@@ -746,6 +741,7 @@ dump_pnp_iou_rec( ib_pnp_iou_rec_t* pr )
                BUS_PRINT( BUS_DBG_PNP, ("  Desc %s\n",pr->desc ));\r
        }\r
 }\r
+#endif\r
 \r
 \r
 ib_api_status_t\r
@@ -767,7 +763,7 @@ port_mgr_port_add(
 \r
        p_bfi = get_set_bfi_by_ca_guid( p_pnp_rec->p_ca_attr->ca_guid );\r
        if ( !p_bfi ) {\r
-               BUS_PRINT( BUS_DBG_PNP,("%s() NULL p_bfi? ca_guid 0x%I64x\n",\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP,("%s() NULL p_bfi? ca_guid 0x%I64x\n",\r
                                                                __FUNCTION__, p_pnp_rec->p_ca_attr->ca_guid ) );\r
                return IB_ERROR;\r
        }\r
@@ -779,7 +775,7 @@ port_mgr_port_add(
                p_ctx = cl_zalloc( sizeof(*p_ctx) );\r
                if( !p_ctx )\r
                {\r
-                       BUS_PRINT(BUS_DBG_PNP,\r
+                       BUS_TRACE_EXIT(BUS_DBG_PNP,\r
                                        ("%s(%s) ca_guid %I64x port(%d) BAD alloc PNP context\n",\r
                                        __FUNCTION__, p_bfi->whoami, p_bfi->ca_guid, \r
                                        p_pnp_rec->p_port_attr->port_num));\r
@@ -905,12 +901,6 @@ port_mgr_port_add(
        IoInvalidateDeviceRelations(\r
                p_port_ext->pdo.h_ca->obj.p_ci_ca->verbs.p_hca_dev, BusRelations );\r
 \r
-#if 0 // XXX\r
-       /* Invalidate removal relations for the bus driver. */\r
-       IoInvalidateDeviceRelations( p_bfi->p_bus_ext->cl_ext.p_pdo,\r
-                                                                RemovalRelations );\r
-#endif\r
-\r
        BUS_EXIT( BUS_DBG_PNP );\r
        return IB_SUCCESS;\r
 }\r
@@ -1015,16 +1005,11 @@ cl_status_t port_mgr_pkey_add(pkey_array_t *pkeys)
        IoInvalidateDeviceRelations(\r
                p_port_ext->pdo.h_ca->obj.p_ci_ca->verbs.p_hca_dev, BusRelations );\r
 \r
-#if 0 // XXX\r
-       /* Invalidate removal relations for the bus driver. */\r
-       IoInvalidateDeviceRelations( p_bfi->p_bus_ext->cl_ext.p_pdo,\r
-                                                                RemovalRelations );\r
-#endif\r
-\r
        BUS_EXIT( BUS_DBG_PNP );\r
        return CL_SUCCESS;\r
 }\r
 \r
+\r
 void\r
 port_mgr_port_remove(\r
        IN                              ib_pnp_port_rec_t*              p_pnp_rec )\r
@@ -1068,16 +1053,7 @@ port_mgr_port_remove(
         */\r
        p_ext = p_ctx->p_pdo_ext;\r
        CL_ASSERT( p_ext );\r
-\r
        CL_ASSERT(p_bfi == p_ext->p_parent_ext->bus_filter);\r
-#if DBG // XXX\r
-       if (p_bfi != p_ext->p_parent_ext->bus_filter) {\r
-               BUS_PRINT(BUS_DBG_PNP,\r
-                       ("%s() p_bfi(%p) != p_ext->bus_filter(%p) line %d file %s\n",\r
-                       __FUNCTION__,p_bfi,p_ext->p_parent_ext->bus_filter,\r
-                       __LINE__,__FILE__));\r
-       }\r
-#endif\r
 \r
        /*\r
         * Flag the port PDO as no longer being present.  We have to wait until\r
@@ -1087,7 +1063,7 @@ port_mgr_port_remove(
         */\r
        if ( !p_ext->h_ca )\r
        {\r
-               BUS_TRACE( BUS_DBG_PNP, ("%s() %s NULL h_ca? p_ext %p\n",\r
+               BUS_TRACE_EXIT( BUS_DBG_PNP, ("%s() %s NULL h_ca? p_ext %p\n",\r
                                        __FUNCTION__, p_bfi->whoami, p_ext ) );\r
                return;\r
        }\r
@@ -1113,12 +1089,6 @@ port_mgr_port_remove(
                p_ext->cl_ext.vfptr_pnp_po->identity, p_ext->cl_ext.p_self_do, p_ext,\r
                p_ext->b_present, p_ext->b_reported_missing ) );\r
 \r
-#if 0 // XXX\r
-       /* Invalidate removal relations for the bus driver. */\r
-       IoInvalidateDeviceRelations( p_bfi->p_bus_ext->cl_ext.p_pdo,\r
-                                                                RemovalRelations );\r
-#endif\r
-\r
        /* Invalidate bus relations for the HCA. */\r
        IoInvalidateDeviceRelations(\r
                p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev, BusRelations );\r
@@ -1173,9 +1143,6 @@ port_query_remove(
 \r
        p_ext = p_dev_obj->DeviceExtension;\r
 \r
-BUS_PRINT( BUS_DBG_PNP, ("%s() %p->n_ifc_ref %d\n",\r
-       __FUNCTION__,p_ext,p_ext->n_ifc_ref ));\r
-\r
        *p_action = IrpComplete;\r
        if( p_ext->n_ifc_ref )\r
        {\r
@@ -1270,9 +1237,10 @@ port_remove(
        p_irp->IoStatus.Status = STATUS_SUCCESS;\r
        IoCompleteRequest( p_irp, IO_NO_INCREMENT );\r
 \r
-       BUS_PRINT/*XXX TRACE*/( BUS_DBG_PNP, ("Deleted device %s: PDO %p(=%p), ext %p\n",\r
+       BUS_TRACE( BUS_DBG_PNP, ("Deleted device %s: PDO %p(=%p), ext %p\n",\r
                p_ext->pdo.cl_ext.vfptr_pnp_po->identity, p_ext->pdo.cl_ext.p_self_do,\r
                p_dev_obj, p_ext ) );\r
+\r
        IoDeleteDevice( p_dev_obj );\r
 \r
        *p_action = IrpDoNothing;\r
@@ -1770,9 +1738,6 @@ port_query_ipoib_ifc(
        p_ipoib_data->port_guid = p_ext->port_guid;\r
        p_ipoib_data->port_num = (uint8_t)p_ext->n_port;\r
 \r
-       BUS_TRACE_EXIT( BUS_DBG_PNP,\r
-                       ("  %p->n_ifc_ref %d\n",p_ext,p_ext->n_ifc_ref) ); //XXX\r
-\r
        BUS_EXIT( BUS_DBG_PNP );\r
        return STATUS_SUCCESS;\r
 }\r