[ofw] RE: IBBUS - remove duplicate info from FDO, use info from BFI
Leonid Keller
leonid at mellanox.co.il
Tue May 19 07:06:50 PDT 2009
OK with me.
Is there a need to zero p_bfi->p_port_mgr_obj after destroying
port_mgr_obj ?
(the same wrt iou_mgr_obj)
> -----Original Message-----
> From: Smith, Stan [mailto:stan.smith at intel.com]
> Sent: Monday, May 18, 2009 7:40 PM
> To: Leonid Keller
> Cc: ofw at lists.openfabrics.org
> Subject: IBBUS - remove duplicate info from FDO, use info from BFI
>
>
> Hello,
> The following patches simplify ibbus code by removing
> duplicate info [p_port_mgr & p_iou_mgr] from the ibbus FDO
> definition 'struct _bus_fdo_ext' to use the duplicate info
> from 'struct _bus_filter_instance'.
>
> I can commit on your approval.
>
> Thank you,
>
> Stan.
>
> Signed off by stan.smith at intel.com
>
> diff U3 C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_driver.h-revBASE.svn000.tmp.h C:/Documents
> and Settings/scsmith/My
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_driver.h
> --- C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_driver.h-revBASE.svn000.tmp.h Mon May
> 18 09:05:38 2009
> +++ C:/Documents and Settings/scsmith/My
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_dr
> iver.h Mon May 18 08:34:41 2009
> @@ -115,9 +115,6 @@
> */
> DEVICE_POWER_STATE po_state[PowerSystemMaximum];
>
> - port_mgr_t *p_port_mgr;
> - iou_mgr_t *p_iou_mgr;
> -
> /* Number of references on the upper interface. */
> atomic32_t n_al_ifc_ref;
> /* Number of references on the CI interface. */
>
>
> diff U3 C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_pnp.-revBASE.svn001.tmp.c C:/Documents and
> Settings/scsmith/My
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_pnp.c
> --- C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_pnp.-revBASE.svn001.tmp.c Mon May 18 09:14:20 2009
> +++ C:/Documents and Settings/scsmith/My
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_pn
> p.c Mon May 18 08:52:42 2009
> @@ -425,7 +425,7 @@
> unlock_control_event();
>
> /* Initialize the port manager. */
> - ib_status = create_port_mgr( p_ext->bus_filter,
> &p_ext->p_port_mgr );
> + ib_status = create_port_mgr( p_ext->bus_filter );
> if( ib_status != IB_SUCCESS )
> {
> BUS_TRACE_EXIT( BUS_DBG_ERROR,
> ("create_port_mgr returned %s.\n", @@ -434,7 +434,7 @@
> }
>
> /* Initialize the IOU manager. */
> - ib_status = create_iou_mgr( p_ext->bus_filter,
> &p_ext->p_iou_mgr );
> + ib_status = create_iou_mgr( p_ext->bus_filter );
> if( ib_status != IB_SUCCESS )
> {
> BUS_TRACE_EXIT( BUS_DBG_ERROR,
> ("create_iou_mgr returned %s.\n", @@ -566,15 +566,11 @@
> ib_get_err_str(ib_status)) );
> }
>
> - if ( p_ext->p_port_mgr && p_bfi->p_port_mgr ) {
> - cl_obj_destroy( &p_ext->p_port_mgr->obj );
> - p_ext->p_port_mgr = NULL;
> - }
> + if ( p_bfi->p_port_mgr )
> + cl_obj_destroy( p_bfi->p_port_mgr_obj );
>
> - if ( p_ext->p_iou_mgr && p_bfi->p_iou_mgr ) {
> - cl_obj_destroy( &p_ext->p_iou_mgr->obj );
> - p_ext->p_iou_mgr = NULL;
> - }
> + if ( p_bfi->p_iou_mgr )
> + cl_obj_destroy( p_bfi->p_iou_mgr_obj );
>
> if ( ic > 0 && p_ext->hca_ifc_taken ) {
> p_ext->hca_ifc.InterfaceHeader.InterfaceDereference(
> @@ -592,7 +588,7 @@
>
> /* if not last Buf Filter Instance, then exit,
> otherwise cleanup/shutdown */
> if ( ic > 0 ) {
> - BUS_TRACE( BUS_DBG_PNP, ("%d remaining
> BusFilters\n", ic ));
> + BUS_TRACE_EXIT( BUS_DBG_PNP, ("%d remaining
> + BusFilters\n", ic ));
> return;
> }
>
>
>
> diff U3 C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_iou_mgr.h-revBASE.svn000.tmp.h C:/Documents
> and Settings/scsmith/My
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_iou_mgr.h
> --- C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_iou_mgr.h-revBASE.svn000.tmp.h Mon May
> 18 09:13:59 2009
> +++ C:/Documents and Settings/scsmith/My
> +++
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_iou_mgr.
> +++ h Mon May 18 08:42:40 2009
> @@ -57,9 +57,7 @@
>
> ib_api_status_t
> create_iou_mgr(
> - IN struct
> _bus_filter_instance* p_bfi,
> - OUT iou_mgr_t** const
> pp_iou_mgr );
> -
> + IN struct
> _bus_filter_instance* p_bfi );
>
> NTSTATUS
> iou_mgr_get_bus_relations(
>
>
> diff U3 C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_iou_mgr.-revBASE.svn001.tmp.c C:/Documents
> and Settings/scsmith/My
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_iou_mgr.c
> --- C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_iou_mgr.-revBASE.svn001.tmp.c Mon May
> 18 09:13:23 2009
> +++ C:/Documents and Settings/scsmith/My
> +++
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_iou_mgr.
> +++ c Mon May 18 09:06:49 2009
> @@ -262,8 +262,7 @@
> */
> ib_api_status_t
> create_iou_mgr(
> - IN bus_filter_t*
> p_bfi,
> - OUT iou_mgr_t** const
> pp_iou_mgr )
> + IN bus_filter_t*
> p_bfi )
> {
> ib_api_status_t status;
> cl_status_t cl_status;
> @@ -284,7 +283,9 @@
>
> /* Construct the load service. */
> cl_obj_construct( &gp_iou_mgr->obj, AL_OBJ_TYPE_LOADER );
> +
> p_bfi->p_iou_mgr_obj = &p_bfi->p_iou_mgr->obj; //
> save for destroy & free
> +
> cl_mutex_construct( &gp_iou_mgr->pdo_mutex );
> cl_qlist_init( &gp_iou_mgr->iou_list );
>
> @@ -318,8 +319,6 @@
> return status;
> }
>
> - *pp_iou_mgr = gp_iou_mgr;
> -
> BUS_EXIT( BUS_DBG_PNP );
> return IB_SUCCESS;
> }
> @@ -346,8 +345,8 @@
> }
> gp_iou_mgr = p_bfi->p_iou_mgr;
>
> - BUS_PRINT(BUS_DBG_PNP, ("%s obj %p port_mgr %p\n",
> -
> p_bfi->whoami, p_obj, gp_iou_mgr));
> + BUS_TRACE(BUS_DBG_PNP, ("%s obj %p iou_mgr %p
> iou_mgr_obj %p\n",
> +
> p_bfi->whoami,
> + p_obj,gp_iou_mgr,&gp_iou_mgr->obj));
>
> CL_ASSERT( gp_iou_mgr == PARENT_STRUCT( p_obj,
> iou_mgr_t, obj ) );
>
> @@ -413,6 +412,7 @@
>
> p_ext->b_present, p_ext->b_reported_missing ) );
> continue;
> }
> +
> if( p_ext->h_ca )
> {
> /* Invalidate bus relations for the
> HCA. */ @@ -483,7 +483,7 @@
> if ( status == IB_SUCCESS )
> {
> /* Reference the load service on behalf of
> the ib_reg_pnp call. */
> - cl_obj_ref( &p_bfi->p_iou_mgr->obj );
> + cl_obj_ref( p_bfi->p_iou_mgr_obj );
> }
>
> return status;
>
>
> diff U3 C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_port_mgr.h-revBASE.svn000.tmp.h
> C:/Documents and Settings/scsmith/My
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_port_mgr.h
> --- C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_port_mgr.h-revBASE.svn000.tmp.h Mon May
> 18 09:15:13 2009
> +++ C:/Documents and Settings/scsmith/My
> +++
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_port_mgr
> +++ .h Mon May 18 08:43:02 2009
> @@ -57,8 +57,7 @@
>
> ib_api_status_t
> create_port_mgr(
> - IN struct
> _bus_filter_instance *p_bfi,
> - OUT port_mgr_t** const
> pp_port_mgr );
> + IN struct
> _bus_filter_instance *p_bfi );
>
>
> NTSTATUS
>
>
> diff U3 C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_port_mgr.-revBASE.svn001.tmp.c C:/Documents
> and Settings/scsmith/My
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_port_mgr.c
> --- C:/Documents and Settings/scsmith/Local
> Settings/Temp/bus_port_mgr.-revBASE.svn001.tmp.c Mon May
> 18 09:14:48 2009
> +++ C:/Documents and Settings/scsmith/My
> +++
> Documents/openIB-windows/SVN/gen1/trunk/core/bus/kernel/bus_port_mgr
> +++ .c Mon May 18 08:45:52 2009
> @@ -254,8 +254,7 @@
> */
> ib_api_status_t
> create_port_mgr(
> - IN bus_filter_t*
> p_bfi,
> - OUT port_mgr_t** const
> pp_port_mgr )
> + IN bus_filter_t*
> p_bfi )
> {
> ib_api_status_t status;
> cl_status_t cl_status;
> @@ -276,7 +275,9 @@
>
> /* Construct the load service. */
> cl_obj_construct( &p_port_mgr->obj, AL_OBJ_TYPE_LOADER );
> +
> p_bfi->p_port_mgr_obj = &p_port_mgr->obj;
> +
> cl_mutex_construct( &p_port_mgr->pdo_mutex );
> cl_qlist_init( &p_port_mgr->port_list );
>
> @@ -311,8 +312,6 @@
> return status;
> }
>
> - *pp_port_mgr = p_port_mgr;
> -
> BUS_EXIT( BUS_DBG_PNP );
> return IB_SUCCESS;
> }
> @@ -342,7 +341,6 @@
> BUS_PRINT(BUS_DBG_PNP, ("%s obj %p port_mgr %p
> port_mgr_obj %p\n",
> p_bfi->whoami,p_obj,p_port_mgr,
> p_bfi->p_port_mgr_obj) );
>
> - CL_ASSERT( (void*)p_bfi->p_port_mgr ==
> (void*)p_bfi->p_port_mgr_obj );
> CL_ASSERT( p_port_mgr == PARENT_STRUCT( p_obj,
> port_mgr_t, obj ) );
>
> /* Deregister for port PnP events if this is the last
> Port manager. */ @@ -476,7 +474,7 @@
> if ( status == IB_SUCCESS )
> {
> /* Reference this bus filter's port load service */
> - cl_obj_ref( &p_bfi->p_port_mgr->obj );
> + cl_obj_ref( p_bfi->p_port_mgr_obj );
> }
>
> return status;
> @@ -1254,7 +1252,6 @@
> }
> }
>
> -
> BUS_TRACE( BUS_DBG_PNP,
> ("Mark removing %s: PDO %p, ext %p, present
> %d, missing %d .\n",
> p_ext->cl_ext.vfptr_pnp_po->identity,
> p_ext->cl_ext.p_self_do, p_ext, @@ -1473,7 +1470,7 @@
>
> p_ext = p_dev_obj->DeviceExtension;
> //
> - // Setting 2 folloeing flags seems like the right behaviour
> + // Setting 2 following flags seems like the right behaviour
> // according to DDK, but it causes
> // WHQL PnP SurpriseRemoval test to fail
> // So, as a work around, they are disabled for now.
>
More information about the ofw
mailing list