[ofw] [PATCH] Cleanup dead code in IBAL
Leonid Keller
leonid at mellanox.co.il
Tue Jul 1 11:15:29 PDT 2008
Applied in 1315. Thank you.
> -----Original Message-----
> From: Fab Tillier [mailto:ftillier at windows.microsoft.com]
> Sent: Tuesday, July 01, 2008 12:49 AM
> To: Leonid Keller
> Cc: ofw at lists.openfabrics.org
> Subject: RE: [ofw] [PATCH] Cleanup dead code in IBAL
>
> Hi Leo,
>
> > Failed to apply it.
>
> Here it is again, but generated by GNU diff.
>
> To apply:
> patch -p 1 < deadcode.patch
>
> Signed-off-by: Fab Tillier <ftillier at microsoft.com>
>
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id:
> old\core\al\al_dev.h trunk\core\al\al_dev.h
> --- old\core\al\al_dev.h Mon Jun 30 11:44:38 2008
> +++ trunk\core\al\al_dev.h Mon Jun 30 14:34:55 2008
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
> * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under the OpenIB.org BSD license
> * below:
> @@ -54,7 +55,7 @@
> #define AL_DEVICE_NAME L"\\Device\\ibal"
> #define ALDEV_KEY (0x3B) /* Matches
> FILE_DEVICE_INFINIBAND from wdm.h */
>
> -#define AL_IOCTL_VERSION (4)
> +#define AL_IOCTL_VERSION (5)
>
> /* max number of devices with non-default pkey */
> #define MAX_NUM_PKEY 16
> @@ -131,8 +132,7 @@ typedef enum al_proxy_ops {
> al_proxy_ops_start = 0,
>
> - ual_get_cm_cb_info = al_proxy_ops_start+1,
> - ual_get_comp_cb_info,
> + ual_get_comp_cb_info = al_proxy_ops_start+1,
> ual_get_misc_cb_info,
> ual_bind,
> ual_bind_sa,
> @@ -155,7 +155,6 @@ typedef enum al_proxy_ops
> * for asynchronous event notifications from proxy
> */
>
> -#define UAL_GET_CM_CB_INFO IOCTL_CODE(ALDEV_KEY,
> ual_get_cm_cb_info)
> #define UAL_GET_COMP_CB_INFO IOCTL_CODE(ALDEV_KEY,
> ual_get_comp_cb_info)
> #define UAL_GET_MISC_CB_INFO IOCTL_CODE(ALDEV_KEY,
> ual_get_misc_cb_info)
> #define UAL_BIND IOCTL_CODE(ALDEV_KEY,
> ual_bind)
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id:
> old\core\al\al_proxy.h trunk\core\al\al_proxy.h
> --- old\core\al\al_proxy.h Mon Jun 30 12:28:07 2008
> +++ trunk\core\al\al_proxy.h Mon Jun 30 14:34:55 2008
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
> * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under the OpenIB.org BSD license
> * below:
> @@ -173,7 +174,6 @@ typedef struct _al_proxy_cb_info
>
> union _cb_type
> {
> - cm_cb_ioctl_info_t cm;
> comp_cb_ioctl_info_t comp;
> misc_cb_ioctl_info_t misc;
>
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id:
> old\core\al\al_proxy_ioctl.h trunk\core\al\al_proxy_ioctl.h
> --- old\core\al\al_proxy_ioctl.h Mon Jun 30 11:44:38 2008
> +++ trunk\core\al\al_proxy_ioctl.h Mon Jun 30 14:34:55 2008
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
> * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under the OpenIB.org BSD license
> * below:
> @@ -66,135 +67,19 @@ typedef enum _misc_cb_rec_type
> MAD_RECV_REC,
> SVC_REG_REC,
> QUERY_REC,
> - PNP_REC,
> - SUB_REC,
> - REPORT_REC,
> - LISTEN_ERROR_REC
> + PNP_REC
>
> } misc_cb_rec_type;
>
>
>
> /*
> - * Information for CM callbacks.
> - */
> -typedef union _cm_cb_ioctl_rec
> -{
> - /* REQ callback */
> - struct _cm_req_cb_ioctl_rec
> - {
> - ib_cm_req_rec_t req_rec;
> -
> - /* Attributes needed to modify the QP in user-mode. */
> - ib_qp_mod_t
> qp_mod_rtr;
> - ib_qp_mod_t
> qp_mod_rts;
> - uint32_t
> timeout_ms;
> -
> - union _cm_req_pdata_rec
> - {
> - ib_req_pdata_t req_pdata;
> - ib_sidr_req_pdata_t
> sidr_req_pdata;
> -
> - } cm_req_pdata_rec;
> -
> - } cm_req_cb_ioctl_rec;
> -
> -
> - /* REP callback */
> - struct _cm_rep_cb_ioctl_rec
> - {
> - ib_cm_rep_rec_t rep_rec;
> -
> - /* Attributes needed to modify the QP in user-mode. */
> - ib_qp_mod_t
> qp_mod_rtr;
> - ib_qp_mod_t
> qp_mod_rts;
> -
> - union _cm_rep_pdata_rec
> - {
> - ib_rep_pdata_t rep_pdata;
> - ib_sidr_rep_pdata_t
> sidr_rep_pdata;
> -
> - } cm_rep_pdata_rec;
> -
> - } cm_rep_cb_ioctl_rec;
> -
> -
> - /* RTU callback */
> - struct _cm_rtu_cb_ioctl_rec
> - {
> - ib_cm_rtu_rec_t rtu_rec;
> - ib_rtu_pdata_t rtu_pdata;
> -
> - } cm_rtu_cb_ioctl_rec;
> -
> -
> - /* REJ callback */
> - struct _cm_rej_cb_ioctl_rec
> - {
> - ib_cm_rej_rec_t rej_rec;
> - ib_ari_t
> ari_pdata;
> - ib_rej_pdata_t rej_pdata;
> -
> - } cm_rej_cb_ioctl_rec;
> -
> -
> - /* MRA callback */
> - struct _cm_mra_cb_ioctl_rec
> - {
> - ib_cm_mra_rec_t mra_rec;
> - ib_mra_pdata_t mra_pdata;
> -
> - } cm_mra_cb_ioctl_rec;
> -
> -
> - /* LAP callback */
> - struct _cm_lap_cb_ioctl_rec
> - {
> - ib_cm_lap_rec_t lap_rec;
> - ib_lap_pdata_t lap_pdata;
> -
> - } cm_lap_cb_ioctl_rec;
> -
> -
> - /* APR callback */
> - struct _cm_apr_cb_ioctl_rec
> - {
> - ib_cm_apr_rec_t apr_rec;
> - ib_apr_pdata_t apr_pdata;
> - ib_apr_info_t apr_info;
> -
> - } cm_apr_cb_ioctl_rec;
> -
> -
> - /* DREQ callback */
> - struct _cm_dreq_cb_ioctl_rec
> - {
> - ib_cm_dreq_rec_t dreq_rec;
> - ib_dreq_pdata_t dreq_pdata;
> -
> - } cm_dreq_cb_ioctl_rec;
> -
> -
> - /* DREP callback */
> - struct _cm_drep_cb_ioctl_rec
> - {
> - ib_cm_drep_rec_t drep_rec;
> - ib_drep_pdata_t drep_pdata;
> -
> - } cm_drep_cb_ioctl_rec;
> -/*
> -*/
> -} cm_cb_ioctl_rec_t;
> -
> -
> -
> -/*
> * Information for most callbacks. This does not include
> callbacks for
> * the CM or completions.
> */
> typedef union _misc_cb_ioctl_rec
> {
> - void* VOID_PTR64
> context;
> + uint64_t
> context;
>
> /* Asynchronous event records */
> ib_async_event_rec_t event_rec;
> @@ -232,10 +117,6 @@ TO_LONG_PTR(
> ib_mcast_handle_t , h_mc
> } mad_recv_cb_ioctl_rec;
>
>
> - /* Service Registration records */
> - ib_reg_svc_rec_t reg_svc_rec;
> -
> -
> /* PNP Record as defined here is for UAL's
> consumption alone */
> struct _pnp_cb_ioctl_rec
> {
> @@ -249,69 +130,17 @@ TO_LONG_PTR(
> ib_mcast_handle_t , h_mc
> struct _pnp_ca
> {
> ib_net64_t
> ca_guid;
> - uint32_t size;
> - uint64_t
> h_ca_attr; /* handle to kernel ca attr */
>
> } ca;
>
> - /* pnp_port is valid only for port events
> - * UAL can query based on the ca_guid
> for more info
> - */
> - struct _pnp_port
> - {
> - ib_net64_t
> ca_guid;
> - uint8_t
> port_num;
> -
> - } port;
> -
> - /* pnp_ioc is valid only for IOC events
> - * If IOC is implemented, need to determine
> - * whether the ioc event handle
> should be passed
> - */
> - struct _pnp_ioc
> - {
> - ib_ioc_info_t info;
> -TO_LONG_PTR( ib_pnp_handle_t ,
> h_ioc_event) ;
> - /* TBD: service entry is
> variable-sized?? */
> - ib_svc_entry_t svc_entry[1];
> -
> - } ioc;
> -
> } pnp_info;
>
> } pnp_cb_ioctl_rec;
>
> -
> - ib_listen_err_rec_t listen_err;
> -
> -
> - /* Subscription Record */
> - ib_sub_rec_t sub_rec;
> -
> -
> - /* Report record */
> - struct _report_cb_ioctl_rec
> - {
> - TO_LONG_PTR(const void* ,
> report_context) ;
> - ib_mad_notice_attr_t notice;
> -
> - } report_cb_ioctl_rec;
> -
> -
> } misc_cb_ioctl_rec_t;
>
>
>
> -
> -typedef struct _cm_cb_ioctl_info
> -{
> - cm_cb_rec_type rec_type;
> - cm_cb_ioctl_rec_t ioctl_rec;
> -
> -} cm_cb_ioctl_info_t;
> -
> -
> -
> typedef struct _comp_cb_ioctl_info
> {
> TO_LONG_PTR(void* ,
> cq_context) ;
> @@ -326,25 +155,6 @@ typedef struct _misc_cb_ioctl_info
> misc_cb_ioctl_rec_t ioctl_rec;
>
> } misc_cb_ioctl_info_t;
> -
> -
> -
> -typedef union _ual_ca_attr_info
> -{
> - struct _ual_ca_attr_info_in
> - {
> - TO_LONG_PTR(ib_ca_attr_t*,p_ca_attr) ;
> /* where to copy in user mode */
> - uint64_t
> h_ca_attr; /* kernel handle to ca attribute */
> -
> - } in;
> - struct _ual_ca_attr_info_out
> - {
> - ib_api_status_t status;
> -
> - } out;
> -
> -} ual_ca_attr_info_ioctl_t;
> -
>
>
> #endif /* __AL_PROXY_IOCTL_H__ */
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id:
> old\core\al\kernel\al_dev.c trunk\core\al\kernel\al_dev.c
> --- old\core\al\kernel\al_dev.c Mon Jun 30 12:28:07 2008
> +++ trunk\core\al\kernel\al_dev.c Mon Jun 30 14:34:55 2008
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
> * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under the OpenIB.org BSD license
> * below:
> @@ -519,9 +520,6 @@ al_dev_cancel_ioctl(
> cl_spinlock_acquire( &p_context->cb_lock );
> switch( cl_ioctl_ctl_code( h_ioctl ) )
> {
> - case UAL_GET_CM_CB_INFO:
> - ph_ioctl = &p_context->h_cm_ioctl;
> - break;
> case UAL_GET_COMP_CB_INFO:
> ph_ioctl = &p_context->h_comp_ioctl;
> break;
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id:
> old\core\al\kernel\al_proxy.c trunk\core\al\kernel\al_proxy.c
> --- old\core\al\kernel\al_proxy.c Mon Jun 30 12:28:07 2008
> +++ trunk\core\al\kernel\al_proxy.c Mon Jun 30 14:34:55 2008
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
> * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under the OpenIB.org BSD license
> * below:
> @@ -206,13 +207,6 @@ proxy_queue_ioctl_buf(
> /* Set up the appropriate callback list. */
> switch( cb_type )
> {
> - case UAL_GET_CM_CB_INFO:
> - p_cb_list = &p_context->cm_cb_list;
> - ph_ioctl = &p_context->h_cm_ioctl;
> - /* TODO: Use output size only. */
> - ioctl_size = sizeof( cm_cb_ioctl_info_t );
> - break;
> -
> case UAL_GET_COMP_CB_INFO:
> p_cb_list = &p_context->comp_cb_list;
> ph_ioctl = &p_context->h_comp_ioctl; @@
> -289,48 +283,6 @@ proxy_queue_ioctl_buf(
>
>
> /*
> - * Process the ioctl UAL_GET_CM_CB_INFO:
> - * Get a CM callback record from the queue of CM callback records
> - */
> -static cl_status_t
> -proxy_get_cm_cb(
> - IN cl_ioctl_handle_t h_ioctl )
> -{
> - cl_status_t cl_status;
> - IO_STACK_LOCATION *p_io_stack;
> - al_dev_open_context_t *p_context;
> -
> - AL_ENTER( AL_DBG_DEV );
> -
> - p_io_stack = IoGetCurrentIrpStackLocation( h_ioctl );
> - p_context =
> (al_dev_open_context_t*)p_io_stack->FileObject->FsContext;
> - if( (uintn_t)p_io_stack->FileObject->FsContext2 !=
> AL_OBJ_TYPE_CM )
> - {
> - AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
> - ("Invalid file object type for
> request: %016I64x\n",
> -
> (LONG_PTR)p_io_stack->FileObject->FsContext2) );
> - return CL_INVALID_PARAMETER;
> - }
> -
> - /* Check the size of the ioctl */
> - if( !p_context || !cl_ioctl_out_buf( h_ioctl ) ||
> - cl_ioctl_out_size( h_ioctl ) !=
> sizeof(cm_cb_ioctl_info_t) )
> - {
> - AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
> - ("No output buffer, or buffer too
> small.\n") );
> - return CL_INVALID_PARAMETER;
> - }
> -
> - cl_status = proxy_queue_ioctl_buf( UAL_GET_CM_CB_INFO,
> - p_context, h_ioctl );
> -
> - AL_EXIT( AL_DBG_DEV );
> - return cl_status;
> -}
> -
> -
> -
> -/*
> * Process the ioctl UAL_GET_COMP_CB_INFO:
> * Get a completion callback record from the queue of CM
> callback records
> */
> @@ -477,8 +429,6 @@ proxy_pnp_port_cb(
> misc_cb_ioctl_info_t misc_cb_info;
> misc_cb_ioctl_rec_t *p_misc_rec =
> &misc_cb_info.ioctl_rec;
> al_dev_open_context_t *p_context;
> - ib_ca_attr_t *p_ca_attr;
> - uint64_t hdl;
>
> AL_ENTER( AL_DBG_PROXY_CB );
>
> @@ -519,31 +469,8 @@ proxy_pnp_port_cb(
> break;
>
> default:
> - /* Allocate space for the CA attributes. */
> - p_ca_attr = cl_zalloc( p_port_rec->p_ca_attr->size );
> - if( !p_ca_attr )
> - {
> - AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
> - ("cl_malloc( %d ) failed.\n",
> p_port_rec->p_ca_attr->size) );
> - break;
> - }
> -
> - ib_copy_ca_attr( p_ca_attr, p_port_rec->p_ca_attr );
> -
> - hdl = al_hdl_lock_insert(
> - p_context->h_al, p_ca_attr,
> AL_OBJ_TYPE_H_CA_ATTR );
> -
> - if( hdl == AL_INVALID_HANDLE )
> - {
> - cl_free( p_ca_attr );
> - break;
> - }
> -
> p_misc_rec->pnp_cb_ioctl_rec.pnp_info.ca.ca_guid =
> p_port_rec->p_ca_attr->ca_guid;
> - p_misc_rec->pnp_cb_ioctl_rec.pnp_info.ca.size =
> - p_port_rec->p_ca_attr->size;
> -
> p_misc_rec->pnp_cb_ioctl_rec.pnp_info.ca.h_ca_attr = hdl;
>
> proxy_queue_cb_buf( UAL_GET_MISC_CB_INFO,
> p_context, &misc_cb_info,
> NULL );
> @@ -564,45 +491,33 @@ proxy_get_ca_attr(
> OUT size_t
> *p_ret_bytes )
> {
> al_dev_open_context_t *p_context;
> - ual_ca_attr_info_ioctl_t *p_ioctl;
> + uint64_t
> *ph_ca_attr;
> ib_ca_attr_t *p_src;
>
> AL_ENTER( AL_DBG_DEV );
>
> + UNREFERENCED_PARAMETER( p_ret_bytes );
> +
> /* Check the size of the ioctl */
> - if( !cl_ioctl_in_buf( h_ioctl ) || !cl_ioctl_out_buf(
> h_ioctl ) ||
> - cl_ioctl_in_size( h_ioctl ) < sizeof(p_ioctl->in) ||
> - cl_ioctl_out_size( h_ioctl ) < sizeof(p_ioctl->out) )
> + if( !cl_ioctl_in_buf( h_ioctl ) ||
> + cl_ioctl_in_size( h_ioctl ) < sizeof(uint64_t) )
> {
> AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
> ("invalid buffer size\n") );
> return CL_INVALID_PARAMETER;
> }
> p_context = (al_dev_open_context_t*)p_open_context;
> - p_ioctl = (ual_ca_attr_info_ioctl_t*)cl_ioctl_in_buf(
> h_ioctl );
> + ph_ca_attr = (uint64_t*)cl_ioctl_in_buf( h_ioctl );
>
> p_src = (ib_ca_attr_t*)al_hdl_get(
> - p_context->h_al, p_ioctl->in.h_ca_attr,
> AL_OBJ_TYPE_H_CA_ATTR );
> + p_context->h_al, *ph_ca_attr, AL_OBJ_TYPE_H_CA_ATTR );
> if( !p_src )
> {
> AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
> ("invalid attr handle\n") );
> return CL_INVALID_PARAMETER;
> }
>
> - __try
> - {
> - ProbeForWrite( p_ioctl->in.p_ca_attr,
> p_src->size, sizeof(void*) );
> - ib_copy_ca_attr( p_ioctl->in.p_ca_attr, p_src );
> - p_ioctl->out.status = IB_SUCCESS;
> - }
> - __except(EXCEPTION_EXECUTE_HANDLER)
> - {
> - p_ioctl->out.status = IB_INVALID_PERMISSION;
> - }
> -
> cl_free(p_src);
>
> - *p_ret_bytes = sizeof(p_ioctl->out);
> -
> AL_EXIT( AL_DBG_DEV );
> return CL_SUCCESS;
> }
> @@ -674,36 +589,32 @@ proxy_ioctl(
>
> switch( cl_ioctl_ctl_code( h_ioctl ) )
> {
> - case UAL_GET_CM_CB_INFO: //check_done
> - ASSERT(FALSE);
> - cl_status = proxy_get_cm_cb( h_ioctl );
> - break;
> - case UAL_GET_MISC_CB_INFO: // check_done, no IN parameters
> - cl_status = proxy_get_misc_cb( h_ioctl );
> + case UAL_GET_MISC_CB_INFO:
> + cl_status = proxy_get_misc_cb( h_ioctl );
> break;
> - case UAL_GET_COMP_CB_INFO: // check_done, no IN parameters
> - cl_status = proxy_get_comp_cb( h_ioctl );
> + case UAL_GET_COMP_CB_INFO:
> + cl_status = proxy_get_comp_cb( h_ioctl );
> break;
> - case UAL_BIND: //check_done, no IN with ptr64
> - cl_status = al_dev_open( h_ioctl );
> + case UAL_BIND:
> + cl_status = al_dev_open( h_ioctl );
> break;
> - case UAL_BIND_SA: //check_done, fixed memclr in
> ual_create_async_file
> - cl_status = proxy_bind_file( h_ioctl,
> AL_OBJ_TYPE_SA_REQ_SVC ); //check_done, fixed memclr in
> ual_create_async_file
> + case UAL_BIND_SA:
> + cl_status = proxy_bind_file( h_ioctl,
> + AL_OBJ_TYPE_SA_REQ_SVC );
> break;
> - case UAL_BIND_DESTROY: //check_done, fixed memclr in
> ual_create_async_file
> - case UAL_BIND_PNP: //check_done, fixed memclr in
> ual_create_async_file
> - cl_status = proxy_bind_file( h_ioctl,
> AL_OBJ_TYPE_PNP_MGR );
> + case UAL_BIND_DESTROY:
> + case UAL_BIND_PNP:
> + cl_status = proxy_bind_file( h_ioctl,
> + AL_OBJ_TYPE_PNP_MGR );
> break;
> - case UAL_BIND_CM: //check_done, fixed memclr in
> ual_create_async_file
> + case UAL_BIND_CM:
> cl_status = proxy_bind_file( h_ioctl,
> AL_OBJ_TYPE_CM );
> break;
> - case UAL_BIND_CQ: //check_done, fixed memclr in
> ual_create_async_file
> + case UAL_BIND_CQ:
> cl_status = proxy_bind_file( h_ioctl,
> AL_OBJ_TYPE_H_CQ );
> break;
> - case UAL_BIND_MISC: //check_done, fixed memclr in
> ual_create_async_file
> + case UAL_BIND_MISC:
> cl_status = proxy_bind_file( h_ioctl,
> AL_OBJ_TYPE_AL_MGR );
> break;
> - case UAL_BIND_ND: //check_done, used only in kernel
> + case UAL_BIND_ND:
> cl_status = proxy_bind_file( h_ioctl,
> AL_OBJ_TYPE_NDI );
> break;
> case UAL_REQ_CREATE_PDO:
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id:
> old\core\al\kernel\al_proxy_verbs.c
> trunk\core\al\kernel\al_proxy_verbs.c
> --- old\core\al\kernel\al_proxy_verbs.c Mon Jun 30 12:28:06 2008
> +++ trunk\core\al\kernel\al_proxy_verbs.c Mon Jun 30
> 14:34:55 2008
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
> * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under the OpenIB.org BSD license
> * below:
> @@ -258,12 +259,6 @@ proxy_queue_cb_buf(
> /* Set up the appropriate callback list. */
> switch( cb_type )
> {
> - case UAL_GET_CM_CB_INFO:
> - p_cb_list = &p_context->cm_cb_list;
> - ph_ioctl = &p_context->h_cm_ioctl;
> - ioctl_size = sizeof( cm_cb_ioctl_info_t );
> - break;
> -
> case UAL_GET_COMP_CB_INFO:
> p_cb_list = &p_context->comp_cb_list;
> ph_ioctl = &p_context->h_comp_ioctl; @@
> -1493,36 +1488,23 @@ proxy_query_qp(
> p_ioctl->out.attr.h_pd =
> (ib_pd_handle_t
> VOID_PTR64)HDL_TO_PTR(p_ioctl->out.attr.h_pd->obj.hdl);
> }
> - else
> - {
> - p_ioctl->out.attr.h_pd = NULL;
> - }
> +
> if( p_ioctl->out.attr.h_sq_cq )
> {
> p_ioctl->out.attr.h_sq_cq =
> (ib_cq_handle_t
> VOID_PTR64)HDL_TO_PTR(p_ioctl->out.attr.h_sq_cq->obj.hdl);
> }
> - else
> - {
> - p_ioctl->out.attr.h_sq_cq = NULL;
> - }
> +
> if( p_ioctl->out.attr.h_rq_cq )
> {
> p_ioctl->out.attr.h_rq_cq =
> (ib_cq_handle_t
> VOID_PTR64)HDL_TO_PTR(p_ioctl->out.attr.h_rq_cq->obj.hdl);
> }
> - else
> - {
> - p_ioctl->out.attr.h_rq_cq = NULL;
> - }
> +
> if( p_ioctl->out.attr.h_srq )
> {
> p_ioctl->out.attr.h_srq =
> (ib_srq_handle_t
> VOID_PTR64)HDL_TO_PTR(p_ioctl->out.attr.h_srq->obj.hdl);
> - }
> - else
> - {
> - p_ioctl->out.attr.h_srq = NULL;
> }
> }
> else
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id:
> old\core\al\kernel\SOURCES trunk\core\al\kernel\SOURCES
> --- old\core\al\kernel\SOURCES Mon Jun 30 11:44:38 2008
> +++ trunk\core\al\kernel\SOURCES Mon Jun 30 14:34:55 2008
> @@ -11,8 +11,6 @@ ENABLE_EVENT_TRACING=1 !endif
>
>
> -DLLDEF=al_exports.def
> -
> SOURCES= ibal.rc \
> al_ci_ca.c \
> al_cm_cep.c \
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id:
> old\core\al\user\ual_mgr.c trunk\core\al\user\ual_mgr.c
> --- old\core\al\user\ual_mgr.c Mon Jun 30 12:28:07 2008
> +++ trunk\core\al\user\ual_mgr.c Mon Jun 30 14:34:55 2008
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
> * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under the OpenIB.org BSD license
> * below:
> @@ -74,10 +75,6 @@ static DWORD WINAPI
> __cb_thread_routine(
> IN void
> *context );
>
> -//static void
> -//__process_cm_cb(
> -// IN cm_cb_ioctl_info_t*
> p_cm_cb_info);
> -
> static void
> __process_misc_cb(
> IN misc_cb_ioctl_info_t*
> p_misc_cb_info );
> @@ -475,21 +472,6 @@ create_al_mgr()
> }
> }
>
> - //if( !DeviceIoControl( gp_al_mgr->ual_mgr.h_cm_file,
> UAL_GET_CM_CB_INFO,
> - // NULL, 0,
> - // &gp_al_mgr->ual_mgr.cm_cb_info,
> sizeof(cm_cb_ioctl_info_t),
> - // NULL, &gp_al_mgr->ual_mgr.cm_ov ) )
> - //{
> - // if( GetLastError() != ERROR_IO_PENDING )
> - // {
> - // AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,
> - // ("DeviceIoControl for CM
> callback request returned %d.\n",
> - // GetLastError()) );
> - //
> gp_al_mgr->obj.pfn_destroy(&gp_al_mgr->obj, NULL);
> - // return IB_ERROR;
> - // }
> - //}
> -
> if( !DeviceIoControl( gp_al_mgr->ual_mgr.h_cq_file,
> UAL_GET_COMP_CB_INFO,
> NULL, 0,
> &gp_al_mgr->ual_mgr.comp_cb_info,
> sizeof(comp_cb_ioctl_info_t), @@ -536,172 +518,6 @@ create_al_mgr()
> /*
> * UAL thread start routines.
> */
> -//
> -//
> -///* Thread to process the asynchronous CM notifications */
> -//void -//cm_cb(
> -// IN DWORD
> error_code,
> -// IN DWORD
> ret_bytes,
> -// IN LPOVERLAPPED
> p_ov )
> -//{
> -// AL_ENTER( AL_DBG_CM );
> -//
> -// UNUSED_PARAM( p_ov );
> -//
> -// if( !error_code && ret_bytes )
> -// {
> -// /* Check the record type and adjust the pointers */
> -// /* TBD */
> -// __process_cm_cb( &gp_al_mgr->ual_mgr.cm_cb_info );
> -// }
> -//
> -// if( error_code != ERROR_OPERATION_ABORTED )
> -// {
> -// if( !DeviceIoControl(
> gp_al_mgr->ual_mgr.h_cm_file, UAL_GET_CM_CB_INFO,
> -// NULL, 0,
> -// &gp_al_mgr->ual_mgr.cm_cb_info,
> sizeof(cm_cb_ioctl_info_t),
> -// NULL, &gp_al_mgr->ual_mgr.cm_ov ) )
> -// {
> -// if( GetLastError() != ERROR_IO_PENDING )
> -// {
> -//
> AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,
> -// ("DeviceIoControl for
> CM callback request returned %d.\n",
> -// GetLastError()) );
> -// }
> -// }
> -// }
> -//
> -// AL_EXIT( AL_DBG_CM );
> -//}
> -
> -
> -
> -//static void
> -//__process_cm_cb(
> -// IN cm_cb_ioctl_info_t*
> p_cm_cb_info)
> -//{
> -// switch( p_cm_cb_info->rec_type)
> -// {
> -// case CM_REQ_REC:
> -// {
> -// struct _cm_req_cb_ioctl_rec *p_ioctl_rec =
> -//
> &p_cm_cb_info->ioctl_rec.cm_req_cb_ioctl_rec;
> -//
> -// if (p_ioctl_rec->req_rec.qp_type ==
> IB_QPT_UNRELIABLE_DGRM)
> -// {
> -// p_ioctl_rec->req_rec.p_req_pdata =
> -// (uint8_t
> *)&p_ioctl_rec->cm_req_pdata_rec.sidr_req_pdata;
> -// }
> -// else
> -// {
> -// p_ioctl_rec->req_rec.p_req_pdata =
> -// (uint8_t
> *)&p_ioctl_rec->cm_req_pdata_rec.req_pdata;
> -// }
> -// ual_cm_req_cb( &p_ioctl_rec->req_rec,
> &p_ioctl_rec->qp_mod_rtr,
> -// &p_ioctl_rec->qp_mod_rts,
> p_ioctl_rec->timeout_ms );
> -// break;
> -// }
> -// case CM_REP_REC:
> -// {
> -// struct _cm_rep_cb_ioctl_rec *p_ioctl_rec =
> -//
> &p_cm_cb_info->ioctl_rec.cm_rep_cb_ioctl_rec;
> -//
> -// if (p_ioctl_rec->rep_rec.qp_type ==
> IB_QPT_UNRELIABLE_DGRM)
> -// {
> -// p_ioctl_rec->rep_rec.p_rep_pdata =
> -// (uint8_t
> *)&p_ioctl_rec->cm_rep_pdata_rec.sidr_rep_pdata;
> -// }
> -// else
> -// {
> -// p_ioctl_rec->rep_rec.p_rep_pdata =
> -// (uint8_t
> *)&p_ioctl_rec->cm_rep_pdata_rec.rep_pdata;
> -// }
> -// ual_cm_rep_cb( &p_ioctl_rec->rep_rec,
> &p_ioctl_rec->qp_mod_rtr,
> -// &p_ioctl_rec->qp_mod_rts );
> -// break;
> -// }
> -// case CM_RTU_REC:
> -// {
> -// struct _cm_rtu_cb_ioctl_rec *p_ioctl_rec =
> -//
> &p_cm_cb_info->ioctl_rec.cm_rtu_cb_ioctl_rec;
> -//
> -// p_ioctl_rec->rtu_rec.p_rtu_pdata = (uint8_t
> *)&p_ioctl_rec->rtu_pdata;
> -// ual_cm_rtu_cb( &p_ioctl_rec->rtu_rec );
> -// break;
> -// }
> -// case CM_REJ_REC:
> -// {
> -// struct _cm_rej_cb_ioctl_rec *p_ioctl_rec =
> -//
> &p_cm_cb_info->ioctl_rec.cm_rej_cb_ioctl_rec;
> -//
> -// p_ioctl_rec->rej_rec.p_rej_pdata =
> -// (uint8_t*)&p_ioctl_rec->rej_pdata;
> -// p_ioctl_rec->rej_rec.p_ari =
> -// (uint8_t*)&p_ioctl_rec->ari_pdata;
> -// ual_cm_rej_cb( &p_ioctl_rec->rej_rec );
> -// break;
> -// }
> -// case CM_MRA_REC:
> -// {
> -// struct _cm_mra_cb_ioctl_rec *p_ioctl_rec =
> -//
> &p_cm_cb_info->ioctl_rec.cm_mra_cb_ioctl_rec;
> -//
> -// p_ioctl_rec->mra_rec.p_mra_pdata =
> -// (uint8_t*)&p_ioctl_rec->mra_pdata;
> -// ual_cm_mra_cb(
> &p_cm_cb_info->ioctl_rec.cm_mra_cb_ioctl_rec.mra_rec );
> -// break;
> -// }
> -// case CM_LAP_REC:
> -// {
> -// struct _cm_lap_cb_ioctl_rec *p_ioctl_rec =
> -//
> &p_cm_cb_info->ioctl_rec.cm_lap_cb_ioctl_rec;
> -//
> -// p_ioctl_rec->lap_rec.p_lap_pdata =
> -// (uint8_t *)&p_ioctl_rec->lap_pdata;
> -// ual_cm_lap_cb( &p_ioctl_rec->lap_rec );
> -// break;
> -// }
> -// case CM_APR_REC:
> -// {
> -// struct _cm_apr_cb_ioctl_rec *p_ioctl_rec =
> -//
> &p_cm_cb_info->ioctl_rec.cm_apr_cb_ioctl_rec;
> -//
> -// p_ioctl_rec->apr_rec.p_apr_pdata =
> -// (uint8_t*)&p_ioctl_rec->apr_pdata;
> -// p_ioctl_rec->apr_rec.p_info =
> -// (uint8_t*)&p_ioctl_rec->apr_info;
> -// ual_cm_apr_cb( &p_ioctl_rec->apr_rec );
> -// break;
> -// }
> -// case CM_DREQ_REC:
> -// {
> -// struct _cm_dreq_cb_ioctl_rec *p_ioctl_rec =
> -//
> &p_cm_cb_info->ioctl_rec.cm_dreq_cb_ioctl_rec;
> -//
> -// p_ioctl_rec->dreq_rec.p_dreq_pdata =
> -// (uint8_t*)&p_ioctl_rec->dreq_pdata;
> -// ual_cm_dreq_cb( &p_ioctl_rec->dreq_rec );
> -// break;
> -// }
> -// case CM_DREP_REC:
> -// {
> -// struct _cm_drep_cb_ioctl_rec *p_ioctl_rec =
> -//
> &p_cm_cb_info->ioctl_rec.cm_drep_cb_ioctl_rec;
> -//
> -// p_ioctl_rec->drep_rec.p_drep_pdata =
> -// (uint8_t*)&p_ioctl_rec->drep_pdata;
> -// ual_cm_drep_cb( &p_ioctl_rec->drep_rec );
> -// break;
> -// }
> -// default:
> -// /* Unknown record type - just return */
> -// break;
> -// }
> -//}
> -//
> -//
> -//
> static void
> __process_comp_cb(
> IN comp_cb_ioctl_info_t*
> p_comp_cb_info )
> @@ -954,13 +770,9 @@ __process_misc_cb(
> ib_pnp_event_t
> pnp_event;
> ib_net64_t
> ca_guid;
> al_ci_ca_t
> *p_ci_ca;
> - ual_ca_attr_info_ioctl_t attr_ioctl;
> - uintn_t
> bytes_ret;
> - cl_status_t
> cl_status;
> ib_ca_attr_t
> *p_old_ca_attr;
> ib_api_status_t
> status;
>
> - cl_memclr(&attr_ioctl, sizeof (attr_ioctl));
> pnp_event =
> p_misc_cb_info->ioctl_rec.pnp_cb_ioctl_rec.pnp_event;
> ca_guid =
> p_misc_cb_info->ioctl_rec.pnp_cb_ioctl_rec.pnp_info.ca.ca_guid;
>
> @@ -1024,58 +836,12 @@ __process_misc_cb(
> if ( p_old_ca_attr )
> cl_free( p_old_ca_attr );
>
> - /*
> - * We need to fetch the cached CA
> attributes from the proxy. We
> - * always send down the IOCTL to free
> the cached attributes.
> - */
> - //p_ca_attr = (ib_ca_attr_t*)cl_zalloc(
> - //
> p_misc_cb_info->ioctl_rec.pnp_cb_ioctl_rec.pnp_info.ca.size );
> - attr_ioctl.in.p_ca_attr = NULL;
> //TODO - Remove, cause we already did cl_memclr
> -
> - /* Get the cached attributes from the
> kernel. */
> - attr_ioctl.in.h_ca_attr =
> -
> p_misc_cb_info->ioctl_rec.pnp_cb_ioctl_rec.pnp_info.ca.h_ca_attr;
> - cl_status = do_al_dev_ioctl(
> UAL_GET_CA_ATTR_INFO,
> - &attr_ioctl, sizeof(attr_ioctl.in),
> - &attr_ioctl, sizeof(attr_ioctl.out),
> - &bytes_ret );
> -
> - ///* Notify PnP manager of the
> changes if we have them. */
> - //if( p_ca_attr )
> - //{
> - // if( cl_status == CL_SUCCESS &&
> - // attr_ioctl.out.status
> == IB_SUCCESS )
> - // {
> - // pnp_ca_change(
> p_ci_ca, p_ca_attr );
> - // }
> - // else
> - // {
> - // }
> -
> - // cl_free( p_ca_attr );
> - //}
> /* Dereference the CA now. */
> deref_al_obj( &p_ci_ca->obj );
> break;
> }
>
> break; /* For PNP_EVENT_REC */
> - }
> - case SUB_REC:
> - {
> - /******* TBD *******/
> - /* No adjustment needed */
> - break;
> - }
> - case REPORT_REC:
> - {
> - ib_report_rec_t report_rec;
> - cl_memcpy((void *)&report_rec,
> -
> (void*)&p_misc_cb_info->ioctl_rec.report_cb_ioctl_rec,
> - sizeof(ib_report_rec_t));
> - report_rec.p_notice =
> &p_misc_cb_info->ioctl_rec.report_cb_ioctl_rec.notice;
> - /******* Call the cb function for app callback *****/
> - break;
> }
> default:
> CL_ASSERT (0);
> diff -up -r -X trunk\docs\dontdiff.txt -I \$Id:
> old\core\al\user\ual_mgr.h trunk\core\al\user\ual_mgr.h
> --- old\core\al\user\ual_mgr.h Mon Jun 30 12:28:07 2008
> +++ trunk\core\al\user\ual_mgr.h Mon Jun 30 14:34:55 2008
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
> * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under the OpenIB.org BSD license
> * below:
> @@ -51,11 +52,6 @@ TO_LONG_PTR( ib_al_handle_t ,
> h_al) ;
> cl_ptr_vector_t cb_threads;
> /* Completion port handle that cb threads use to get
> I/O completions. */
> HANDLE h_cb_port;
> -
> - /* File to handle CM related notifications */
> - //HANDLE
> h_cm_file;
> - //cm_cb_ioctl_info_t cm_cb_info;
> - //OVERLAPPED cm_ov;
>
> /* Thread to handle work request completions */
> HANDLE h_cq_file;
>
More information about the ofw
mailing list