From: eitan Date: Wed, 22 Mar 2006 08:11:06 +0000 (+0000) Subject: [OpenSM] - X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=707c74857add8a93a968b6f9de868f7851f676bb;p=~shefty%2Frdma-win.git [OpenSM] - Update according to linux trunk and also add opensm as service. git-svn-id: svn://openib.tc.cornell.edu/gen1@249 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/opensm/user/include/iba/ib_types.h b/trunk/ulp/opensm/user/include/iba/ib_types.h index e8c4be31..cbbf4432 100644 --- a/trunk/ulp/opensm/user/include/iba/ib_types.h +++ b/trunk/ulp/opensm/user/include/iba/ib_types.h @@ -2826,9 +2826,9 @@ ib_path_rec_hop_limit( */ #define IB_CLASS_CAP_GETSET 0x0002 /*********/ -/****s* IBA Base: Constants/IB_CLASS_CAP_GETSET +/****s* IBA Base: Constants/IB_CLASS_RESP_TIME_MASK * NAME -* IB_CLASS_CAP_GETSET +* IB_CLASS_RESP_TIME_MASK * * DESCRIPTION * Mask bits to extract the reponse time value from the @@ -2857,7 +2857,8 @@ typedef struct _ib_class_port_info uint8_t base_ver; uint8_t class_ver; ib_net16_t cap_mask; - ib_net32_t resp_time_val; + uint8_t reserved[3]; + uint8_t resp_time_val; ib_gid_t redir_gid; ib_net32_t redir_tc_sl_fl; ib_net16_t redir_lid; @@ -4913,7 +4914,7 @@ ib_port_info_get_hoq_lifetime( * ib_port_info_set_vl_stall_count * * DESCRIPTION -* Sets the VL Stall Count which define the number of contigious +* Sets the VL Stall Count which define the number of contiguous * HLL (hoq) drops that will put the VL into stalled mode. * * SYNOPSIS @@ -4943,15 +4944,15 @@ ib_port_info_set_vl_stall_count( *********/ /****f* IBA Base: Types/ib_port_info_get_vl_stall_count - * NAME - * ib_port_info_get_vl_stall_count - * - * DESCRIPTION - * Gets the VL Stall Count which define the number of contigious - * HLL (hoq) drops that will put the VL into stalled mode - * - * SYNOPSIS - */ +* NAME +* ib_port_info_get_vl_stall_count +* +* DESCRIPTION +* Gets the VL Stall Count which define the number of contiguous +* HLL (hoq) drops that will put the VL into stalled mode +* +* SYNOPSIS +*/ OSM_INLINE uint8_t AL_API ib_port_info_get_vl_stall_count( IN const ib_port_info_t* const p_pi ) @@ -5512,7 +5513,7 @@ typedef struct _ib_pkey_table_record { ib_net16_t lid; // for CA: lid of port, for switch lid of port 0 uint16_t block_num; - uint8_t port_num; // for swithc: port number, for CA: reserved + uint8_t port_num; // for switch: port number, for CA: reserved uint8_t reserved1; uint16_t reserved2; ib_pkey_table_t pkey_tbl; @@ -5552,8 +5553,8 @@ typedef struct _ib_slvl_table typedef struct _ib_slvl_table_record { ib_net16_t lid; // for CA: lid of port, for switch lid of port 0 - uint8_t in_port_num; // reserved for CA's - uint8_t out_port_num; // reserved for CA's + uint8_t in_port_num; // reserved for CAs + uint8_t out_port_num; // reserved for CAs uint32_t resv; ib_slvl_table_t slvl_tbl; @@ -5870,9 +5871,6 @@ typedef struct _ib_member_rec * port_gid * Valid GID of the endpoint joining this multicast group. * -* requestor_gid -* GID of the endpoint making this request on hehave of port_gid. -* * qkey * Q_Key to be sued by this multicast group. * diff --git a/trunk/ulp/opensm/user/include/opensm/osm_base.h b/trunk/ulp/opensm/user/include/opensm/osm_base.h index 3fcf6195..f06331e6 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_base.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_base.h @@ -180,7 +180,7 @@ BEGIN_C_DECLS * SYNOPSIS */ #ifdef __WIN__ -#define OSM_DEFAULT_TMP_DIR GetOsmPath() +#define OSM_DEFAULT_TMP_DIR GetOsmTempPath() #else #define OSM_DEFAULT_TMP_DIR "/tmp/" #endif @@ -197,7 +197,7 @@ BEGIN_C_DECLS * SYNOPSIS */ #ifdef __WIN__ -#define OSM_DEFAULT_CACHE_DIR GetOsmPath() +#define OSM_DEFAULT_CACHE_DIR GetOsmCachePath() #else #define OSM_DEFAULT_CACHE_DIR "/var/cache/osm/" #endif @@ -213,7 +213,7 @@ BEGIN_C_DECLS * SYNOPSIS */ #ifdef __WIN__ -#define OSM_DEFAULT_LOG_FILE strcat(GetOsmPath(), "osm.log") +#define OSM_DEFAULT_LOG_FILE strcat(GetOsmTempPath(), "osm.log") #else #define OSM_DEFAULT_LOG_FILE "/var/log/osm.log" #endif diff --git a/trunk/ulp/opensm/user/include/opensm/osm_subnet.h b/trunk/ulp/opensm/user/include/opensm/osm_subnet.h index dcbacddf..3ccce640 100644 --- a/trunk/ulp/opensm/user/include/opensm/osm_subnet.h +++ b/trunk/ulp/opensm/user/include/opensm/osm_subnet.h @@ -187,6 +187,7 @@ typedef enum _osm_testability_modes */ typedef struct _osm_subn_opt { + ib_net64_t guid; ib_net64_t m_key; ib_net64_t sm_key; ib_net64_t subnet_prefix; @@ -233,10 +234,14 @@ typedef struct _osm_subn_opt boolean_t updn_activate; char * updn_guid_file; boolean_t exit_on_fatal; + boolean_t honor_guid2lid_file; } osm_subn_opt_t; /* * FIELDS * +* guid +* The port guid that the SM is binding to. +* * m_key * M_Key value sent to all ports qualifing all Set(PortInfo). * @@ -377,6 +382,11 @@ typedef struct _osm_subn_opt * a. SM recognizes 2 different nodes with the same guid, or 12x link with * lane reversal badly configured. * +* honor_guid2lid_file +* Always honor the guid2lid file if it exists and is valid. This means that +* the file will be honored when SM is coming out of STANDBY. +* By default this is FALSE. +* * SEE ALSO * Subnet object *********/ diff --git a/trunk/ulp/opensm/user/include/vendor/winosm_common.h b/trunk/ulp/opensm/user/include/vendor/winosm_common.h index c20f3ddc..75738f90 100644 --- a/trunk/ulp/opensm/user/include/vendor/winosm_common.h +++ b/trunk/ulp/opensm/user/include/vendor/winosm_common.h @@ -190,17 +190,17 @@ syslog(int priority, ...) {} #define LOG_ERR 2 /*****************************************/ -/****f* OpenSM: osm_common/GetOsmPath +/****f* OpenSM: osm_common/GetOsmTempPath * NAME -* GetOsmPath +* GetOsmTempPath * * DESCRIPTION -* The function retrieve the temp path defined in Windows using its API +* The function retrieves the temp path defined in Windows using its API * * SYNOPSIS */ char* -GetOsmPath(void); +GetOsmTempPath(void); /* * PARAMETERS * NONE @@ -211,6 +211,31 @@ GetOsmPath(void); * NOTES */ +/****f* OpenSM: osm_common/GetOsmCachePath +* NAME +* GetOsmCachePath +* +* DESCRIPTION +* The function retrieves the path the cache directory. This directory is +* the etc dir under the installation directory of the mellanox stack. +* The installation directory should be pointed out by the WinIB_HOME variable. +* If WinIB_HOME variable is missing, or there is not /etc/ dir under it - then +* the function will return the getOsmTempPath() value. +* +* SYNOPSIS +*/ +char* +GetOsmCachePath(void); +/* +* PARAMETERS +* NONE +* +* RETURN VALUE +* This function returns string containing the default cache path for osm use. +* +* NOTES +*/ + /* Implementation of strtok_r for windows: since strtok in windows is safe, just ignore the last variable, and call strtok. */ static inline diff --git a/trunk/ulp/opensm/user/libopensm/osm_helper.c b/trunk/ulp/opensm/user/libopensm/osm_helper.c index bed65851..14718502 100644 --- a/trunk/ulp/opensm/user/libopensm/osm_helper.c +++ b/trunk/ulp/opensm/user/libopensm/osm_helper.c @@ -1127,7 +1127,7 @@ osm_dump_inform_info( "\t\t\t\tis_generic..............0x%X\n" "\t\t\t\tsubscribe...............0x%X\n" "\t\t\t\ttrap_type...............0x%X\n" - "\t\t\t\ttrap_num................0x%X\n" + "\t\t\t\ttrap_num................%u\n" "\t\t\t\tqpn.....................0x%06X\n" "\t\t\t\tresp_time_val...........0x%X\n" "\t\t\t\tnode_type...............0x%06X\n" @@ -1906,6 +1906,7 @@ osm_get_node_type_str_fixed_width( #define OSM_VENDOR_ID_IBM 0x000255 #define OSM_VENDOR_ID_DIVERGENET 0x00084E #define OSM_VENDOR_ID_FLEXTRONICS 0x000B8C +#define OSM_VENDOR_ID_AGILENT 0x0030D3 /********************************************************************** **********************************************************************/ @@ -1925,6 +1926,7 @@ osm_get_manufacturer_str( static const char* ibm_str = "IBM "; static const char* divergenet_str = "DivergeNet "; static const char* flextronics_str = "Flextronics "; + static const char* agilent_str = "Agilent "; static const char* unknown_str = "Unknown "; switch( (uint32_t)(guid_ho >> (5 * 8)) ) @@ -1954,6 +1956,8 @@ osm_get_manufacturer_str( return( divergenet_str ); case OSM_VENDOR_ID_FLEXTRONICS: return( flextronics_str ); + case OSM_VENDOR_ID_AGILENT: + return( agilent_str ); default: return( unknown_str ); } diff --git a/trunk/ulp/opensm/user/libvendor/osm_vendor_al.c b/trunk/ulp/opensm/user/libvendor/osm_vendor_al.c index 891026ff..04715b8b 100644 --- a/trunk/ulp/opensm/user/libvendor/osm_vendor_al.c +++ b/trunk/ulp/opensm/user/libvendor/osm_vendor_al.c @@ -1039,9 +1039,6 @@ osm_vendor_bind( ib_qp_create_t qp_create; ib_mad_svc_t mad_svc; ib_av_attr_t av; - DWORD get_last_error; - HANDLE handle; - char mutex_name[100]; OSM_LOG_ENTER( p_vend->p_log, osm_vendor_bind ); @@ -1091,49 +1088,6 @@ osm_vendor_bind( CL_ASSERT( p_bind->port_num ); - /* Patch to handle mutiple instances of vendor calls */ - - switch( p_user_bind->mad_class ) - { - case IB_MCLASS_SUBN_LID: - case IB_MCLASS_SUBN_DIR: - sprintf(mutex_name,"Global\\osm_vendor_sm_%d",p_bind->port_num); - break; - - case IB_MCLASS_SUBN_ADM: - default: - sprintf(mutex_name,"Global\\osm_vendor_sa_%d",p_bind->port_num); - break; - } - - - handle = CreateMutex( NULL, TRUE, mutex_name); - - if(handle == NULL) - { - osm_log( p_vend->p_log, OSM_LOG_ERROR, - "osm_vendor_bind: ERR 3B32: " - "Can't create Mutex\n"); - cl_free(p_bind); - p_bind = NULL; - /* Bug in IBAL in exit flow , thus force exit , cleanup is not done , OS responsibility*/ - exit(1); - } - get_last_error = GetLastError(); - - if (get_last_error == ERROR_ALREADY_EXISTS) - { - osm_log( p_vend->p_log, OSM_LOG_ERROR, - "osm_vendor_bind: ERR 3B35: " - "Current Mutex already exist : %s\n",mutex_name); - printf("ERROR : Port %d already binded.\n",p_bind->port_num); - cl_free(p_bind); - p_bind = NULL; - /* Bug in IBAL in exit flow , thus force exit , cleanup is not done , OS responsibility*/ - exit(1); - } - /* End Of Patch */ - /* Get the proper QP. */ @@ -1167,11 +1121,12 @@ osm_vendor_bind( if( status != IB_SUCCESS ) { - cl_free( p_bind ); osm_log( p_vend->p_log, OSM_LOG_ERROR, "osm_vendor_bind: ERR 3B19: " "Unable to get QP handle (%s).\n", ib_get_err_str( status ) ); + cl_free( p_bind ); + p_bind = 0; goto Exit; } @@ -1200,11 +1155,12 @@ osm_vendor_bind( if( status != IB_SUCCESS ) { - cl_free( p_bind ); osm_log( p_vend->p_log, OSM_LOG_ERROR, "osm_vendor_bind: ERR 3B21: " "Unable to register QP0 MAD service (%s).\n", ib_get_err_str( status ) ); + cl_free( p_bind ); + p_bind = 0; goto Exit; } @@ -1218,6 +1174,8 @@ osm_vendor_bind( "Unable to create address vector (%s).\n", ib_get_err_str( status ) ); + cl_free( p_bind ); + p_bind = 0; goto Exit; } diff --git a/trunk/ulp/opensm/user/libvendor/winosm_common.c b/trunk/ulp/opensm/user/libvendor/winosm_common.c index a12410ab..361d2c00 100644 --- a/trunk/ulp/opensm/user/libvendor/winosm_common.c +++ b/trunk/ulp/opensm/user/libvendor/winosm_common.c @@ -9,7 +9,7 @@ int optopt='?'; int iArg=1; char* -GetOsmPath(void) +GetOsmTempPath(void) { char* temp_path; int length; @@ -23,6 +23,48 @@ GetOsmPath(void) } return temp_path; } + +char* +GetOsmCachePath(void) +{ + char* cache_path; + char* tmp_file_name; + char* winib_home, tmp; + HANDLE hFile; + + winib_home = (char*)cl_malloc(OSM_MAX_LOG_NAME_SIZE); + winib_home = getenv("WinIB_HOME"); + if (winib_home == NULL) + { + /* The WinIB_HOME variable isn't defined. Use the + default temp path */ + return GetOsmTempPath(); + } + cache_path = (char*)cl_malloc(OSM_MAX_LOG_NAME_SIZE); + strcpy(cache_path, winib_home); + + strcat(cache_path, "\\etc\\"); + tmp_file_name = (char*)cl_malloc(OSM_MAX_LOG_NAME_SIZE); + strcpy(tmp_file_name, cache_path); + strcat(tmp_file_name, "opensm.opts"); + hFile = CreateFile(tmp_file_name, + GENERIC_READ, + 0, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); + if (hFile == INVALID_HANDLE_VALUE) + { + cl_free(cache_path); + return GetOsmTempPath(); + } + /* Such file exists. This means the directory is usable */ + CloseHandle(hFile); + + return cache_path; +} + /****************************************************************************/ int getopt_long_only(int argc, char *const*argv, const char *optstring, diff --git a/trunk/ulp/opensm/user/opensm/main.c b/trunk/ulp/opensm/user/opensm/main.c index 34e5e411..49671610 100644 --- a/trunk/ulp/opensm/user/opensm/main.c +++ b/trunk/ulp/opensm/user/opensm/main.c @@ -71,6 +71,12 @@ volatile unsigned int osm_exit_flag = 0; #define GUID_ARRAY_SIZE 64 #define INVALID_GUID (0xFFFFFFFFFFFFFFFFULL) +typedef struct _osm_main_args_t +{ + int argc; + char** argv; +} osm_main_args_t; + /********************************************************************** **********************************************************************/ void show_usage(void); @@ -159,6 +165,12 @@ show_usage(void) " This option provides the means to define a set of ports\n" " (by guids) that will be ignored by the link load \n" " equalization algorithm.\n\n" ); + printf( "-x\n" + "--honor_guid2lid\n" + " This option forces OpenSM to honor the guid2lid file,\n" + " when it comes out of Standby state, if such file exists\n" + " under OSM_CACHE_DIR, and is valid.\n" + " By default this is FALSE.\n" ); printf( "-f\n" "--log_file\n" " This option defines the log to be the given file.\n" @@ -290,6 +302,21 @@ get_port_guid( } #endif /* OSM_VENDOR_INTF_OPENIB */ + /* If port_guid is 0, and we are in windows - find the first port with link_state != DOWN and + use it as default port. */ + if ( port_guid == 0 ) + { + for ( i = 0; i < num_ports; i++ ) + { + if (attr_array[i].link_state > IB_LINK_DOWN) + { + /* Use this port */ + printf("Using default guid 0x%" PRIx64 "\n", cl_hton64(attr_array[i].port_guid)); + return( attr_array[i].port_guid ); + } + } + } + /* More than one possible port - list all ports and let the user to choose. */ while( done_flag == FALSE ) { @@ -447,13 +474,13 @@ parse_ignore_guids_file(IN char *guids_file_name, /********************************************************************** **********************************************************************/ -int __cdecl -main( - int argc, - char* argv[] ) +int +opensm_main( + void *osm_main_args) { + int argc = ((osm_main_args_t*)osm_main_args)->argc; + char** argv = ((osm_main_args_t*)osm_main_args)->argv; osm_subn_opt_t opt; - ib_net64_t guid = 0; ib_net64_t sm_key = 0; ib_api_status_t status; uint32_t log_flags = OSM_LOG_DEFAULT_LEVEL; @@ -466,7 +493,7 @@ main( boolean_t cache_options = FALSE; char *ignore_guids_file_name = NULL; uint32_t val; - const char * const short_option = "i:f:ed:g:l:s:t:a:uvVhorcy"; + const char * const short_option = "i:f:ed:g:l:s:t:a:uvVhorcyx"; /* In the array below, the 2nd parameter specified the number @@ -498,6 +525,7 @@ main( { "add_guid_file", 1, NULL, 'a'}, { "cache-options", 0, NULL, 'c'}, { "stay_on_fatal", 0, NULL, 'y'}, + { "honor_guid2lid", 0, NULL, 'x'}, { NULL, 0, NULL, 0 } /* Required at the end of the array */ }; @@ -542,14 +570,14 @@ main( /* Specifies port guid with which to bind. */ - guid = cl_hton64( strtoull( optarg, NULL, 16 )); - if (! guid) + opt.guid = cl_hton64( strtoull( optarg, NULL, 16 )); + if (! opt.guid) { /* If guid is 0 - need to display the guid list */ - guid = INVALID_GUID; + opt.guid = INVALID_GUID; } else - printf(" Guid <0x%"PRIx64">\n", cl_hton64( guid )); + printf(" Guid <0x%"PRIx64">\n", cl_hton64( opt.guid )); break; case 's': @@ -692,6 +720,11 @@ main( printf (" Caching command line options\n"); break; + case 'x': + opt.honor_guid2lid_file = TRUE; + printf (" Honor guid2lid file, if possible\n"); + break; + case 'h': case '?': case ':': @@ -719,9 +752,6 @@ main( opt.log_flags = (uint8_t)log_flags; - if ( cache_options == TRUE ) - osm_subn_write_conf_file( &opt ); - status = osm_opensm_init( &osm, &opt ); if( status != IB_SUCCESS ) { @@ -741,17 +771,20 @@ main( If the user didn't specify a GUID on the command line, then get a port GUID value with which to bind. */ - if( guid == 0 || cl_hton64(guid) == CL_HTON64(INVALID_GUID)) - guid = get_port_guid( &osm, guid ); + if( opt.guid == 0 || cl_hton64(opt.guid) == CL_HTON64(INVALID_GUID)) + opt.guid = get_port_guid( &osm, opt.guid ); - if ( guid == 0 ) + if ( opt.guid == 0 ) { printf( "Error: Could not get port guid \n" ); status = IB_ERROR; goto Exit; } - status = osm_opensm_bind( &osm, guid ); + if ( cache_options == TRUE ) + osm_subn_write_conf_file( &opt ); + + status = osm_opensm_bind( &osm, opt.guid ); if( status != IB_SUCCESS ) { printf( "\nError from osm_opensm_bind (0x%X)\n", status ); @@ -822,3 +855,179 @@ main( exit( 0 ); } + +SERVICE_STATUS OsmServiceStatus; +SERVICE_STATUS_HANDLE OsmServiceStatusHandle; + +VOID SvcDebugOut(LPSTR String, DWORD Status); +VOID WINAPI OsmServiceCtrlHandler (DWORD opcode); +__stdcall OsmServiceStart (DWORD argc, LPTSTR *argv); + +DWORD OsmServiceInitialization (DWORD argc, LPTSTR *argv, + DWORD *specificError); + +void __cdecl +main ( + int argc, + char* argv[] ) +{ + int i; + boolean_t run_as_service = FALSE; + osm_main_args_t osm_main_args; + osm_main_args.argc = argc; + osm_main_args.argv = argv; + /* If there are arguments that the executable is ran with, then this is + not running as service - just run the opensm_main. */ + for (i = 0 ; i< argc ; i++) + if (!strcmp(argv[i], "--service")) + { + run_as_service = TRUE; + break; + } + + if (!run_as_service) + /* Running as executable */ + opensm_main(&osm_main_args); + else + { + /* Running as service */ + SERVICE_TABLE_ENTRY DispatchTable[] = + { + { "OsmService", OsmServiceStart }, + { NULL, NULL } + }; + + if (!StartServiceCtrlDispatcher( DispatchTable)) + { + SvcDebugOut(" [OSM_SERVICE] StartServiceCtrlDispatcher (%d)\n", + GetLastError()); + } + } +} + +VOID SvcDebugOut(LPSTR String, DWORD Status) +{ + CHAR Buffer[1024]; + if (strlen(String) < 1000) + { + sprintf(Buffer, String, Status); + OutputDebugStringA(Buffer); + } +} + +VOID WINAPI OsmServiceCtrlHandler (DWORD Opcode) +{ + DWORD status; + + switch(Opcode) + { + case SERVICE_CONTROL_STOP: + // Do whatever it takes to stop here. + osm_exit_flag = TRUE; + OsmServiceStatus.dwWin32ExitCode = 0; + OsmServiceStatus.dwCurrentState = SERVICE_STOPPED; + OsmServiceStatus.dwCheckPoint = 0; + OsmServiceStatus.dwWaitHint = 0; + + if (!SetServiceStatus (OsmServiceStatusHandle, + &OsmServiceStatus)) + { + status = GetLastError(); + SvcDebugOut(" [OSM_SERVICE] SetServiceStatus error %ld\n", + status); + } + + SvcDebugOut(" [OSM_SERVICE] Leaving OsmService \n",0); + return; + + case SERVICE_CONTROL_INTERROGATE: + // Fall through to send current status. + break; + + default: + SvcDebugOut(" [OSM_SERVICE] Unrecognized opcode %ld\n", + Opcode); + } + + // Send current status. + if (!SetServiceStatus (OsmServiceStatusHandle, &OsmServiceStatus)) + { + status = GetLastError(); + SvcDebugOut(" [OSM_SERVICE] SetServiceStatus error %ld\n", + status); + } + return; +} + +__stdcall OsmServiceStart (DWORD argc, LPTSTR *argv) +{ + DWORD status; + DWORD specificError; + + OsmServiceStatus.dwServiceType = SERVICE_WIN32; + OsmServiceStatus.dwCurrentState = SERVICE_START_PENDING; + OsmServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | + SERVICE_ACCEPT_PAUSE_CONTINUE; + OsmServiceStatus.dwWin32ExitCode = 0; + OsmServiceStatus.dwServiceSpecificExitCode = 0; + OsmServiceStatus.dwCheckPoint = 0; + OsmServiceStatus.dwWaitHint = 0; + + OsmServiceStatusHandle = RegisterServiceCtrlHandler( + "OsmService", + OsmServiceCtrlHandler); + + if (OsmServiceStatusHandle == (SERVICE_STATUS_HANDLE)0) + { + SvcDebugOut(" [OSM_SERVICE] RegisterServiceCtrlHandler failed %d\n", GetLastError()); + return 0; + } + + // Initialization code goes here. + status = OsmServiceInitialization(argc,argv, &specificError); + + // Handle error condition + if (status != NO_ERROR) + { + OsmServiceStatus.dwCurrentState = SERVICE_STOPPED; + OsmServiceStatus.dwCheckPoint = 0; + OsmServiceStatus.dwWaitHint = 0; + OsmServiceStatus.dwWin32ExitCode = status; + OsmServiceStatus.dwServiceSpecificExitCode = specificError; + + SetServiceStatus (OsmServiceStatusHandle, &OsmServiceStatus); + return 0; + } + + // Initialization complete - report running status. + OsmServiceStatus.dwCurrentState = SERVICE_RUNNING; + OsmServiceStatus.dwCheckPoint = 0; + OsmServiceStatus.dwWaitHint = 0; + + if (!SetServiceStatus (OsmServiceStatusHandle, &OsmServiceStatus)) + { + status = GetLastError(); + SvcDebugOut(" [OSM_SERVICE] SetServiceStatus error %ld\n",status); + } + + // This is where the service does its work. + SvcDebugOut(" [OSM_SERVICE] Returning the Main Thread \n",0); + + return 1; +} + +// Stub initialization function. +DWORD OsmServiceInitialization(DWORD argc, LPTSTR *argv, + DWORD *specificError) +{ + osm_main_args_t osm_main_args; + osm_main_args.argc = argc; + osm_main_args.argv = argv; + if (CreateThread(NULL, 0, opensm_main, &osm_main_args, 0, NULL) == NULL) + { + SvcDebugOut(" [OSM_SERVICE] failed to create thread (%d)\n", + GetLastError()); + return(1); + } + return(0); +} diff --git a/trunk/ulp/opensm/user/opensm/opensm.opts b/trunk/ulp/opensm/user/opensm/opensm.opts new file mode 100644 index 00000000..1e0a18b1 --- /dev/null +++ b/trunk/ulp/opensm/user/opensm/opensm.opts @@ -0,0 +1,139 @@ +# +# DEVICE ATTRIBUTES OPTIONS +# +# The port GUID on which the OpenSM is running. +#guid + +# M_Key value sent to all ports qualifing all Set(PortInfo). +m_key 0x0000000000000000 + +# The lease period used for the M_Key on this subnet in [msec] +m_key_lease_period 0 + +# SM_Key value of the SM to qualify rcv SA queries as 'trusted' +sm_key 0x0100000000000000 + +# Subnet prefix used on this subnet +subnet_prefix 0xfe80000000000000 + +# The LMC value used on this subnet +lmc 0 + +# The code of maximal time a packet can live in a switch +# The actual time is 4.096usec * 2^ +# The value 0x14 disables this mechanism +packet_life_time 0x12 + +# The code of maximal time a packet can wait at the head of +# transmission queue. +# The actual time is 4.096usec * 2^ +# The value 0x14 disables this mechanism +head_of_queue_lifetime 0x12 + +# The maximal time a packet can wait at the head of queue on +# switch port connected to a HCA +leaf_head_of_queue_lifetime 0x0c + +# Limit the maximal operational VLs +max_op_vls 5 + +# The subnet_timeout code that will be set for all the ports +# The actual timeout is 4.096usec * 2^ +subnet_timeout 18 + +# Threshold of local phy errors for sending Trap 129 +local_phy_errors_threshold 0x08 + +# Threshold of credits over-run errors for sending Trap 129 +overrun_errors_threshold 0x08 + +# +# SWEEP OPTIONS +# +# The number of seconds between subnet sweeps (0 disables it) +sweep_interval 10 + +# If TRUE cause all lids to be re-assigned +reassign_lids FALSE + +# If TRUE ignore existing LFT entries on first sweep (default). +# Otherwise only non minimal hop cases are modified. +# NOTE: A standby SM clears its first sweep flag - since the +# master SM already sweeps... +reassign_lfts TRUE + +# If true forces every sweep to be a heavy sweep +force_heavy_sweep FALSE + +# If true every trap will cause a heavy sweep. +# NOTE: successive same traps (>10) are supressed +sweep_on_trap TRUE + +# +# ROUTING OPTIONS +# +# If true do not count switches as link subscriptions +port_profile_switch_nodes FALSE + +# Activate the Up/Down routing algorithm +updn_activate FALSE + +# +# HANDOVER - MULTIPLE SM's OPTIONS +# +# SM priority used for deciding who is the master +sm_priority 1 + +# If TRUE other SM's on the subnet should be ignored +ignore_other_sm FALSE + +# Timeout in [sec] between two polls of active master SM +sminfo_polling_timeout 10000 + +# Number of failing polls of remote SM that declares it dead +polling_retry_number 4 + +# +# TIMING AND THREADING OPTIONS +# +# Number of MADs sent in parallel +max_wire_smps 4 + +# The time taken to a transaction to finish in [msec] +transaction_timeout 200 + +# Maximal time in [msec] a message can stay in the incoming message queue. +# If there is more then one message in the queue and the last message +# stayed in the queue more then this value any SA request will be +# immediately returned with a BUSY status. +max_msg_fifo_timeout 10000 + +# Use a single thread for handling SA queries +single_thread FALSE + +# +# DEBUG FEATURES +# +# The log flags used +log_flags 0x03 + +# Force flush of the log file after each log message +force_log_flush TRUE + +# Log file to be used +log_file K:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1\osm.log + +accum_log_file TRUE + +# The directory to hold the file OpenSM dumps +dump_files_dir C:\yael\trunk\ + +# If TRUE if OpenSM should disable multicast support +no_multicast_option FALSE + +# No multicast routing is performed if TRUE +disable_multicast FALSE + +# If TRUE opensm will exit on fatal initialization issues +exit_on_fatal TRUE + diff --git a/trunk/ulp/opensm/user/opensm/osm_db_files.c b/trunk/ulp/opensm/user/opensm/osm_db_files.c index 8527a57e..0ac9234e 100644 --- a/trunk/ulp/opensm/user/opensm/osm_db_files.c +++ b/trunk/ulp/opensm/user/opensm/osm_db_files.c @@ -194,7 +194,7 @@ osm_db_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_db_init: ERR 6101: " - " Fail to create the db directory:%s\n", + " Failed to create the db directory:%s\n", p_db_imp->db_dir_name); OSM_LOG_EXIT( p_log ); return 1; @@ -250,7 +250,7 @@ osm_db_domain_init( { osm_log( p_log, OSM_LOG_ERROR, "osm_db_domain_init: ERR 6102: " - " Fail to open the db file:%s\n", + " Failed to open the db file:%s\n", p_domain_imp->file_name); cl_free(p_domain_imp); cl_free(p_domain); @@ -305,7 +305,7 @@ osm_db_restore( { osm_log( p_log, OSM_LOG_ERROR, "osm_db_restore: ERR 6103: " - " Fail to open the db file:%s\n", + " Failed to open the db file:%s\n", p_domain_imp->file_name); status = 1; goto Exit; @@ -480,7 +480,7 @@ osm_db_store( { osm_log( p_log, OSM_LOG_ERROR, "osm_db_store: ERR 6107: " - " Fail to open the db file:%s for writing\n", + " Failed to open the db file:%s for writing\n", p_domain_imp->file_name); status = 1; goto Exit; @@ -495,7 +495,7 @@ osm_db_store( { osm_log( p_log, OSM_LOG_ERROR, "osm_db_store: ERR 6109: " - " Fail to remove file:%s (err:%u)\n", + " Failed to remove file:%s (err:%u)\n", p_domain_imp->file_name, status); } @@ -504,7 +504,7 @@ osm_db_store( { osm_log( p_log, OSM_LOG_ERROR, "osm_db_store: ERR 6108: " - " Fail to rename the db file to:%s (err:%u)\n", + " Failed to rename the db file to:%s (err:%u)\n", p_domain_imp->file_name, status); } Exit: diff --git a/trunk/ulp/opensm/user/opensm/osm_lid_mgr.c b/trunk/ulp/opensm/user/opensm/osm_lid_mgr.c index c481dd58..2f0752fd 100644 --- a/trunk/ulp/opensm/user/opensm/osm_lid_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_lid_mgr.c @@ -356,12 +356,31 @@ __osm_lid_mgr_init_sweep( lmc_mask = 0xffff; /* if we came out of standby we need to discard any previous guid2lid - info we might have */ + info we might have. + Do this only if the honor_guid2lid_file option is FALSE. If not, then + need to honor this file. */ if ( p_mgr->p_subn->coming_out_of_standby == TRUE ) { - osm_db_clear( p_mgr->p_g2l ); - for (lid = 0; lid < cl_ptr_vector_get_size(&p_mgr->used_lids); lid++) - cl_ptr_vector_set(p_persistent_vec, lid, NULL); + if ( p_mgr->p_subn->opt.honor_guid2lid_file == FALSE ) + { + osm_log( p_mgr->p_log, OSM_LOG_DEBUG, + "__osm_lid_mgr_init_sweep: " + "Ignore guid2lid file when coming out of standby\n"); + osm_db_clear( p_mgr->p_g2l ); + for (lid = 0; lid < cl_ptr_vector_get_size(&p_mgr->used_lids); lid++) + cl_ptr_vector_set(p_persistent_vec, lid, NULL); + } + else + { + osm_log( p_mgr->p_log, OSM_LOG_DEBUG, + "__osm_lid_mgr_init_sweep: " + "Honor current guid2lid file when coming out of standby\n"); + osm_db_clear( p_mgr->p_g2l ); + if (osm_db_restore(p_mgr->p_g2l)) + osm_log( p_mgr->p_log, OSM_LOG_ERROR, + "osm_lid_mgr_init_sweep: ERR 0306: " + "Error restoring Guid-to-Lid persistant database. Ignoring it\n"); + } } /* we need to cleanup the empty ranges list */ diff --git a/trunk/ulp/opensm/user/opensm/osm_mcast_mgr.c b/trunk/ulp/opensm/user/opensm/osm_mcast_mgr.c index 0c683de8..fffb8e60 100644 --- a/trunk/ulp/opensm/user/opensm/osm_mcast_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_mcast_mgr.c @@ -863,7 +863,7 @@ __osm_mcast_mgr_branch( { osm_log( p_mgr->p_log, OSM_LOG_DEBUG, "__osm_mcast_mgr_branch: " - "Found leaf for port 0x%016" PRIx64 ",\n" + "Found leaf for port 0x%016" PRIx64 "\n" "\t\t\t\ton switch port 0x%X\n", cl_ntoh64( osm_port_get_guid( p_wobj->p_port ) ), i ); } @@ -1405,7 +1405,7 @@ osm_mcast_mgr_dump_mcast_routes( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_mcast_mgr_dump_mcast_routes: ERR 0A23: " - "Fail to open mcfdb file (%s)\n", + "Failed to open mcfdb file (%s)\n", file_name ); goto Exit; } @@ -1670,7 +1670,6 @@ osm_mcast_mgr_process_mgrp_cb( osm_mcast_mgr_process_mgrp( p_mgr, p_mgrp, req_type, port_guid ); p_mgrp->last_tree_id = p_mgrp->last_change_id; } - CL_PLOCK_RELEASE( p_mgr->p_lock ); /* Remove MGRP only if osm_mcm_port_t count is 0 and * Not a well known group @@ -1683,18 +1682,17 @@ osm_mcast_mgr_process_mgrp_cb( "Destroying mgrp with lid:0x%X\n", cl_ntoh16(mlid) ); - /* Send a Report to any InformInfo registerd for + /* Send a Report to any InformInfo registered for Trap 67 : MCGroup delete */ osm_mgrp_send_delete_notice( p_mgr->p_subn, p_mgr->p_log, p_mgrp ); - CL_PLOCK_EXCL_ACQUIRE( p_mgr->p_lock ); cl_qmap_remove_item(&p_mgr->p_subn->mgrp_mlid_tbl, (cl_map_item_t *)p_mgrp ); osm_mgrp_destroy(p_mgrp); - CL_PLOCK_RELEASE( p_mgr->p_lock ); } - /* no need for CL_PLOCK_RELEASE( p_mgr->p_lock ) - internally done */ + + CL_PLOCK_RELEASE( p_mgr->p_lock ); OSM_LOG_EXIT( p_mgr->p_log ); return signal; } diff --git a/trunk/ulp/opensm/user/opensm/osm_port.c b/trunk/ulp/opensm/user/opensm/osm_port.c index 1cabf922..45e84c92 100644 --- a/trunk/ulp/opensm/user/opensm/osm_port.c +++ b/trunk/ulp/opensm/user/opensm/osm_port.c @@ -410,7 +410,7 @@ osm_physp_calc_link_mtu( "MTU mismatch between ports." "\n\t\t\t\tPort 0x%016" PRIx64 ", port# 0x%X" " and port 0x%016" PRIx64 ", port# 0x%X." - "\n\t\t\t\tUsing lower MTU of %u.\n", + "\n\t\t\t\tUsing lower MTU of %u\n", cl_ntoh64( osm_physp_get_port_guid( p_physp ) ), osm_physp_get_port_num( p_physp ), cl_ntoh64( osm_physp_get_port_guid( p_remote_physp ) ), @@ -424,7 +424,7 @@ osm_physp_calc_link_mtu( { osm_log( p_log, OSM_LOG_DEBUG, "osm_physp_calc_link_mtu: ERR 4101: " - "Invalid MTU = 0. Forcing correction to 256.\n" ); + "Invalid MTU = 0. Forcing correction to 256\n" ); mtu = 1; } @@ -483,7 +483,7 @@ osm_physp_calc_link_op_vls( "OP_VLS mismatch between ports." "\n\t\t\t\tPort 0x%016" PRIx64 ", port# 0x%X" " and port 0x%016" PRIx64 ", port# 0x%X." - "\n\t\t\t\tUsing lower OP_VLS of %u.\n", + "\n\t\t\t\tUsing lower OP_VLS of %u\n", cl_ntoh64( osm_physp_get_port_guid( p_physp ) ), osm_physp_get_port_num( p_physp ), cl_ntoh64( osm_physp_get_port_guid( p_remote_physp ) ), @@ -501,7 +501,7 @@ osm_physp_calc_link_op_vls( { osm_log( p_log, OSM_LOG_DEBUG, "osm_physp_calc_link_op_vls: ERR 4102: " - "Invalid OP_VLS = 0. Forcing correction to 256.\n" ); + "Invalid OP_VLS = 0. Forcing correction to 256\n" ); op_vls = 1; } @@ -551,7 +551,7 @@ __osm_physp_get_dr_physp_set( { osm_log( p_log, OSM_LOG_ERROR, "__osm_physp_get_dr_nodes_set: ERR 4103: " - "Fail to find the SM own port by guid.\n"); + "Failed to find the SM own port by guid\n"); status = CL_ERROR; goto Exit; } @@ -715,7 +715,7 @@ osm_physp_replace_dr_path_with_alternate_dr_path( { osm_log( p_log, OSM_LOG_ERROR, "osm_physp_replace_dr_path_with_alternate_dr_path: ERR 4105: " - "No SM port object.\n" ); + "No SM port object\n" ); goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info.c b/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info.c index 306144f6..58d9dab7 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_class_port_info.c @@ -63,6 +63,17 @@ #include #include +#define MAX_MSECS_TO_RTV 24 +/* Precalculated table in msec (index is related to encoded value) */ +/* 4.096 usec * 2 ** n (where n = 8 - 31) */ +static uint32_t __msecs_to_rtv_table[MAX_MSECS_TO_RTV] = + { 1, 2, 4, 8, + 16, 33, 67, 134, + 268, 536, 1073, 2147, + 4294, 8589, 17179, 34359, + 68719, 137438, 274877, 549755, + 1099511, 2199023, 4398046, 8796093 }; + /********************************************************************** **********************************************************************/ void @@ -122,6 +133,7 @@ __osm_cpi_rcv_respond( ib_class_port_info_t *p_resp_cpi; ib_api_status_t status; ib_gid_t zero_gid; + uint8_t rtv; OSM_LOG_ENTER( p_rcv->p_log, __osm_cpi_rcv_respond ); @@ -156,7 +168,18 @@ __osm_cpi_rcv_respond( /* finally do it (the job) man ! */ p_resp_cpi->base_ver = 1; p_resp_cpi->class_ver = 2; - p_resp_cpi->resp_time_val = p_rcv->p_subn->opt.transaction_timeout; + /* Calculate encoded response time value */ + /* transaction timeout is in msec */ + if (p_rcv->p_subn->opt.transaction_timeout > __msecs_to_rtv_table[MAX_MSECS_TO_RTV]) + rtv = MAX_MSECS_TO_RTV - 1; + else { + for (rtv = 0; rtv < MAX_MSECS_TO_RTV; rtv++) { + if (p_rcv->p_subn->opt.transaction_timeout <= __msecs_to_rtv_table[rtv]) + break; + } + } + rtv += 8; + p_resp_cpi->resp_time_val = rtv; p_resp_cpi->redir_gid = zero_gid; p_resp_cpi->redir_tc_sl_fl = 0; p_resp_cpi->redir_lid = 0; diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_informinfo.c b/trunk/ulp/opensm/user/opensm/osm_sa_informinfo.c index 6dd4876f..a00ac1f8 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_informinfo.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_informinfo.c @@ -440,7 +440,7 @@ osm_infr_rcv_process_set_method( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_infr_rcv_process_set_method: ERR 4305: " - "Fail to validate a new inform object\n"); + "Failed to validate a new inform object\n"); /* o13-13.1.1: we need to set the subscribe bit to 0 */ p_recvd_inform_info->subscribe = 0; @@ -463,7 +463,7 @@ osm_infr_rcv_process_set_method( osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_infr_rcv_process_set_method: ERR 4306: " - "Fail to create a new inform object\n"); + "Failed to create a new inform object\n"); /* o13-13.1.1: we need to set the subscribe bit to 0 */ p_recvd_inform_info->subscribe = 0; @@ -498,7 +498,7 @@ osm_infr_rcv_process_set_method( /* No Such Item - So Error */ osm_log( p_rcv->p_log, OSM_LOG_ERROR, "osm_infr_rcv_process_set_method: ERR 4307: " - "Fail to Un-Subscribe to non exiting inform object\n"); + "Failed to UnSubscribe to non exiting inform object\n"); /* o13-13.1.1: we need to set the subscribe bit to 0 */ p_recvd_inform_info->subscribe = 0; diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_lft_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_lft_record.c index 549a7c01..933eea73 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_lft_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_lft_record.c @@ -242,7 +242,7 @@ __osm_lftr_rcv_by_comp_mask( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_lftr_rcv_by_comp_mask: ERR 4405: " - "Fail to find Port by Node Guid:0x%016" PRIx64 + "Failed to find Port by Node Guid:0x%016" PRIx64 "\n", cl_ntoh64( p_sw->p_node->node_info.node_guid ) ); @@ -259,7 +259,7 @@ __osm_lftr_rcv_by_comp_mask( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_lftr_rcv_by_comp_mask: ERR 4406: " - "Fail to find default physical Port by Node Guid:0x%016" PRIx64 + "Failed to find default physical Port by Node Guid:0x%016" PRIx64 "\n", cl_ntoh64( p_sw->p_node->node_info.node_guid ) ); diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record.c index 1460cc81..e69ed18f 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record.c @@ -1331,7 +1331,6 @@ osm_mcmr_rcv_create_new_mgrp( /* create a new MC Group */ *pp_mgrp = osm_mgrp_new(mlid); - if (*pp_mgrp == NULL) { osm_log( p_rcv->p_log, OSM_LOG_ERROR, @@ -1597,7 +1596,7 @@ osm_mcmr_rcv_join_mgrp( CL_PLOCK_RELEASE( p_rcv->p_lock ); goto Exit; } - + if (! osm_physp_share_pkey( p_rcv->p_log, p_physp, p_request_physp)) { CL_PLOCK_RELEASE( p_rcv->p_lock ); @@ -1932,14 +1931,7 @@ __osm_sa_mcm_by_comp_mask_cb( if (! osm_physp_has_pkey( p_rcv->p_log, p_mgrp->mcmember_rec.pkey, p_req_physp )) goto Exit; - /* - * o15-0.1.16: If SA supports UD multicast, then if it receives a - * SubnAdmGetTable() of MCMemberRecord with the MCMemberRecord:PortGID - * wildcarded, then SA shall return a single MCMemberRecord for each - * multicast group that matches the query operation. - */ - - /* so did we got the PortGUID mask */ + /* so did we get the PortGUID mask */ if (IB_MCR_COMPMASK_PORT_GID & comp_mask) { /* try to find this port */ @@ -2199,7 +2191,7 @@ osm_mcmr_query_mgrp(IN osm_mcmr_recv_t* const p_rcv, the mad is valid. Meaning - is either zero or equal to the local sm_key. */ - if (p_resp_sa_mad->sm_key == 0) + if (p_rcvd_mad->sm_key == 0) trusted_req = FALSE; for ( i = 0; i < pre_trim_num_rec; i++ ) diff --git a/trunk/ulp/opensm/user/opensm/osm_sa_service_record.c b/trunk/ulp/opensm/user/opensm/osm_sa_service_record.c index 25c8b09d..90fc71c2 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sa_service_record.c +++ b/trunk/ulp/opensm/user/opensm/osm_sa_service_record.c @@ -498,7 +498,6 @@ __get_matching_sr( ib_net64_t comp_mask = p_sr_item->comp_mask; const osm_physp_t* p_req_physp = p_ctxt->p_req_physp; - if((comp_mask & IB_SR_COMPMASK_SID) == IB_SR_COMPMASK_SID) { if(p_sr_item->p_service_rec->service_id != diff --git a/trunk/ulp/opensm/user/opensm/osm_sm_mad_ctrl.c b/trunk/ulp/opensm/user/opensm/osm_sm_mad_ctrl.c index dfceb40d..29d3354b 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sm_mad_ctrl.c +++ b/trunk/ulp/opensm/user/opensm/osm_sm_mad_ctrl.c @@ -852,7 +852,7 @@ __osm_sm_mad_ctrl_send_err_cb( { osm_log( p_ctrl->p_log, OSM_LOG_ERROR, "__osm_sm_mad_ctrl_send_err_cb: ERR 3114: " - "Fail to find the corresponding phys port\n"); + "Failed to find the corresponding phys port\n"); } else { diff --git a/trunk/ulp/opensm/user/opensm/osm_sm_state_mgr.c b/trunk/ulp/opensm/user/opensm/osm_sm_state_mgr.c index 2b420565..6791bf3f 100644 --- a/trunk/ulp/opensm/user/opensm/osm_sm_state_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_sm_state_mgr.c @@ -377,7 +377,7 @@ __osm_sm_state_mgr_polling_callback( { osm_log( p_sm_mgr->p_log, OSM_LOG_ERROR, "__osm_sm_state_mgr_polling_callback : ERR 3211: " - "Failed to re-start timer\n" ); + "Failed to restart timer\n" ); } Exit: diff --git a/trunk/ulp/opensm/user/opensm/osm_state_mgr.c b/trunk/ulp/opensm/user/opensm/osm_state_mgr.c index e4590832..79cf8b06 100644 --- a/trunk/ulp/opensm/user/opensm/osm_state_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_state_mgr.c @@ -1351,7 +1351,7 @@ __osm_state_mgr_report( } else { - sprintf( line, " %s : %s : %s ", " ", " ", " " ); + sprintf( line, " %s : %s : %s ", " ", " ", " " ); } strcat( p_mgr->p_report_buf, line ); diff --git a/trunk/ulp/opensm/user/opensm/osm_subnet.c b/trunk/ulp/opensm/user/opensm/osm_subnet.c index 41a92da8..0d4ed6aa 100644 --- a/trunk/ulp/opensm/user/opensm/osm_subnet.c +++ b/trunk/ulp/opensm/user/opensm/osm_subnet.c @@ -390,6 +390,7 @@ osm_subn_set_default_opt( IN osm_subn_opt_t* const p_opt ) { cl_memclr(p_opt, sizeof(osm_subn_opt_t)); + p_opt->guid = 0; p_opt->m_key = OSM_DEFAULT_M_KEY; p_opt->sm_key = OSM_DEFAULT_SM_KEY; p_opt->subnet_prefix = IB_DEFAULT_SUBNET_PREFIX; @@ -420,6 +421,8 @@ osm_subn_set_default_opt( p_opt->polling_retry_number = 4; p_opt->force_heavy_sweep = FALSE; p_opt->log_flags = 0; + p_opt->honor_guid2lid_file = FALSE; + p_opt->dump_files_dir = getenv("OSM_TMP_DIR"); if (!p_opt->dump_files_dir) p_opt->dump_files_dir = OSM_DEFAULT_TMP_DIR; @@ -627,7 +630,10 @@ osm_subn_parse_conf_file( if (p_key) { p_val = strtok_r(NULL, " \t\n", &p_last); - + + __osm_subn_opts_unpack_net64( + "guid", p_key, p_val, &p_opts->guid); + __osm_subn_opts_unpack_net64( "m_key", p_key, p_val, &p_opts->m_key); @@ -768,6 +774,11 @@ osm_subn_parse_conf_file( __osm_subn_opts_unpack_boolean( "exit_on_fatal", p_key, p_val, &p_opts->exit_on_fatal); + + __osm_subn_opts_unpack_boolean( + "honor_guid2lid_file", + p_key, p_val, &p_opts->honor_guid2lid_file); + } } fclose(opts_file); @@ -795,6 +806,8 @@ osm_subn_write_conf_file( fprintf( opts_file, "#\n# DEVICE ATTRIBUTES OPTIONS\n#\n" + "# The port GUID on which the OpenSM is running.\n" + "guid 0x%016" PRIx64 "\n\n" "# M_Key value sent to all ports qualifing all Set(PortInfo).\n" "m_key 0x%016" PRIx64 "\n\n" "# The lease period used for the M_Key on this subnet in [msec]\n" @@ -826,6 +839,7 @@ osm_subn_write_conf_file( "local_phy_errors_threshold 0x%02x\n\n" "# Threshold of credits over-run errors for sending Trap 129\n" "overrun_errors_threshold 0x%02x\n\n", + cl_ntoh64(p_opts->guid), cl_ntoh64(p_opts->m_key), cl_ntoh16(p_opts->m_key_lease_period), cl_ntoh64(p_opts->sm_key), @@ -891,11 +905,15 @@ osm_subn_write_conf_file( "# Timeout in [sec] between two polls of active master SM\n" "sminfo_polling_timeout %u\n\n" "# Number of failing polls of remote SM that declares it dead\n" - "polling_retry_number %u\n\n", + "polling_retry_number %u\n" + "# If true honor the guid2lid file when coming out of standby\n" + "# state, if such file exists and is valid\n" + "honor_guid2lid_file %s\n\n", p_opts->sm_priority, p_opts->ignore_other_sm ? "TRUE" : "FALSE", p_opts->sminfo_polling_timeout, - p_opts->polling_retry_number + p_opts->polling_retry_number, + p_opts->honor_guid2lid_file ? "TRUE" : "FALSE" ); fprintf( diff --git a/trunk/ulp/opensm/user/opensm/osm_trap_rcv.c b/trunk/ulp/opensm/user/opensm/osm_trap_rcv.c index 29d7228f..dcdef2ea 100644 --- a/trunk/ulp/opensm/user/opensm/osm_trap_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_trap_rcv.c @@ -136,7 +136,6 @@ osm_trap_rcv_aging_tracker_callback( port_num = (uint8_t)(( key & 0x00FF000000000000ULL) >> 48); p_physp = __get_physp_by_lid_and_num( p_rcv, lid, port_num ); - if (!p_physp) { osm_log( p_rcv->p_log, OSM_LOG_VERBOSE, @@ -482,7 +481,7 @@ __osm_trap_rcv_process_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_trap_rcv_process_request: ERR 3804: " - "Received the trap %u times continuously\n", + "Received trap %u times consecutively\n", num_received); /* * If the trap provides info about a bad port @@ -502,7 +501,7 @@ __osm_trap_rcv_process_request( { osm_log( p_rcv->p_log, OSM_LOG_ERROR, "__osm_trap_rcv_process_request: ERR 3805: " - "Fail to find physical port by lid:0x%02X num:%u\n", + "Failed to find physical port by lid:0x%02X num:%u\n", cl_ntoh16(p_ntci->data_details.ntc_129_131.lid), p_ntci->data_details.ntc_129_131.port_num ); diff --git a/trunk/ulp/opensm/user/opensm/osm_ucast_mgr.c b/trunk/ulp/opensm/user/opensm/osm_ucast_mgr.c index 017d95c0..02e88169 100644 --- a/trunk/ulp/opensm/user/opensm/osm_ucast_mgr.c +++ b/trunk/ulp/opensm/user/opensm/osm_ucast_mgr.c @@ -239,7 +239,7 @@ osm_ucast_mgr_dump_ucast_routes( { osm_log( p_mgr->p_log, OSM_LOG_ERROR, "osm_ucast_mgr_dump_ucast_routes: ERR 3A12: " - "Fail to open fdb file (%s)\n", + "Failed to open fdb file (%s)\n", file_name ); goto Exit; } diff --git a/trunk/ulp/opensm/user/opensm/osm_ucast_updn.c b/trunk/ulp/opensm/user/opensm/osm_ucast_updn.c index 2aaea04a..24fea111 100644 --- a/trunk/ulp/opensm/user/opensm/osm_ucast_updn.c +++ b/trunk/ulp/opensm/user/opensm/osm_ucast_updn.c @@ -546,7 +546,7 @@ updn_init( { osm_log( &osm.log, OSM_LOG_ERROR, "osm_opensm_init : ERR AA02: " - "Fail to open guid list file (%s)\n", + "Failed to open guid list file (%s)\n", osm.subn.opt.updn_guid_file); status = IB_NOT_FOUND; goto Exit;