From: tzachid Date: Sat, 28 Jun 2008 18:42:34 +0000 (+0000) Subject: [wsd] remove XXX_PTR64 and TO_ULONG_PTR macro use from WSD. X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c5e9e22eead4f4c814e8879c27ad3b76465958d3;p=~shefty%2Frdma-win.git [wsd] remove XXX_PTR64 and TO_ULONG_PTR macro use from WSD. git-svn-id: svn://openib.tc.cornell.edu/gen1@1302 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/wsd/user/extensions.c b/trunk/ulp/wsd/user/extensions.c index 6f817423..cebf3bc6 100644 --- a/trunk/ulp/wsd/user/extensions.c +++ b/trunk/ulp/wsd/user/extensions.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. * Copyright (c) 2006 Mellanox Technologies. 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: @@ -402,7 +403,7 @@ do_rdma_op( /* Format the send work request and post. */ send_wr.p_next = NULL; - send_wr.wr_id = (uint64_t)(void* VOID_PTR64)wr; + send_wr.wr_id = (ULONG_PTR)wr; send_wr.wr_type = wr_type; send_wr.send_opt = 0; send_wr.num_ds = dwBufferCount; @@ -414,7 +415,7 @@ do_rdma_op( lpOverlapped->InternalHigh = 0; for( ds_idx = 0; ds_idx < dwBufferCount; ds_idx++ ) { - local_ds[ds_idx].vaddr = (uint64_t)(void* VOID_PTR64)lpBuffers[ds_idx].buf; + local_ds[ds_idx].vaddr = (ULONG_PTR)lpBuffers[ds_idx].buf; local_ds[ds_idx].length = lpBuffers[ds_idx].len; local_ds[ds_idx].lkey = ((struct memory_node*)lpBuffers[ds_idx].handle)->p_reg1->lkey; diff --git a/trunk/ulp/wsd/user/ib_cm.c b/trunk/ulp/wsd/user/ib_cm.c index 88526698..3b38c59d 100644 --- a/trunk/ulp/wsd/user/ib_cm.c +++ b/trunk/ulp/wsd/user/ib_cm.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. * Copyright (c) 2006 Mellanox Technologies. 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: @@ -113,7 +114,7 @@ cm_req_callback( IN ib_cm_req_rec_t *p_cm_req_rec ) { struct ibsp_socket_info *socket_info = - (struct ibsp_socket_info * VOID_PTR64)p_cm_req_rec->context; + (struct ibsp_socket_info *)p_cm_req_rec->context; struct listen_incoming *incoming; IBSP_ENTER( IBSP_DBG_CM ); @@ -208,7 +209,7 @@ cm_rep_callback( IN ib_cm_rep_rec_t *p_cm_rep_rec ) { struct ibsp_socket_info *socket_info = - (struct ibsp_socket_info * VOID_PTR64)p_cm_rep_rec->qp_context; + (struct ibsp_socket_info *)p_cm_rep_rec->qp_context; ib_cm_rtu_t cm_rtu; ib_api_status_t status; @@ -291,7 +292,7 @@ cm_rtu_callback( IN ib_cm_rtu_rec_t *p_cm_rtu_rec ) { struct ibsp_socket_info *socket_info = - (struct ibsp_socket_info * VOID_PTR64)p_cm_rtu_rec->qp_context; + (struct ibsp_socket_info *)p_cm_rtu_rec->qp_context; IBSP_ENTER( IBSP_DBG_CM ); @@ -336,7 +337,7 @@ cm_rtu_callback( wr = &socket_info->recv_wr[socket_info->recv_idx]; /* Update the work request ID. */ - wr->recv.wr_id = (uint64_t)(void* VOID_PTR64)wr; + wr->recv.wr_id = (ULONG_PTR)wr; /* * Increment the count before posting so it doesn't go @@ -421,7 +422,7 @@ cm_rej_callback( IN ib_cm_rej_rec_t *p_cm_rej_rec ) { struct ibsp_socket_info *socket_info = - (struct ibsp_socket_info * VOID_PTR64)p_cm_rej_rec->qp_context; + (struct ibsp_socket_info *)p_cm_rej_rec->qp_context; IBSP_ENTER( IBSP_DBG_CM ); @@ -504,14 +505,14 @@ cm_dreq_callback( ib_cm_drep_t cm_drep; struct disconnect_reason *reason; struct ibsp_socket_info *socket_info = - (struct ibsp_socket_info * VOID_PTR64)p_cm_dreq_rec->qp_context; + (struct ibsp_socket_info *)p_cm_dreq_rec->qp_context; IBSP_ENTER( IBSP_DBG_CM ); IBSP_PRINT(TRACE_LEVEL_INFORMATION, IBSP_DBG_CM, ("socket=%p state=%s\n", socket_info, IBSP_SOCKET_STATE_STR( socket_info->socket_state )) ); - reason = (struct disconnect_reason * VOID_PTR64)p_cm_dreq_rec->p_dreq_pdata; + reason = (struct disconnect_reason *)p_cm_dreq_rec->p_dreq_pdata; cl_spinlock_acquire( &socket_info->mutex1 ); diff --git a/trunk/ulp/wsd/user/ibsp_iblow.c b/trunk/ulp/wsd/user/ibsp_iblow.c index f6c9ca25..c6625327 100644 --- a/trunk/ulp/wsd/user/ibsp_iblow.c +++ b/trunk/ulp/wsd/user/ibsp_iblow.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. * Copyright (c) 2006 Mellanox Technologies. 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,8 +67,8 @@ complete_wq( IBSP_ENTER( IBSP_DBG_IO ); - wr = (struct _wr * VOID_PTR64)HDL_TO_PTR(wc->wr_id); - p_recv_wr = (struct _recv_wr * VOID_PTR64)HDL_TO_PTR(wc->wr_id); + wr = (struct _wr *)(ULONG_PTR)wc->wr_id; + p_recv_wr = (struct _recv_wr *)(ULONG_PTR)wc->wr_id; CL_ASSERT( wr ); @@ -110,7 +111,7 @@ complete_wq( #ifdef IBSP_LOGGING cl_spinlock_acquire( &socket_info->recv_lock ); DataLogger_WriteData(&socket_info->RecvDataLogger, - p_recv_wr->idx, (void * VOID_PTR64)p_recv_wr->ds_array[0].vaddr, + p_recv_wr->idx, (void *)p_recv_wr->ds_array[0].vaddr, wc->length); cl_spinlock_release( &socket_info->recv_lock ); #endif @@ -251,7 +252,7 @@ complete_wq( // if( idx >= QP_ATTRIB_RQ_DEPTH ) // idx += QP_ATTRIB_RQ_DEPTH; - // CL_ASSERT( wc->wr_id == (uint64_t)(void* VOID_PTR64)&socket_info->recv_wr[idx] ); + // CL_ASSERT( wc->wr_id == (ULONG_PTR)&socket_info->recv_wr[idx] ); // cl_atomic_dec( &socket_info->recv_cnt ); // cl_spinlock_release( &socket_info->recv_lock ); //} @@ -259,7 +260,7 @@ complete_wq( if( wc->status == IB_SUCCESS && p_recv_wr->ds_array[0].length >= 40 ) { debug_dump_buffer( IBSP_DBG_WQ, "RECV", - (void * VOID_PTR64)p_recv_wr->ds_array[0].vaddr, 40 ); + (void *)(ULONG_PTR)p_recv_wr->ds_array[0].vaddr, 40 ); } cl_atomic_dec( &g_ibsp.recv_count ); @@ -279,7 +280,7 @@ complete_wq( // idx = socket_info->send_idx - (uint8_t)socket_info->send_cnt; // if( idx >= QP_ATTRIB_SQ_DEPTH ) // idx += QP_ATTRIB_SQ_DEPTH; - // CL_ASSERT( wc->wr_id == (uint64_t)(void* VOID_PTR64)&socket_info->send_wr[idx] ); + // CL_ASSERT( wc->wr_id == (ULONG_PTR)&socket_info->send_wr[idx] ); // cl_atomic_dec( &socket_info->send_cnt ); // cl_spinlock_release( &socket_info->send_lock ); //} diff --git a/trunk/ulp/wsd/user/ibsp_ip.c b/trunk/ulp/wsd/user/ibsp_ip.c index dbf8f339..5581b05c 100644 --- a/trunk/ulp/wsd/user/ibsp_ip.c +++ b/trunk/ulp/wsd/user/ibsp_ip.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. * Copyright (c) 2006 Mellanox Technologies. 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: @@ -271,7 +272,7 @@ query_guid_callback( ib_query_rec_t *p_query_rec ) { struct query_guid_context *query_context = - (struct query_guid_context * VOID_PTR64)p_query_rec->query_context; + (struct query_guid_context *)p_query_rec->query_context; ib_service_record_t *service_record; IBSP_ENTER( IBSP_DBG_HW ); @@ -311,7 +312,7 @@ query_guid_address( ib_user_query_t user_query; struct query_guid_context query_context; ib_service_record_t service_record; - ib_query_handle_t VOID_PTR64 query_handle; + ib_query_handle_t query_handle; ib_query_req_t query_req; ib_api_status_t status; @@ -392,7 +393,7 @@ query_pr_callback( ib_query_rec_t *p_query_rec ) { struct query_pr_context *query_context = - (struct query_pr_context * VOID_PTR64)p_query_rec->query_context; + (struct query_pr_context *)p_query_rec->query_context; ib_api_status_t status; IBSP_ENTER( IBSP_DBG_HW ); @@ -432,7 +433,7 @@ query_pr( { ib_gid_pair_t user_query; struct query_pr_context query_context; - ib_query_handle_t VOID_PTR64 query_handle; + ib_query_handle_t query_handle; ib_query_req_t query_req; ib_api_status_t status; uint8_t pkt_life; diff --git a/trunk/ulp/wsd/user/ibsp_mem.c b/trunk/ulp/wsd/user/ibsp_mem.c index f802afa2..70710441 100644 --- a/trunk/ulp/wsd/user/ibsp_mem.c +++ b/trunk/ulp/wsd/user/ibsp_mem.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. * Copyright (c) 2006 Mellanox Technologies. 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,8 +52,8 @@ __check_mr( { return( (p_reg->type.access_ctrl & acl_mask) == acl_mask && start >= p_reg->type.vaddr && - ((uintn_t)start) + len <= - ((uintn_t)(uint64_t)p_reg->type.vaddr) + p_reg->type.length ); + ((ULONG_PTR)start) + len <= + ((ULONG_PTR)p_reg->type.vaddr) + p_reg->type.length ); } @@ -100,7 +101,7 @@ lookup_partial_mr( struct memory_node * ibsp_reg_mem( IN struct ibsp_socket_info *s, - IN ib_pd_handle_t FUNC_PTR64 pd, + IN ib_pd_handle_t pd, IN void *start, IN size_t len, IN ib_access_t access_ctrl, @@ -361,8 +362,8 @@ ibsp_hca_flush_mr_cache( p_item = cl_qlist_next( p_item ); if( lpvAddress > p_reg->type.vaddr || - ((uintn_t)lpvAddress) + Size < - ((uintn_t)(uint64_t)p_reg->type.vaddr) + p_reg->type.length ) + ((ULONG_PTR)lpvAddress) + Size < + ((ULONG_PTR)p_reg->type.vaddr) + p_reg->type.length ) { continue; } diff --git a/trunk/ulp/wsd/user/ibsp_perfmon.c b/trunk/ulp/wsd/user/ibsp_perfmon.c index 8eb383b4..e4d947a7 100644 --- a/trunk/ulp/wsd/user/ibsp_perfmon.c +++ b/trunk/ulp/wsd/user/ibsp_perfmon.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. * Copyright (c) 2006 Mellanox Technologies. 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: @@ -43,6 +44,7 @@ struct _ibsp_pm_definition g_ibsp_pm_def; /* IB WSD performance object */ +struct _pm_stat g_pm_stat; void IBSPPmInit( void ) @@ -420,7 +422,7 @@ IBSPPmCollectData( IBSP_ENTER( IBSP_DBG_PERFMON ); - p_mem = (pm_shmem_t * VOID_PTR64 )g_pm_stat.p_shmem; + p_mem = (pm_shmem_t *)g_pm_stat.p_shmem; if( p_mem == NULL ) { diff --git a/trunk/ulp/wsd/user/ibsp_perfmon.h b/trunk/ulp/wsd/user/ibsp_perfmon.h index d3098689..1d94cb78 100644 --- a/trunk/ulp/wsd/user/ibsp_perfmon.h +++ b/trunk/ulp/wsd/user/ibsp_perfmon.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2005 SilverStorm Technologies. 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: @@ -95,7 +96,9 @@ struct _pm_stat DWORD idx; /* slot index assigned for this process */ LONG64 fall_back_data[IBSP_PM_NUM_COUNTERS]; -} g_pm_stat; +}; + +extern struct _pm_stat g_pm_stat; void diff --git a/trunk/ulp/wsd/user/ibsp_pnp.c b/trunk/ulp/wsd/user/ibsp_pnp.c index ebe6a656..efd1ef90 100644 --- a/trunk/ulp/wsd/user/ibsp_pnp.c +++ b/trunk/ulp/wsd/user/ibsp_pnp.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. * Copyright (c) 2006 Mellanox Technologies. 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: @@ -319,7 +320,7 @@ pnp_callback( break; case IB_PNP_CA_REMOVE: - pnp_ca_remove( (struct ibsp_hca* VOID_PTR64)pnp_rec->context ); + pnp_ca_remove( (struct ibsp_hca*)pnp_rec->context ); break; /* Port events */ @@ -335,7 +336,7 @@ pnp_callback( break; case IB_PNP_PORT_REMOVE: - pnp_port_remove( (struct ibsp_port* VOID_PTR64)pnp_rec->context ); + pnp_port_remove( (struct ibsp_port*)pnp_rec->context ); break; case IB_PNP_PKEY_CHANGE: diff --git a/trunk/ulp/wsd/user/ibspdll.c b/trunk/ulp/wsd/user/ibspdll.c index b5ae2486..74467ccd 100644 --- a/trunk/ulp/wsd/user/ibspdll.c +++ b/trunk/ulp/wsd/user/ibspdll.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. * Copyright (c) 2006 Mellanox Technologies. 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: @@ -1621,7 +1622,7 @@ IBSPRecv( /* Looks good. Post the receive buffer. */ wr->recv.p_next = NULL; - wr->recv.wr_id = (uint64_t)(void* VOID_PTR64)wr; + wr->recv.wr_id = (ULONG_PTR)wr; wr->recv.num_ds = dwBufferCount; wr->recv.ds_array = wr->ds_array; @@ -1643,7 +1644,7 @@ IBSPRecv( } wr->ds_array[ds_idx].vaddr = - (uint64_t)(void* VOID_PTR64)lpBuffers[ds_idx].buf; + (ULONG_PTR)lpBuffers[ds_idx].buf; wr->ds_array[ds_idx].length = lpBuffers[ds_idx].len; wr->ds_array[ds_idx].lkey = node->p_reg1->lkey; } @@ -1847,7 +1848,7 @@ IBSPSend( lpOverlapped->InternalHigh = 0; for( ds_idx = 0; ds_idx < dwBufferCount; ds_idx++ ) { - local_ds[ds_idx].vaddr = (uint64_t)(void* VOID_PTR64)lpBuffers[ds_idx].buf; + local_ds[ds_idx].vaddr = (ULONG_PTR)lpBuffers[ds_idx].buf; local_ds[ds_idx].length = lpBuffers[ds_idx].len; lpOverlapped->InternalHigh += lpBuffers[ds_idx].len; @@ -2324,3 +2325,4 @@ WSPStartupEx( } + diff --git a/trunk/ulp/wsd/user/ibspproto.h b/trunk/ulp/wsd/user/ibspproto.h index 261dce8d..d2f67dc3 100644 --- a/trunk/ulp/wsd/user/ibspproto.h +++ b/trunk/ulp/wsd/user/ibspproto.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2005 SilverStorm Technologies. 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: @@ -249,7 +250,7 @@ lookup_partial_mr( struct memory_node * ibsp_reg_mem( IN struct ibsp_socket_info *s, - IN ib_pd_handle_t FUNC_PTR64 pd, + IN ib_pd_handle_t pd, IN void *start, IN size_t len, IN ib_access_t access_ctrl, diff --git a/trunk/ulp/wsd/user/ibspstruct.h b/trunk/ulp/wsd/user/ibspstruct.h index 671076a5..3b1fc533 100644 --- a/trunk/ulp/wsd/user/ibspstruct.h +++ b/trunk/ulp/wsd/user/ibspstruct.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2005 SilverStorm Technologies. 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,7 @@ struct memory_reg /* Memory registration parameters, returned by ib_reg_mem. */ uint32_t lkey; uint32_t rkey; -TO_LONG_PTR( ib_mr_handle_t , mr_handle) ; + ib_mr_handle_t mr_handle; }; @@ -203,7 +204,7 @@ struct cq_thread_info cl_list_item_t list_item; cl_waitobj_handle_t cq_waitobj; -TO_LONG_PTR( ib_cq_handle_t , cq) ; + ib_cq_handle_t cq; /* Number of qp's using this cq */ atomic32_t qp_count; @@ -248,7 +249,7 @@ struct ibsp_socket_info /* Listening socket */ unsigned int backlog; /* Maximum number of pending connections */ cl_qlist_t list; /* list of pending connections */ -TO_LONG_PTR( ib_listen_handle_t , handle) ; + ib_listen_handle_t handle; struct listen_req_param listen_req_param; } listen; @@ -264,12 +265,12 @@ TO_LONG_PTR( ib_listen_handle_t , handle) ; struct ibsp_socket_options socket_options; /* Socket Options */ /* Infiniband ressources */ -TO_LONG_PTR( ib_pd_handle_t , hca_pd) ; /* Copy of the HCA PD, for faster access. */ + ib_pd_handle_t hca_pd; /* Copy of the HCA PD, for faster access. */ /* Pointer to completion queue and thread assigned to this socket */ struct cq_thread_info *cq_tinfo; -TO_LONG_PTR( ib_qp_handle_t , qp) ; + ib_qp_handle_t qp; uint32_t max_inline; /* State on the QP. This is only valid when the socket state is IBSP_CONNECTED. @@ -394,9 +395,9 @@ struct ibsp_hca ib_net64_t guid; uint16_t dev_id; /* Device ID to selectively cap MTU to 1K for Tavor. */ -TO_LONG_PTR( ib_ca_handle_t , hca_handle) ; + ib_ca_handle_t hca_handle; -TO_LONG_PTR( ib_pd_handle_t , pd) ; + ib_pd_handle_t pd; /* Memory management */ struct mr_list rdma_mem_list; /* Regions registered through IBSPRegisterRdmaMemory */ @@ -430,9 +431,9 @@ struct ibspdll_globals WSAPROTOCOL_INFOW protocol_info; /* Infiniband */ -TO_LONG_PTR( ib_al_handle_t , al_handle) ; -TO_LONG_PTR( ib_pnp_handle_t , pnp_handle_ca) ; -TO_LONG_PTR( ib_pnp_handle_t , pnp_handle_port) ; + ib_al_handle_t al_handle; + ib_pnp_handle_t pnp_handle_ca; + ib_pnp_handle_t pnp_handle_port; cl_qlist_t hca_list; cl_spinlock_t hca_mutex;