From: Stan Smith Date: Mon, 9 Aug 2010 20:27:47 +0000 (+0000) Subject: [IPOIB_NDIS6_CM] simplify/clarify the IPOIB_INLINE_RECV conditionals by separating... X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=3dd47613ee523cda7d59991505a1ed141bc4762e;p=~shefty%2Frdma-win.git [IPOIB_NDIS6_CM] simplify/clarify the IPOIB_INLINE_RECV conditionals by separating out only the different items; enhances readability/understanding of the code. No Functionality changes! git-svn-id: svn://openib.tc.cornell.edu/gen1@2870 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp b/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp index b2e4d3d3..41fba4d8 100644 --- a/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp +++ b/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp @@ -198,7 +198,7 @@ static void __recv_dtor( IN const cl_pool_item_t* const p_pool_item, IN void *context ); -#endif /* IPOIB_INLINE_RECV */ +#endif static inline ipoib_send_desc_t* __buf_mgr_get_send( @@ -1410,11 +1410,17 @@ __buf_mgr_init( /* Allocate the receive descriptor pool */ cl_status = cl_qpool_init( &p_port->buf_mgr.recv_pool, p_params->rq_depth * p_params->recv_pool_ratio, + 0, + 0, + sizeof(ipoib_recv_desc_t), + __recv_ctor, #if IPOIB_INLINE_RECV - 0, 0, sizeof(ipoib_recv_desc_t), __recv_ctor, NULL, p_port ); -#else /* IPOIB_INLINE_RECV */ - 0, 0, sizeof(ipoib_recv_desc_t), __recv_ctor, __recv_dtor, p_port ); -#endif /* IPOIB_INLINE_RECV */ + NULL, +#else + __recv_dtor, +#endif + p_port ); + if( cl_status != CL_SUCCESS ) { NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, @@ -2214,12 +2220,14 @@ __recv_get_endpts( { /* Lookup the source endpoints based on GID. */ cl_perf_start( GetEndptByGid ); - *pp_src = + *pp_src = __endpt_mgr_get_by_gid( p_port, #if IPOIB_INLINE_RECV - __endpt_mgr_get_by_gid( p_port, &p_desc->buf.ib.grh.src_gid ); -#else /* IPOIB_INLINE_RECV */ - __endpt_mgr_get_by_gid( p_port, &p_desc->p_buf->ib.grh.src_gid ); -#endif /* IPOIB_INLINE_RECV */ + &p_desc->buf.ib.grh.src_gid +#else + &p_desc->p_buf->ib.grh.src_gid +#endif + ); + cl_perf_stop( &p_port->p_adapter->perf, GetEndptByGid ); /* @@ -2228,12 +2236,15 @@ __recv_get_endpts( * whether to report this to NDIS. */ cl_perf_start( GetEndptByGid ); - *pp_dst = + + *pp_dst = __endpt_mgr_get_by_gid( p_port, #if IPOIB_INLINE_RECV - __endpt_mgr_get_by_gid( p_port, &p_desc->buf.ib.grh.dest_gid ); -#else /* IPOIB_INLINE_RECV */ - __endpt_mgr_get_by_gid( p_port, &p_desc->p_buf->ib.grh.dest_gid ); -#endif /* IPOIB_INLINE_RECV */ + &p_desc->buf.ib.grh.dest_gid +#else + &p_desc->p_buf->ib.grh.dest_gid +#endif + ); + cl_perf_stop( &p_port->p_adapter->perf, GetEndptByGid ); /* @@ -2245,10 +2256,13 @@ __recv_get_endpts( { status = ipoib_mac_from_guid( #if IPOIB_INLINE_RECV - p_desc->buf.ib.grh.src_gid.unicast.interface_id, p_port->p_adapter->params.guid_mask, &mac ); -#else /* IPOIB_INLINE_RECV */ - p_desc->p_buf->ib.grh.src_gid.unicast.interface_id, p_port->p_adapter->params.guid_mask, &mac ); -#endif /* IPOIB_INLINE_RECV */ + p_desc->buf.ib.grh.src_gid.unicast.interface_id, +#else + p_desc->p_buf->ib.grh.src_gid.unicast.interface_id, +#endif + p_port->p_adapter->params.guid_mask, + &mac ); + if( status != IB_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, @@ -2258,12 +2272,14 @@ __recv_get_endpts( } /* Create the endpoint. */ + *pp_src = ipoib_endpt_create( #if IPOIB_INLINE_RECV - *pp_src = ipoib_endpt_create( &p_desc->buf.ib.grh.src_gid, -#else /* IPOIB_INLINE_RECV */ - *pp_src = ipoib_endpt_create( &p_desc->p_buf->ib.grh.src_gid, -#endif /* IPOIB_INLINE_RECV */ - p_wc->recv.ud.remote_lid, p_wc->recv.ud.remote_qp ); + &p_desc->buf.ib.grh.src_gid, +#else + &p_desc->p_buf->ib.grh.src_gid, +#endif + p_wc->recv.ud.remote_lid, + p_wc->recv.ud.remote_qp ); if( !*pp_src ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, @@ -2416,10 +2432,10 @@ __recv_mgr_filter( #if IPOIB_INLINE_RECV p_ipoib = &p_desc->buf.ib.pkt; p_eth = &p_desc->buf.eth.pkt; -#else /* IPOIB_INLINE_RECV */ +#else p_ipoib = &p_desc->p_buf->ib.pkt; p_eth = &p_desc->p_buf->eth.pkt; -#endif /*IPOIB_INLINE_RECV */ +#endif if( p_src ) {