From 3aae7e8e0ccd791c281f92cb827fc3c6215b653c Mon Sep 17 00:00:00 2001 From: tzachid Date: Tue, 7 Mar 2006 12:07:53 +0000 Subject: [PATCH] [IPOIB\CORE] sync with main trunk git-svn-id: svn://openib.tc.cornell.edu/gen1@229 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- branches/MTHCA/core/al/al_ca.c | 32 +-- branches/MTHCA/core/al/al_ci_ca_shared.c | 13 +- branches/MTHCA/core/al/al_cm_qp.c | 17 +- branches/MTHCA/core/al/al_mad.c | 9 +- branches/MTHCA/core/al/al_query.c | 14 +- branches/MTHCA/core/bus/kernel/ib_bus.inf | 19 +- branches/MTHCA/core/complib/cl_memory.c | 3 - branches/MTHCA/hw/dirs | 2 +- branches/MTHCA/inc/iba/ib_types.h | 84 +++++- branches/MTHCA/inc/kernel/iba/ipoib_ifc.h | 3 +- branches/MTHCA/inc/oib_ver.h | 20 +- branches/MTHCA/inc/openib.def | 33 ++- branches/MTHCA/tests/dirs | 4 +- branches/MTHCA/tools/vstat/user/vstat_main.c | 80 +++--- branches/MTHCA/ulp/ipoib/kernel/SOURCES | 6 +- .../MTHCA/ulp/ipoib/kernel/ipoib_adapter.c | 128 ++++++--- .../MTHCA/ulp/ipoib/kernel/ipoib_adapter.h | 18 +- .../MTHCA/ulp/ipoib/kernel/ipoib_driver.c | 192 ++++++++++--- .../MTHCA/ulp/ipoib/kernel/ipoib_driver.h | 10 +- .../MTHCA/ulp/ipoib/kernel/ipoib_endpoint.c | 42 ++- branches/MTHCA/ulp/ipoib/kernel/ipoib_port.c | 269 +++++++++++++++--- branches/MTHCA/ulp/ipoib/kernel/ipoib_port.h | 6 + .../MTHCA/ulp/ipoib/kernel/ipoib_xfr_mgr.h | 138 ++++++++- branches/MTHCA/ulp/ipoib/kernel/netipoib.inf | 38 +-- 24 files changed, 891 insertions(+), 289 deletions(-) diff --git a/branches/MTHCA/core/al/al_ca.c b/branches/MTHCA/core/al/al_ca.c index f1bbf59f..7ebacd5c 100644 --- a/branches/MTHCA/core/al/al_ca.c +++ b/branches/MTHCA/core/al/al_ca.c @@ -51,12 +51,12 @@ static void __destroying_ca( IN struct _al_obj *p_obj ); -void -cleanup_ca( +static void +__cleanup_ca( IN struct _al_obj *p_obj ); -void -free_ca( +static void +__free_ca( IN struct _al_obj *p_obj ); @@ -123,10 +123,10 @@ open_ca( h_ca->pfn_event_cb = pfn_ca_event_cb; status = init_al_obj( &h_ca->obj, ca_context, TRUE, - __destroying_ca, cleanup_ca, free_ca ); + NULL, __cleanup_ca, __free_ca ); if( status != IB_SUCCESS ) { - free_ca( &h_ca->obj ); + __free_ca( &h_ca->obj ); CL_EXIT( AL_DBG_CA, g_al_dbg_lvl ); return status; } @@ -194,8 +194,11 @@ ib_close_ca( } +/* + * Release all resources associated with the CA. + */ static void -__destroying_ca( +__cleanup_ca( IN struct _al_obj *p_obj ) { #if defined(CL_KERNEL) @@ -208,19 +211,8 @@ __destroying_ca( h_ca->obj.p_ci_ca->verbs.um_close_ca( h_ca->obj.p_ci_ca->h_ci_ca, h_ca->h_um_ca ); } -#else - UNUSED_PARAM( p_obj ); #endif -} - -/* - * Release all resources associated with the CA. - */ -void -cleanup_ca( - IN struct _al_obj *p_obj ) -{ /* It is now safe to release the CI CA. */ if( p_obj->p_ci_ca ) release_ci_ca( PARENT_STRUCT( p_obj, ib_ca_t, obj ) ); @@ -228,8 +220,8 @@ cleanup_ca( -void -free_ca( +static void +__free_ca( IN struct _al_obj *p_obj ) { ib_ca_handle_t h_ca; diff --git a/branches/MTHCA/core/al/al_ci_ca_shared.c b/branches/MTHCA/core/al/al_ci_ca_shared.c index 25c639d6..a6b1a9e1 100644 --- a/branches/MTHCA/core/al/al_ci_ca_shared.c +++ b/branches/MTHCA/core/al/al_ci_ca_shared.c @@ -112,7 +112,7 @@ get_port_info( ib_api_status_t status; ib_ca_attr_t *p_ca_attr; uint32_t attr_size; - uintn_t i; + uint8_t i; CL_ENTER( AL_DBG_CA, g_al_dbg_lvl ); @@ -162,6 +162,17 @@ get_port_info( for( i = 0; i < p_ca_attr->num_ports; i++ ) { p_ci_ca->port_array[i] = p_ca_attr->p_port_attr[i].port_guid; + +#ifdef CL_KERNEL + /* Set the port's client reregister bit. */ + { + ib_port_attr_mod_t attr; + + attr.cap.client_reregister = TRUE; + ib_modify_ca( p_ci_ca->h_ca, i + 1, + IB_CA_MOD_IS_CLIENT_REREGISTER_SUPPORTED, &attr ); + } +#endif } cl_free( p_ca_attr ); diff --git a/branches/MTHCA/core/al/al_cm_qp.c b/branches/MTHCA/core/al/al_cm_qp.c index bc2c95c6..518284f3 100644 --- a/branches/MTHCA/core/al/al_cm_qp.c +++ b/branches/MTHCA/core/al/al_cm_qp.c @@ -1496,7 +1496,7 @@ ib_cm_rtu( status = al_cep_rtu( h_cm_rep.h_al, h_cm_rep.cid, p_cm_rtu->p_rtu_pdata, p_cm_rtu->rtu_length ); - if( status != IB_SUCCESS ) + if( status != IB_SUCCESS && status != IB_INVALID_STATE ) { err: /* Reject and abort the connection. */ @@ -1508,13 +1508,16 @@ err: cid = cl_atomic_xchg( &((al_conn_qp_t*)h_cm_rep.h_qp)->cid, AL_INVALID_CID ); - CL_ASSERT( cid == h_cm_rep.cid ); - - ref_al_obj( &h_cm_rep.h_qp->obj ); - if( al_destroy_cep( - h_cm_rep.h_al, h_cm_rep.cid, deref_al_obj ) != IB_SUCCESS ) + if( cid != AL_INVALID_CID ) { - deref_al_obj( &h_cm_rep.h_qp->obj ); + CL_ASSERT( cid == h_cm_rep.cid ); + + ref_al_obj( &h_cm_rep.h_qp->obj ); + if( al_destroy_cep( + h_cm_rep.h_al, h_cm_rep.cid, deref_al_obj ) != IB_SUCCESS ) + { + deref_al_obj( &h_cm_rep.h_qp->obj ); + } } AL_TRACE_EXIT( AL_DBG_ERROR, diff --git a/branches/MTHCA/core/al/al_mad.c b/branches/MTHCA/core/al/al_mad.c index 6c9d1e73..a76b7eb2 100644 --- a/branches/MTHCA/core/al/al_mad.c +++ b/branches/MTHCA/core/al/al_mad.c @@ -1256,13 +1256,16 @@ __destroying_mad_svc( * Since the MAD service is being destroyed, the user cannot be issuing * sends. */ + if( h_mad_svc->h_mad_reg ) + { #ifdef CL_KERNEL - old_irql = KeRaiseIrqlToDpcLevel(); + old_irql = KeRaiseIrqlToDpcLevel(); #endif - __check_send_queue( h_mad_svc ); + __check_send_queue( h_mad_svc ); #ifdef CL_KERNEL - KeLowerIrql( old_irql ); + KeLowerIrql( old_irql ); #endif + } cl_timer_destroy( &h_mad_svc->send_timer ); diff --git a/branches/MTHCA/core/al/al_query.c b/branches/MTHCA/core/al/al_query.c index f6fd620d..8dc88981 100644 --- a/branches/MTHCA/core/al/al_query.c +++ b/branches/MTHCA/core/al/al_query.c @@ -332,9 +332,17 @@ query_req_cb( CL_ASSERT( p_mad_response ); p_sa_mad = (ib_sa_mad_t*)p_mad_response->p_mad_buf; - query_rec.result_cnt = - ( ( p_mad_response->size - IB_SA_MAD_HDR_SIZE ) / - ib_get_attr_size( p_sa_mad->attr_offset ) ); + if (ib_get_attr_size( p_sa_mad->attr_offset ) != 0) + { + query_rec.result_cnt = + ( ( p_mad_response->size - IB_SA_MAD_HDR_SIZE ) / + ib_get_attr_size( p_sa_mad->attr_offset ) ); + } + else + { + query_rec.result_cnt = 0; + } + query_rec.p_result_mad = p_mad_response; } else diff --git a/branches/MTHCA/core/bus/kernel/ib_bus.inf b/branches/MTHCA/core/bus/kernel/ib_bus.inf index 55a51bf0..9b05bbe3 100644 --- a/branches/MTHCA/core/bus/kernel/ib_bus.inf +++ b/branches/MTHCA/core/bus/kernel/ib_bus.inf @@ -1,13 +1,12 @@ -; SilverStorm Technologies InfiniBand Bus Driver. +; OpenIB InfiniBand Bus Driver. ; Copyright 2005 SilverStorm Technologies all Rights Reserved. [Version] Signature="$Windows NT$" Class=System ClassGuid={4D36E97D-E325-11CE-BFC1-08002BE10318} -Provider=%SST% -CatalogFile=ibbus.cat -DriverVer=09/01/2005,3.0.0036.0 +Provider=%OPENIB% +DriverVer=01/12/2006,1.0.0000.213 ; ================= Device Install section ===================== @@ -83,7 +82,7 @@ dapl32d.dll=1 dapl32.dll=1 [Manufacturer] -%SST% = Ibbus.DeviceSection,ntx86,ntamd64,ntia64 +%OPENIB% = Ibbus.DeviceSection,ntx86,ntamd64,ntia64 [Ibbus.DeviceSection] ; empty since we don't support W9x/Me @@ -221,15 +220,15 @@ HKR,"Parameters","IocPollInterval",%REG_DWORD_NO_CLOBBER%,30000 HKR,"Parameters","DebugFlags",%REG_DWORD%,0x80000000 [Strings] -SST = "SilverStorm Technologies" +OPENIB = "OpenIB Alliance" Ibbus.DeviceDesc = "InfiniBand Fabric" VFx.DeviceDesc = "SilverStorm VFx" VEx.DeviceDesc = "SilverStorm VEx" Iou.DeviceDesc = "InfiniBand I/O Unit" -Ibbus.ServiceDesc = "SilverStorm InfiniBand Bus Driver" -Ibal.ServiceDesc = "SilverStorm InfiniBand Access Layer" -Iou.ServiceDesc = "SilverStorm InfiniBand I/O Unit Driver" -DiskId = "SilverStorm InfiniBand Access Layer installation disk" +Ibbus.ServiceDesc = "OpenIB InfiniBand Bus Driver" +Ibal.ServiceDesc = "OpenIB InfiniBand Access Layer" +Iou.ServiceDesc = "OpenIB InfiniBand I/O Unit Driver" +DiskId = "OpenIB InfiniBand Access Layer installation disk" SPSVCINST_NULL = 0x0 SPSVCINST_ASSOCSERVICE = 0x00000002 SERVICE_KERNEL_DRIVER = 1 diff --git a/branches/MTHCA/core/complib/cl_memory.c b/branches/MTHCA/core/complib/cl_memory.c index 671509c4..eec7a235 100644 --- a/branches/MTHCA/core/complib/cl_memory.c +++ b/branches/MTHCA/core/complib/cl_memory.c @@ -94,9 +94,6 @@ __cl_mem_track_start( void ) __cl_free_priv( gp_mem_tracker ); return; } - - cl_msg_out( "\n\n\n*** Memory tracker object address = %p ***\n\n\n", - gp_mem_tracker ); } diff --git a/branches/MTHCA/hw/dirs b/branches/MTHCA/hw/dirs index 0cf85a2c..5905f6c2 100644 --- a/branches/MTHCA/hw/dirs +++ b/branches/MTHCA/hw/dirs @@ -1,2 +1,2 @@ DIRS=\ - mt23108 + mthca diff --git a/branches/MTHCA/inc/iba/ib_types.h b/branches/MTHCA/inc/iba/ib_types.h index 2dfbbc9b..1d6b4560 100644 --- a/branches/MTHCA/inc/iba/ib_types.h +++ b/branches/MTHCA/inc/iba/ib_types.h @@ -3837,7 +3837,8 @@ typedef struct _ib_port_info #define IB_PORT_MPB_SHIFT 6 #define IB_PORT_LINK_SPEED_SHIFT 4 #define IB_PORT_LINK_SPEED_SUPPORTED_MASK 0xF0 - +#define IB_PORT_LINK_SPEED_ACTIVE_MASK 0xF0 +#define IB_PORT_LINK_SPEED_ENABLED_MASK 0x0F #define IB_PORT_CAP_RESV0 (CL_NTOH32(0x00000001)) #define IB_PORT_CAP_IS_SM (CL_NTOH32(0x00000002)) @@ -4110,13 +4111,54 @@ ib_port_info_set_link_speed_sup( * SEE ALSO *********/ +/****f* IBA Base: Types/ib_port_info_get_link_speed_active +* NAME +* ib_port_info_get_link_speed_active +* +* DESCRIPTION +* Returns the Link Speed Active value assigned to this port. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_port_info_get_link_speed_active( + IN const ib_port_info_t* const p_pi ) +{ + return( (uint8_t)((p_pi->link_speed & IB_PORT_LINK_SPEED_ACTIVE_MASK) >> + IB_PORT_LINK_SPEED_SHIFT) ); +} +/* +* PARAMETERS +* p_pi +* [in] Pointer to a PortInfo attribute. +* +* RETURN VALUES +* Returns the link speed active value assigned to this port. +* +* NOTES +* +* SEE ALSO +*********/ + + #define IB_LINK_WIDTH_ACTIVE_1X 1 #define IB_LINK_WIDTH_ACTIVE_4X 2 #define IB_LINK_WIDTH_ACTIVE_12X 8 +#define IB_LINK_SPEED_ACTIVE_2_5 1 +#define IB_LINK_SPEED_ACTIVE_5 2 +#define IB_LINK_SPEED_ACTIVE_10 4 + #define IB_PATH_RECORD_RATE_2_5_GBS 2 #define IB_PATH_RECORD_RATE_10_GBS 3 #define IB_PATH_RECORD_RATE_30_GBS 4 +#define IB_PATH_RECORD_RATE_5_GBS 5 +#define IB_PATH_RECORD_RATE_20_GBS 6 +#define IB_PATH_RECORD_RATE_40_GBS 7 +#define IB_PATH_RECORD_RATE_60_GBS 8 +#define IB_PATH_RECORD_RATE_80_GBS 9 +#define IB_PATH_RECORD_RATE_120_GBS 10 + /****f* IBA Base: Types/ib_port_info_compute_rate * NAME @@ -4127,27 +4169,41 @@ ib_port_info_set_link_speed_sup( * * SYNOPSIS */ - AL_INLINE uint8_t AL_API ib_port_info_compute_rate( IN const ib_port_info_t* const p_pi ) { - switch(p_pi->link_width_active) + switch( p_pi->link_width_active * p_pi->link_width_active * + ib_port_info_get_link_speed_active( p_pi ) ) { - case IB_LINK_WIDTH_ACTIVE_1X: - return IB_PATH_RECORD_RATE_2_5_GBS; + case 1: + return IB_PATH_RECORD_RATE_2_5_GBS; - case IB_LINK_WIDTH_ACTIVE_4X: - return IB_PATH_RECORD_RATE_10_GBS; + case 2: + return IB_PATH_RECORD_RATE_5_GBS; - case IB_LINK_WIDTH_ACTIVE_12X: - return IB_PATH_RECORD_RATE_30_GBS; + case 4: + return IB_PATH_RECORD_RATE_10_GBS; - default: - return IB_PATH_RECORD_RATE_2_5_GBS; + case 8: + return IB_PATH_RECORD_RATE_20_GBS; + + case 16: + return IB_PATH_RECORD_RATE_40_GBS; + + case 64: + return IB_PATH_RECORD_RATE_30_GBS; + + case 128: + return IB_PATH_RECORD_RATE_60_GBS; + + case 256: + return IB_PATH_RECORD_RATE_120_GBS; + + default: + return IB_PATH_RECORD_RATE_2_5_GBS; } } - /* * PARAMETERS * p_pi @@ -7574,6 +7630,7 @@ typedef struct _ib_ca_attr uint32_t vend_id; uint16_t dev_id; uint16_t revision; + uint64_t fw_ver; /* * Total size of the ca attributes in bytes @@ -7658,6 +7715,9 @@ typedef struct _ib_ca_attr * revision * Revision ID of this adapter * +* fw_ver +* Device Firmware version. +* * size * Total size in bytes for the HCA attributes. This size includes total * size required for all the variable members of the structure. If a diff --git a/branches/MTHCA/inc/kernel/iba/ipoib_ifc.h b/branches/MTHCA/inc/kernel/iba/ipoib_ifc.h index d723b825..f680f775 100644 --- a/branches/MTHCA/inc/kernel/iba/ipoib_ifc.h +++ b/branches/MTHCA/inc/kernel/iba/ipoib_ifc.h @@ -51,7 +51,7 @@ *********/ -#define IPOIB_INTERFACE_DATA_VERSION (4) +#define IPOIB_INTERFACE_DATA_VERSION (5) /* Interface definitions */ @@ -60,6 +60,7 @@ typedef struct _ipoib_ifc_data /* HCA and Port GUID */ net64_t ca_guid; net64_t port_guid; + uint8_t port_num; } ipoib_ifc_data_t; diff --git a/branches/MTHCA/inc/oib_ver.h b/branches/MTHCA/inc/oib_ver.h index 7d3caf2b..59a29d3f 100644 --- a/branches/MTHCA/inc/oib_ver.h +++ b/branches/MTHCA/inc/oib_ver.h @@ -33,22 +33,6 @@ #include #include -#ifndef VER_FILEMAJORVERSION -#define VER_FILEMAJORVERSION 1 -#endif - -#ifndef VER_FILEMINORVERSION -#define VER_FILEMINORVERSION 0 -#endif - -#ifndef VER_FILEBUILD -#define VER_FILEBUILD VER_OPENIB -#endif - -#ifndef VER_FILEREV -#define VER_FILEREV 0 -#endif - #if (VER_FILEBUILD < 10) #define VER_FILEBPAD "000" #elif (VER_FILEBUILD < 100) @@ -76,11 +60,11 @@ #ifdef VER_COMPANYNAME_STR #undef VER_COMPANYNAME_STR #endif -#define VER_COMPANYNAME_STR "OpenIB Alliance" +#define VER_COMPANYNAME_STR IB_COMPANYNAME #ifdef VER_PRODUCTNAME_STR #undef VER_PRODUCTNAME_STR #endif -#define VER_PRODUCTNAME_STR "OpenIB Windows" +#define VER_PRODUCTNAME_STR IB_PRODUCTNAME #define VER_LEGALCOPYRIGHT_STR "Copyright\xa9 2005 OpenIB Alliance" diff --git a/branches/MTHCA/inc/openib.def b/branches/MTHCA/inc/openib.def index 76cebece..58a14e23 100644 --- a/branches/MTHCA/inc/openib.def +++ b/branches/MTHCA/inc/openib.def @@ -1,3 +1,34 @@ !INCLUDE $(NTMAKEENV)\makefile.def -C_DEFINES=$(C_DEFINES) -DVER_OPENIB="$(VER_OPENIB)" +# Allow overriding the company name. +!IF !DEFINED(IB_COMPANYNAME) +IB_COMPANYNAME="""OpenIB\x20Alliance""" +!ENDIF + +# Allow overriding the product name. +!IF !DEFINED(IB_PRODUCTNAME) +IB_PRODUCTNAME="""OpenIB\x20Windows""" +!ENDIF + +!IF !DEFINED(IB_MAJORVERSION) +IB_MAJORVERSION=1 +!endif + +!IF !DEFINED(IB_MINORVERSION) +IB_MINORVERSION=0 +!endif + +!IF !DEFINED(IB_FILEBUILD) +IB_FILEBUILD=0 +!endif + +!IF !DEFINED(IB_FILEREV) +IB_FILEREV=$(OPENIB_REV) +!endif + +C_DEFINES=$(C_DEFINES) -DIB_COMPANYNAME=$(IB_COMPANYNAME) \ + -DIB_PRODUCTNAME=$(IB_PRODUCTNAME) \ + -DVER_FILEMAJORVERSION=$(IB_MAJORVERSION) \ + -DVER_FILEMINORVERSION=$(IB_MINORVERSION) \ + -DVER_FILEBUILD=$(IB_FILEBUILD) \ + -DVER_FILEREV=$(IB_FILEREV) diff --git a/branches/MTHCA/tests/dirs b/branches/MTHCA/tests/dirs index c6d59525..fc792b6c 100644 --- a/branches/MTHCA/tests/dirs +++ b/branches/MTHCA/tests/dirs @@ -1,4 +1,6 @@ DIRS=\ alts \ cmtest \ - wsd + wsd \ + ibat \ + limits diff --git a/branches/MTHCA/tools/vstat/user/vstat_main.c b/branches/MTHCA/tools/vstat/user/vstat_main.c index bbcb40f4..f6f780ef 100644 --- a/branches/MTHCA/tools/vstat/user/vstat_main.c +++ b/branches/MTHCA/tools/vstat/user/vstat_main.c @@ -44,6 +44,7 @@ #endif +#define VEND_ID_MELLNOX 0x02c9 /******************************************************************* @@ -139,10 +140,10 @@ void printPortInfo(ib_port_attr_t* portPtr, BOOLEAN fullPrint){ if(fullPrint){ printf("\t\tmax_msg_sz=0x%x (Max message size)\n", portPtr->max_msg_size); printf("\t\tcapability_mask=TBD\n"); - printf("\t\tmax_vl_num=0x%x (Maximum number of VL supported by this port)\n", portPtr->max_vls); + printf("\t\tmax_vl_num=0x%x (Maximum number of VL supported by this port)\n", portPtr->max_vls); printf("\t\tbad_pkey_counter=0x%x (Bad PKey counter)\n", portPtr->pkey_ctr); printf("\t\tqkey_viol_counter=0x%x (QKey violation counter)\n", portPtr->qkey_ctr); - printf("\t\tsm_sl=0x%x (IB_SL to be used in communication with subnet manager)\n", portPtr->sm_sl); + printf("\t\tsm_sl=0x%x (IB_SL to be used in communication with subnet manager)\n", portPtr->sm_sl); printf("\t\tpkey_tbl_len=0x%x (Current size of pkey table)\n", portPtr->num_pkeys); printf("\t\tgid_tbl_len=0x%x (Current size of GID table)\n", portPtr->num_gids); printf("\t\tsubnet_timeout=0x%x (Subnet Timeout for this port (see PortInfo))\n", portPtr->subnet_timeout); @@ -155,53 +156,58 @@ void printPortInfo(ib_port_attr_t* portPtr, BOOLEAN fullPrint){ -void vstat_print_ca_attr(ib_ca_attr_t* ca_attr, BOOLEAN fullPrint){ +void vstat_print_ca_attr(int idx, ib_ca_attr_t* ca_attr, BOOLEAN fullPrint){ int i; - printf("\thca_id=%s\n", ca_attr->dev_id==0x5a44?"InfiniHost0":"TBD"); //TODO: all HCAs and hadle multi HCAs - printf("\tpci_location={BUS=TBD,DEV/FUNC=TBD}\n"); + printf("\thca_idx=%d\n",idx); + printf("\tpci_location={BUS=NA,DEV/FUNC=NA}\n"); printf("\tvendor_id=0x%04x\n", ca_attr->vend_id); printf("\tvendor_part_id=0x%04x\n", ca_attr->dev_id); printf("\thw_ver=0x%x\n", ca_attr->revision); //TODO: ??? - printf("\tfw_ver=TBD\n"); - printf("\tPSID=TBD\n"); + if(ca_attr->vend_id == VEND_ID_MELLNOX){ + printf("\tfw_ver=%d.%.2d.%.4d\n", + (uint16_t )(ca_attr->fw_ver>>32), + (uint16_t)(ca_attr->fw_ver>>16), + (uint16_t )(ca_attr->fw_ver)); + }else{ + printf("\tfw_ver=0x%I64x\n",ca_attr->fw_ver); + } + printf("\tPSID=NA\n"); if(fullPrint){ - printf("\tnum_phys_ports = TBD\n"); + printf("\tnum_phys_ports = %d\n",ca_attr->num_ports); printf("\tmax_num_qp = 0x%x (Maximum Number of QPs supported)\n", ca_attr->max_qps); - printf("\tmax_qp_ous_wr = 0x%x (Maximum Number of oustanding WR on any WQ)\n", ca_attr->max_wrs); - printf("\tflags== TBD\n"); + printf("\tmax_qp_ous_wr = 0x%x (Maximum Number of oustanding WR on any WQ)\n", ca_attr->max_wrs); printf("\tmax_num_sg_ent = 0x%x (Max num of scatter/gather entries for WQE other than RD)\n", ca_attr->max_sges); - printf("\tmax_num_sg_ent_rd = 0x%x (Max num of scatter/gather entries for RD WQE)\n", ca_attr->max_rd_sges); - printf("\tmax_num_srq = TBD (Maximum Number of SRQs supported)\n"); - printf("\tmax_wqe_per_srq = TBD (Maximum Number of oustanding WR on any SRQ)\n"); - printf("\tmax_srq_sentries = TBD (Maximum Number of scatter entries for SRQ WQE)\n"); - printf("\tsrq_resize_supported = TBD (SRQ resize supported)\n"); - printf("\tmax_num_cq = 0x%x (Max num of supported CQs)\n", ca_attr->max_cqs); + printf("\tmax_num_sg_ent_rd = 0x%x (Max num of scatter/gather entries for RD WQE)\n", ca_attr->max_rd_sges); + printf("\tmax_num_srq = 0 (Maximum Number of SRQs supported)\n"); + printf("\tmax_wqe_per_srq = 0 (Maximum Number of oustanding WR on any SRQ)\n"); + printf("\tmax_srq_sentries = 0 (Maximum Number of scatter entries for SRQ WQE)\n"); + printf("\tsrq_resize_supported = 0 (SRQ resize supported)\n"); + printf("\tmax_num_cq = 0x%x (Max num of supported CQs)\n", ca_attr->max_cqs); printf("\tmax_num_ent_cq = 0x%x (Max num of supported entries per CQ)\n", ca_attr->max_cqes); - printf("\tmax_num_mr = 0x%x (Maximum number of memory region supported)\n", ca_attr->init_regions); + printf("\tmax_num_mr = 0x%x (Maximum number of memory region supported)\n", ca_attr->init_regions); printf("\tmax_mr_size = 0x%x (Largest contigous block of memory region in bytes)\n", ca_attr->init_region_size); - printf("\tmax_pd_num = 0x%x (Maximum number of protection domains supported)\n", ca_attr->max_pds); - printf("\tpage_size_cap = TBD (Largest page size supported by this HCA)\n"); - printf("\tmax_pkeys = TBD (Maximum number of partitions supported)\n"); + printf("\tmax_pd_num = 0x%x (Maximum number of protection domains supported)\n", ca_attr->max_pds); + printf("\tpage_size_cap = 0x%x (Largest page size supported by this HCA)\n",ca_attr->p_page_size[ca_attr->num_page_sizes-1]); printGUID(ca_attr->ca_guid); - printf("\tlocal_ca_ack_delay = 0x%x (Log2 4.096usec Max. RX to ACK or NAK delay)\n", ca_attr->local_ack_delay); - printf("\tmax_qp_ous_rd_atom = TBD (Maximum number of oust. RDMA read/atomic as target)\n"); - printf("\tmax_ee_ous_rd_atom = TBD (EE Maximum number of outs. RDMA read/atomic as target)\n"); - printf("\tmax_res_rd_atom = TBD (Max. Num. of resources used for RDMA read/atomic as target)\n"); - printf("\tmax_qp_init_rd_atom = TBD (Max. Num. of outs. RDMA read/atomic as initiator)\n"); - printf("\tmax_ee_init_rd_atom = TBD (EE Max. Num. of outs. RDMA read/atomic as initiator)\n"); - printf("\tatomic_cap = TBD (Level of Atomicity supported)\n"); + printf("\tlocal_ca_ack_delay = 0x%x (Log2 4.096usec Max. RX to ACK or NAK delay)\n", ca_attr->local_ack_delay); + printf("\tmax_qp_ous_rd_atom = 0x%x (Maximum number of oust. RDMA read/atomic as target)\n",ca_attr->max_qp_resp_res); + printf("\tmax_ee_ous_rd_atom = 0 (EE Maximum number of outs. RDMA read/atomic as target)\n"); + printf("\tmax_res_rd_atom = 0x%x (Max. Num. of resources used for RDMA read/atomic as target)\n",ca_attr->max_resp_res); + printf("\tmax_qp_init_rd_atom = 0x%x (Max. Num. of outs. RDMA read/atomic as initiator)\n",ca_attr->max_qp_init_depth); + printf("\tmax_ee_init_rd_atom = 0 (EE Max. Num. of outs. RDMA read/atomic as initiator)\n"); + printf("\tatomic_cap = %s (Level of Atomicity supported)\n",ca_attr->atomicity == IB_ATOMIC_GLOBAL?"GLOBAL": + ca_attr->atomicity == IB_ATOMIC_LOCAL?"LOCAL":"NORMAL"); printf("\tmax_ee_num = 0x0 (Maximum number of EEC supported)\n"); printf("\tmax_rdd_num = 0x0 (Maximum number of IB_RDD supported)\n"); - printf("\tmax_mw_num = 0x%x (Maximum Number of memory windows supported)\n", ca_attr->init_windows); - printf("\tmax_raw_ipv6_qp = 0x%x (Maximum number of Raw IPV6 QPs supported)\n", ca_attr->max_ipv6_qps); - printf("\tmax_raw_ethy_qp = 0x%x (Maximum number of Raw Ethertypes QPs supported)\n", ca_attr->max_ether_qps); + printf("\tmax_mw_num = 0x%x (Maximum Number of memory windows supported)\n", ca_attr->init_windows); + printf("\tmax_raw_ipv6_qp = 0x%x (Maximum number of Raw IPV6 QPs supported)\n", ca_attr->max_ipv6_qps); + printf("\tmax_raw_ethy_qp = 0x%x (Maximum number of Raw Ethertypes QPs supported)\n", ca_attr->max_ether_qps); printf("\tmax_mcast_grp_num = 0x%x (Maximum Number of multicast groups)\n", ca_attr->max_mcast_grps); - printf("\tmax_mcast_qp_attach_num = 0x%x(Maximum number of QP per multicast group)\n", ca_attr->max_qps_per_mcast_grp); - printf("\tmax_total_mcast_qp_attach_num = 0x%x(Maximum number of QPs which can be attached to a mcast grp)\n", ca_attr->max_mcast_qps); - printf("\tmax_ah_num = 0x%x (Maximum number of address handles)\n", ca_attr->max_addr_handles); - printf("\tmax_num_fmr = TBD (maximum number FMRs)\n"); - printf("\tmax_num_map_per_fmr = TBD (Maximum number of (re)maps per FMR before an unmap operation in required)\n"); + printf("\tmax_mcast_qp_attach_num = 0x%x (Maximum number of QP per multicast group)\n", ca_attr->max_qps_per_mcast_grp); + printf("\tmax_ah_num = 0x%x (Maximum number of address handles)\n", ca_attr->max_addr_handles); + printf("\tmax_num_fmr = 0 (Maximum number FMRs)\n"); + printf("\tmax_num_map_per_fmr = 0 (Maximum number of (re)maps per FMR before an unmap operation in required)\n"); }else{ printf("\tnum_phys_ports=%d\n", ca_attr->num_ports); } @@ -225,7 +231,7 @@ vstat_ca_attr( size_t guid_count; ib_net64_t *ca_guid_array; ib_ca_attr_t *vstat_ca_attr; - uintn_t i; + size_t i; ib_ca_handle_t h_ca = NULL; uint32_t bsize; ib_port_attr_mod_t port_attr_mod; @@ -338,7 +344,7 @@ vstat_ca_attr( /* Print_ca_attributes */ - vstat_print_ca_attr(vstat_ca_attr, fullPrint); + vstat_print_ca_attr((int)i, vstat_ca_attr, fullPrint); /* Free the memory */ diff --git a/branches/MTHCA/ulp/ipoib/kernel/SOURCES b/branches/MTHCA/ulp/ipoib/kernel/SOURCES index a7f370da..75f58a53 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/SOURCES +++ b/branches/MTHCA/ulp/ipoib/kernel/SOURCES @@ -2,11 +2,13 @@ TARGETNAME=ipoib TARGETPATH=..\..\..\bin\kernel\obj$(BUILD_ALT_DIR) TARGETTYPE=DRIVER -SOURCES= ipoib.rc \ +SOURCES= ipoib_log.mc \ + ipoib.rc \ ipoib_driver.c \ ipoib_adapter.c \ ipoib_endpoint.c \ - ipoib_port.c + ipoib_port.c \ + ipoib_ibat.c INCLUDES=..;..\..\..\inc;..\..\..\inc\kernel; diff --git a/branches/MTHCA/ulp/ipoib/kernel/ipoib_adapter.c b/branches/MTHCA/ulp/ipoib/kernel/ipoib_adapter.c index b1837474..7e90b6dd 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/ipoib_adapter.c +++ b/branches/MTHCA/ulp/ipoib/kernel/ipoib_adapter.c @@ -125,8 +125,6 @@ ipoib_create_adapter( ipoib_adapter_t *p_adapter; ib_api_status_t status; cl_status_t cl_status; - uint8_t port_num; - KLOCK_QUEUE_HANDLE hdl; IPOIB_ENTER( IPOIB_DBG_INIT ); @@ -163,10 +161,10 @@ ipoib_create_adapter( return status; } - port_num = IPOIB_GET_PORT_NUM_FROM_GUID(p_adapter->guids.port_guid); - - IPOIB_TRACE( IPOIB_DBG_INFO, - ("Port %d initializing\n", port_num) ); + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Port %016I64x (CA %016I64x port %d) initializing\n", + p_adapter->guids.port_guid, p_adapter->guids.ca_guid, + p_adapter->guids.port_num) ); /* Read configuration parameters. */ status = ipoib_get_adapter_params( wrapper_config_context, @@ -189,10 +187,6 @@ ipoib_create_adapter( return IB_ERROR; } - KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl ); - InsertHeadList( &g_ipoib.adapter_list, &p_adapter->entry ); - KeReleaseInStackQueuedSpinLock( &hdl ); - status = adapter_init( p_adapter ); if( status != IB_SUCCESS ) { @@ -243,7 +237,6 @@ ipoib_destroy_adapter( cl_mutex_acquire( &p_adapter->mutex ); cl_obj_lock( &p_adapter->obj ); p_adapter->state = IB_PNP_PORT_REMOVE; - cl_obj_unlock( &p_adapter->obj ); /* * Clear the pointer to the port object since the object destruction @@ -252,6 +245,8 @@ ipoib_destroy_adapter( */ p_adapter->p_port = NULL; + cl_obj_unlock( &p_adapter->obj ); + cl_mutex_release( &p_adapter->mutex ); cl_obj_destroy( &p_adapter->obj ); @@ -428,10 +423,19 @@ __adapter_destroying( p_adapter->h_pnp = NULL; } - KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl ); - ASSERT( !IsListEmpty( &g_ipoib.adapter_list ) ); - RemoveEntryList( &p_adapter->entry ); - KeReleaseInStackQueuedSpinLock( &hdl ); + if( p_adapter->packet_filter ) + { + KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl ); + cl_obj_lock( &p_adapter->obj ); + + ASSERT( cl_qlist_count( &g_ipoib.adapter_list ) ); + cl_qlist_remove_item( &g_ipoib.adapter_list, &p_adapter->entry ); + + p_adapter->packet_filter = 0; + + cl_obj_unlock( &p_adapter->obj ); + KeReleaseInStackQueuedSpinLock( &hdl ); + } IPOIB_EXIT( IPOIB_DBG_INIT ); } @@ -476,6 +480,7 @@ __ipoib_pnp_cb( { ib_api_status_t status; ipoib_adapter_t *p_adapter; + ipoib_port_t *p_port; ib_pnp_event_t old_state; IPOIB_ENTER( IPOIB_DBG_PNP ); @@ -527,17 +532,20 @@ __ipoib_pnp_cb( p_adapter->state = IB_PNP_PORT_ADD; cl_obj_unlock( &p_adapter->obj ); status = ipoib_create_port( p_adapter, - (ib_pnp_port_rec_t*)p_pnp_rec, &p_adapter->p_port ); + (ib_pnp_port_rec_t*)p_pnp_rec, &p_port ); + cl_obj_lock( &p_adapter->obj ); if( status != IB_SUCCESS ) { - cl_obj_lock( &p_adapter->obj ); p_adapter->state = old_state; cl_obj_unlock( &p_adapter->obj ); p_adapter->hung = TRUE; break; } - p_pnp_rec->context = p_adapter->p_port; + p_pnp_rec->context = p_port; + + p_adapter->p_port = p_port; + cl_obj_unlock( &p_adapter->obj ); break; case IB_PNP_PORT_REMOVE: @@ -546,9 +554,10 @@ __ipoib_pnp_cb( cl_obj_lock( &p_adapter->obj ); p_adapter->state = IB_PNP_PORT_REMOVE; - cl_obj_unlock( &p_adapter->obj ); - ipoib_port_destroy( p_adapter->p_port ); + p_port = p_adapter->p_port; p_adapter->p_port = NULL; + cl_obj_unlock( &p_adapter->obj ); + ipoib_port_destroy( p_port ); p_pnp_rec->context = NULL; status = IB_SUCCESS; break; @@ -618,7 +627,10 @@ __ipoib_pnp_cb( case IB_PNP_SM_CHANGE: case IB_PNP_GID_CHANGE: case IB_PNP_LID_CHANGE: - p_adapter->hung = TRUE; + cl_obj_lock( &p_adapter->obj ); + if( p_adapter->state == IB_PNP_PORT_ACTIVE ) + p_adapter->hung = TRUE; + cl_obj_unlock( &p_adapter->obj ); status = IB_SUCCESS; break; } @@ -732,6 +744,7 @@ __ipoib_pnp_dereg( IN void* context ) { ipoib_adapter_t* p_adapter; + ipoib_port_t* p_port; ib_api_status_t status; ib_pnp_event_t state; @@ -751,16 +764,17 @@ __ipoib_pnp_dereg( state = p_adapter->state; + /* Destroy the current port instance if it still exists. */ + p_port = p_adapter->p_port; + p_adapter->p_port = NULL; cl_obj_unlock( &p_adapter->obj ); - /* Destroy the current port instance if it still exists. */ - if( p_adapter->p_port ) - { - ipoib_port_destroy( p_adapter->p_port ); - p_adapter->p_port = NULL; - } + if( p_port ) + ipoib_port_destroy( p_port ); + /* Complete any pending OIDs. */ ipoib_resume_oids( p_adapter ); + ipoib_dereg_addrs( p_adapter ); if( state != IB_PNP_PORT_REMOVE ) { @@ -795,35 +809,65 @@ __ipoib_pnp_dereg( void ipoib_set_rate( IN ipoib_adapter_t* const p_adapter, - IN const uint8_t link_width ) + IN const uint8_t link_width, + IN const uint8_t link_speed ) { IPOIB_ENTER( IPOIB_DBG_INIT ); cl_obj_lock( &p_adapter->obj ); /* Set the link speed based on the IB link speed (1x vs 4x, etc). */ + switch( link_speed ) + { + case IB_LINK_SPEED_ACTIVE_2_5: + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link speed is 2.5Gs\n") ); + p_adapter->rate = IB_LINK_SPEED_ACTIVE_2_5; + break; + + case IB_LINK_SPEED_ACTIVE_5: + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link speed is 5G\n") ); + p_adapter->rate = IB_LINK_SPEED_ACTIVE_5; + break; + + case IB_LINK_SPEED_ACTIVE_10: + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link speed is 10G\n") ); + p_adapter->rate = IB_LINK_SPEED_ACTIVE_10; + break; + + default: + IPOIB_TRACE( IPOIB_DBG_ERROR, + ("Invalid link speed %d.\n", link_speed) ); + p_adapter->rate = 0; + } + switch( link_width ) { case IB_LINK_WIDTH_ACTIVE_1X: - IPOIB_TRACE( IPOIB_DBG_INFO, ("Link speed is 2.5Gbps\n") ); - p_adapter->rate = ONE_X_IN_100BPS; + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link width is 1X\n") ); + p_adapter->rate *= ONE_X_IN_100BPS; break; case IB_LINK_WIDTH_ACTIVE_4X: - IPOIB_TRACE( IPOIB_DBG_INFO, ("Link speed is 10Gbps\n") ); - p_adapter->rate = FOUR_X_IN_100BPS; + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link width is 4X\n") ); + p_adapter->rate *= FOUR_X_IN_100BPS; break; case IB_LINK_WIDTH_ACTIVE_12X: - IPOIB_TRACE( IPOIB_DBG_INFO, ("Link speed is 30Gbps\n") ); - p_adapter->rate = TWELVE_X_IN_100BPS; + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Link width is 12X\n") ); + p_adapter->rate *= TWELVE_X_IN_100BPS; break; default: - IPOIB_TRACE( IPOIB_DBG_INFO, ("Invalid rate.\n") ); + IPOIB_TRACE( IPOIB_DBG_ERROR, + ("Invalid link rate (%d).\n", link_width) ); p_adapter->rate = 0; } cl_obj_unlock( &p_adapter->obj ); - IPOIB_EXIT( IPOIB_DBG_INIT ); } @@ -864,14 +908,22 @@ ipoib_set_active( /* Join all programmed multicast groups. */ for( i = 0; i < p_adapter->mcast_array_size; i++ ) { - ipoib_port_join_mcast( p_adapter->p_port, p_adapter->mcast_array[i] ); + ipoib_port_join_mcast( + p_adapter->p_port, p_adapter->mcast_array[i] ); } /* Register all existing addresses. */ ipoib_reg_addrs( p_adapter ); - /* Now that we're in the broadcast group, notify that we have a link. */ + /* + * Now that we're in the broadcast group, notify that + * we have a link. + */ IPOIB_TRACE( IPOIB_DBG_INFO, ("Link UP!\n") ); + NdisWriteErrorLogEntry( p_adapter->h_adapter, + EVENT_IPOIB_PORT_UP + (p_adapter->rate/ONE_X_IN_100BPS), + 1, p_adapter->rate ); + NdisMIndicateStatus( p_adapter->h_adapter, NDIS_STATUS_MEDIA_CONNECT, NULL, 0 ); NdisMIndicateStatusComplete( p_adapter->h_adapter ); diff --git a/branches/MTHCA/ulp/ipoib/kernel/ipoib_adapter.h b/branches/MTHCA/ulp/ipoib/kernel/ipoib_adapter.h index ba67e240..3a1849a1 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/ipoib_adapter.h +++ b/branches/MTHCA/ulp/ipoib/kernel/ipoib_adapter.h @@ -58,8 +58,6 @@ /* * Macros */ -#define IPOIB_GET_PORT_NUM_FROM_GUID( __guid__ ) ( ((uint8_t *)&(__guid__))[PORT_NUM_INDEX_IN_GUID] + 1 ) -#define IPOIB_ADAPTER_GET_PORT_NUM(__p_adapter__) ( IPOIB_GET_PORT_NUM_FROM_GUID( (__p_adapter__)->guids.port_guid ) ) typedef struct _ipoib_params @@ -130,7 +128,7 @@ typedef struct _ipoib_adapter NDIS_HANDLE h_adapter; ipoib_ifc_data_t guids; - LIST_ENTRY entry; + cl_list_item_t entry; ib_al_handle_t h_al; ib_pnp_handle_t h_pnp; @@ -183,6 +181,13 @@ typedef struct _ipoib_adapter * guids * CA and port GUIDs returned by the bus driver. * +* entry +* List item for storing all adapters in a list for address translation. +* We add adapters when their packet filter is set to a non-zero value, +* and remove them when their packet filter is cleared. This is needed +* since user-mode removal events are generated after the packet filter +* is cleared, but before the adapter is destroyed. +* * h_al * AL handle for all IB resources. * @@ -378,7 +383,8 @@ ipoib_inc_send_stat( void ipoib_set_rate( IN ipoib_adapter_t* const p_adapter, - IN const uint8_t rate ); + IN const uint8_t link_width, + IN const uint8_t link_speed ); void @@ -394,4 +400,8 @@ void ipoib_reg_addrs( IN ipoib_adapter_t* const p_adapter ); +void +ipoib_dereg_addrs( + IN ipoib_adapter_t* const p_adapter ); + #endif /* _IPOIB_ADAPTER_H_ */ diff --git a/branches/MTHCA/ulp/ipoib/kernel/ipoib_driver.c b/branches/MTHCA/ulp/ipoib/kernel/ipoib_driver.c index 26ac3592..6850cdee 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/ipoib_driver.c +++ b/branches/MTHCA/ulp/ipoib/kernel/ipoib_driver.c @@ -33,6 +33,7 @@ #include "ipoib_driver.h" #include "ipoib_debug.h" #include "ipoib_port.h" +#include "ipoib_ibat.h" #include #include #include @@ -115,9 +116,6 @@ static const unsigned char VENDOR_ID[] = {0x00, 0x06, 0x6A, 0x00}; #define IB_INFINITE_SERVICE_LEASE 0xFFFFFFFF -#define DEFAULT_SA_TIMEOUT 250 -#define DEFAULT_SA_RETRIES 3 - /* Global driver debug level */ uint32_t g_ipoib_dbg_lvl = IPOIB_DBG_ERROR; @@ -219,9 +217,9 @@ static void __ipoib_ats_dereg_cb( IN void *context ); -static void -__ipoib_dereg_addrs( - IN ipoib_adapter_t* const p_adapter ); +static NTSTATUS +__ipoib_read_registry( + IN UNICODE_STRING* const p_registry_path ); //! Standard Windows Device Driver Entry Point @@ -262,10 +260,13 @@ DriverEntry( status = NDIS_STATUS_SUCCESS; ndis_handle = NULL; + __ipoib_read_registry(p_registry_path); + KeInitializeSpinLock( &g_ipoib.lock ); - InitializeListHead( &g_ipoib.adapter_list ); + cl_qlist_init( &g_ipoib.adapter_list ); - NdisMInitializeWrapper( &ndis_handle, p_drv_obj, p_registry_path, NULL ); + NdisMInitializeWrapper( + &g_ipoib.h_ndis_wrapper, p_drv_obj, p_registry_path, NULL ); memset(&characteristics, 0, sizeof(characteristics)); characteristics.MajorNdisVersion = MAJOR_NDIS_VERSION; @@ -286,19 +287,67 @@ DriverEntry( #endif status = NdisMRegisterMiniport( - ndis_handle, &characteristics, sizeof(characteristics) ); + g_ipoib.h_ndis_wrapper, &characteristics, sizeof(characteristics) ); if( status != NDIS_STATUS_SUCCESS ) { IPOIB_TRACE( IPOIB_DBG_ERROR, ("NdisMRegisterMiniport failed with status of %d\n", status) ); - NdisTerminateWrapper( ndis_handle, NULL ); + NdisTerminateWrapper( g_ipoib.h_ndis_wrapper, NULL ); CL_DEINIT; + return status; } - else + + NdisMRegisterUnloadHandler( g_ipoib.h_ndis_wrapper, ipoib_unload ); + + IPOIB_EXIT( IPOIB_DBG_INIT ); + return status; +} + + +static NTSTATUS +__ipoib_read_registry( + IN UNICODE_STRING* const p_registry_path ) +{ + NTSTATUS status; + /* Remember the terminating entry in the table below. */ + RTL_QUERY_REGISTRY_TABLE table[2]; + UNICODE_STRING param_path; + + IPOIB_ENTER( IPOIB_DBG_INIT ); + + RtlInitUnicodeString( ¶m_path, NULL ); + param_path.MaximumLength = p_registry_path->Length + + sizeof(L"\\Parameters"); + param_path.Buffer = cl_zalloc( param_path.MaximumLength ); + if( !param_path.Buffer ) { - NdisMRegisterUnloadHandler( ndis_handle, ipoib_unload ); + IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, + ("Failed to allocate parameters path buffer.\n") ); + return STATUS_INSUFFICIENT_RESOURCES; } + RtlAppendUnicodeStringToString( ¶m_path, p_registry_path ); + RtlAppendUnicodeToString( ¶m_path, L"\\Parameters" ); + + /* + * Clear the table. This clears all the query callback pointers, + * and sets up the terminating table entry. + */ + cl_memclr( table, sizeof(table) ); + + /* Setup the table entries. */ + table[0].Flags = RTL_QUERY_REGISTRY_DIRECT; + table[0].Name = L"DebugFlags"; + table[0].EntryContext = &g_ipoib_dbg_lvl; + table[0].DefaultType = REG_DWORD; + table[0].DefaultData = &g_ipoib_dbg_lvl; + table[0].DefaultLength = sizeof(ULONG); + + /* Have at it! */ + status = RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE, + param_path.Buffer, table, NULL, NULL ); + + cl_free( param_path.Buffer ); IPOIB_EXIT( IPOIB_DBG_INIT ); return status; } @@ -457,8 +506,11 @@ ipoib_get_adapter_guids( { NTSTATUS status; ib_al_ifc_data_t data; - IO_STACK_LOCATION io_stack; + IO_STACK_LOCATION io_stack, *p_fwd_io_stack; DEVICE_OBJECT *p_pdo; + IRP *p_irp; + KEVENT event; + IO_STATUS_BLOCK io_status; IPOIB_ENTER( IPOIB_DBG_INIT ); @@ -479,7 +531,34 @@ ipoib_get_adapter_guids( io_stack.Parameters.QueryInterface.InterfaceType = &GUID_IB_AL_INTERFACE; - status = cl_fwd_query_ifc( p_pdo, &io_stack ); + KeInitializeEvent( &event, NotificationEvent, FALSE ); + + /* Build the IRP for the HCA. */ + p_irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, p_pdo, + NULL, 0, NULL, &event, &io_status ); + if( !p_irp ) + { + IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, + ("Failed to allocate query interface IRP.\n") ); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Copy the request query parameters. */ + p_fwd_io_stack = IoGetNextIrpStackLocation( p_irp ); + p_fwd_io_stack->MinorFunction = IRP_MN_QUERY_INTERFACE; + p_fwd_io_stack->Parameters.QueryInterface = + io_stack.Parameters.QueryInterface; + p_irp->IoStatus.Status = STATUS_NOT_SUPPORTED; + + /* Send the IRP. */ + status = IoCallDriver( p_pdo, p_irp ); + if( status == STATUS_PENDING ) + { + KeWaitForSingleObject( &event, Executive, KernelMode, + FALSE, NULL ); + status = io_status.Status; + } + if( !NT_SUCCESS( status ) ) { IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, @@ -585,12 +664,16 @@ ipoib_initialize( ib_status = ipoib_start_adapter( p_adapter ); if( ib_status != IB_SUCCESS ) { + NdisWriteErrorLogEntry( h_adapter, + NDIS_ERROR_CODE_HARDWARE_FAILURE, 0 ); ipoib_destroy_adapter( p_adapter ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ipoib_start_adapter returned status %d.\n", ib_status ) ); return NDIS_STATUS_FAILURE; } + ipoib_ref_ibat(); + IPOIB_EXIT( IPOIB_DBG_INIT ); return status; } @@ -609,11 +692,15 @@ ipoib_halt( IPOIB_ENTER( IPOIB_DBG_INIT ); + ipoib_deref_ibat(); + CL_ASSERT( adapter_context ); p_adapter = (ipoib_adapter_t*)adapter_context; - IPOIB_TRACE( IPOIB_DBG_INFO, - ("Port %d halting\n", IPOIB_ADAPTER_GET_PORT_NUM(p_adapter)) ); + IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO, + ("Port %016I64x (CA %016I64x port %d) halting\n", + p_adapter->guids.port_guid, p_adapter->guids.ca_guid, + p_adapter->guids.port_num) ); ipoib_destroy_adapter( p_adapter ); @@ -691,7 +778,7 @@ ipoib_query_info( src_buf = &info; buf_len = sizeof(info); - port_num = IPOIB_ADAPTER_GET_PORT_NUM(p_adapter); + port_num = p_adapter->guids.port_num; switch( oid ) { @@ -1195,13 +1282,11 @@ __ipoib_get_tcp_task_offload( NDIS_TASK_OFFLOAD_HEADER *p_offload_hdr; NDIS_TASK_OFFLOAD *p_offload_task; NDIS_TASK_TCP_IP_CHECKSUM *p_offload_chksum; - uint8_t port_num; ULONG buf_len; - port_num = IPOIB_ADAPTER_GET_PORT_NUM(p_adapter); - IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO, - ("Port %d received query for OID_TCP_TASK_OFFLOAD\n", port_num) ); + ("Port %d received query for OID_TCP_TASK_OFFLOAD\n", + p_adapter->guids.port_num) ); buf_len = sizeof(NDIS_TASK_OFFLOAD_HEADER) + sizeof(NDIS_TASK_OFFLOAD) + @@ -1340,6 +1425,8 @@ ipoib_set_info( ULONG buf_len; uint8_t port_num; + + KLOCK_QUEUE_HANDLE hdl; IPOIB_ENTER( IPOIB_DBG_OID ); @@ -1354,7 +1441,7 @@ ipoib_set_info( *p_bytes_needed = 0; buf_len = sizeof(ULONG); - port_num = IPOIB_ADAPTER_GET_PORT_NUM(p_adapter); + port_num = p_adapter->guids.port_num; switch( oid ) { @@ -1372,6 +1459,7 @@ ipoib_set_info( } else { + KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl ); cl_obj_lock( &p_adapter->obj ); switch( p_adapter->state ) { @@ -1392,6 +1480,9 @@ ipoib_set_info( default: if( !p_adapter->packet_filter && (*(uint32_t*)info_buf) ) { + cl_qlist_insert_tail( + &g_ipoib.adapter_list, &p_adapter->entry ); + /* * Filter was zero, now non-zero. Register IP addresses * with SA. @@ -1403,12 +1494,17 @@ ipoib_set_info( /* * Filter was non-zero, now zero. Deregister IP addresses. */ - __ipoib_dereg_addrs( p_adapter ); + ipoib_dereg_addrs( p_adapter ); + + ASSERT( cl_qlist_count( &g_ipoib.adapter_list ) ); + cl_qlist_remove_item( + &g_ipoib.adapter_list, &p_adapter->entry ); } p_adapter->packet_filter = *(uint32_t*)info_buf; } cl_obj_unlock( &p_adapter->obj ); + KeReleaseInStackQueuedSpinLock( &hdl ); } break; @@ -1647,11 +1743,12 @@ void ipoib_resume_oids( IN ipoib_adapter_t* const p_adapter ) { - ULONG info; - NDIS_STATUS status; - boolean_t pending_query, pending_set; - pending_oid_t query_oid = {0}; - pending_oid_t set_oid = {0}; + ULONG info; + NDIS_STATUS status; + boolean_t pending_query, pending_set; + pending_oid_t query_oid = {0}; + pending_oid_t set_oid = {0}; + KLOCK_QUEUE_HANDLE hdl; IPOIB_ENTER( IPOIB_DBG_INIT ); @@ -1722,25 +1819,32 @@ ipoib_resume_oids( case OID_GEN_CURRENT_PACKET_FILTER: /* Validation already performed in the SetInformation path. */ + KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl ); cl_obj_lock( &p_adapter->obj ); if( !p_adapter->packet_filter && (*(PULONG)set_oid.p_buf) ) { + cl_qlist_insert_tail( + &g_ipoib.adapter_list, &p_adapter->entry ); /* - * Filter was zero, now non-zero. Register IP addresses - * with SA. - */ + * Filter was zero, now non-zero. Register IP addresses + * with SA. + */ ipoib_reg_addrs( p_adapter ); } else if( p_adapter->packet_filter && !(*(PULONG)set_oid.p_buf) ) { - /* - * Filter was non-zero, now zero. Deregister IP addresses. - */ - __ipoib_dereg_addrs( p_adapter ); + /* Filter was non-zero, now zero. Deregister IP addresses. */ + ipoib_dereg_addrs( p_adapter ); + + ASSERT( cl_qlist_count( &g_ipoib.adapter_list ) ); + cl_qlist_remove_item( + &g_ipoib.adapter_list, &p_adapter->entry ); } + p_adapter->packet_filter = *(PULONG)set_oid.p_buf; + cl_obj_unlock( &p_adapter->obj ); + KeReleaseInStackQueuedSpinLock( &hdl ); - p_adapter->packet_filter = *(PULONG)set_oid.p_buf; NdisMSetInformationComplete( p_adapter->h_adapter, status ); break; @@ -1793,7 +1897,7 @@ __ipoib_set_net_addr( IPOIB_ENTER( IPOIB_DBG_OID ); status = NDIS_STATUS_SUCCESS; - port_num = IPOIB_ADAPTER_GET_PORT_NUM(p_adapter); + port_num = p_adapter->guids.port_num; IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO, ("Port %d received set for OID_GEN_NETWORK_LAYER_ADDRESSES\n", @@ -2074,7 +2178,7 @@ ipoib_reg_addrs( IPOIB_ENTER( IPOIB_DBG_OID ); - port_num = IPOIB_ADAPTER_GET_PORT_NUM( p_adapter ); + port_num = p_adapter->guids.port_num; /* Setup our service call with things common to all calls */ cl_memset( &ib_service, 0, sizeof(ib_service) ); @@ -2092,8 +2196,8 @@ ipoib_reg_addrs( /* IP Address in question will be put in below */ ib_service.port_guid = p_adapter->guids.port_guid; - ib_service.timeout_ms = DEFAULT_SA_TIMEOUT; - ib_service.retry_cnt = DEFAULT_SA_RETRIES; + ib_service.timeout_ms = p_adapter->params.sa_timeout; + ib_service.retry_cnt = p_adapter->params.sa_retry_cnt; /* Can't set IB_FLAGS_SYNC here because I can't wait at dispatch */ ib_service.flags = 0; @@ -2179,8 +2283,8 @@ ipoib_reg_addrs( /* Object lock is held when this function is called. */ -static void -__ipoib_dereg_addrs( +void +ipoib_dereg_addrs( IN ipoib_adapter_t* const p_adapter ) { net_address_item_t *p_addr_item; @@ -2192,7 +2296,7 @@ __ipoib_dereg_addrs( for( idx = 0; idx < cl_vector_get_size( &p_adapter->ip_vector); idx++ ) { p_addr_item = (net_address_item_t*) - cl_vector_get_ptr( &p_adapter->ip_vector, idx ); + cl_vector_get_ptr( &p_adapter->ip_vector, idx ); if( !p_addr_item->p_reg ) continue; @@ -2226,7 +2330,7 @@ __ipoib_ats_reg_cb( CL_ASSERT( p_reg_svc_rec->svc_context ); p_reg = (ats_reg_t* __ptr64)p_reg_svc_rec->svc_context; - port_num = IPOIB_ADAPTER_GET_PORT_NUM( p_reg->p_adapter ); + port_num = p_reg->p_adapter->guids.port_num; cl_obj_lock( &p_reg->p_adapter->obj ); diff --git a/branches/MTHCA/ulp/ipoib/kernel/ipoib_driver.h b/branches/MTHCA/ulp/ipoib/kernel/ipoib_driver.h index 94bea711..a3bb2cf3 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/ipoib_driver.h +++ b/branches/MTHCA/ulp/ipoib/kernel/ipoib_driver.h @@ -34,6 +34,7 @@ #define _IPOIB_DRIVER_H_ +#include "ipoib_log.h" #include "ipoib_adapter.h" #include #include @@ -64,11 +65,15 @@ typedef struct _ipoib_globals { KSPIN_LOCK lock; - LIST_ENTRY adapter_list; + cl_qlist_t adapter_list; cl_qlist_t bundle_list; atomic32_t laa_idx; + NDIS_HANDLE h_ndis_wrapper; + NDIS_HANDLE h_ibat_dev; + volatile LONG ibat_ref; + } ipoib_globals_t; /* * FIELDS @@ -83,6 +88,9 @@ typedef struct _ipoib_globals * * laa_idx * Global counter for generating LAA MACs +* +* h_ibat_dev +* Device handle returned by NdisMRegisterDevice. *********/ extern ipoib_globals_t g_ipoib; diff --git a/branches/MTHCA/ulp/ipoib/kernel/ipoib_endpoint.c b/branches/MTHCA/ulp/ipoib/kernel/ipoib_endpoint.c index 2c62c2af..3d0a43fd 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/ipoib_endpoint.c +++ b/branches/MTHCA/ulp/ipoib/kernel/ipoib_endpoint.c @@ -159,6 +159,12 @@ ipoib_endpt_set_mcast( IPOIB_ENTER( IPOIB_DBG_ENDPT ); + IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO), + ("Create av for MAC: %02X-%02X-%02X-%02X-%02X-%02X\n", + p_endpt->mac.addr[0], p_endpt->mac.addr[1], + p_endpt->mac.addr[2], p_endpt->mac.addr[3], + p_endpt->mac.addr[4], p_endpt->mac.addr[5]) ); + status = __create_mcast_av( h_pd, port_num, p_mcast_rec->p_member_rec, &p_endpt->h_av ); if( status != IB_SUCCESS ) @@ -277,7 +283,8 @@ ipoib_endpt_queue( return NDIS_STATUS_SUCCESS; } - if( p_endpt->h_query ) + if( p_endpt->h_query || + p_endpt->qpn == CL_HTON32(0x00FFFFFF) ) { ipoib_endpt_deref( p_endpt ); IPOIB_EXIT( IPOIB_DBG_ENDPT ); @@ -379,20 +386,25 @@ __path_query_cb( av_attr.sl = ib_path_rec_sl( p_path ); av_attr.dlid = p_path->dlid; - if( p_path->dgid.unicast.prefix != IB_DEFAULT_SUBNET_PREFIX ) - { - flow_lbl = ib_path_rec_flow_lbl( p_path ); - /* Not on the same subnet, need GRH. */ - av_attr.grh_valid = TRUE; - av_attr.grh.ver_class_flow = ib_grh_set_ver_class_flow( - 6, p_path->tclass, flow_lbl ); - av_attr.grh.resv1 = 0; - av_attr.grh.resv2 = 0; - av_attr.grh.hop_limit = ib_path_rec_hop_limit( p_path ); - av_attr.grh.src_gid = p_path->sgid; - av_attr.grh.dest_gid = p_path->dgid; - } - else if( !p_endpt->dlid ) + /* + * We always send the GRH so that we preferably lookup endpoints + * by GID rather than by LID. This allows certain WHQL tests + * such as the 2c_MediaCheck test to succeed since they don't use + * IP. This allows endpoints to be created on the fly for requests + * for which there is no match, something that doesn't work when + * using LIDs only. + */ + flow_lbl = ib_path_rec_flow_lbl( p_path ); + av_attr.grh_valid = TRUE; + av_attr.grh.ver_class_flow = ib_grh_set_ver_class_flow( + 6, p_path->tclass, flow_lbl ); + av_attr.grh.resv1 = 0; + av_attr.grh.resv2 = 0; + av_attr.grh.hop_limit = ib_path_rec_hop_limit( p_path ); + av_attr.grh.src_gid = p_path->sgid; + av_attr.grh.dest_gid = p_path->dgid; + + if( !p_endpt->dlid ) { /* This is a subnet local endpoint that does not have its LID set. */ p_endpt->dlid = p_path->dlid; diff --git a/branches/MTHCA/ulp/ipoib/kernel/ipoib_port.c b/branches/MTHCA/ulp/ipoib/kernel/ipoib_port.c index 3c21429a..5a9955af 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/ipoib_port.c +++ b/branches/MTHCA/ulp/ipoib/kernel/ipoib_port.c @@ -48,7 +48,7 @@ * request that specifies an MGID. The ESM returns every McMemberRecord * instead. */ -#define PR_102801 +//#define PR_102801 /* Amount of physical memory to register. */ @@ -521,7 +521,7 @@ ipoib_port_destroy( CL_ASSERT( p_port ); CL_ASSERT( p_port->p_adapter ); - CL_ASSERT( p_port->p_adapter->p_port == p_port ); + CL_ASSERT( !p_port->p_adapter->p_port ); cl_obj_destroy( &p_port->obj ); @@ -747,6 +747,8 @@ __ib_mgr_init( NULL, p_port, &p_port->ib_mgr.h_ca ); if( status != IB_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_OPEN_CA, 1, status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ib_open_ca returned %s\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); @@ -758,6 +760,8 @@ __ib_mgr_init( p_port->ib_mgr.h_ca, IB_PDT_UD, p_port, &p_port->ib_mgr.h_pd ); if( status != IB_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_ALLOC_PD, 1, status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ib_alloc_pd returned %s\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); @@ -774,6 +778,8 @@ __ib_mgr_init( __cq_event, &p_port->ib_mgr.h_recv_cq ); if( status != IB_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_CREATE_RECV_CQ, 1, status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ib_create_cq returned %s.\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); @@ -789,6 +795,8 @@ __ib_mgr_init( __cq_event, &p_port->ib_mgr.h_send_cq ); if( status != IB_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_CREATE_SEND_CQ, 1, status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ib_create_cq returned %s.\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); @@ -811,6 +819,8 @@ __ib_mgr_init( __qp_event, &p_port->ib_mgr.h_qp ); if( status != IB_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_CREATE_QP, 1, status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ib_create_qp returned %s\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); @@ -821,6 +831,8 @@ __ib_mgr_init( p_port->ib_mgr.h_qp, &qp_attr ); if( status != IB_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_QUERY_QP, 1, status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ib_query_qp returned %s\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); @@ -843,6 +855,8 @@ __ib_mgr_init( &p_port->ib_mgr.lkey, &rkey, &p_port->ib_mgr.h_mr ); if( status != IB_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_REG_PHYS, 1, status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ib_reg_phys returned %s\n", p_port->p_adapter->p_ifc->get_err_str( status )) ); @@ -926,6 +940,8 @@ __buf_mgr_init( #endif /* IPOIB_INLINE_RECV */ if( cl_status != CL_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_RECV_POOL, 1, cl_status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("cl_qpool_init for recvs returned %s\n", cl_status_text[cl_status]) ); @@ -937,6 +953,8 @@ __buf_mgr_init( p_params->rq_depth, PROTOCOL_RESERVED_SIZE_IN_PACKET ); if( ndis_status != NDIS_STATUS_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_RECV_PKT_POOL, 1, ndis_status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("NdisAllocatePacketPool returned %08X\n", ndis_status) ); return IB_INSUFFICIENT_RESOURCES; @@ -946,6 +964,8 @@ __buf_mgr_init( p_params->rq_depth ); if( ndis_status != NDIS_STATUS_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_RECV_BUF_POOL, 1, ndis_status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("NdisAllocateBufferPool returned %08X\n", ndis_status) ); return IB_INSUFFICIENT_RESOURCES; @@ -956,6 +976,8 @@ __buf_mgr_init( 1, PROTOCOL_RESERVED_SIZE_IN_PACKET ); if( ndis_status != NDIS_STATUS_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_SEND_PKT_POOL, 1, ndis_status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("NdisAllocatePacketPool returned %08X\n", ndis_status) ); return IB_INSUFFICIENT_RESOURCES; @@ -965,6 +987,8 @@ __buf_mgr_init( &p_port->buf_mgr.h_send_buf_pool, 1 ); if( ndis_status != NDIS_STATUS_SUCCESS ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_SEND_BUF_POOL, 1, ndis_status ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("NdisAllocateBufferPool returned %08X\n", ndis_status) ); return IB_INSUFFICIENT_RESOURCES; @@ -1249,6 +1273,8 @@ __recv_mgr_init( sizeof(NDIS_PACKET*) * p_port->p_adapter->params.rq_depth ); if( !p_port->recv_mgr.recv_pkt_array ) { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_RECV_PKT_ARRAY, 0 ); IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("cl_malloc for PNDIS_PACKET array failed.\n") ); return IB_INSUFFICIENT_MEMORY; @@ -1674,6 +1700,31 @@ __recv_get_endpts( CL_ASSERT( *pp_dst ); } + if( *pp_src && (*pp_src)->qpn != p_wc->recv.ud.remote_qp ) + { + /* Update the QPN for the endpoint. */ + IPOIB_TRACE( (IPOIB_DBG_RECV | IPOIB_DBG_WARN), + ("Updating QPN for MAC: %02X-%02X-%02X-%02X-%02X-%02X\n", + (*pp_src )->mac.addr[0], (*pp_src )->mac.addr[1], + (*pp_src )->mac.addr[2], (*pp_src )->mac.addr[3], + (*pp_src )->mac.addr[4], (*pp_src )->mac.addr[5]) ); + (*pp_src)->qpn = p_wc->recv.ud.remote_qp; + } + + if( *pp_src && *pp_dst ) + { + IPOIB_TRACE( (IPOIB_DBG_RECV | IPOIB_DBG_INFO), + ("Recv:\n" + "\tsrc MAC: %02X-%02X-%02X-%02X-%02X-%02X\n" + "\tdst MAC: %02X-%02X-%02X-%02X-%02X-%02X\n", + (*pp_src )->mac.addr[0], (*pp_src )->mac.addr[1], + (*pp_src )->mac.addr[2], (*pp_src )->mac.addr[3], + (*pp_src )->mac.addr[4], (*pp_src )->mac.addr[5], + (*pp_dst )->mac.addr[0], (*pp_dst )->mac.addr[1], + (*pp_dst )->mac.addr[2], (*pp_dst )->mac.addr[3], + (*pp_dst )->mac.addr[4], (*pp_dst )->mac.addr[5]) ); + } + IPOIB_EXIT( IPOIB_DBG_RECV ); } @@ -1729,9 +1780,9 @@ __recv_mgr_filter( continue; } - len = p_wc->length; + len = p_wc->length - sizeof(ib_grh_t); - if( len < (sizeof(ib_grh_t) + sizeof(ipoib_hdr_t)) ) + if( len < sizeof(ipoib_hdr_t) ) { IPOIB_TRACE( IPOIB_DBG_ERROR, ("Received ETH packet < min size\n") ); @@ -1754,25 +1805,27 @@ __recv_mgr_filter( p_eth = &p_desc->p_buf->eth.pkt; #endif /*IPOIB_INLINE_RECV */ - /* Don't report loopback traffic - we requested SW loopback. */ - if( !cl_memcmp( &p_port->p_adapter->mac, &p_eth->hdr.src, - sizeof(p_port->p_adapter->mac) ) ) + if( p_src ) { - /* - * "This is not the packet you're looking for" - don't update - * receive statistics, the packet never happened. - */ - cl_qlist_insert_tail( p_bad_list, &p_desc->item.list_item ); - /* Dereference the port object on behalf of the failed receive. */ - cl_obj_deref( &p_port->obj ); - continue; + /* Don't report loopback traffic - we requested SW loopback. */ + if( !cl_memcmp( &p_port->p_adapter->mac, &p_src->mac, + sizeof(p_port->p_adapter->mac) ) ) + { + /* + * "This is not the packet you're looking for" - don't update + * receive statistics, the packet never happened. + */ + cl_qlist_insert_tail( p_bad_list, &p_desc->item.list_item ); + /* Dereference the port object on behalf of the failed recv. */ + cl_obj_deref( &p_port->obj ); + continue; + } } switch( p_ipoib->hdr.type ) { case ETH_PROT_TYPE_IP: - if( len < - (sizeof(ib_grh_t) + sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t)) ) + if( len < (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t)) ) { IPOIB_TRACE( IPOIB_DBG_ERROR, ("Received IP packet < min size\n") ); @@ -1791,8 +1844,8 @@ __recv_mgr_filter( } /* First packet of a UDP transfer. */ - if( len < (sizeof(ib_grh_t) + sizeof(ipoib_hdr_t) + - sizeof(ip_hdr_t) + sizeof(udp_hdr_t)) ) + if( len < + (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t) + sizeof(udp_hdr_t)) ) { IPOIB_TRACE( IPOIB_DBG_ERROR, ("Received UDP packet < min size\n") ); @@ -1806,8 +1859,8 @@ __recv_mgr_filter( (p_ipoib->type.ip.prot.udp.hdr.dst_port == DHCP_PORT_CLIENT && p_ipoib->type.ip.prot.udp.hdr.src_port == DHCP_PORT_SERVER) ) { - if( len < (sizeof(ib_grh_t) + sizeof(ipoib_hdr_t) + - sizeof(ip_hdr_t) + sizeof(udp_hdr_t) + DHCP_MIN_SIZE )) + if( len < (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t) + + sizeof(udp_hdr_t) + DHCP_MIN_SIZE) ) { IPOIB_TRACE( IPOIB_DBG_ERROR, ("Received DHCP < min size\n") ); @@ -1861,7 +1914,7 @@ __recv_mgr_filter( { p_desc->len = len + sizeof(eth_hdr_t) - sizeof(ipoib_hdr_t); - if( p_dst ) + if( p_dst->h_mcast) { if( p_dst->dgid.multicast.raw_group_id[10] == 0xFF && p_dst->dgid.multicast.raw_group_id[11] == 0xFF && @@ -3294,6 +3347,19 @@ __send_mgr_queue( status = __endpt_mgr_ref( p_port, p_eth_hdr->dst, pp_endpt ); cl_perf_stop( &p_port->p_adapter->perf, GetEndpt ); + if( status == NDIS_STATUS_NO_ROUTE_TO_DESTINATION && + p_eth_hdr->dst.addr[0] == 0x01 && + p_eth_hdr->dst.addr[1] == 0x00 && + p_eth_hdr->dst.addr[2] == 0x5E ) + { + if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst ) == IB_SUCCESS ) + { + IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT, + ("Multicast Mac - trying to join.\n") ); + return NDIS_STATUS_PENDING; + } + } + IPOIB_EXIT( IPOIB_DBG_SEND ); return status; } @@ -3555,6 +3621,22 @@ ipoib_port_resume( else if( status != NDIS_STATUS_SUCCESS ) { ASSERT( status == NDIS_STATUS_NO_ROUTE_TO_DESTINATION ); + + if( p_eth_hdr->dst.addr[0] == 0x01 && + p_eth_hdr->dst.addr[1] == 0x00 && + p_eth_hdr->dst.addr[2] == 0x5E ) + { + if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst ) == + IB_SUCCESS ) + { + IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT, + ("Multicast Mac - trying to join.\n") ); + cl_qlist_insert_head( &p_port->send_mgr.pending_list, + IPOIB_LIST_ITEM_FROM_PACKET( desc.p_pkt ) ); + break; + } + } + /* * Complete the send as if we sent it - WHQL tests don't like the * sends to fail. @@ -3611,6 +3693,7 @@ __send_cb( ib_wc_t wc[MAX_SEND_WC], *p_wc, *p_free; cl_qlist_t done_list; NDIS_PACKET *p_packet; + uint32_t length; ipoib_endpt_t *p_endpt; send_buf_t *p_send_buf; ip_stat_sel_t type; @@ -3680,8 +3763,8 @@ __send_cb( { type = IP_STAT_UCAST_BYTES; } - ipoib_inc_send_stat( p_port->p_adapter, type, - p_wc->length - sizeof(ipoib_hdr_t) + sizeof(eth_hdr_t) ); + NdisQueryPacketLength( p_packet, &length ); + ipoib_inc_send_stat( p_port->p_adapter, type, length ); NdisMSendComplete( p_port->p_adapter->h_adapter, p_packet, NDIS_STATUS_SUCCESS ); break; @@ -3857,6 +3940,40 @@ __endpt_mgr_remove( } +NTSTATUS +ipoib_mac_to_gid( + IN ipoib_port_t* const p_port, + IN const mac_addr_t mac, + OUT ib_gid_t* p_gid ) +{ + ipoib_endpt_t* p_endpt; + cl_map_item_t *p_item; + uint64_t key = 0; + + IPOIB_ENTER( IPOIB_DBG_ENDPT ); + + cl_memcpy( &key, &mac, sizeof(mac_addr_t) ); + + cl_obj_lock( &p_port->obj ); + + p_item = cl_qmap_get( &p_port->endpt_mgr.mac_endpts, key ); + if( p_item == cl_qmap_end( &p_port->endpt_mgr.mac_endpts ) ) + { + cl_obj_unlock( &p_port->obj ); + IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT, ("Failed endpoint lookup.\n") ); + return STATUS_INVALID_PARAMETER; + } + + p_endpt = PARENT_STRUCT( p_item, ipoib_endpt_t, mac_item ); + *p_gid = p_endpt->dgid; + + cl_obj_unlock( &p_port->obj ); + + IPOIB_EXIT( IPOIB_DBG_ENDPT ); + return STATUS_SUCCESS; +} + + static inline NDIS_STATUS __endpt_mgr_ref( IN ipoib_port_t* const p_port, @@ -3871,11 +3988,24 @@ __endpt_mgr_ref( IPOIB_ENTER( IPOIB_DBG_ENDPT ); + if( !cl_memcmp( &mac, &p_port->p_adapter->mac, sizeof(mac) ) ) + { + /* Discard loopback traffic. */ + IPOIB_TRACE( IPOIB_DBG_WARN, ("Discarding loopback traffic\n") ); + IPOIB_EXIT( IPOIB_DBG_ENDPT ); + return NDIS_STATUS_NO_ROUTE_TO_DESTINATION; + } + key = 0; cl_memcpy( &key, &mac, sizeof(mac_addr_t) ); cl_obj_lock( &p_port->obj ); + IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO), + ("Look for :\t MAC: %02X-%02X-%02X-%02X-%02X-%02X\n", + mac.addr[0], mac.addr[1], mac.addr[2], + mac.addr[3], mac.addr[4], mac.addr[5]) ); + p_item = cl_qmap_get( &p_port->endpt_mgr.mac_endpts, key ); if( p_item == cl_qmap_end( &p_port->endpt_mgr.mac_endpts ) ) { @@ -3988,6 +4118,11 @@ __endpt_mgr_insert_locked( { IPOIB_ENTER( IPOIB_DBG_ENDPT ); + IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO), + ("insert :\t MAC: %02X-%02X-%02X-%02X-%02X-%02X\n", + mac.addr[0], mac.addr[1], mac.addr[2], + mac.addr[3], mac.addr[4], mac.addr[5]) ); + cl_obj_lock( &p_port->obj ); while( p_port->endpt_rdr ) { @@ -4283,24 +4418,7 @@ __endpt_mgr_add_local( av_attr.port_num = p_port->port_num; av_attr.sl = 0; av_attr.dlid = p_port_info->base_lid; - switch( p_port_info->link_width_active ) - { - case IB_LINK_WIDTH_ACTIVE_1X: - av_attr.static_rate = IB_PATH_RECORD_RATE_2_5_GBS; - break; - - case IB_LINK_WIDTH_ACTIVE_4X: - av_attr.static_rate = IB_PATH_RECORD_RATE_10_GBS; - break; - - case IB_LINK_WIDTH_ACTIVE_12X: - av_attr.static_rate = IB_PATH_RECORD_RATE_30_GBS; - break; - - default: - cl_obj_destroy( &p_endpt->obj ); - return IB_INVALID_SETTING; - } + av_attr.static_rate = ib_port_info_compute_rate( p_port_info ); av_attr.path_bits = 0; status = p_port->p_adapter->p_ifc->create_av( p_port->ib_mgr.h_pd, &av_attr, &p_endpt->h_av ); @@ -4351,8 +4469,14 @@ __port_info_cb( IPOIB_TRACE( IPOIB_DBG_INFO, ("Received port info: link width = %d.\n", p_port_rec->port_info.link_width_active) ); + + p_port->ib_mgr.rate = + ib_port_info_compute_rate( &p_port_rec->port_info ); + ipoib_set_rate( p_port->p_adapter, - p_port_rec->port_info.link_width_active ); + p_port_rec->port_info.link_width_active, + ib_port_info_get_link_speed_active( &p_port_rec->port_info ) ); + __port_get_mcast( p_port ); } else @@ -4368,9 +4492,22 @@ __port_info_cb( ("Instance destroying - Aborting.\n") ); break; + case IB_TIMEOUT: + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_PORT_INFO_TIMEOUT, 0 ); + IPOIB_TRACE( IPOIB_DBG_INFO, ("Port info query timed out.\n") ); + break; + + case IB_REMOTE_ERROR: + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_PORT_INFO_REJECT, 0 ); + IPOIB_TRACE( IPOIB_DBG_INFO, ("Port info query rejected by SA.\n") ); + break; + default: - /* Flag the adapter as hung. */ - p_port->p_adapter->hung = TRUE; + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_QUERY_PORT_INFO, 1, p_query_rec->status ); + /* Hopefully we'll get an SM change event that will restart things. */ IPOIB_TRACE( IPOIB_DBG_INFO, ("Port info query failed.\n") ); } @@ -4396,7 +4533,7 @@ __port_get_mcast( IPOIB_ENTER( IPOIB_DBG_MCAST ); - info.method = IB_MAD_METHOD_GETTABLE; + info.method = IB_MAD_METHOD_GET; info.attr_id = IB_MAD_ATTR_MCMEMBER_RECORD; info.attr_size = sizeof(ib_member_rec_t); info.comp_mask = IB_MCR_COMPMASK_MGID; @@ -4496,6 +4633,8 @@ __bcast_get_cb( IPOIB_TRACE( IPOIB_DBG_INIT, ("Instance destroying - Aborting.\n") ); default: + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_BCAST_GET, 1, p_query_rec->status ); /* Flag the adapter as hung. */ p_port->p_adapter->hung = TRUE; } @@ -4521,6 +4660,22 @@ __port_join_bcast( IPOIB_ENTER( IPOIB_DBG_MCAST ); + /* Check that the rate is realizable for our port. */ + if( p_port->ib_mgr.rate < (p_member_rec->rate & 0x3F) ) + { + /* + * The MC group rate is higher than our port's rate. Log an error + * and stop. A port transition will drive the retry. + */ + IPOIB_TRACE( IPOIB_DBG_WARN, + ("Unrealizable join due to rate mismatch.\n") ); + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_BCAST_RATE, 2, + (uint32_t)(p_member_rec->rate & 0x3F), + (uint32_t)p_port->ib_mgr.rate ); + return; + } + /* Join the broadcast group. */ cl_memclr( &mcast_req, sizeof(mcast_req) ); /* Copy the results of the Get to use as parameters. */ @@ -4641,6 +4796,9 @@ ipoib_port_down( cl_obj_lock( &p_port->obj ); p_port->state = IB_QPS_ERROR; + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_PORT_DOWN, 0 ); + 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 ); @@ -4720,6 +4878,8 @@ __bcast_cb( } else { + NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, + EVENT_IPOIB_BCAST_JOIN, 1, p_mcast_rec->status ); /* Flag the adapter as hung. */ p_port->p_adapter->hung = TRUE; } @@ -4866,6 +5026,19 @@ ipoib_port_join_mcast( IPOIB_ENTER( IPOIB_DBG_MCAST ); + switch( __endpt_mgr_ref( p_port, mac, &p_endpt ) ) + { + case NDIS_STATUS_NO_ROUTE_TO_DESTINATION: + break; + + case NDIS_STATUS_SUCCESS: + ipoib_endpt_deref( p_endpt ); + /* Fall through */ + + case NDIS_STATUS_PENDING: + return IB_SUCCESS; + } + /* * Issue the mcast request, using the parameters of the broadcast group. * This allows us to do a create request that should always succeed since @@ -5030,6 +5203,10 @@ __mcast_cb( CL_ASSERT( p_qitem == &p_endpt->lid_item ); } cl_obj_unlock( &p_port->obj ); + + /* Try to send all pending sends. */ + ipoib_port_resume( p_port ); + cl_obj_deref( &p_port->obj ); IPOIB_EXIT( IPOIB_DBG_MCAST ); diff --git a/branches/MTHCA/ulp/ipoib/kernel/ipoib_port.h b/branches/MTHCA/ulp/ipoib/kernel/ipoib_port.h index 7c122929..c9c8cc4e 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/ipoib_port.h +++ b/branches/MTHCA/ulp/ipoib/kernel/ipoib_port.h @@ -90,6 +90,7 @@ typedef struct _ipoib_ib_mgr ib_mr_handle_t h_mr; net32_t lkey; + uint8_t rate; ib_member_rec_t bcast_rec; } ipoib_ib_mgr_t; @@ -584,5 +585,10 @@ void ipoib_port_resume( IN ipoib_port_t* const p_port ); +NTSTATUS +ipoib_mac_to_gid( + IN ipoib_port_t* const p_port, + IN const mac_addr_t mac, + OUT ib_gid_t* p_gid ); #endif /* _IPOIB_PORT_H_ */ diff --git a/branches/MTHCA/ulp/ipoib/kernel/ipoib_xfr_mgr.h b/branches/MTHCA/ulp/ipoib/kernel/ipoib_xfr_mgr.h index 2b5a3b88..84d3c7c9 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/ipoib_xfr_mgr.h +++ b/branches/MTHCA/ulp/ipoib/kernel/ipoib_xfr_mgr.h @@ -191,6 +191,68 @@ ipoib_mac_from_sst_guid( *********/ +/****f* IPOIB/ipoib_mac_from_mlx_guid +* NAME +* ipoib_mac_from_sst_guid +* +* DESCRIPTION +* Generates an ethernet MAC address given a Mellanox port GUID. +* +* SYNOPSIS +*/ +static inline ib_api_status_t +ipoib_mac_from_mlx_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; + uint32_t low24; + + /* Port guid is in network byte order. OUI is in lower 3 bytes. */ + ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x02 && p_guid[2] == 0xc9 ); + + if( (port_guid & CL_HTON64( 0x000000ffff0000 )) != + CL_HTON64(0x00000002000000)) + { + return IB_INVALID_GUID; + } + + low24 = ((uint32_t)cl_ntoh64( port_guid ) & 0x00FFFFFF); + + 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] = (uint8_t)(low24 >> 16); + p_mac_addr->addr[4] = (uint8_t)(low24 >> 8); + p_mac_addr->addr[5] = (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_mac_from_guid * NAME * ipoib_mac_from_guid @@ -216,7 +278,13 @@ ipoib_mac_from_guid( if( status == IB_SUCCESS ) return IB_SUCCESS; } - + if( p_guid[0] == 0x00 && p_guid[1] == 0x02 && p_guid[2] == 0xc9 ) + { + status = ipoib_mac_from_mlx_guid( port_guid, p_mac_addr ); + if( status == IB_SUCCESS ) + return IB_SUCCESS; + } + /* Value of zero is reserved. */ laa = cl_atomic_inc( &g_ipoib.laa_idx ); @@ -256,9 +324,9 @@ ipoib_mac_from_guid( *********/ -/****f* IPOIB/ipoib_guid_from_mac +/****f* IPOIB/ipoib_sst_guid_from_mac * NAME -* ipoib_guid_from_mac +* ipoib_sst_guid_from_mac * * DESCRIPTION * Generates a port GUID given an ethernet MAC address. @@ -266,7 +334,7 @@ ipoib_mac_from_guid( * SYNOPSIS */ static inline ib_api_status_t -ipoib_guid_from_mac( +ipoib_sst_guid_from_mac( IN const mac_addr_t mac, OUT net64_t* const p_port_guid ) { @@ -329,6 +397,68 @@ ipoib_guid_from_mac( *********/ +/****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 +*********/ #ifdef __cplusplus diff --git a/branches/MTHCA/ulp/ipoib/kernel/netipoib.inf b/branches/MTHCA/ulp/ipoib/kernel/netipoib.inf index d651c0e4..66981344 100644 --- a/branches/MTHCA/ulp/ipoib/kernel/netipoib.inf +++ b/branches/MTHCA/ulp/ipoib/kernel/netipoib.inf @@ -1,31 +1,30 @@ -; SilverStorm Technologies Internet Protocol over InfiniBand Adapter +; OpenIB Internet Protocol over InfiniBand Adapter ; Copyright 2005 SilverStorm Technologies all Rights Reserved. [Version] Signature = "$Windows NT$" Class = Net ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} -Provider = %SST% -CatalogFile = netipoib.cat -DriverVer=09/01/2005,3.0.0036.0 +Provider = %OPENIB% +DriverVer=01/12/2006,1.0.0000.213 [Manufacturer] -%SST% = SST,ntx86,ntamd64,ntia64 +%OPENIB% = OPENIB,ntx86,ntamd64,ntia64 [ControlFlags] ExcludeFromSelect = IBA\IPoIB -[SST] +[OPENIB] ; empty since we don't support W9x/Me -[SST.ntx86] -%IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; SilverStorm Internet Protocol over InfiniBand Adapter +[OPENIB.ntx86] +%IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; Internet Protocol over InfiniBand Adapter -[SST.ntamd64] -%IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; SilverStorm Internet Protocol over InfiniBand Adapter +[OPENIB.ntamd64] +%IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; Internet Protocol over InfiniBand Adapter -[SST.ntia64] -%IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; SilverStorm Internet Protocol over InfiniBand Adapter +[OPENIB.ntia64] +%IpoibDesc% = Ipoib.DDInstall, IBA\IPoIB ; Internet Protocol over InfiniBand Adapter [Ipoib.DDInstall.ntx86] Characteristics = 0x81 ; NCF_HAS_UI | NCF_VIRTUAL @@ -58,7 +57,7 @@ AddService = ipoib, 2, IpoibService, IpoibEventLog [IpoibAddReg] HKR, Ndi, Service, 0, "ipoib" -HKR, Ndi\Interfaces, UpperRange, 0, "ndis5_ip" +HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" HKR, Ndi\Params\RqDepth, ParamDesc, 0, "Receive Queue Depth" @@ -133,12 +132,16 @@ StartType = 3 ;%SERVICE_DEMAND_START% ErrorControl = 1 ;%SERVICE_ERROR_NORMAL% ServiceBinary = %12%\ipoib.sys LoadOrderGroup = NDIS +AddReg = Ipoib.ParamsReg + +[Ipoib.ParamsReg] +HKR,"Parameters","DebugFlags",%REG_DWORD_NO_CLOBBER%,0x80000000 [IpoibEventLog] AddReg = IpoibAddEventLogReg [IpoibAddEventLogReg] -HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll" +HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll";"%%SystemRoot%%\System32\drivers\ipoib.sys" HKR, , TypesSupported, 0x00010001, 7 @@ -181,10 +184,11 @@ WOW64CopyFiles = %DIRID_SYSTEM_X86% DefaultDestDir = %DIRID_SYSTEM% [Strings] -SST = "SilverStorm Technologies" -IpoibDesc = "SilverStorm IPoIB Adapter" +OPENIB = "OpenIB Alliance" +IpoibDesc = "OpenIB IPoIB Adapter" IpoibServiceDispName = "IPoIB" -IcsDisk1 = "SilverStorm Systems IPoIB Disk #1" +IcsDisk1 = "OpenIB IPoIB Disk #1" DIRID_SYSTEM = 11 DIRID_DRIVERS = 12 DIRID_SYSTEM_X86 = 16425 +REG_DWORD_NO_CLOBBER = 0x00010003 -- 2.41.0