From f3589aceb4191b4450b307d94c584cfb9913e906 Mon Sep 17 00:00:00 2001 From: aestrin Date: Sat, 6 Dec 2008 00:05:42 +0000 Subject: [PATCH] [ipoib] CM - added large multicast and ICMP packets fragmentation. (each fragment utilises UD WR and all WRs chained to use one postsend per descriptor. Only Last WR set flag for completion). - fixed some bugs, - added changes from the trunk. git-svn-id: svn://openib.tc.cornell.edu/gen1@1777 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- branches/ipoib_cm/kernel/ipoib_adapter.c | 32 +- branches/ipoib_cm/kernel/ipoib_adapter.h | 2 +- branches/ipoib_cm/kernel/ipoib_debug.h | 8 +- branches/ipoib_cm/kernel/ipoib_driver.c | 8 +- branches/ipoib_cm/kernel/ipoib_driver.h | 7 +- branches/ipoib_cm/kernel/ipoib_endpoint.c | 21 +- branches/ipoib_cm/kernel/ipoib_endpoint.h | 2 - branches/ipoib_cm/kernel/ipoib_log.mc | 1 + branches/ipoib_cm/kernel/ipoib_port.c | 1043 ++++++++++++++------ branches/ipoib_cm/kernel/ipoib_port.h | 24 +- branches/ipoib_cm/kernel/ipoib_xfr_mgr.h | 224 +---- branches/ipoib_cm/kernel/makefile.inc | 1 - branches/ipoib_cm/kernel/netipoib-xp32.inf | 87 +- branches/ipoib_cm/kernel/netipoib.inx | 131 ++- 14 files changed, 1017 insertions(+), 574 deletions(-) diff --git a/branches/ipoib_cm/kernel/ipoib_adapter.c b/branches/ipoib_cm/kernel/ipoib_adapter.c index c51d9474..dd81c377 100644 --- a/branches/ipoib_cm/kernel/ipoib_adapter.c +++ b/branches/ipoib_cm/kernel/ipoib_adapter.c @@ -123,7 +123,7 @@ ipoib_get_adapter_params( IN NDIS_HANDLE* const wrapper_config_context, IN OUT ipoib_adapter_t *p_adapter, OUT PUCHAR *p_mac, - OUT UINT *p_len ); + OUT UINT *p_len); /* Implementation */ @@ -498,6 +498,7 @@ __adapter_free( p_adapter->p_ifc->close_al( p_adapter->h_al ); cl_free( p_adapter->p_ifc ); + p_adapter->p_ifc = NULL; } cl_vector_destroy( &p_adapter->ip_vector ); @@ -547,19 +548,19 @@ ipoib_query_pkey_index(ipoib_adapter_t *p_adapter) p_adapter->p_ifc->get_err_str( status )) ); goto pkey_end; } - - CL_ASSERT(ca_attr->p_port_attr->p_pkey_table[0] == IB_DEFAULT_PKEY); - for(index = 0; index < ca_attr->p_port_attr->num_pkeys; index++) + CL_ASSERT(ca_attr->p_port_attr[p_adapter->p_port->port_num -1].p_pkey_table[0] == IB_DEFAULT_PKEY); + for(index = 0; index < ca_attr->p_port_attr[p_adapter->p_port->port_num -1].num_pkeys; index++) { - if(cl_hton16(p_adapter->guids.port_guid.pkey) == ca_attr->p_port_attr->p_pkey_table[index]) + if(cl_hton16(p_adapter->guids.port_guid.pkey) == ca_attr->p_port_attr[p_adapter->p_port->port_num -1].p_pkey_table[index]) break; } - if(index >= ca_attr->p_port_attr->num_pkeys) + if(index >= ca_attr->p_port_attr[p_adapter->p_port->port_num -1].num_pkeys) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, ("Pkey table is invalid, index not found\n")); NdisWriteErrorLogEntry( p_adapter->h_adapter, EVENT_IPOIB_PARTITION_ERR, 1, p_adapter->guids.port_guid.pkey ); + status = IB_NOT_FOUND; p_adapter->p_port->pkey_index = PKEY_INVALID_INDEX; goto pkey_end; } @@ -754,7 +755,11 @@ __ipoib_pnp_cb( { status = ipoib_query_pkey_index(p_adapter); if(status != IB_SUCCESS) - break; + { + cl_obj_lock( &p_adapter->obj ); + p_adapter->state = IB_PNP_PORT_INIT; + cl_obj_unlock( &p_adapter->obj ); + } } case IB_PNP_SM_CHANGE: @@ -1070,12 +1075,13 @@ ipoib_set_rate( } -void +ib_api_status_t ipoib_set_active( IN ipoib_adapter_t* const p_adapter ) { ib_pnp_event_t old_state; uint8_t i; + ib_api_status_t status = IB_SUCCESS; IPOIB_ENTER( IPOIB_DBG_INIT ); @@ -1104,8 +1110,13 @@ ipoib_set_active( default: if (p_adapter->guids.port_guid.pkey != IB_DEFAULT_PKEY) - ipoib_query_pkey_index(p_adapter); - + { + status = ipoib_query_pkey_index(p_adapter); + if( IB_SUCCESS != status) + { + break; + } + } /* Join all programmed multicast groups. */ for( i = 0; i < p_adapter->mcast_array_size; i++ ) { @@ -1143,6 +1154,7 @@ ipoib_set_active( } IPOIB_EXIT( IPOIB_DBG_INIT ); + return status; } diff --git a/branches/ipoib_cm/kernel/ipoib_adapter.h b/branches/ipoib_cm/kernel/ipoib_adapter.h index 34e1d598..cf05562c 100644 --- a/branches/ipoib_cm/kernel/ipoib_adapter.h +++ b/branches/ipoib_cm/kernel/ipoib_adapter.h @@ -422,7 +422,7 @@ ipoib_set_rate( IN const uint8_t link_speed ); -void +ib_api_status_t ipoib_set_active( IN ipoib_adapter_t* const p_adapter ); diff --git a/branches/ipoib_cm/kernel/ipoib_debug.h b/branches/ipoib_cm/kernel/ipoib_debug.h index 417bb686..b63fe11b 100644 --- a/branches/ipoib_cm/kernel/ipoib_debug.h +++ b/branches/ipoib_cm/kernel/ipoib_debug.h @@ -163,13 +163,13 @@ extern uint32_t g_ipoib_dbg_flags; size_t _loop_; \ for( _loop_ = 0; _loop_ < (len); ++_loop_ ) \ { \ - DbgPrint( "0x%.2X ", ((uint8_t*)(ptr))[_loop_] ); \ + cl_dbg_out( "0x%.2X ", ((uint8_t*)(ptr))[_loop_] ); \ if( (_loop_ + 1)% 16 == 0 ) \ - DbgPrint("\n"); \ + cl_dbg_out("\n"); \ else if( (_loop_ % 4 + 1) == 0 ) \ - DbgPrint(" "); \ + cl_dbg_out(" "); \ } \ - DbgPrint("\n"); \ + cl_dbg_out("\n"); \ } \ } diff --git a/branches/ipoib_cm/kernel/ipoib_driver.c b/branches/ipoib_cm/kernel/ipoib_driver.c index 056d86ed..ded9b5a6 100644 --- a/branches/ipoib_cm/kernel/ipoib_driver.c +++ b/branches/ipoib_cm/kernel/ipoib_driver.c @@ -150,7 +150,7 @@ typedef struct _IPOIB_REG_ENTRY IPOIB_REG_ENTRY HCARegTable[] = { // reg value name If Required Offset in parentr struct Field size Default Min Max - {NDIS_STRING_CONST("GUIDMask"), 1, IPOIB_OFFSET(guid_mask), IPOIB_SIZE(guid_mask), 0, 0, MAX_GUID_MAX}, + {NDIS_STRING_CONST("GUIDMask"), 0, IPOIB_OFFSET(guid_mask), IPOIB_SIZE(guid_mask), 0, 0, MAX_GUID_MAX}, /* GUIDMask should be the first element */ {NDIS_STRING_CONST("RqDepth"), 1, IPOIB_OFFSET(rq_depth), IPOIB_SIZE(rq_depth), 512, 128, 1024}, {NDIS_STRING_CONST("RqLowWatermark"), 0, IPOIB_OFFSET(rq_low_watermark), IPOIB_SIZE(rq_low_watermark), 4, 2, 8}, @@ -160,7 +160,7 @@ IPOIB_REG_ENTRY HCARegTable[] = { {NDIS_STRING_CONST("SaTimeout"), 1, IPOIB_OFFSET(sa_timeout), IPOIB_SIZE(sa_timeout), 1000, 250, UINT_MAX}, {NDIS_STRING_CONST("SaRetries"), 1, IPOIB_OFFSET(sa_retry_cnt), IPOIB_SIZE(sa_retry_cnt), 10, 1, UINT_MAX}, {NDIS_STRING_CONST("RecvRatio"), 1, IPOIB_OFFSET(recv_pool_ratio), IPOIB_SIZE(recv_pool_ratio), 1, 1, 10}, - {NDIS_STRING_CONST("PayloadMtu"), 1, IPOIB_OFFSET(payload_mtu), IPOIB_SIZE(payload_mtu), 2044, 60, MAX_CM_PAYLOAD_MTU}, + {NDIS_STRING_CONST("PayloadMtu"), 1, IPOIB_OFFSET(payload_mtu), IPOIB_SIZE(payload_mtu), 2044, 512, MAX_CM_PAYLOAD_MTU}, {NDIS_STRING_CONST("lso"), 0, IPOIB_OFFSET(lso), IPOIB_SIZE(lso), 0, 0, 1}, {NDIS_STRING_CONST("MCLeaveRescan"), 1, IPOIB_OFFSET(mc_leave_rescan), IPOIB_SIZE(mc_leave_rescan), 260, 1, 3600}, {NDIS_STRING_CONST("BCJoinRetry"), 1, IPOIB_OFFSET(bc_join_retry), IPOIB_SIZE(bc_join_retry), 50, 0, 1000}, @@ -493,7 +493,7 @@ ipoib_get_adapter_params( IN NDIS_HANDLE* const wrapper_config_context, IN OUT ipoib_adapter_t *p_adapter, OUT PUCHAR *p_mac, - OUT UINT *p_len ) + OUT UINT *p_len) { NDIS_STATUS status; NDIS_HANDLE h_config; @@ -619,7 +619,7 @@ ipoib_get_adapter_params( p_adapter->params.cm_xfer_block_size = p_adapter->params.cm_payload_mtu + sizeof(eth_hdr_t); p_adapter->params.payload_mtu = - min( MAX_UD_PAYLOAD_MTU, p_adapter->params.payload_mtu); + min( DEFAULT_PAYLOAD_MTU, p_adapter->params.payload_mtu); p_adapter->params.xfer_block_size = (sizeof(eth_hdr_t) + p_adapter->params.payload_mtu); NdisReadNetworkAddress( &status, p_mac, p_len, h_config ); diff --git a/branches/ipoib_cm/kernel/ipoib_driver.h b/branches/ipoib_cm/kernel/ipoib_driver.h index db2ea863..b5995e03 100644 --- a/branches/ipoib_cm/kernel/ipoib_driver.h +++ b/branches/ipoib_cm/kernel/ipoib_driver.h @@ -48,14 +48,17 @@ #define MAX_BUNDLE_ID_LENGTH 32 /* MLX4 supports 4K MTU */ -#define IB_MTU 4096 +#define MAX_IB_MTU 4096 +#define DEFAULT_MTU 2048 /* * Header length as defined by IPoIB spec: * http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-04.txt */ -#define MAX_UD_PAYLOAD_MTU (IB_MTU - sizeof(ipoib_hdr_t)) +#define MAX_UD_PAYLOAD_MTU (MAX_IB_MTU - sizeof(ipoib_hdr_t)) +#define DEFAULT_PAYLOAD_MTU (DEFAULT_MTU - sizeof(ipoib_hdr_t)) #define MAX_CM_PAYLOAD_MTU (65520) +#define MAX_WRS_PER_MSG (MAX_CM_PAYLOAD_MTU/MAX_UD_PAYLOAD_MTU) /* * Only the protocol type is sent as part of the UD payload * since the rest of the Ethernet header is encapsulated in the diff --git a/branches/ipoib_cm/kernel/ipoib_endpoint.c b/branches/ipoib_cm/kernel/ipoib_endpoint.c index af0f3832..339b1e08 100644 --- a/branches/ipoib_cm/kernel/ipoib_endpoint.c +++ b/branches/ipoib_cm/kernel/ipoib_endpoint.c @@ -254,7 +254,7 @@ ipoib_endpt_set_mcast( return status; } p_endpt->h_mcast = p_mcast_rec->h_mcast; - p_endpt->dlid = p_mcast_rec->p_member_rec->mlid; + CL_ASSERT(p_endpt->dlid == 0); IPOIB_EXIT( IPOIB_DBG_ENDPT ); return IB_SUCCESS; @@ -617,6 +617,7 @@ __cm_recv_desc_ctor( ipoib_cm_desc_t* p_desc; ipoib_port_t* p_port; ib_mr_create_t create_mr; + net32_t rkey; CL_ASSERT( p_object ); CL_ASSERT( context ); @@ -628,13 +629,9 @@ __cm_recv_desc_ctor( p_desc->alloc_buf_size = ROUNDUP( p_port->p_adapter->params.cm_xfer_block_size, BUF_ALIGN ); - - NdisMAllocateSharedMemory( - p_port->p_adapter->h_adapter, - p_desc->alloc_buf_size, - FALSE, - &p_desc->p_alloc_buf, - &p_desc->phys_alloc_buf ); + + p_desc->p_alloc_buf = (uint8_t *)ExAllocatePoolWithTag( + NonPagedPool, p_desc->alloc_buf_size, 'DOMC' ); if( p_desc->p_alloc_buf == NULL ) { @@ -652,7 +649,7 @@ __cm_recv_desc_ctor( p_port->ib_mgr.h_pd, &create_mr, &p_desc->lkey, - &p_desc->rkey, + &rkey, &p_desc->h_mr ) != IB_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, @@ -699,11 +696,7 @@ __cm_recv_desc_dtor( p_port->p_adapter->p_ifc->dereg_mr( p_desc->h_mr ); if( p_desc->p_alloc_buf ) - NdisMFreeSharedMemory( p_port->p_adapter->h_adapter, - p_desc->alloc_buf_size, - FALSE, - p_desc->p_alloc_buf, - p_desc->phys_alloc_buf ); + ExFreePoolWithTag( p_desc->p_alloc_buf, 'DOMC' ); } static NDIS_PACKET* diff --git a/branches/ipoib_cm/kernel/ipoib_endpoint.h b/branches/ipoib_cm/kernel/ipoib_endpoint.h index 0115b2ed..bb74a0a2 100644 --- a/branches/ipoib_cm/kernel/ipoib_endpoint.h +++ b/branches/ipoib_cm/kernel/ipoib_endpoint.h @@ -114,7 +114,6 @@ typedef struct _ipoib_endpt net32_t qpn; uint8_t cm_flag; ib_av_handle_t h_av; - boolean_t expired; endpt_conn_t conn; ib_al_ifc_t *p_ifc; @@ -199,7 +198,6 @@ ipoib_endpt_ref( * or trying to send data to that endpoint. Clear the expired flag * to prevent the AV from being flushed. */ - p_endpt->expired = FALSE; } diff --git a/branches/ipoib_cm/kernel/ipoib_log.mc b/branches/ipoib_cm/kernel/ipoib_log.mc index 8faf5e7e..bb7d1c1d 100644 --- a/branches/ipoib_cm/kernel/ipoib_log.mc +++ b/branches/ipoib_cm/kernel/ipoib_log.mc @@ -315,6 +315,7 @@ SymbolicName=EVENT_IPOIB_PARTITION_ERR Language=English %2: Pkey index not found for partition , change switch pkey configuration. . + MessageId=0x005C Facility=IPoIB Severity=Error diff --git a/branches/ipoib_cm/kernel/ipoib_port.c b/branches/ipoib_cm/kernel/ipoib_port.c index 0483f0c5..5316c33b 100644 --- a/branches/ipoib_cm/kernel/ipoib_port.c +++ b/branches/ipoib_cm/kernel/ipoib_port.c @@ -63,6 +63,11 @@ ipoib_port_t *gp_ipoib_port; static void __port_mcast_garbage_dpc(KDPC *p_gc_dpc,void *context,void *s_arg1, void *s_arg2); static void __port_do_mcast_garbage(ipoib_port_t* const p_port ); + + +static void __recv_cb_dpc(KDPC *p_gc_dpc,void *context,void *s_arg1, void *s_arg2); + + /****************************************************************************** * * Declarations @@ -337,15 +342,44 @@ __send_cb( IN const ib_cq_handle_t h_cq, IN void *cq_context ); -static NDIS_STATUS GetLsoHeaderSize( - IN ipoib_port_t* const pPort, - IN PNDIS_BUFFER CurrBuffer, - IN LsoData *pLsoData, - OUT uint16_t *pSize, - OUT INT *IndexOfData, - IN ipoib_hdr_t *ipoib_hdr - ); +static NDIS_STATUS +GetLsoHeaderSize( + IN ipoib_port_t* const pPort, + IN PNDIS_BUFFER CurrBuffer, + IN LsoData *pLsoData, + OUT uint16_t *pSize, + OUT INT *IndexOfData, + IN ipoib_hdr_t *ipoib_hdr ); +static NDIS_STATUS +__build_lso_desc( + IN ipoib_port_t* const p_port, + IN OUT ipoib_send_desc_t* const p_desc, + IN ULONG mss, + IN int32_t hdr_idx ); + +static NDIS_STATUS +__send_fragments( + IN ipoib_port_t* const p_port, + IN ipoib_send_desc_t* const p_desc, + IN eth_hdr_t* const p_eth_hdr, + IN ip_hdr_t* const p_ip_hdr, + IN uint32_t buf_len, + IN NDIS_BUFFER* p_ndis_buf ); + +static void +__update_fragment_ip_hdr( +IN ip_hdr_t* const p_ip_hdr, +IN uint16_t fragment_size, +IN uint16_t fragment_offset, +IN BOOLEAN more_fragments ); + +static void +__copy_ip_options( +IN uint8_t* p_buf, +IN uint8_t* p_options, +IN uint32_t options_len, +IN BOOLEAN copy_all ); /****************************************************************************** * * Endpoint manager operations @@ -496,8 +530,6 @@ inline void ipoib_port_ref( ipoib_port_t * p_port, int type ) inline void ipoib_port_deref(ipoib_port_t * p_port, int type) { - cl_obj_deref( &p_port->obj ); - #if DBG cl_atomic_dec( &p_port->ref[type % ref_mask] ); IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ, @@ -505,6 +537,8 @@ inline void ipoib_port_deref(ipoib_port_t * p_port, int type) #else UNREFERENCED_PARAMETER(type); #endif + cl_obj_deref( &p_port->obj ); + } /* function returns pointer to payload that is going after IP header. @@ -512,7 +546,7 @@ inline void ipoib_port_deref(ipoib_port_t * p_port, int type) */ static void* GetIpPayloadPtr(const ip_hdr_t* const p_ip_hdr) { - return (void*)((uint8_t*)p_ip_hdr + 4*(p_ip_hdr->ver_hl & 0xf)); + return (void*)((uint8_t*)p_ip_hdr + IP_HEADER_LENGTH(p_ip_hdr)); } /****************************************************************************** @@ -677,6 +711,10 @@ __port_init( p_adapter->p_ifc->get_err_str( status )) ); return status; } + + KeInitializeDpc(&p_port->recv_dpc,(PKDEFERRED_ROUTINE)__recv_cb_dpc,p_port); + + /* Initialize multicast garbage collector timer and DPC object */ KeInitializeDpc(&p_port->gc_dpc,(PKDEFERRED_ROUTINE)__port_mcast_garbage_dpc,p_port); KeInitializeTimerEx(&p_port->gc_timer,SynchronizationTimer); @@ -928,7 +966,7 @@ __ib_mgr_init( } qp_create.h_sq_cq = p_port->ib_mgr.h_send_cq; - qp_create.sq_signaled = TRUE; + qp_create.sq_signaled = FALSE; status = p_port->p_adapter->p_ifc->create_qp( p_port->ib_mgr.h_pd, &qp_create, p_port, __qp_event, &p_port->ib_mgr.h_qp ); @@ -1792,6 +1830,22 @@ ipoib_return_packet( IPOIB_EXIT( IPOIB_DBG_RECV ); } +static void __recv_cb_dpc(KDPC *p_gc_dpc,void *context,void * s_arg1 , void * s_arg2) +{ + + ipoib_port_t *p_port = context; + + UNREFERENCED_PARAMETER(p_gc_dpc); + UNREFERENCED_PARAMETER(s_arg1); + UNREFERENCED_PARAMETER(s_arg2); + + + __recv_cb(NULL, p_port); + ipoib_port_deref( p_port, ref_recv_cb ); + + +} + static void __recv_cb( @@ -1856,7 +1910,7 @@ __recv_cb( recv_cnt += __recv_mgr_filter( p_port, p_wc, &done_list, &bad_list ); cl_perf_stop( &p_port->p_adapter->perf, FilterRecv ); - } while( !p_free ); + } while( (!p_free) && (recv_cnt < 128)); /* We're done looking at the endpoint map, release the reference. */ cl_atomic_dec( &p_port->endpt_rdr ); @@ -1935,18 +1989,23 @@ __recv_cb( } while( pkt_cnt ); cl_spinlock_release( &p_port->recv_lock ); - /* - * Rearm after filtering to prevent contention on the enpoint maps - * and eliminate the possibility of having a call to - * __endpt_mgr_insert find a duplicate. - */ - cl_perf_start( RearmRecv ); - status = p_port->p_adapter->p_ifc->rearm_cq( - p_port->ib_mgr.h_recv_cq, FALSE ); - cl_perf_stop( &p_port->p_adapter->perf, RearmRecv ); - CL_ASSERT( status == IB_SUCCESS ); + if (p_free ) { + /* + * Rearm after filtering to prevent contention on the enpoint maps + * and eliminate the possibility of having a call to + * __endpt_mgr_insert find a duplicate. + */ + cl_perf_start( RearmRecv ); + status = p_port->p_adapter->p_ifc->rearm_cq( + p_port->ib_mgr.h_recv_cq, FALSE ); + cl_perf_stop( &p_port->p_adapter->perf, RearmRecv ); + CL_ASSERT( status == IB_SUCCESS ); - ipoib_port_deref( p_port, ref_recv_cb ); + ipoib_port_deref( p_port, ref_recv_cb ); + } else { + // Please note the reference is still up + KeInsertQueueDpc(&p_port->recv_dpc, NULL, NULL); + } cl_perf_stop( &p_port->p_adapter->perf, RecvCb ); @@ -2040,6 +2099,7 @@ __recv_get_endpts( IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, ("__endpt_mgr_insert returned %s\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); + *pp_src = NULL; return; } cl_obj_unlock( &p_port->obj ); @@ -2157,7 +2217,8 @@ __recv_mgr_filter( if((len - sizeof(ipoib_hdr_t)) > p_port->p_adapter->params.payload_mtu) { IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("Received ETH packet > payload MTU (%d)\n", + ("Received ETH packet len %d > payload MTU (%d)\n", + (len - sizeof(ipoib_hdr_t)), p_port->p_adapter->params.payload_mtu) ); ipoib_inc_recv_stat( p_port->p_adapter, IP_STAT_ERROR, 0, 0 ); cl_qlist_insert_tail( p_bad_list, &p_desc->item.list_item ); @@ -3042,6 +3103,7 @@ __send_mgr_filter( cl_perf_start( FilterArp ); status = __send_mgr_filter_arp( p_port, p_eth_hdr, p_buf, buf_len, p_desc ); + p_desc->send_dir = SEND_UD_QP; cl_perf_stop( &p_port->p_adapter->perf, FilterArp ); break; @@ -3050,6 +3112,8 @@ __send_mgr_filter( * The IPoIB spec doesn't define how to send non IP or ARP packets. * Just send the payload and hope for the best. */ + + p_desc->send_dir = SEND_UD_QP; cl_perf_start( SendGen ); status = __send_gen( p_port, p_desc, 0 ); cl_perf_stop( &p_port->p_adapter->perf, SendGen ); @@ -3105,11 +3169,11 @@ __send_copy( NdisQueryPacketLength( p_desc->p_pkt, &tot_len ); /* Setup the work request. */ - p_desc->local_ds[1].vaddr = cl_get_physaddr( + p_desc->send_wr[0].local_ds[1].vaddr = cl_get_physaddr( ((uint8_t*)p_desc->p_buf) + sizeof(eth_hdr_t) ); - p_desc->local_ds[1].length = tot_len - sizeof(eth_hdr_t); - p_desc->local_ds[1].lkey = p_port->ib_mgr.lkey; - p_desc->wr.num_ds = 2; + p_desc->send_wr[0].local_ds[1].length = tot_len - sizeof(eth_hdr_t); + p_desc->send_wr[0].local_ds[1].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[0].wr.num_ds = 2; /* Copy the packet. */ NdisCopyFromPacketToPacketSafe( p_packet, bytes_copied, tot_len, @@ -3201,18 +3265,18 @@ __send_gen( CL_ASSERT( i == 0 ); if( offset < PAGE_SIZE ) { - p_desc->local_ds[j].lkey = p_port->ib_mgr.lkey; - p_desc->local_ds[j].vaddr = (page_array[i] << PAGE_SHIFT); + p_desc->send_wr[0].local_ds[j].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[0].local_ds[j].vaddr = (page_array[i] << PAGE_SHIFT); /* Add the byte offset since we're on the 1st page. */ - p_desc->local_ds[j].vaddr += offset; + p_desc->send_wr[0].local_ds[j].vaddr += offset; if( offset + buf_len > PAGE_SIZE ) { - p_desc->local_ds[j].length = PAGE_SIZE - offset; - buf_len -= p_desc->local_ds[j].length; + p_desc->send_wr[0].local_ds[j].length = PAGE_SIZE - offset; + buf_len -= p_desc->send_wr[0].local_ds[j].length; } else { - p_desc->local_ds[j].length = buf_len; + p_desc->send_wr[0].local_ds[j].length = buf_len; buf_len = 0; } /* This data segment is done. Move to the next. */ @@ -3228,25 +3292,25 @@ __send_gen( /* Finish this MDL */ while( buf_len ) { - p_desc->local_ds[j].lkey = p_port->ib_mgr.lkey; - p_desc->local_ds[j].vaddr = (page_array[i] << PAGE_SHIFT); + p_desc->send_wr[0].local_ds[j].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[0].local_ds[j].vaddr = (page_array[i] << PAGE_SHIFT); /* Add the first page's offset if we're on the first page. */ if( i == 0 ) - p_desc->local_ds[j].vaddr += MmGetMdlByteOffset( p_mdl ); + p_desc->send_wr[0].local_ds[j].vaddr += MmGetMdlByteOffset( p_mdl ); if( i == 0 && (MmGetMdlByteOffset( p_mdl ) + buf_len) > PAGE_SIZE ) { /* Buffers spans pages. */ - p_desc->local_ds[j].length = + p_desc->send_wr[0].local_ds[j].length = PAGE_SIZE - MmGetMdlByteOffset( p_mdl ); - buf_len -= p_desc->local_ds[j].length; + buf_len -= p_desc->send_wr[0].local_ds[j].length; /* This page is done. Move to the next. */ i++; } else { /* Last page of the buffer. */ - p_desc->local_ds[j].length = buf_len; + p_desc->send_wr[0].local_ds[j].length = buf_len; buf_len = 0; } /* This data segment is done. Move to the next. */ @@ -3267,7 +3331,7 @@ __send_gen( } /* Set the number of data segments. */ - p_desc->wr.num_ds = j; + p_desc->send_wr[0].wr.num_ds = j; IPOIB_EXIT( IPOIB_DBG_SEND ); return IB_SUCCESS; @@ -3300,11 +3364,11 @@ __send_gen( } /* Remember that one of the DS entries is reserved for the IPoIB header. */ - if( ( p_sgl->NumberOfElements > MAX_SEND_SGE || + if( ( p_sgl->NumberOfElements >= MAX_SEND_SGE || p_sgl->Elements[0].Length < sizeof(eth_hdr_t)) ) { - IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND, + IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_SEND, ("Too many buffers %d to fit in WR ds_array[%d] \ Or buffer[0] length %d < Eth header. Copying data.\n", p_sgl->NumberOfElements, MAX_SEND_SGE, p_sgl->Elements[0].Length ) ); @@ -3337,11 +3401,11 @@ __send_gen( } else { - p_desc->local_ds[j].vaddr = + p_desc->send_wr[0].local_ds[j].vaddr = p_sgl->Elements[i].Address.QuadPart + offset; - p_desc->local_ds[j].length = + p_desc->send_wr[0].local_ds[j].length = p_sgl->Elements[i].Length - offset; - p_desc->local_ds[j].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[0].local_ds[j].lkey = p_port->ib_mgr.lkey; i++; j++; break; @@ -3350,15 +3414,15 @@ __send_gen( /* Now fill in the rest of the local data segments. */ while( i < p_sgl->NumberOfElements ) { - p_desc->local_ds[j].vaddr = p_sgl->Elements[i].Address.QuadPart; - p_desc->local_ds[j].length = p_sgl->Elements[i].Length; - p_desc->local_ds[j].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[0].local_ds[j].vaddr = p_sgl->Elements[i].Address.QuadPart; + p_desc->send_wr[0].local_ds[j].length = p_sgl->Elements[i].Length; + p_desc->send_wr[0].local_ds[j].lkey = p_port->ib_mgr.lkey; i++; j++; } /* Set the number of data segments. */ - p_desc->wr.num_ds = j; + p_desc->send_wr[0].wr.num_ds = j; IPOIB_EXIT( IPOIB_DBG_SEND ); return NDIS_STATUS_SUCCESS; @@ -3376,6 +3440,7 @@ __send_mgr_filter_ip( { NDIS_STATUS status; ip_hdr_t *p_ip_hdr; + uint32_t ip_packet_len; PERF_DECLARE( QueryIp ); PERF_DECLARE( SendTcp ); @@ -3414,43 +3479,76 @@ __send_mgr_filter_ip( return NDIS_STATUS_BUFFER_TOO_SHORT; } - if( p_ip_hdr->offset || - p_ip_hdr->prot != IP_PROT_UDP ) + switch( p_ip_hdr->prot ) { - /* Check if this packet is IGMP */ - if ( p_ip_hdr->prot == IP_PROT_IGMP ) - { - /* - In igmp packet I saw that iph arrive in 2 NDIS_BUFFERs: - 1. iph - 2. ip options - So to get the IGMP packet we need to skip the ip options NDIS_BUFFER - */ - size_t iph_size_in_bytes = (p_ip_hdr->ver_hl & 0xf) * 4; - size_t iph_options_size = iph_size_in_bytes - buf_len; - buf_len -= sizeof(ip_hdr_t);//without ipheader + case IP_PROT_UDP: - /* - Could be a case that arrived igmp packet not from type IGMPv2 , - but IGMPv1 or IGMPv3. - We anyway pass it to __send_mgr_filter_igmp_v2(). - */ - __send_mgr_filter_igmp_v2(p_port, p_ip_hdr, iph_options_size, p_buf, buf_len); - } - /* Not a UDP packet. */ - cl_perf_start( SendTcp ); - status = __send_gen( p_port, p_desc,0 ); - cl_perf_stop( &p_port->p_adapter->perf, SendTcp ); - IPOIB_EXIT( IPOIB_DBG_SEND ); + cl_perf_start( FilterUdp ); + status = __send_mgr_filter_udp( + p_port, p_ip_hdr, p_buf, (buf_len - sizeof(ip_hdr_t)), p_desc ); + cl_perf_stop( &p_port->p_adapter->perf, FilterUdp ); + if( status == NDIS_STATUS_PENDING ) + { /* not DHCP packet, keep going */ + if( ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) ) + p_desc->send_dir = SEND_UD_QP; + else + p_desc->send_dir = SEND_RC_QP; + break; + } return status; + + case IP_PROT_TCP: + p_desc->send_dir = SEND_RC_QP; + break; + case IP_PROT_IGMP: + /* + In igmp packet I saw that iph arrive in 2 NDIS_BUFFERs: + 1. iph + 2. ip options + So to get the IGMP packet we need to skip the ip options NDIS_BUFFER. + Could be a case that arrived igmp packet not from type IGMPv2 , + but IGMPv1 or IGMPv3. + We anyway pass it to __send_mgr_filter_igmp_v2(). + */ + status = + __send_mgr_filter_igmp_v2(p_port, p_ip_hdr, + (size_t)( IP_HEADER_LENGTH(p_ip_hdr) - buf_len ), + p_buf, (buf_len - sizeof(ip_hdr_t)) ); + if( status != NDIS_STATUS_SUCCESS ) + return status; + p_desc->send_dir = SEND_UD_QP; + break; + case IP_PROT_ICMP: + p_desc->send_dir = SEND_UD_QP; + default: + break; + } + + if( !p_port->p_adapter->params.cm_enabled ) + { + p_desc->send_dir = SEND_UD_QP; + goto send_gen; + } + else if( endpt_cm_get_state( p_desc->p_endpt ) != IPOIB_CM_CONNECTED ) + { + p_desc->send_dir = SEND_UD_QP; } - buf_len -= sizeof(ip_hdr_t); + if( p_desc->send_dir == SEND_UD_QP ) + { + ip_packet_len = cl_ntoh16( p_ip_hdr->length ); + if( ip_packet_len > p_port->p_adapter->params.payload_mtu ) + { + status = __send_fragments( p_port, p_desc, (eth_hdr_t* const)p_eth_hdr, + (ip_hdr_t* const)p_ip_hdr, (uint32_t)buf_len, p_buf ); + return status; + } + } - cl_perf_start( FilterUdp ); - status = __send_mgr_filter_udp( - p_port, p_ip_hdr, p_buf, buf_len, p_desc ); - cl_perf_stop( &p_port->p_adapter->perf, FilterUdp ); +send_gen: + cl_perf_start( SendTcp ); + status = __send_gen( p_port, p_desc,0 ); + cl_perf_stop( &p_port->p_adapter->perf, SendTcp ); IPOIB_EXIT( IPOIB_DBG_SEND ); return status; @@ -3637,11 +3735,7 @@ __send_mgr_filter_udp( p_udp_hdr->dst_port != DHCP_PORT_CLIENT) ) { /* Not a DHCP packet. */ - cl_perf_start( SendUdp ); - status = __send_gen( p_port, p_desc,0 ); - cl_perf_stop( &p_port->p_adapter->perf, SendUdp ); - IPOIB_EXIT( IPOIB_DBG_SEND ); - return status; + return NDIS_STATUS_PENDING; } buf_len -= sizeof(udp_hdr_t); @@ -3851,10 +3945,11 @@ __send_mgr_filter_dhcp( } /* no chksum for udp */ p_desc->p_buf->ip.prot.udp.hdr.chksum = 0; - p_desc->local_ds[1].vaddr = cl_get_physaddr( p_desc->p_buf ); - p_desc->local_ds[1].length = sizeof(ip_hdr_t) + sizeof(udp_hdr_t) + sizeof(dhcp_pkt_t); - p_desc->local_ds[1].lkey = p_port->ib_mgr.lkey; - p_desc->wr.num_ds = 2; + p_desc->send_wr[0].local_ds[1].vaddr = cl_get_physaddr( p_desc->p_buf ); + p_desc->send_wr[0].local_ds[1].length = sizeof(ip_hdr_t) + sizeof(udp_hdr_t) + sizeof(dhcp_pkt_t); + p_desc->send_wr[0].local_ds[1].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[0].wr.num_ds = 2; + p_desc->send_dir = SEND_UD_QP; IPOIB_EXIT( IPOIB_DBG_SEND ); return NDIS_STATUS_SUCCESS; } @@ -4005,9 +4100,8 @@ __send_mgr_filter_arp( #if DBG if( p_port->p_adapter->params.cm_enabled ) { - IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT, - (" %s SEND to ENDPT[%p] State: %d flag: %#x, QPN: %#x MAC %02x:%02x:%02x:%02x:%02x:%02x\n", - (( p_arp->op == ARP_OP_REQ )? "ARP REQUEST" : "ARP REPLY" ), + IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT, + (" ARP SEND to ENDPT[%p] State: %d flag: %#x, QPN: %#x MAC %02x:%02x:%02x:%02x:%02x:%02x\n", p_desc->p_endpt, endpt_cm_get_state( p_desc->p_endpt ), p_desc->p_endpt->cm_flag, @@ -4020,10 +4114,11 @@ __send_mgr_filter_arp( p_ib_arp->dst_ip = p_arp->dst_ip; - p_desc->local_ds[1].vaddr = cl_get_physaddr( p_ib_arp ); - p_desc->local_ds[1].length = sizeof(ipoib_arp_pkt_t); - p_desc->local_ds[1].lkey = p_port->ib_mgr.lkey; - p_desc->wr.num_ds = 2; + p_desc->send_wr[0].local_ds[1].vaddr = cl_get_physaddr( p_ib_arp ); + p_desc->send_wr[0].local_ds[1].length = sizeof(ipoib_arp_pkt_t); + p_desc->send_wr[0].local_ds[1].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[0].wr.num_ds = 2; + p_desc->send_wr[0].wr.p_next = NULL; IPOIB_EXIT( IPOIB_DBG_SEND ); return NDIS_STATUS_SUCCESS; @@ -4035,14 +4130,14 @@ __send_mgr_get_eth_hdr( IN NDIS_PACKET* const p_packet, OUT NDIS_BUFFER** const pp_buf, OUT eth_hdr_t** const pp_eth_hdr, - OUT UINT* p_buf_len, - OUT UINT* p_tot_len ) + OUT UINT* p_buf_len ) { + UINT tot_len; IPOIB_ENTER( IPOIB_DBG_SEND ); NdisGetFirstBufferFromPacketSafe( - p_packet, pp_buf, pp_eth_hdr, p_buf_len, p_tot_len, NormalPagePriority ); + p_packet, pp_buf, pp_eth_hdr, p_buf_len, &tot_len, NormalPagePriority ); if( !*pp_eth_hdr ) { @@ -4147,26 +4242,17 @@ __build_send_desc( PNDIS_PACKET_EXTENSION PktExt; PNDIS_TCP_IP_CHECKSUM_PACKET_INFO pChecksumPktInfo; //NDIS 5.1 ULONG mss; - LsoData TheLsoData; - INT IndexOfData = 0; - ULONG PhysBufCount; - ULONG PacketLength; - PNDIS_BUFFER FirstBuffer; - uint16_t lso_header_size; - PERF_DECLARE( SendMgrFilter ); IPOIB_ENTER( IPOIB_DBG_SEND ); /* Format the send descriptor. */ - cl_perf_start( SendMgrFilter ); PktExt = NDIS_PACKET_EXTENSION_FROM_PACKET(p_desc->p_pkt); - pChecksumPktInfo = (PNDIS_TCP_IP_CHECKSUM_PACKET_INFO)&PktExt->NdisPacketInfo[TcpIpChecksumPacketInfo]; + pChecksumPktInfo = + (PNDIS_TCP_IP_CHECKSUM_PACKET_INFO)&PktExt->NdisPacketInfo[TcpIpChecksumPacketInfo]; mss = PtrToUlong(PktExt->NdisPacketInfo[TcpLargeSendPacketInfo]); - //TODO: optimization: we already got total length from NdisGetFirstBufferFromPacketSafe before - NdisQueryPacket(p_desc->p_pkt, (PUINT)&PhysBufCount, NULL, &FirstBuffer,(PUINT)&PacketLength); /* Format the send descriptor. */ hdr_idx = cl_atomic_inc( &p_port->hdr_idx ); @@ -4175,48 +4261,27 @@ __build_send_desc( p_port->hdr[hdr_idx].type = p_eth_hdr->type; p_port->hdr[hdr_idx].resv = 0; + p_desc->send_wr[0].local_ds[0].vaddr = cl_get_physaddr( &p_port->hdr[hdr_idx] ); + p_desc->send_wr[0].local_ds[0].length = sizeof(ipoib_hdr_t); + p_desc->send_wr[0].local_ds[0].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[0].wr.send_opt = 0; + if( p_port->p_adapter->params.lso && mss ) { - memset(&TheLsoData, 0, sizeof TheLsoData ); - status = GetLsoHeaderSize( - p_port, - FirstBuffer, - &TheLsoData, - &lso_header_size, - &IndexOfData, - &p_port->hdr[hdr_idx] ); - - if ((status != NDIS_STATUS_SUCCESS ) || - (TheLsoData.FullBuffers != TheLsoData.UsedBuffers)) { - ASSERT(FALSE); - - IPOIB_PRINT(TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, ("<-- Throwing this packet\n")); - - //NdisReleaseSpinLock(&Port->SendLock); - //MP_ASSERT_NDIS_PACKET_TYPE(Packet); - //SendComplete(Port, Packet, NDIS_STATUS_INVALID_PACKET); - //NdisAcquireSpinLock(&Port->SendLock); - //IPOIB_PRINT_EXIT + status = __build_lso_desc( p_port, p_desc, mss, hdr_idx ); + if( status != NDIS_STATUS_SUCCESS ) + { + IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, + ("__build_lso_desc returned 0x%08X.\n", status) ); return status; } - ASSERT(lso_header_size > 0); - p_desc->wr.dgrm.ud.mss = mss; - p_desc->wr.dgrm.ud.header = TheLsoData.LsoBuffers[0].pData; - p_desc->wr.dgrm.ud.hlen = lso_header_size; - // Tell NDIS how much we will send. - PktExt->NdisPacketInfo[TcpLargeSendPacketInfo] = UlongToPtr(PacketLength); - p_desc->wr.send_opt |= (IB_SEND_OPT_TX_IP_CSUM | IB_SEND_OPT_TX_TCP_UDP_CSUM) | IB_SEND_OPT_SIGNALED; - __send_gen(p_port, p_desc, IndexOfData); - p_desc->wr.wr_type = WR_LSO; - } else { - - /* Setup the first local data segment (used for the IPoIB header). */ - p_desc->local_ds[0].vaddr = cl_get_physaddr( &p_port->hdr[hdr_idx] ); - p_desc->local_ds[0].length = sizeof(ipoib_hdr_t); - p_desc->local_ds[0].lkey = p_port->ib_mgr.lkey; - + } + else + { + uint32_t i; + cl_perf_start( SendMgrFilter ); status = __send_mgr_filter( - p_port, p_eth_hdr, p_buf, buf_len, p_desc); + p_port, p_eth_hdr, p_buf, buf_len, p_desc ); cl_perf_stop( &p_port->p_adapter->perf, SendMgrFilter ); if( status != NDIS_STATUS_SUCCESS ) { @@ -4224,46 +4289,52 @@ __build_send_desc( ("__send_mgr_filter returned 0x%08X.\n", status) ); return status; } - p_desc->wr.wr_type = WR_SEND; - p_desc->wr.send_opt = IB_SEND_OPT_SIGNALED; - } - - - /* Setup the work request. */ - p_desc->wr.p_next = NULL; - p_desc->wr.wr_id = (uintn_t)p_desc->p_pkt; - p_desc->wr.ds_array = p_desc->local_ds; - - /* check if we can send data through RC QP */ - if( !( p_eth_hdr->dst.addr[0] & (uint8_t)0x01 ) && - endpt_cm_get_state( p_desc->p_endpt) == IPOIB_CM_CONNECTED ) - { - p_desc->send_qp = p_desc->p_endpt->conn.h_work_qp; - } - else /* UD QP */ - { - if( p_port->p_adapter->params.send_chksum_offload && - ( pChecksumPktInfo->Transmit.NdisPacketChecksumV4 || - pChecksumPktInfo->Transmit.NdisPacketChecksumV6 )) + if( p_desc->send_dir == SEND_UD_QP ) { - // Set transimition checksum offloading - if( pChecksumPktInfo->Transmit.NdisPacketIpChecksum ) + p_desc->send_qp = p_port->ib_mgr.h_qp; // UD QP + for( i = 0; i < p_desc->num_wrs; i++ ) { - p_desc->wr.send_opt |= IB_SEND_OPT_TX_IP_CSUM; + p_desc->send_wr[i].wr.dgrm.ud.remote_qp = p_desc->p_endpt->qpn; + p_desc->send_wr[i].wr.dgrm.ud.remote_qkey = p_port->ib_mgr.bcast_rec.qkey; + p_desc->send_wr[i].wr.dgrm.ud.h_av = p_desc->p_endpt->h_av; + p_desc->send_wr[i].wr.dgrm.ud.pkey_index = p_port->pkey_index; + p_desc->send_wr[i].wr.dgrm.ud.rsvd = NULL; + p_desc->send_wr[i].wr.send_opt = 0; + + if( p_port->p_adapter->params.send_chksum_offload && + ( pChecksumPktInfo->Transmit.NdisPacketChecksumV4 || + pChecksumPktInfo->Transmit.NdisPacketChecksumV6 )) + { + // Set transimition checksum offloading + if( pChecksumPktInfo->Transmit.NdisPacketIpChecksum ) + { + p_desc->send_wr[i].wr.send_opt |= IB_SEND_OPT_TX_IP_CSUM; + } + if( pChecksumPktInfo->Transmit.NdisPacketTcpChecksum ) + { + p_desc->send_wr[i].wr.send_opt |= IB_SEND_OPT_TX_TCP_UDP_CSUM; + } + } } - if( pChecksumPktInfo->Transmit.NdisPacketTcpChecksum ) + } + else // RC QP + { + CL_ASSERT( p_desc->send_dir == SEND_RC_QP ); + p_desc->send_qp = p_desc->p_endpt->conn.h_work_qp; + } + for( i = 0; i < p_desc->num_wrs; i++ ) + { + p_desc->send_wr[i].wr.wr_type = WR_SEND; + p_desc->send_wr[i].wr.wr_id = (uintn_t)p_desc->p_pkt; + p_desc->send_wr[i].wr.ds_array = &p_desc->send_wr[i].local_ds[0]; + if( i ) { - p_desc->wr.send_opt |= IB_SEND_OPT_TX_TCP_UDP_CSUM; + p_desc->send_wr[i-1].wr.p_next = &p_desc->send_wr[i].wr; } } - - p_desc->send_qp = p_port->ib_mgr.h_qp; - p_desc->wr.dgrm.ud.remote_qp = p_desc->p_endpt->qpn; - p_desc->wr.dgrm.ud.remote_qkey = p_port->ib_mgr.bcast_rec.qkey; - p_desc->wr.dgrm.ud.h_av = p_desc->p_endpt->h_av; - p_desc->wr.dgrm.ud.pkey_index = p_port->pkey_index; - p_desc->wr.dgrm.ud.rsvd = NULL; + p_desc->send_wr[p_desc->num_wrs - 1].wr.send_opt |= IB_SEND_OPT_SIGNALED; + p_desc->send_wr[p_desc->num_wrs - 1].wr.p_next = NULL; } /* Store context in our reserved area of the packet. */ @@ -4275,6 +4346,82 @@ __build_send_desc( return NDIS_STATUS_SUCCESS; } +static NDIS_STATUS +__build_lso_desc( + IN ipoib_port_t* const p_port, + IN OUT ipoib_send_desc_t* const p_desc, + IN ULONG mss, + IN int32_t hdr_idx ) +{ + NDIS_STATUS status; + PNDIS_PACKET_EXTENSION PktExt; + LsoData TheLsoData; + INT IndexOfData = 0; + ULONG PhysBufCount; + ULONG PacketLength; + PNDIS_BUFFER FirstBuffer; + uint16_t lso_header_size; + + IPOIB_ENTER( IPOIB_DBG_SEND ); + + NdisQueryPacket(p_desc->p_pkt, (PUINT)&PhysBufCount, NULL, + &FirstBuffer,(PUINT)&PacketLength); + PktExt = NDIS_PACKET_EXTENSION_FROM_PACKET(p_desc->p_pkt); + + memset(&TheLsoData, 0, sizeof TheLsoData ); + status = GetLsoHeaderSize( + p_port, + FirstBuffer, + &TheLsoData, + &lso_header_size, + &IndexOfData, + &p_port->hdr[hdr_idx] ); + + if ((status != NDIS_STATUS_SUCCESS ) || + (TheLsoData.FullBuffers != TheLsoData.UsedBuffers)) + { + ASSERT(FALSE); + + IPOIB_PRINT(TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, ("<-- Throwing this packet\n")); + + //NdisReleaseSpinLock(&Port->SendLock); + //MP_ASSERT_NDIS_PACKET_TYPE(Packet); + //SendComplete(Port, Packet, NDIS_STATUS_INVALID_PACKET); + //NdisAcquireSpinLock(&Port->SendLock); + //IPOIB_PRINT_EXIT + if( status == NDIS_STATUS_SUCCESS ) + { + status = NDIS_STATUS_INVALID_PACKET; + } + return status; + } + ASSERT(lso_header_size > 0); + // Tell NDIS how much we will send. + PktExt->NdisPacketInfo[TcpLargeSendPacketInfo] = UlongToPtr(PacketLength); + + p_desc->send_wr[0].wr.dgrm.ud.mss = mss; + p_desc->send_wr[0].wr.dgrm.ud.header = TheLsoData.LsoBuffers[0].pData; + p_desc->send_wr[0].wr.dgrm.ud.hlen = lso_header_size; + p_desc->send_wr[0].wr.dgrm.ud.remote_qp = p_desc->p_endpt->qpn; + p_desc->send_wr[0].wr.dgrm.ud.remote_qkey = p_port->ib_mgr.bcast_rec.qkey; + p_desc->send_wr[0].wr.dgrm.ud.h_av = p_desc->p_endpt->h_av; + p_desc->send_wr[0].wr.dgrm.ud.pkey_index = p_port->pkey_index; + p_desc->send_wr[0].wr.dgrm.ud.rsvd = NULL; + + p_desc->send_wr[0].wr.wr_id = (uintn_t)p_desc->p_pkt; + p_desc->send_wr[0].wr.ds_array = p_desc->send_wr[0].local_ds; + p_desc->send_wr[0].wr.wr_type = WR_LSO; + p_desc->send_wr[0].wr.send_opt = + (IB_SEND_OPT_TX_IP_CSUM | IB_SEND_OPT_TX_TCP_UDP_CSUM) | IB_SEND_OPT_SIGNALED; + + p_desc->send_wr[0].wr.p_next = NULL; + p_desc->send_qp = p_port->ib_mgr.h_qp; + p_desc->send_dir = SEND_UD_QP; + status = __send_gen(p_port, p_desc, IndexOfData ); + + IPOIB_EXIT( IPOIB_DBG_SEND ); + return status; +} static inline void __process_failed_send( @@ -4315,7 +4462,7 @@ ipoib_port_send( eth_hdr_t *p_eth_hdr; NDIS_BUFFER *p_buf; UINT buf_len; - UINT tot_len; + ib_send_wr_t *p_wr_failed; PERF_DECLARE( GetEthHdr ); PERF_DECLARE( BuildSendDesc ); @@ -4354,11 +4501,12 @@ ipoib_port_send( desc.p_endpt = NULL; desc.p_buf = NULL; desc.send_qp = NULL; + desc.num_wrs = 1; /* Get the ethernet header so we can find the endpoint. */ cl_perf_start( GetEthHdr ); status = __send_mgr_get_eth_hdr( - p_packet_array[i], &p_buf, &p_eth_hdr, &buf_len, &tot_len ); + p_packet_array[i], &p_buf, &p_eth_hdr, &buf_len ); cl_perf_stop( &p_port->p_adapter->perf, GetEthHdr ); if( status != NDIS_STATUS_SUCCESS ) { @@ -4378,15 +4526,6 @@ ipoib_port_send( NDIS_BUFFER *p_ip_hdr_buf; UINT ip_hdr_buf_len; - /* drop multicast packets larger than UD MTU */ - if( p_port->p_adapter->params.cm_enabled && - tot_len > p_port->p_adapter->params.payload_mtu ) - { - cl_perf_start( ProcessFailedSends ); - __process_failed_send( p_port, &desc, NDIS_STATUS_SUCCESS ); - cl_perf_stop( &p_port->p_adapter->perf, ProcessFailedSends ); - continue; - } // Extract the ip hdr if(buf_len >= sizeof(ip_hdr_t)+ sizeof(eth_hdr_t)) { @@ -4459,7 +4598,7 @@ h_end: if( status == NDIS_STATUS_PENDING ) { ipoib_endpt_deref( desc.p_endpt ); - break; + continue; } cl_perf_start( ProcessFailedSends ); __process_failed_send( p_port, &desc, status ); @@ -4469,7 +4608,7 @@ h_end: /* Post the WR. */ cl_perf_start( PostSend ); - ib_status = p_port->p_adapter->p_ifc->post_send( desc.send_qp, &desc.wr, NULL ); + ib_status = p_port->p_adapter->p_ifc->post_send( desc.send_qp, &desc.send_wr[0].wr, &p_wr_failed ); cl_perf_stop( &p_port->p_adapter->perf, PostSend ); if( ib_status != IB_SUCCESS ) { @@ -4503,7 +4642,7 @@ ipoib_port_resume( eth_hdr_t *p_eth_hdr; NDIS_BUFFER *p_buf; UINT buf_len; - UINT tot_len; + ib_send_wr_t *p_wr_failed; PERF_DECLARE( GetEndpt ); PERF_DECLARE( BuildSendDesc ); @@ -4542,10 +4681,11 @@ ipoib_port_resume( desc.p_endpt = NULL; desc.p_buf = NULL; desc.send_qp = NULL; + desc.num_wrs = 1; /* Get the ethernet header so we can find the endpoint. */ status = __send_mgr_get_eth_hdr( - desc.p_pkt, &p_buf, &p_eth_hdr, &buf_len, &tot_len ); + desc.p_pkt, &p_buf, &p_eth_hdr, &buf_len ); if( status != NDIS_STATUS_SUCCESS ) { cl_perf_start( ProcessFailedSends ); @@ -4559,6 +4699,7 @@ ipoib_port_resume( cl_perf_stop( &p_port->p_adapter->perf, GetEndpt ); if( status == NDIS_STATUS_PENDING ) { + CL_ASSERT(desc.p_endpt == NULL); cl_qlist_insert_head( &p_port->send_mgr.pending_list, IPOIB_LIST_ITEM_FROM_PACKET( desc.p_pkt ) ); break; @@ -4566,6 +4707,7 @@ ipoib_port_resume( else if( status != NDIS_STATUS_SUCCESS ) { ASSERT( status == NDIS_STATUS_NO_ROUTE_TO_DESTINATION ); + CL_ASSERT(desc.p_endpt == NULL); if( ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) ) { @@ -4599,7 +4741,7 @@ ipoib_port_resume( { /* ARP REPLY packet queued */ ipoib_endpt_deref( desc.p_endpt ); - break; + continue; } cl_perf_start( ProcessFailedSends ); __process_failed_send( p_port, &desc, status ); @@ -4609,7 +4751,7 @@ ipoib_port_resume( /* Post the WR. */ cl_perf_start( PostSend ); - ib_status = p_port->p_adapter->p_ifc->post_send( desc.send_qp, &desc.wr, NULL ); + ib_status = p_port->p_adapter->p_ifc->post_send( desc.send_qp, &desc.send_wr[0].wr, &p_wr_failed ); cl_perf_stop( &p_port->p_adapter->perf, PostSend ); if( ib_status != IB_SUCCESS ) { @@ -4996,8 +5138,6 @@ __endpt_mgr_reset_all( cl_qmap_remove_item( &p_port->endpt_mgr.mac_endpts, &p_port->p_local_endpt->mac_item ); - cl_fmap_remove_item( &p_port->endpt_mgr.gid_endpts, - &p_port->p_local_endpt->gid_item ); cl_qmap_remove_item( &p_port->endpt_mgr.lid_endpts, &p_port->p_local_endpt->lid_item ); @@ -5087,8 +5227,10 @@ __endpt_mgr_reset_all( /* Destroy all multicast endpoints now that we have released the lock. */ while( cl_qlist_count( &mc_list ) ) { - cl_obj_destroy( &PARENT_STRUCT( cl_qlist_remove_head( &mc_list ), - ipoib_endpt_t, mac_item.pool_item.list_item )->obj ); + cl_list_item_t *p_item; + p_item = cl_qlist_remove_head( &mc_list ); + p_endpt = PARENT_STRUCT(p_item, ipoib_endpt_t, mac_item.pool_item.list_item); + cl_obj_destroy( &p_endpt->obj); } IPOIB_EXIT( IPOIB_DBG_ENDPT ); @@ -5110,8 +5252,11 @@ __endpt_mgr_remove( IPOIB_ENTER( IPOIB_DBG_ENDPT ); + /* This function must be called from the recieve path */ + CL_ASSERT(p_port->endpt_rdr > 0); + cl_obj_lock( &p_port->obj ); - /* Wait for all readers to complete. */ + /* Wait for all readers to complete. */ while( p_port->endpt_rdr > 1 ) ; @@ -5478,6 +5623,10 @@ __endpt_mgr_insert( p_qitem = cl_qmap_insert( &p_port->endpt_mgr.lid_endpts, p_endpt->dlid, &p_endpt->lid_item ); CL_ASSERT( p_qitem == &p_endpt->lid_item ); + if (p_qitem != &p_endpt->lid_item) { + // Since we failed to insert into the list, make sure it is not removed + p_endpt->dlid =0; + } } IPOIB_EXIT( IPOIB_DBG_ENDPT ); @@ -5503,7 +5652,7 @@ __endpt_mgr_add_bcast( /* Allocate the broadcast endpoint. */ p_endpt = ipoib_endpt_create( &p_mcast_rec->p_member_rec->mgid, - p_mcast_rec->p_member_rec->mlid, CL_HTON32(0x00FFFFFF) ); + 0 , CL_HTON32(0x00FFFFFF) ); if( !p_endpt ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, @@ -5604,51 +5753,6 @@ ipoib_port_remove_endpt( IPOIB_EXIT( IPOIB_DBG_ENDPT ); } - -void -ipoib_port_flush_endpts( - IN ipoib_port_t* const p_port ) -{ - cl_map_item_t *p_item; - ipoib_endpt_t *p_endpt; - - IPOIB_ENTER( IPOIB_DBG_ENDPT ); - - cl_obj_lock( &p_port->obj ); - p_item = cl_qmap_head( &p_port->endpt_mgr.mac_endpts ); - while( p_item != cl_qmap_end( &p_port->endpt_mgr.mac_endpts ) ) - { - p_endpt = PARENT_STRUCT( p_item, ipoib_endpt_t, mac_item ); - p_item = cl_qmap_next( p_item ); - - /* - * If the endpoint has been marked as expired before, and we have - * an AV handle, free the AV. - */ - if( p_endpt->expired && p_endpt->h_av ) - { - CL_ASSERT( p_endpt->obj.ref_cnt == 1 ); - p_port->p_adapter->p_ifc->destroy_av( p_endpt->h_av ); - p_endpt->h_av = NULL; - p_endpt->expired = FALSE; - } - - /* - * If the endpoint is not in use, mark it as expired. - * Note that the ref count is only zero when the endpoint gets - * destroyed, so an endpoint that is not in use has a ref count of 1. - * Also note that we never expire any multicast endpoints. - */ - CL_ASSERT( p_endpt->obj.ref_cnt != 0 ); - if( p_endpt->obj.ref_cnt == 1 && p_endpt->h_av && !p_endpt->h_mcast ) - p_endpt->expired = TRUE; - } - cl_obj_unlock( &p_port->obj ); - - IPOIB_EXIT( IPOIB_DBG_ENDPT ); -} - - /* * The sequence for port up is as follows: * 1. The port goes active. This allows the adapter to send SA queries @@ -5675,14 +5779,24 @@ ipoib_port_up( IPOIB_ENTER( IPOIB_DBG_INIT ); + cl_obj_lock( &p_port->obj ); + if ((p_port->state == IB_QPS_INIT) || + (p_port->state == IB_QPS_RTS)){ + cl_obj_unlock( &p_port->obj ); + status = STATUS_SUCCESS; + IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT, + ("p_port->state = %d - Aborting.\n", p_port->state) ); + goto up_done; + } + p_port->state = IB_QPS_INIT; + cl_obj_unlock( &p_port->obj ); + + /* Wait for all work requests to get flushed. */ while( p_port->recv_mgr.depth || p_port->send_mgr.depth ) cl_thread_suspend( 0 ); - cl_obj_lock( &p_port->obj ); - p_port->state = IB_QPS_INIT; KeResetEvent( &p_port->sa_event ); - cl_obj_unlock( &p_port->obj ); mad_out = (ib_mad_t*)cl_zalloc(256); if(! mad_out) @@ -5742,6 +5856,8 @@ up_done: ipoib_set_inactive( p_port->p_adapter ); __endpt_mgr_reset_all( p_port ); } + ASSERT(p_port->state == IB_QPS_INIT || p_port->state == IB_QPS_ERROR); + p_port->state = IB_QPS_ERROR; KeSetEvent( &p_port->sa_event, EVENT_INCREMENT, FALSE ); } @@ -5780,8 +5896,8 @@ __endpt_mgr_add_local( cl_memclr( &av_attr, sizeof(ib_av_attr_t) ); av_attr.port_num = p_port->port_num; av_attr.sl = 0; - IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ENDPT, - ("<__endpt_mgr_add_local>: av_attr.dlid = p_port_info->base_lid = %d\n",p_port_info->base_lid)); + IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ENDPT, + (" av_attr.dlid = p_port_info->base_lid = %d\n", cl_ntoh16( p_port_info->base_lid ) )); av_attr.dlid = p_port_info->base_lid; av_attr.static_rate = p_port->ib_mgr.rate; av_attr.path_bits = 0; @@ -5883,14 +5999,20 @@ __bcast_get_cb( cl_obj_lock( &p_port->obj ); p_port->ib_mgr.h_query = NULL; + + CL_ASSERT(p_port->state == IB_QPS_INIT || p_port->state == IB_QPS_ERROR); if( p_port->state != IB_QPS_INIT ) { status = IB_CANCELED; goto done; } - + status = p_query_rec->status; + IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT, + ("status of request %s\n", + p_port->p_adapter->p_ifc->get_err_str( status )) ); + switch( status ) { case IB_SUCCESS: @@ -5919,7 +6041,6 @@ __bcast_get_cb( NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, EVENT_IPOIB_BCAST_GET, 1, p_query_rec->status ); } - done: cl_obj_unlock( &p_port->obj ); @@ -5930,6 +6051,7 @@ done: ipoib_set_inactive( p_port->p_adapter ); __endpt_mgr_reset_all( p_port ); } + p_port->state = IB_QPS_ERROR; KeSetEvent( &p_port->sa_event, EVENT_INCREMENT, FALSE ); } @@ -6160,11 +6282,12 @@ __bcast_cb( p_port = (ipoib_port_t*)p_mcast_rec->mcast_context; cl_obj_lock( &p_port->obj ); + + ASSERT(p_port->state == IB_QPS_INIT || p_port->state == IB_QPS_ERROR); if( p_port->state != IB_QPS_INIT ) { cl_obj_unlock( &p_port->obj ); if( p_mcast_rec->status == IB_SUCCESS ) - { ipoib_port_ref(p_port, ref_leave_mcast); p_port->p_adapter->p_ifc->leave_mcast( p_mcast_rec->h_mcast, __leave_error_mcast_cb ); @@ -6175,9 +6298,7 @@ __bcast_cb( ("Invalid state - Aborting.\n") ); return; } - status = p_mcast_rec->status; - if( status != IB_SUCCESS ) { IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, @@ -6223,15 +6344,23 @@ __bcast_cb( { ipoib_set_inactive( p_port->p_adapter ); __endpt_mgr_reset_all( p_port ); + ASSERT(p_port->state == IB_QPS_INIT || p_port->state == IB_QPS_ERROR); + p_port->state = IB_QPS_ERROR; KeSetEvent( &p_port->sa_event, EVENT_INCREMENT, FALSE ); } ipoib_port_deref( p_port, ref_bcast_req_failed ); IPOIB_EXIT( IPOIB_DBG_INIT ); return; } - cl_obj_unlock( &p_port->obj ); p_port->bc_join_retry_cnt = 0; - if(! p_port->p_local_endpt) + + while( p_port->endpt_rdr ) + { + cl_obj_unlock( &p_port->obj ); + cl_obj_lock( &p_port->obj ); + } + + if( !p_port->p_local_endpt ) { ib_port_info_t port_info; cl_memclr(&port_info, sizeof(port_info)); @@ -6242,9 +6371,13 @@ __bcast_cb( IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, ("__endpt_mgr_add_local returned %s\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); + cl_obj_unlock( &p_port->obj ); goto err; } } + + cl_obj_unlock( &p_port->obj ); + status = __endpt_mgr_add_bcast( p_port, p_mcast_rec ); if( status != IB_SUCCESS ) { @@ -6268,6 +6401,8 @@ __bcast_cb( err: /* Flag the adapter as hung. */ p_port->p_adapter->hung = TRUE; + ASSERT(p_port->state == IB_QPS_INIT || p_port->state == IB_QPS_ERROR); + p_port->state = IB_QPS_ERROR; KeSetEvent( &p_port->sa_event, EVENT_INCREMENT, FALSE ); ipoib_port_deref( p_port, ref_bcast_error ); IPOIB_EXIT( IPOIB_DBG_INIT ); @@ -6276,8 +6411,10 @@ err: cl_obj_lock( &p_port->obj ); /* Only change the state if we're still in INIT. */ - if( p_port->state == IB_QPS_INIT ) + ASSERT( p_port->state == IB_QPS_INIT || p_port->state == IB_QPS_ERROR); + if (p_port->state == IB_QPS_INIT) { p_port->state = IB_QPS_RTS; + } cl_obj_unlock( &p_port->obj ); /* Prepost receives. */ @@ -6286,7 +6423,35 @@ err: cl_spinlock_release( &p_port->recv_lock ); /* Notify the adapter that we now have an active connection. */ - ipoib_set_active( p_port->p_adapter ); + status = ipoib_set_active( p_port->p_adapter ); + if( status != IB_SUCCESS ) + { + ib_qp_mod_t qp_mod; + ipoib_set_inactive( p_port->p_adapter ); + KeSetEvent( &p_port->sa_event, EVENT_INCREMENT, FALSE ); + IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT, + ("ipoib_set_active returned %s.\n",p_port->p_adapter->p_ifc->get_err_str( status ))); + cl_spinlock_acquire( &p_port->recv_lock ); + cl_obj_lock( &p_port->obj ); + p_port->state = IB_QPS_ERROR; + if( p_port->ib_mgr.h_query ) + { + p_port->p_adapter->p_ifc->cancel_query( + p_port->p_adapter->h_al, p_port->ib_mgr.h_query ); + p_port->ib_mgr.h_query = NULL; + } + cl_obj_unlock( &p_port->obj ); + cl_spinlock_release( &p_port->recv_lock ); + + CL_ASSERT( p_port->ib_mgr.h_qp ); + cl_memclr( &qp_mod, sizeof(ib_qp_mod_t) ); + qp_mod.req_state = IB_QPS_ERROR; + status = p_port->p_adapter->p_ifc->modify_qp( p_port->ib_mgr.h_qp, &qp_mod ); + __endpt_mgr_reset_all( p_port ); + + ipoib_port_deref( p_port, ref_join_bcast ); + return; + } if( p_port->p_adapter->params.cm_enabled && !p_port->p_local_endpt->conn.h_cm_listen ) @@ -6513,7 +6678,6 @@ __mcast_cb( ib_api_status_t status; ipoib_port_t *p_port; cl_fmap_item_t *p_item; - cl_map_item_t *p_qitem; ipoib_endpt_t *p_endpt; IPOIB_ENTER( IPOIB_DBG_MCAST ); @@ -6521,6 +6685,11 @@ __mcast_cb( p_port = (ipoib_port_t*)p_mcast_rec->mcast_context; cl_obj_lock( &p_port->obj ); + while( p_port->endpt_rdr ) + { + cl_obj_unlock( &p_port->obj ); + cl_obj_lock( &p_port->obj ); + } if( p_port->state != IB_QPS_RTS ) { cl_obj_unlock( &p_port->obj ); @@ -6535,10 +6704,10 @@ __mcast_cb( ("Invalid state - Aborting.\n") ); return; } - cl_obj_unlock( &p_port->obj ); if( p_mcast_rec->status != IB_SUCCESS ) { + cl_obj_unlock( &p_port->obj ); IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, ("Multicast join request failed with status %s.\n", p_port->p_adapter->p_ifc->get_err_str( p_mcast_rec->status )) ); @@ -6549,7 +6718,6 @@ __mcast_cb( return; } - cl_obj_lock( &p_port->obj ); p_item = cl_fmap_get( &p_port->endpt_mgr.gid_endpts, &p_mcast_rec->p_member_rec->mgid ); if( p_item == cl_fmap_end( &p_port->endpt_mgr.gid_endpts ) ) @@ -6591,14 +6759,9 @@ __mcast_cb( /* * The endpoint is already in the GID and MAC maps. - * Add it to the LID map if it has local scope. + * mast endpoint are not used in the LID map. */ - if( p_endpt->dlid ) - { - p_qitem = cl_qmap_insert( - &p_port->endpt_mgr.lid_endpts, p_endpt->dlid, &p_endpt->lid_item ); - CL_ASSERT( p_qitem == &p_endpt->lid_item ); - } + CL_ASSERT(p_endpt->dlid == 0); /* set flag that endpoint is use */ p_endpt->is_in_use = TRUE; cl_obj_unlock( &p_port->obj ); @@ -6728,7 +6891,7 @@ NDIS_STATUS GetLsoHeaderSize( } IpHdr = (ip_hdr_t UNALIGNED*)pSrc; IpHeaderLen = (uint16_t)IP_HEADER_LENGTH(IpHdr); - ASSERT(IpHdr->prot == PROTOCOL_TCP); + ASSERT(IpHdr->prot == IP_PROT_TCP); if (CurrLength < IpHeaderLen) { IPOIB_PRINT(TRACE_LEVEL_VERBOSE, IPOIB_DBG_ERROR, ("Error processing packets\n")); return status; @@ -6824,6 +6987,12 @@ static void __port_do_mcast_garbage(ipoib_port_t* const p_port) cl_qlist_init( &destroy_mc_list ); cl_obj_lock( &p_port->obj ); + /* Wait for all readers to finish */ + while( p_port->endpt_rdr ) + { + cl_obj_unlock( &p_port->obj ); + cl_obj_lock( &p_port->obj ); + } cnt = 0; p_item = cl_qmap_head( &p_port->endpt_mgr.mac_endpts ); while( (p_item != cl_qmap_end( &p_port->endpt_mgr.mac_endpts )) && (cnt < GC_MAX_LEAVE_NUM)) @@ -6862,7 +7031,7 @@ static void __port_do_mcast_garbage(ipoib_port_t* const p_port) /* Destroy all multicast endpoints now that we have released the lock. */ while( cl_qlist_count( &destroy_mc_list ) ) { - p_endpt = PARENT_STRUCT( cl_qlist_head( &destroy_mc_list ), + p_endpt = PARENT_STRUCT( cl_qlist_remove_head( &destroy_mc_list ), ipoib_endpt_t, mac_item.pool_item.list_item ); IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ENDPT, ("mcast garbage collector: destroying endpoint %02x:%02x:%02x:%02x:%02x:%02x \n", @@ -6872,9 +7041,7 @@ static void __port_do_mcast_garbage(ipoib_port_t* const p_port) p_endpt->mac.addr[3], p_endpt->mac.addr[4], p_endpt->mac.addr[5]) ); - - cl_obj_destroy( &PARENT_STRUCT( cl_qlist_remove_head( &destroy_mc_list ), - ipoib_endpt_t, mac_item.pool_item.list_item )->obj ); + cl_obj_destroy( &p_endpt->obj ); } } @@ -7019,3 +7186,321 @@ ipoib_endpt_get_path( IPOIB_EXIT( IPOIB_DBG_ENDPT ); return STATUS_SUCCESS; } + +/* +* Put all fragments into separate WR and chain together. +* The last WR will be set to generate CQ Event. +* lookaside buffer is used for ipoib and ip headers attached to each WR. +* Buffer will be released on last WR send completion. +*/ +static NDIS_STATUS +__send_fragments( +IN ipoib_port_t* const p_port, +IN ipoib_send_desc_t* const p_desc, +IN eth_hdr_t* const p_eth_hdr, +IN ip_hdr_t* const p_ip_hdr, +IN uint32_t buf_len, +IN NDIS_BUFFER* p_ndis_buf ) +{ + uint32_t ds_idx = 0; + uint32_t wr_idx = 0; + uint32_t sgl_idx = 2; //skip eth hdr, ip hdr + uint32_t options_len = 0; + uint8_t* p_options = NULL; + uint8_t* p_buf; + uint32_t frag_offset = 0; + uint32_t next_sge; + uint32_t wr_size = 0; + uint32_t ip_hdr_len = IP_HEADER_LENGTH( p_ip_hdr ); + uint32_t total_ip_len = cl_ntoh16( p_ip_hdr->length ); + + SCATTER_GATHER_LIST *p_sgl; + + IPOIB_ENTER( IPOIB_DBG_SEND ); + + if( IP_DONT_FRAGMENT(p_ip_hdr) ) + return NDIS_STATUS_INVALID_PACKET; + + p_sgl = NDIS_PER_PACKET_INFO_FROM_PACKET( p_desc->p_pkt, ScatterGatherListPacketInfo ); + if( !p_sgl ) + { + ASSERT( p_sgl ); + IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, + ("Failed to get SGL from packet.\n") ); + return NDIS_STATUS_FAILURE; + } + if( ( p_sgl->NumberOfElements > MAX_SEND_SGE || + p_sgl->Elements[0].Length < sizeof(eth_hdr_t)) ) + { + IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, + ("Too many SG Elements in packet.\n") ); + return NDIS_STATUS_FAILURE; + } + p_buf = (uint8_t *) + ExAllocateFromNPagedLookasideList( &p_port->buf_mgr.send_buf_list ); + if( !p_buf ) + { + IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, + ("Failed to allocate lookaside buffer.\n") ); + return NDIS_STATUS_RESOURCES; + } + p_desc->p_buf = (send_buf_t*)p_buf; + + /* build first fragment WR */ + ((ipoib_hdr_t*)p_buf)->type = p_eth_hdr->type; + ((ipoib_hdr_t*)p_buf)->resv = 0; + p_desc->send_wr[0].local_ds[0].vaddr = cl_get_physaddr( (void *)p_buf ); + p_desc->send_wr[0].local_ds[0].length = sizeof( ipoib_hdr_t ); + p_desc->send_wr[0].local_ds[0].lkey = p_port->ib_mgr.lkey; + + p_buf += sizeof( ipoib_hdr_t ); + + if( buf_len < ip_hdr_len ) + { /* ip options in a separate buffer */ + CL_ASSERT( buf_len == sizeof( ip_hdr_t ) ); + NdisGetNextBuffer( p_ndis_buf, &p_ndis_buf ); + if( !p_ndis_buf ) + { + IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, + ("Failed to get IP options buffer.\n") ); + return NDIS_STATUS_FAILURE; + } + NdisQueryBufferSafe( p_ndis_buf, &p_options, &options_len, NormalPagePriority ); + if( !p_options ) + { + IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, + ("Failed to query IP options buffer address.\n") ); + return NDIS_STATUS_FAILURE; + } + cl_memcpy( p_buf, p_ip_hdr, sizeof( ip_hdr_t ) ); + if( p_options && options_len ) + { + cl_memcpy( &p_buf[sizeof(ip_hdr_t)], p_options, options_len ); + } + wr_size = buf_len + options_len; + sgl_idx++; + } + else + { /*options probably in the same buffer */ + cl_memcpy( p_buf, p_ip_hdr, buf_len ); + options_len = ip_hdr_len - sizeof( ip_hdr_t ); + if( options_len ) + { + p_options = p_buf + sizeof( ip_hdr_t ); + } + frag_offset += ( buf_len - ip_hdr_len ); + wr_size = buf_len; + } + ++ds_idx; + + p_desc->send_wr[wr_idx].local_ds[ds_idx].vaddr = cl_get_physaddr( p_buf ); + p_desc->send_wr[wr_idx].local_ds[ds_idx].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[wr_idx].local_ds[ds_idx].length = wr_size; + + /* count how much data can be put into the first WR beside IP header. + * other protocols headers possibly supplied in subsequent buffers. + */ + for( sgl_idx; sgl_idx < p_sgl->NumberOfElements; sgl_idx++ ) + { + next_sge = p_sgl->Elements[sgl_idx].Length; + + /* add sgl if it can fit into the same WR + * Note: so far not going to split large SGE between WRs, + * so first fragment could be a smaller size. + */ + if( next_sge <= ( p_port->p_adapter->params.payload_mtu - wr_size ) ) + { + ++ds_idx; + wr_size += next_sge; + frag_offset += next_sge; + p_desc->send_wr[wr_idx].local_ds[ds_idx].vaddr = + p_sgl->Elements[sgl_idx].Address.QuadPart; + p_desc->send_wr[wr_idx].local_ds[ds_idx].length = next_sge; + p_desc->send_wr[wr_idx].local_ds[ds_idx].lkey = p_port->ib_mgr.lkey; + } + else + { + /* fix ip hdr for the first fragment and move on */ + __update_fragment_ip_hdr( (ip_hdr_t* const)p_buf, + (uint16_t)wr_size, IP_FRAGMENT_OFFSET(p_ip_hdr), TRUE ); + + p_desc->send_wr[wr_idx].wr.num_ds = ds_idx + 1; + p_buf += ip_hdr_len; + p_buf += (( buf_len > ip_hdr_len ) ? ( buf_len - ip_hdr_len ): 0); + frag_offset += ( (IP_FRAGMENT_OFFSET(p_ip_hdr)) << 3 ); + ++wr_idx; + ds_idx = 0; + break; + } + } + total_ip_len -= wr_size; + wr_size = 0; + + for( sgl_idx, wr_idx; sgl_idx < p_sgl->NumberOfElements; sgl_idx++ ) + { + uint32_t seg_len; + uint64_t next_sgl_addr; + + if( wr_idx >= ( MAX_WRS_PER_MSG - 1 ) ) + return NDIS_STATUS_RESOURCES; + + next_sge = p_sgl->Elements[sgl_idx].Length; + next_sgl_addr = p_sgl->Elements[sgl_idx].Address.QuadPart; + + while( next_sge ) + { + if( ds_idx == 0 ) + { /* new ipoib + ip header */ + ((ipoib_hdr_t*)p_buf)->type = p_eth_hdr->type; + ((ipoib_hdr_t*)p_buf)->resv = 0; + p_desc->send_wr[wr_idx].local_ds[ds_idx].vaddr = cl_get_physaddr( p_buf ); + p_desc->send_wr[wr_idx].local_ds[ds_idx].lkey = p_port->ib_mgr.lkey; + p_desc->send_wr[wr_idx].local_ds[ds_idx].length = sizeof( ipoib_hdr_t ); + p_buf += sizeof( ipoib_hdr_t ); + ++ds_idx; + + cl_memcpy( p_buf, p_ip_hdr, sizeof( ip_hdr_t ) ); + if( p_options && options_len ) + { + /* copy ip options if needed */ + __copy_ip_options( &p_buf[sizeof(ip_hdr_t)], + p_options, options_len, FALSE ); + } + wr_size = ip_hdr_len; + } + if( ds_idx == 1 ) + { + p_desc->send_wr[wr_idx].local_ds[ds_idx].length = ip_hdr_len; + p_desc->send_wr[wr_idx].local_ds[ds_idx].vaddr = cl_get_physaddr( p_buf ); + p_desc->send_wr[wr_idx].local_ds[ds_idx].lkey = p_port->ib_mgr.lkey; + ++ds_idx; + } + + seg_len = ( next_sge > ( p_port->p_adapter->params.payload_mtu - wr_size ) )? + ( p_port->p_adapter->params.payload_mtu - wr_size ) : next_sge; + + p_desc->send_wr[wr_idx].local_ds[ds_idx].vaddr = next_sgl_addr; + p_desc->send_wr[wr_idx].local_ds[ds_idx].length = seg_len; + p_desc->send_wr[wr_idx].local_ds[ds_idx].lkey = p_port->ib_mgr.lkey; + ++ds_idx; + + wr_size += seg_len; + total_ip_len -= seg_len; + + if( wr_size >= p_port->p_adapter->params.payload_mtu || total_ip_len == 0 ) + { /* fix ip hdr for that fragment */ + __update_fragment_ip_hdr( (ip_hdr_t* const)p_buf, (uint16_t)wr_size, + ((uint16_t)(frag_offset >> 3 )), + (BOOLEAN)(( total_ip_len > 0 ) || IP_MORE_FRAGMENTS( p_ip_hdr)) ); + p_desc->send_wr[wr_idx].wr.num_ds = ds_idx; + if( total_ip_len > 0 ) + { + ++wr_idx; + frag_offset += (wr_size - ip_hdr_len); + wr_size = 0; + ds_idx = 0; + p_buf += ip_hdr_len; + } + } + next_sge -= seg_len; + if( next_sge > 0 ) + { + next_sgl_addr += seg_len; + } + } + } + p_desc->num_wrs += wr_idx; + + IPOIB_EXIT( IPOIB_DBG_SEND ); + return NDIS_STATUS_SUCCESS; +} + +static void +__update_fragment_ip_hdr( +IN ip_hdr_t* const p_ip_hdr, +IN uint16_t fragment_size, +IN uint16_t fragment_offset, +IN BOOLEAN more_fragments ) +{ + + p_ip_hdr->length = cl_hton16( fragment_size ); // bytes + p_ip_hdr->offset = cl_hton16( fragment_offset ); // 8-byte units + if( more_fragments ) + { + IP_SET_MORE_FRAGMENTS( p_ip_hdr ); + } + else + { + IP_SET_LAST_FRAGMENT( p_ip_hdr ); + } + p_ip_hdr->chksum = 0; + p_ip_hdr->chksum = ipchksum( (uint16_t*)p_ip_hdr, IP_HEADER_LENGTH(p_ip_hdr) ); +} + +static void +__copy_ip_options( +IN uint8_t* p_buf, +IN uint8_t* p_options, +IN uint32_t options_len, +IN BOOLEAN copy_all ) +{ + uint32_t option_length; + uint32_t total_length = 0; + uint32_t copied_length = 0; + uint8_t* p_src = p_options; + uint8_t* p_dst = p_buf; + + if( p_options == NULL || options_len == 0 ) + return; + if( copy_all ) + { + cl_memcpy( p_dst, p_src, options_len ); + return; + } + do + { + if( ( *p_src ) == 0 ) // end of options list + { + total_length++; + break; + } + if( ( *p_src ) == 0x1 ) // no op + { + p_src++; + total_length++; + continue; + } + /*from RFC791: + * This option may be used between options, for example, to align + * the beginning of a subsequent option on a 32 bit boundary. + */ + if( copied_length && (copied_length % 4) ) + { + uint32_t align = 4 - (copied_length % 4); + cl_memset( p_dst, 0x1, (size_t)align ); + p_dst += align; + copied_length += align; + } + option_length = *(p_src + 1); + + if( *p_src & 0x80 ) + { + cl_memcpy( p_dst, p_src, option_length ); + p_dst += option_length; + copied_length += option_length; + } + total_length += option_length; + p_src += option_length; + + }while( total_length < options_len ); + + CL_ASSERT( total_length == options_len ); + CL_ASSERT( copied_length <= 40 ); + + /* padding the rest */ + if( options_len > copied_length ) + { + cl_memclr( p_dst, ( options_len - copied_length ) ); + } + return; +} diff --git a/branches/ipoib_cm/kernel/ipoib_port.h b/branches/ipoib_cm/kernel/ipoib_port.h index cbdbd2d6..c9418c67 100644 --- a/branches/ipoib_cm/kernel/ipoib_port.h +++ b/branches/ipoib_cm/kernel/ipoib_port.h @@ -337,11 +337,9 @@ typedef struct _ipoib_cm_desc cl_list_item_t list_item; uint8_t* p_alloc_buf; uint8_t* p_buf; - NDIS_PHYSICAL_ADDRESS phys_alloc_buf; uint32_t alloc_buf_size; uint32_t buf_size; net32_t lkey; - net32_t rkey; ib_mr_handle_t h_mr; NDIS_TCP_IP_CHECKSUM_PACKET_INFO ndis_csum; @@ -389,7 +387,17 @@ typedef struct _ipoib_recv_desc * The pool item is always first to allow casting form a cl_pool_item_t or * cl_list_item_t to the descriptor. *********/ +typedef struct __ipoib_send_wr +{ + ib_send_wr_t wr; + ib_local_ds_t local_ds[MAX_SEND_SGE]; /* Must be last. */ +} ipoib_send_wr_t; +typedef enum __send_dir +{ + SEND_UD_QP = 1, + SEND_RC_QP = 2 +} send_dir_t; typedef struct _ipoib_send_desc { @@ -397,9 +405,9 @@ typedef struct _ipoib_send_desc ipoib_endpt_t *p_endpt; send_buf_t *p_buf; ib_qp_handle_t send_qp; - ib_send_wr_t wr; - ipoib_hdr_t pkt_hdr; - ib_local_ds_t local_ds[MAX_SEND_SGE]; /* Must be last. */ + send_dir_t send_dir; + uint32_t num_wrs; + ipoib_send_wr_t send_wr[MAX_WRS_PER_MSG]; } ipoib_send_desc_t; /* @@ -529,6 +537,8 @@ typedef struct _ipoib_port ipoib_recv_mgr_t recv_mgr; ipoib_send_mgr_t send_mgr; + KDPC recv_dpc; + ipoib_endpt_mgr_t endpt_mgr; endpt_buf_mgr_t cm_buf_mgr; @@ -625,10 +635,6 @@ ipoib_port_remove_endpt( IN ipoib_port_t* const p_port, IN const mac_addr_t mac ); -void -ipoib_port_flush_endpts( - IN ipoib_port_t* const p_port ); - void ipoib_port_send( IN ipoib_port_t* const p_port, diff --git a/branches/ipoib_cm/kernel/ipoib_xfr_mgr.h b/branches/ipoib_cm/kernel/ipoib_xfr_mgr.h index d2ee06bf..cff2e31e 100644 --- a/branches/ipoib_cm/kernel/ipoib_xfr_mgr.h +++ b/branches/ipoib_cm/kernel/ipoib_xfr_mgr.h @@ -82,6 +82,7 @@ typedef struct _ipoib_hw_addr #include + #ifdef __cplusplus extern "C" { @@ -239,49 +240,53 @@ ipoib_mac_from_mlx_guid( return IB_SUCCESS; } +/* +* PARAMETERS +* port_guid +* The port GUID, in network byte order, for which to generate a +* MAC address. +* +* p_mac_addr +* Pointer to a mac address in which to store the results. +* +* RETURN VALUES +* IB_SUCCESS +* The MAC address was successfully converted. +* +* IB_INVALID_GUID +* The port GUID provided was not a known GUID format. +* +*********/ -/****f* IPOIB/ipoib_mac_from_dell_guid + +/****f* IPOIB/ipoib_mac_from_voltaire_guid * NAME -* ipoib_mac_from_dell_guid +* ipoib_mac_from_voltaire_guid * * DESCRIPTION -* Generates an ethernet MAC address given a DELL port GUID. +* Generates an ethernet MAC address given a Voltaire port GUID. * * SYNOPSIS */ static inline ib_api_status_t -ipoib_mac_from_dell_guid( +ipoib_mac_from_voltaire_guid( IN const net64_t port_guid, OUT mac_addr_t* const p_mac_addr ) { const uint8_t *p_guid = (const uint8_t*)&port_guid; /* Port guid is in network byte order. OUI is in lower 3 bytes. */ - ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x18 && p_guid[2] == 0x8b ); - + ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x08 && p_guid[2] == 0xf1 ); + p_mac_addr->addr[0] = p_guid[0]; p_mac_addr->addr[1] = p_guid[1]; p_mac_addr->addr[2] = p_guid[2]; - p_mac_addr->addr[3] = p_guid[5]; - p_mac_addr->addr[4] = p_guid[6]; - p_mac_addr->addr[5] = p_guid[7]; - + p_mac_addr->addr[3] = p_guid[4] ^ p_guid[6]; + p_mac_addr->addr[4] = p_guid[5] ^ p_guid[7]; + p_mac_addr->addr[5] = p_guid[5] + p_guid[6] + p_guid[7]; + return IB_SUCCESS; } -/* -* PARAMETERS -* port_guid -* The port GUID, in network byte order, for which to generate a -* MAC address. -* -* p_mac_addr -* Pointer to a mac address in which to store the results. -* -* RETURN VALUES -* IB_SUCCESS -* The MAC address was successfully converted. -* -*********/ /****f* IPOIB/ipoib_mac_from_guid_mask @@ -325,7 +330,6 @@ ipoib_mac_from_guid_mask( return IB_SUCCESS; } - /* * PARAMETERS * port_guid @@ -352,36 +356,6 @@ ipoib_mac_from_guid_mask( *********/ -/****f* IPOIB/ipoib_mac_from_voltaire_guid -* NAME -* ipoib_mac_from_voltaire_guid -* -* DESCRIPTION -* Generates an ethernet MAC address given a Voltaire port GUID. -* -* SYNOPSIS -*/ -static inline ib_api_status_t -ipoib_mac_from_voltaire_guid( - IN const net64_t port_guid, - OUT mac_addr_t* const p_mac_addr ) -{ - const uint8_t *p_guid = (const uint8_t*)&port_guid; - - /* Port guid is in network byte order. OUI is in lower 3 bytes. */ - ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x08 && p_guid[2] == 0xf1 ); - - p_mac_addr->addr[0] = p_guid[0]; - p_mac_addr->addr[1] = p_guid[1]; - p_mac_addr->addr[2] = p_guid[2]; - p_mac_addr->addr[3] = p_guid[4] ^ p_guid[6]; - p_mac_addr->addr[4] = p_guid[5] ^ p_guid[7]; - p_mac_addr->addr[5] = p_guid[5] + p_guid[6] + p_guid[7]; - - return IB_SUCCESS; -} - - /****f* IPOIB/ipoib_mac_from_guid * NAME * ipoib_mac_from_guid @@ -429,7 +403,8 @@ ipoib_mac_from_guid( status = ipoib_mac_from_sst_guid( port_guid, p_mac_addr ); } else if( p_guid[1] == 0x1a && p_guid[2] == 0x4b || - p_guid[1] == 0x17 && p_guid[2] == 0x08 ) + p_guid[1] == 0x17 && p_guid[2] == 0x08 || + p_guid[1] == 0x1e && p_guid[2] == 0x0b ) { //HP GUID status =ipoib_mac_from_guid_mask( p_guid, guid_default_mask, p_mac_addr ); @@ -486,143 +461,6 @@ ipoib_mac_from_guid( *********/ -/****f* IPOIB/ipoib_sst_guid_from_mac -* NAME -* ipoib_sst_guid_from_mac -* -* DESCRIPTION -* Generates a port GUID given an ethernet MAC address. -* -* SYNOPSIS -*/ -static inline ib_api_status_t -ipoib_sst_guid_from_mac( - IN const mac_addr_t mac, - OUT net64_t* const p_port_guid ) -{ - uint8_t *p_guid = (uint8_t*)p_port_guid; - uint32_t low24; - - /* MAC address is in network byte order. OUI is in lower 3 bytes. */ - if( mac.addr[0] != 0x00 || - mac.addr[1] != 0x06 || - mac.addr[2] != 0x6a ) - { - return IB_INVALID_GUID; - } - - low24 = mac.addr[3] << 16 || mac.addr[4] << 8 || mac.addr[5]; - - low24 = 0x00FFF000 - low24; - /* Divide by two */ - low24 >>= 1; - /* Add the serial number base offset. */ - low24 += 0x101; - - /* OUI */ - p_guid[0] = mac.addr[0]; - p_guid[1] = mac.addr[1]; - p_guid[2] = mac.addr[2]; - /* Port number */ - p_guid[3] = mac.addr[5] & 0x01; - /* Type */ - p_guid[4] = 0x98; - /* Serial Number */ - p_guid[5] = (uint8_t)(low24 >> 16); - p_guid[6] = (uint8_t)(low24 >> 8); - p_guid[7] = (uint8_t)low24; - - return IB_SUCCESS; -} -/* -* PARAMETERS -* port_guid -* The port GUID, in network byte order, for which to generate a -* MAC address. -* -* p_mac_addr -* Pointer to a mac address in which to store the results. -* -* RETURN VALUES -* IB_SUCCESS -* The MAC address was successfully converted. -* -* IB_INVALID_GUID -* The port GUID provided was not a known GUID format. -* -* NOTES -* The algorithm to convert portGuid to MAC address is as per DN0074, and -* assumes a 2 port HCA. -* -* SEE ALSO -* IPOIB -*********/ - - -/****f* IPOIB/ipoib_mlx_guid_from_mac -* NAME -* ipoib_mlx_guid_from_mac -* -* DESCRIPTION -* Generates a port GUID given an ethernet MAC address. -* -* SYNOPSIS -*/ -static inline ib_api_status_t -ipoib_mlx_guid_from_mac( - IN const mac_addr_t mac, - OUT net64_t* const p_port_guid ) -{ - uint8_t *p_guid = (uint8_t*)p_port_guid; - uint32_t low24; - - /* MAC address is in network byte order. OUI is in lower 3 bytes. */ - if( mac.addr[0] != 0x00 || - mac.addr[1] != 0x02 || - mac.addr[2] != 0xc9 ) - { - return IB_INVALID_GUID; - } - - low24 = mac.addr[3] << 16 || mac.addr[4] << 8 || mac.addr[5]; - - /* OUI */ - p_guid[0] = mac.addr[0]; - p_guid[1] = mac.addr[1]; - p_guid[2] = mac.addr[2]; - p_guid[3] = 0x02; - p_guid[4] = 0x00; - /* Serial Number */ - p_guid[5] = (uint8_t)(low24 >> 16); - p_guid[6] = (uint8_t)(low24 >> 8); - p_guid[7] = (uint8_t)low24; - - return IB_SUCCESS; -} -/* -* PARAMETERS -* port_guid -* The port GUID, in network byte order, for which to generate a -* MAC address. -* -* p_mac_addr -* Pointer to a mac address in which to store the results. -* -* RETURN VALUES -* IB_SUCCESS -* The MAC address was successfully converted. -* -* IB_INVALID_GUID -* The port GUID provided was not a known GUID format. -* -* NOTES -* The algorithm to convert portGuid to MAC address is as -* -* SEE ALSO -* IPOIB -*********/ - - /****f* IPOIB/ipoib_is_voltaire_router_gid * NAME * ipoib_is_voltaire_router_gid diff --git a/branches/ipoib_cm/kernel/makefile.inc b/branches/ipoib_cm/kernel/makefile.inc index 8125bb69..4f29f500 100644 --- a/branches/ipoib_cm/kernel/makefile.inc +++ b/branches/ipoib_cm/kernel/makefile.inc @@ -15,4 +15,3 @@ STAMP=stampinf -a $(_BUILDARCH) $(INF_TARGET) : $(_INX)\$(INF_NAME).inx copy $(_INX)\$(@B).inx $@ $(STAMP) -f $@ -d * -v $(IB_MAJORVERSION).$(IB_MINORVERSION).$(IB_BUILDVERSION).$(OPENIB_REV) - diff --git a/branches/ipoib_cm/kernel/netipoib-xp32.inf b/branches/ipoib_cm/kernel/netipoib-xp32.inf index 3453ac0e..9abf1276 100644 --- a/branches/ipoib_cm/kernel/netipoib-xp32.inf +++ b/branches/ipoib_cm/kernel/netipoib-xp32.inf @@ -7,7 +7,7 @@ Signature = "$Windows NT$" Class = Net ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %OPENIB% -DriverVer=09/09/2008,2.0.0000.1576 +DriverVer=10/10/2008,2.0.0000.1630 CatalogFile=ipoib.cat [Manufacturer] @@ -21,12 +21,15 @@ ExcludeFromSelect = IBA\IPoIB [OPENIB.ntx86] %IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; Internet Protocol over InfiniBand Adapter +%IpoibDescP% = Ipoib.DDInstall, IBA\IPoIBP ; Internet Protocol over InfiniBand Adapter with partition key [OPENIB.ntamd64] %IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; Internet Protocol over InfiniBand Adapter +%IpoibDescP% = Ipoib.DDInstall, IBA\IPoIBP ; Internet Protocol over InfiniBand Adapter with partition key [OPENIB.ntia64] %IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; Internet Protocol over InfiniBand Adapter +%IpoibDescP% = Ipoib.DDInstall, IBA\IPoIBP ; Internet Protocol over InfiniBand Adapter with partition key [Ipoib.DDInstall.ntx86] Characteristics = 0x81 ; NCF_HAS_UI | NCF_VIRTUAL @@ -63,7 +66,7 @@ HKR, Ndi, Service, 0, "ipoib" HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" -HKR, Ndi\Params\RqDepth, ParamDesc, 0, "Receive Queue Depth" +HKR, Ndi\Params\RqDepth, ParamDesc, 0, %RQ_DEPTH_STR% HKR, Ndi\Params\RqDepth, Type, 0, "dword" HKR, Ndi\Params\RqDepth, Default, 0, "512" HKR, Ndi\Params\RqDepth, Optional, 0, "0" @@ -71,7 +74,7 @@ HKR, Ndi\Params\RqDepth, Min, 0, "128" HKR, Ndi\Params\RqDepth, Max, 0, "1024" HKR, Ndi\Params\RqDepth, Step, 0, "128" -HKR, Ndi\Params\RqLowWatermark, ParamDesc, 0, "Receive Queue Low Watermark" +HKR, Ndi\Params\RqLowWatermark, ParamDesc, 0, %RQ_WATERMARK_STR% HKR, Ndi\Params\RqLowWatermark, Type, 0, "dword" HKR, Ndi\Params\RqLowWatermark, Default, 0, "4" HKR, Ndi\Params\RqLowWatermark, Optional, 0, "0" @@ -79,7 +82,7 @@ HKR, Ndi\Params\RqLowWatermark, Min, 0, "2" HKR, Ndi\Params\RqLowWatermark, Max, 0, "8" HKR, Ndi\Params\RqLowWatermark, Step, 0, "1" -HKR, Ndi\Params\SqDepth, ParamDesc, 0, "Send Queue Depth" +HKR, Ndi\Params\SqDepth, ParamDesc, 0, %SQ_DEPTH_STR% HKR, Ndi\Params\SqDepth, Type, 0, "dword" HKR, Ndi\Params\SqDepth, Default, 0, "512" HKR, Ndi\Params\SqDepth, Optional, 0, "0" @@ -87,63 +90,84 @@ HKR, Ndi\Params\SqDepth, Min, 0, "128" HKR, Ndi\Params\SqDepth, Max, 0, "1024" HKR, Ndi\Params\SqDepth, Step, 0, "128" -HKR, Ndi\Params\SendChksum, ParamDesc, 0, "Send Checksum Offload" +HKR, Ndi\Params\SendChksum, ParamDesc, 0, %SQ_CSUM_STR% HKR, Ndi\Params\SendChksum, Type, 0, "enum" HKR, Ndi\Params\SendChksum, Default, 0, "1" HKR, Ndi\Params\SendChksum, Optional, 0, "0" -HKR, Ndi\Params\SendChksum\enum, "0", 0, "Disabled" -HKR, Ndi\Params\SendChksum\enum, "1", 0, "Enabled (if supported by HW)" -HKR, Ndi\Params\SendChksum\enum, "2", 0, "Bypass" +HKR, Ndi\Params\SendChksum\enum, "0", 0, %DISABLED_STR% +HKR, Ndi\Params\SendChksum\enum, "1", 0, %ENABLED_IF_STR% +HKR, Ndi\Params\SendChksum\enum, "2", 0, %BYPASS_STR% -HKR, Ndi\Params\RecvChksum, ParamDesc, 0, "Recv Checksum Offload" +HKR, Ndi\Params\RecvChksum, ParamDesc, 0, %RQ_CSUM_STR% HKR, Ndi\Params\RecvChksum, Type, 0, "enum" HKR, Ndi\Params\RecvChksum, Default, 0, "1" HKR, Ndi\Params\RecvChksum, Optional, 0, "0" -HKR, Ndi\Params\RecvChksum\enum, "0", 0, "Disabled" -HKR, Ndi\Params\RecvChksum\enum, "1", 0, "Enabled (if supported by HW)" -HKR, Ndi\Params\RecvChksum\enum, "2", 0, "Bypass" +HKR, Ndi\Params\RecvChksum\enum, "0", 0, %DISABLED_STR% +HKR, Ndi\Params\RecvChksum\enum, "1", 0, %ENABLED_IF_STR% +HKR, Ndi\Params\RecvChksum\enum, "2", 0, %BYPASS_STR% -HKR, Ndi\Params\lso, ParamDesc, 0, "Large Send Offload" +HKR, Ndi\Params\lso, ParamDesc, 0, %LSO_STR% HKR, Ndi\Params\lso, Type, 0, "enum" HKR, Ndi\Params\lso, Default, 0, "0" HKR, Ndi\Params\lso, Optional, 0, "0" -HKR, Ndi\Params\lso\enum, "0", 0, "Disabled" -HKR, Ndi\Params\lso\enum, "1", 0, "Enabled" +HKR, Ndi\Params\lso\enum, "0", 0, %DISABLED_STR% +HKR, Ndi\Params\lso\enum, "1", 0, %ENABLED_STR% -HKR, Ndi\Params\SaTimeout, ParamDesc, 0, "SA Query Timeout (ms)" +HKR, Ndi\Params\SaTimeout, ParamDesc, 0, %SA_QUERY_TO_STR% HKR, Ndi\Params\SaTimeout, Type, 0, "dword" HKR, Ndi\Params\SaTimeout, Default, 0, "1000" HKR, Ndi\Params\SaTimeout, Optional, 0, "0" HKR, Ndi\Params\SaTimeout, Min, 0, "500" HKR, Ndi\Params\SaTimeout, Step, 0, "250" -HKR, Ndi\Params\SaRetries, ParamDesc, 0, "SA Query Retry Count" +HKR, Ndi\Params\SaRetries, ParamDesc, 0, %SA_QUERY_RETRY_STR% HKR, Ndi\Params\SaRetries, Type, 0, "dword" HKR, Ndi\Params\SaRetries, Default, 0, "10" HKR, Ndi\Params\SaRetries, Optional, 0, "0" HKR, Ndi\Params\SaRetries, Min, 0, "1" -HKR, Ndi\Params\RecvRatio, ParamDesc, 0, "Receive Pool Ratio" +HKR, Ndi\Params\RecvRatio, ParamDesc, 0, %RECV_RATIO_STR% HKR, Ndi\Params\RecvRatio, Type, 0, "dword" HKR, Ndi\Params\RecvRatio, Default, 0, "1" HKR, Ndi\Params\RecvRatio, Optional, 0, "0" HKR, Ndi\Params\RecvRatio, Min, 0, "1" HKR, Ndi\Params\RecvRatio, Max, 0, "10" -HKR, Ndi\Params\PayloadMtu, ParamDesc, 0, "Payload Mtu size" +HKR, Ndi\Params\PayloadMtu, ParamDesc, 0, %MTU_STR% HKR, Ndi\Params\PayloadMtu, Type, 0, "dword" HKR, Ndi\Params\PayloadMtu, Default, 0, "2044" -HKR, Ndi\Params\PayloadMtu, Min, 0, "60" -HKR, Ndi\Params\PayloadMtu, Max, 0, "4092" +HKR, Ndi\Params\PayloadMtu, Min, 0, "512" +HKR, Ndi\Params\PayloadMtu, Max, 0, "65520" -HKR, Ndi\Params\MCLeaveRescan, ParamDesc, 0, "MC leave rescan (sec)" +HKR, Ndi\Params\MCLeaveRescan, ParamDesc, 0, %MC_RESCAN_STR% HKR, Ndi\Params\MCLeaveRescan, Type, 0, "dword" HKR, Ndi\Params\MCLeaveRescan, Default, 0, "260" HKR, Ndi\Params\MCLeaveRescan, Optional, 0, "0" HKR, Ndi\Params\MCLeaveRescan, Min, 0, "1" HKR, Ndi\Params\MCLeaveRescan, Max, 0, "3600" +HKR, Ndi\Params\GUIDMask, ParamDesc, 0, %GUID_MASK_STR% +HKR, Ndi\Params\GUIDMask, Type, 0, "dword" +HKR, Ndi\Params\GUIDMask, Default, 0, "0" +HKR, Ndi\Params\GUIDMask, Optional, 0, "0" +HKR, Ndi\Params\GUIDMask, Min, 0, "0" +HKR, Ndi\Params\GUIDMask, Max, 0, "252" + +HKR, Ndi\Params\BCJoinRetry, ParamDesc, 0, %BC_JOIN_RETRY_STR% +HKR, Ndi\Params\BCJoinRetry, Type, 0, "dword" +HKR, Ndi\Params\BCJoinRetry, Default, 0, "50" +HKR, Ndi\Params\BCJoinRetry, Optional, 0, "0" +HKR, Ndi\Params\BCJoinRetry, Min, 0, "0" +HKR, Ndi\Params\BCJoinRetry, Max, 0, "1000" + +HKR, Ndi\Params\CmEnabled, ParamDesc, 0, %CONNECTED_MODE_STR% +HKR, Ndi\Params\CmEnabled, Type, 0, "enum" +HKR, Ndi\Params\CmEnabled, Default, 0, "0" +HKR, Ndi\Params\CmEnabled, Optional, 0, "0" +HKR, Ndi\Params\CmEnabled\enum, "0", 0, %DISABLED_STR% +HKR, Ndi\Params\CmEnabled\enum, "1", 0, %ENABLED_STR% + [IpoibService] DisplayName = %IpoibServiceDispName% ServiceType = 1 ;%SERVICE_KERNEL_DRIVER% @@ -226,3 +250,22 @@ DIRID_SYSTEM_X86 = 16425 REG_DWORD = 0x00010001 REG_DWORD_NO_CLOBBER = 0x00010003 +RQ_DEPTH_STR = "Receive Queue depth" +RQ_WATERMARK_STR = "Receive Queue Low Watermark" +SQ_DEPTH_STR = "Send Queue Depth" +SQ_CSUM_STR = "Send Checksum Offload" +RQ_CSUM_STR = "Recv Checksum Offload" +LSO_STR = "Large Send Offload" +SA_QUERY_TO_STR = "SA Query Timeout (ms)" +SA_QUERY_RETRY_STR = "SA Query Retry Count" +RECV_RATIO_STR = "Receive Pool Ratio" +MTU_STR = "Payload Mtu size" +MC_RESCAN_STR = "MC leave rescan (sec)" +GUID_MASK_STR = "GUID bitwise mask" +BC_JOIN_RETRY_STR = "Number of retries connecting to bc" + +ENABLED_IF_STR = "Enabled (if supported by HW)" +ENABLED_STR = "Enabled" +DISABLED_STR = "Disabled" +BYPASS_STR = "Bypass" +CONNECTED_MODE_STR = "Connected mode" diff --git a/branches/ipoib_cm/kernel/netipoib.inx b/branches/ipoib_cm/kernel/netipoib.inx index b47f1818..52caeb5a 100644 --- a/branches/ipoib_cm/kernel/netipoib.inx +++ b/branches/ipoib_cm/kernel/netipoib.inx @@ -1,4 +1,4 @@ -; OpenIB Internet Protocol over InfiniBand Adapter +; OpenFabrics Alliance Internet Protocol over InfiniBand Adapter ; Copyright 2005 SilverStorm Technologies all Rights Reserved. ; Copyright 2006 Mellanox Technologies all Rights Reserved. @@ -7,7 +7,7 @@ Signature = "$Windows NT$" Class = Net ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %OPENIB% -DriverVer=05/15/2008,1.1.0000.1177 +DriverVer=06/11/2008,1.0.0000.1207 CatalogFile=ipoib.cat [Manufacturer] @@ -21,32 +21,38 @@ ExcludeFromSelect = IBA\IPoIB [OPENIB.ntx86] %IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; Internet Protocol over InfiniBand Adapter +%IpoibDescP% = Ipoib.DDInstall, IBA\IPoIBP ; Internet Protocol over InfiniBand Adapter with partition key [OPENIB.ntamd64] %IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; Internet Protocol over InfiniBand Adapter +%IpoibDescP% = Ipoib.DDInstall, IBA\IPoIBP ; Internet Protocol over InfiniBand Adapter with partition key [OPENIB.ntia64] %IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; Internet Protocol over InfiniBand Adapter +%IpoibDescP% = Ipoib.DDInstall, IBA\IPoIBP ; Internet Protocol over InfiniBand Adapter with partition key [Ipoib.DDInstall.ntx86] Characteristics = 0x81 ; NCF_HAS_UI | NCF_VIRTUAL AddReg = IpoibAddReg CopyFiles = IpoibCopyFiles -CopyFiles = WsdCopyFiles +CopyFiles = WsdCopyFiles +CopyFiles = NdCopyFiles [Ipoib.DDInstall.ntamd64] Characteristics = 0x81 ; NCF_HAS_UI | NCF_VIRTUAL AddReg = IpoibAddReg CopyFiles = IpoibCopyFiles -CopyFiles = WsdCopyFiles -CopyFiles = WOW64CopyFiles +CopyFiles = WsdCopyFiles +CopyFiles = NdCopyFiles +CopyFiles = WOW64CopyFiles [Ipoib.DDInstall.ntia64] Characteristics = 0x81 ; NCF_HAS_UI | NCF_VIRTUAL AddReg = IpoibAddReg CopyFiles = IpoibCopyFiles -CopyFiles = WsdCopyFiles -CopyFiles = WOW64CopyFiles +CopyFiles = WsdCopyFiles +CopyFiles = NdCopyFiles +CopyFiles = WOW64CopyFiles [Ipoib.DDInstall.ntx86.Services] AddService = ipoib, 2, IpoibService, IpoibEventLog @@ -58,11 +64,12 @@ AddService = ipoib, 2, IpoibService, IpoibEventLog AddService = ipoib, 2, IpoibService, IpoibEventLog [IpoibAddReg] +HKR, ,RDMACapable, %REG_DWORD%, 1 HKR, Ndi, Service, 0, "ipoib" HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" -HKR, Ndi\Params\RqDepth, ParamDesc, 0, "Receive Queue Depth" +HKR, Ndi\Params\RqDepth, ParamDesc, 0, %RQ_DEPTH_STR% HKR, Ndi\Params\RqDepth, Type, 0, "dword" HKR, Ndi\Params\RqDepth, Default, 0, "512" HKR, Ndi\Params\RqDepth, Optional, 0, "0" @@ -70,15 +77,15 @@ HKR, Ndi\Params\RqDepth, Min, 0, "128" HKR, Ndi\Params\RqDepth, Max, 0, "1024" HKR, Ndi\Params\RqDepth, Step, 0, "128" -HKR, Ndi\Params\RqLowWatermark, ParamDesc, 0, "Receive Queue Low Watermark" +HKR, Ndi\Params\RqLowWatermark, ParamDesc, 0, %RQ_WATERMARK_STR% HKR, Ndi\Params\RqLowWatermark, Type, 0, "dword" HKR, Ndi\Params\RqLowWatermark, Default, 0, "4" -HKR, Ndi\Params\RqLowWatermark, Optional, 0, "1" +HKR, Ndi\Params\RqLowWatermark, Optional, 0, "0" HKR, Ndi\Params\RqLowWatermark, Min, 0, "2" HKR, Ndi\Params\RqLowWatermark, Max, 0, "8" HKR, Ndi\Params\RqLowWatermark, Step, 0, "1" -HKR, Ndi\Params\SqDepth, ParamDesc, 0, "Send Queue Depth" +HKR, Ndi\Params\SqDepth, ParamDesc, 0, %SQ_DEPTH_STR% HKR, Ndi\Params\SqDepth, Type, 0, "dword" HKR, Ndi\Params\SqDepth, Default, 0, "512" HKR, Ndi\Params\SqDepth, Optional, 0, "0" @@ -86,61 +93,83 @@ HKR, Ndi\Params\SqDepth, Min, 0, "128" HKR, Ndi\Params\SqDepth, Max, 0, "1024" HKR, Ndi\Params\SqDepth, Step, 0, "128" -HKR, Ndi\Params\SendChksum, ParamDesc, 0, "Send Checksum Offload" +HKR, Ndi\Params\SendChksum, ParamDesc, 0, %SQ_CSUM_STR% HKR, Ndi\Params\SendChksum, Type, 0, "enum" HKR, Ndi\Params\SendChksum, Default, 0, "1" HKR, Ndi\Params\SendChksum, Optional, 0, "0" -HKR, Ndi\Params\SendChksum\enum, "0", 0, "Disabled" -HKR, Ndi\Params\SendChksum\enum, "1", 0, "Enabled (if supported by HW)" -HKR, Ndi\Params\SendChksum\enum, "2", 0, "Bypass" +HKR, Ndi\Params\SendChksum\enum, "0", 0, %DISABLED_STR% +HKR, Ndi\Params\SendChksum\enum, "1", 0, %ENABLED_IF_STR% +HKR, Ndi\Params\SendChksum\enum, "2", 0, %BYPASS_STR% -HKR, Ndi\Params\RecvChksum, ParamDesc, 0, "Recv Checksum Offload" +HKR, Ndi\Params\RecvChksum, ParamDesc, 0, %RQ_CSUM_STR% HKR, Ndi\Params\RecvChksum, Type, 0, "enum" HKR, Ndi\Params\RecvChksum, Default, 0, "1" HKR, Ndi\Params\RecvChksum, Optional, 0, "0" -HKR, Ndi\Params\RecvChksum\enum, "0", 0, "Disabled" -HKR, Ndi\Params\RecvChksum\enum, "1", 0, "Enabled (if supported by HW)" -HKR, Ndi\Params\RecvChksum\enum, "2", 0, "Bypass" +HKR, Ndi\Params\RecvChksum\enum, "0", 0, %DISABLED_STR% +HKR, Ndi\Params\RecvChksum\enum, "1", 0, %ENABLED_IF_STR% +HKR, Ndi\Params\RecvChksum\enum, "2", 0, %BYPASS_STR% -HKR, Ndi\Params\lso, ParamDesc, 0, "Large Send Offload" +HKR, Ndi\Params\lso, ParamDesc, 0, %LSO_STR% HKR, Ndi\Params\lso, Type, 0, "enum" HKR, Ndi\Params\lso, Default, 0, "0" HKR, Ndi\Params\lso, Optional, 0, "0" -HKR, Ndi\Params\lso\enum, "0", 0, "Disabled" -HKR, Ndi\Params\lso\enum, "1", 0, "Enabled" +HKR, Ndi\Params\lso\enum, "0", 0, %DISABLED_STR% +HKR, Ndi\Params\lso\enum, "1", 0, %ENABLED_STR% -HKR, Ndi\Params\SaTimeout, ParamDesc, 0, "SA Query Timeout (ms)" + +HKR, Ndi\Params\SaTimeout, ParamDesc, 0, %SA_QUERY_TO_STR% HKR, Ndi\Params\SaTimeout, Type, 0, "dword" HKR, Ndi\Params\SaTimeout, Default, 0, "1000" HKR, Ndi\Params\SaTimeout, Optional, 0, "0" HKR, Ndi\Params\SaTimeout, Min, 0, "500" HKR, Ndi\Params\SaTimeout, Step, 0, "250" -HKR, Ndi\Params\SaRetries, ParamDesc, 0, "SA Query Retry Count" +HKR, Ndi\Params\SaRetries, ParamDesc, 0, %SA_QUERY_RETRY_STR% HKR, Ndi\Params\SaRetries, Type, 0, "dword" HKR, Ndi\Params\SaRetries, Default, 0, "10" HKR, Ndi\Params\SaRetries, Optional, 0, "0" HKR, Ndi\Params\SaRetries, Min, 0, "1" -HKR, Ndi\Params\RecvRatio, ParamDesc, 0, "Receive Pool Ratio" +HKR, Ndi\Params\RecvRatio, ParamDesc, 0, %RECV_RATIO_STR% HKR, Ndi\Params\RecvRatio, Type, 0, "dword" HKR, Ndi\Params\RecvRatio, Default, 0, "1" HKR, Ndi\Params\RecvRatio, Optional, 0, "0" HKR, Ndi\Params\RecvRatio, Min, 0, "1" HKR, Ndi\Params\RecvRatio, Max, 0, "10" -HKR, Ndi\Params\PayloadMtu, ParamDesc, 0, "Payload Mtu size" +HKR, Ndi\Params\PayloadMtu, ParamDesc, 0, %MTU_STR% HKR, Ndi\Params\PayloadMtu, Type, 0, "dword" HKR, Ndi\Params\PayloadMtu, Default, 0, "2044" -HKR, Ndi\Params\PayloadMtu, Min, 0, "60" +HKR, Ndi\Params\PayloadMtu, Min, 0, "512" HKR, Ndi\Params\PayloadMtu, Max, 0, "65520" -HKR, Ndi\Params\CmEnabled, ParamDesc, 0, "Connected Mode" +HKR, Ndi\Params\MCLeaveRescan, ParamDesc, 0, %MC_RESCAN_STR% +HKR, Ndi\Params\MCLeaveRescan, Type, 0, "dword" +HKR, Ndi\Params\MCLeaveRescan, Default, 0, "260" +HKR, Ndi\Params\MCLeaveRescan, Optional, 0, "0" +HKR, Ndi\Params\MCLeaveRescan, Min, 0, "1" +HKR, Ndi\Params\MCLeaveRescan, Max, 0, "3600" + +HKR, Ndi\Params\GUIDMask, ParamDesc, 0, %GUID_MASK_STR% +HKR, Ndi\Params\GUIDMask, Type, 0, "dword" +HKR, Ndi\Params\GUIDMask, Default, 0, "0" +HKR, Ndi\Params\GUIDMask, Optional, 0, "0" +HKR, Ndi\Params\GUIDMask, Min, 0, "0" +HKR, Ndi\Params\GUIDMask, Max, 0, "252" + +HKR, Ndi\Params\BCJoinRetry, ParamDesc, 0, %BC_JOIN_RETRY_STR% +HKR, Ndi\Params\BCJoinRetry, Type, 0, "dword" +HKR, Ndi\Params\BCJoinRetry, Default, 0, "50" +HKR, Ndi\Params\BCJoinRetry, Optional, 0, "0" +HKR, Ndi\Params\BCJoinRetry, Min, 0, "0" +HKR, Ndi\Params\BCJoinRetry, Max, 0, "1000" + +HKR, Ndi\Params\CmEnabled, ParamDesc, 0, %CONNECTED_MODE_STR% HKR, Ndi\Params\CmEnabled, Type, 0, "enum" HKR, Ndi\Params\CmEnabled, Default, 0, "0" HKR, Ndi\Params\CmEnabled, Optional, 0, "0" -HKR, Ndi\Params\CmEnabled\enum, "0", 0, "Disabled" -HKR, Ndi\Params\CmEnabled\enum, "1", 0, "Enabled" +HKR, Ndi\Params\CmEnabled\enum, "0", 0, %DISABLED_STR% +HKR, Ndi\Params\CmEnabled\enum, "1", 0, %ENABLED_STR% [IpoibService] DisplayName = %IpoibServiceDispName% @@ -170,8 +199,13 @@ ipoib.sys,,,2 [WsdCopyFiles] ibwsd.dll,,,0x00000002 +[NdCopyFiles] +ibndprov.dll,,,0x00000002 +ndinstall.exe,,,0x00000002 + [WOW64CopyFiles] ibwsd.dll,ibwsd32.dll,,0x00000002 +ibndprov.dll,ibndprov32.dll,,0x00000002 [SourceDisksNames.x86] 1 = %IcsDisk1%,,,"" @@ -185,29 +219,60 @@ ibwsd.dll,ibwsd32.dll,,0x00000002 [SourceDisksFiles.x86] ipoib.sys = 1 ibwsd.dll = 1 +ibndprov.dll = 1 +ndinstall.exe = 1 [SourceDisksFiles.amd64] ipoib.sys = 1 ibwsd.dll = 1 ibwsd32.dll = 1 +ibndprov.dll = 1 +ibndprov32.dll = 1 +ndinstall.exe = 1 [SourceDisksFiles.ia64] ipoib.sys = 1 ibwsd.dll = 1 ibwsd32.dll = 1 +ibndprov.dll = 1 +ibndprov32.dll = 1 +ndinstall.exe = 1 [DestinationDirs] IpoibCopyFiles = %DIRID_DRIVERS% WsdCopyFiles = %DIRID_SYSTEM% +NdCopyFiles = %DIRID_SYSTEM% WOW64CopyFiles = %DIRID_SYSTEM_X86% DefaultDestDir = %DIRID_SYSTEM% [Strings] -OPENIB = "OpenIB Alliance" -IpoibDesc = "OpenIB IPoIB Adapter" +OPENIB = "OpenFabrics Alliance" +IpoibDesc = "OpenFabrics IPoIB Adapter" +IpoibDescP = "OpenFabrics IPoIB Adapter Partition" IpoibServiceDispName = "IPoIB" -IcsDisk1 = "OpenIB IPoIB Disk #1" +IcsDisk1 = "OpenFabrics IPoIB Disk #1" DIRID_SYSTEM = 11 DIRID_DRIVERS = 12 DIRID_SYSTEM_X86 = 16425 +REG_DWORD = 0x00010001 REG_DWORD_NO_CLOBBER = 0x00010003 + +RQ_DEPTH_STR = "Receive Queue depth" +RQ_WATERMARK_STR = "Receive Queue Low Watermark" +SQ_DEPTH_STR = "Send Queue Depth" +SQ_CSUM_STR = "Send Checksum Offload" +RQ_CSUM_STR = "Recv Checksum Offload" +LSO_STR = "Large Send Offload" +SA_QUERY_TO_STR = "SA Query Timeout (ms)" +SA_QUERY_RETRY_STR = "SA Query Retry Count" +RECV_RATIO_STR = "Receive Pool Ratio" +MTU_STR = "Payload Mtu size" +MC_RESCAN_STR = "MC leave rescan (sec)" +GUID_MASK_STR = "GUID bitwise mask" +BC_JOIN_RETRY_STR = "Number of retries connecting to bc" + +ENABLED_IF_STR = "Enabled (if supported by HW)" +ENABLED_STR = "Enabled" +DISABLED_STR = "Disabled" +BYPASS_STR = "Bypass" +CONNECTED_MODE_STR = "Connected mode" \ No newline at end of file -- 2.46.0