*/
#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
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;
* 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
*********/
/****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 )
{
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;
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;
* 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.
*
* SYNOPSIS
*/
#ifdef __WIN__
-#define OSM_DEFAULT_TMP_DIR GetOsmPath()
+#define OSM_DEFAULT_TMP_DIR GetOsmTempPath()
#else
#define OSM_DEFAULT_TMP_DIR "/tmp/"
#endif
* 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
* 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
*/
typedef struct _osm_subn_opt
{
+ ib_net64_t guid;
ib_net64_t m_key;
ib_net64_t sm_key;
ib_net64_t subnet_prefix;
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).
*
* 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
*********/
#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
* 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
"\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"
#define OSM_VENDOR_ID_IBM 0x000255
#define OSM_VENDOR_ID_DIVERGENET 0x00084E
#define OSM_VENDOR_ID_FLEXTRONICS 0x000B8C
+#define OSM_VENDOR_ID_AGILENT 0x0030D3
/**********************************************************************
**********************************************************************/
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)) )
return( divergenet_str );
case OSM_VENDOR_ID_FLEXTRONICS:
return( flextronics_str );
+ case OSM_VENDOR_ID_AGILENT:
+ return( agilent_str );
default:
return( unknown_str );
}
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 );
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.
*/
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;
}
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;
}
"Unable to create address vector (%s).\n",
ib_get_err_str( status ) );
+ cl_free( p_bind );
+ p_bind = 0;
goto Exit;
}
int iArg=1;
char*
-GetOsmPath(void)
+GetOsmTempPath(void)
{
char* temp_path;
int length;
}
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,
#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);
" 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"
}
#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 )
{
/**********************************************************************
**********************************************************************/
-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;
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
{ "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 */
};
/*
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':
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 ':':
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 )
{
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 );
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);
+}
--- /dev/null
+#\r
+# DEVICE ATTRIBUTES OPTIONS\r
+#\r
+# The port GUID on which the OpenSM is running.\r
+#guid <PORT GUID>\r
+\r
+# M_Key value sent to all ports qualifing all Set(PortInfo).\r
+m_key 0x0000000000000000\r
+\r
+# The lease period used for the M_Key on this subnet in [msec]\r
+m_key_lease_period 0\r
+\r
+# SM_Key value of the SM to qualify rcv SA queries as 'trusted'\r
+sm_key 0x0100000000000000\r
+\r
+# Subnet prefix used on this subnet\r
+subnet_prefix 0xfe80000000000000\r
+\r
+# The LMC value used on this subnet\r
+lmc 0\r
+\r
+# The code of maximal time a packet can live in a switch\r
+# The actual time is 4.096usec * 2^<packet_life_time code>\r
+# The value 0x14 disables this mechanism\r
+packet_life_time 0x12\r
+\r
+# The code of maximal time a packet can wait at the head of\r
+# transmission queue. \r
+# The actual time is 4.096usec * 2^<head_of_queue_lifetime>\r
+# The value 0x14 disables this mechanism\r
+head_of_queue_lifetime 0x12\r
+\r
+# The maximal time a packet can wait at the head of queue on \r
+# switch port connected to a HCA\r
+leaf_head_of_queue_lifetime 0x0c\r
+\r
+# Limit the maximal operational VLs\r
+max_op_vls 5\r
+\r
+# The subnet_timeout code that will be set for all the ports\r
+# The actual timeout is 4.096usec * 2^<subnet_timeout code>\r
+subnet_timeout 18\r
+\r
+# Threshold of local phy errors for sending Trap 129\r
+local_phy_errors_threshold 0x08\r
+\r
+# Threshold of credits over-run errors for sending Trap 129\r
+overrun_errors_threshold 0x08\r
+\r
+#\r
+# SWEEP OPTIONS\r
+#\r
+# The number of seconds between subnet sweeps (0 disables it)\r
+sweep_interval 10\r
+\r
+# If TRUE cause all lids to be re-assigned\r
+reassign_lids FALSE\r
+\r
+# If TRUE ignore existing LFT entries on first sweep (default).\r
+# Otherwise only non minimal hop cases are modified.\r
+# NOTE: A standby SM clears its first sweep flag - since the\r
+# master SM already sweeps...\r
+reassign_lfts TRUE\r
+\r
+# If true forces every sweep to be a heavy sweep\r
+force_heavy_sweep FALSE\r
+\r
+# If true every trap will cause a heavy sweep.\r
+# NOTE: successive same traps (>10) are supressed\r
+sweep_on_trap TRUE\r
+\r
+#\r
+# ROUTING OPTIONS\r
+#\r
+# If true do not count switches as link subscriptions\r
+port_profile_switch_nodes FALSE\r
+\r
+# Activate the Up/Down routing algorithm\r
+updn_activate FALSE\r
+\r
+#\r
+# HANDOVER - MULTIPLE SM's OPTIONS\r
+#\r
+# SM priority used for deciding who is the master\r
+sm_priority 1\r
+\r
+# If TRUE other SM's on the subnet should be ignored\r
+ignore_other_sm FALSE\r
+\r
+# Timeout in [sec] between two polls of active master SM\r
+sminfo_polling_timeout 10000\r
+\r
+# Number of failing polls of remote SM that declares it dead\r
+polling_retry_number 4\r
+\r
+#\r
+# TIMING AND THREADING OPTIONS\r
+#\r
+# Number of MADs sent in parallel\r
+max_wire_smps 4\r
+\r
+# The time taken to a transaction to finish in [msec]\r
+transaction_timeout 200\r
+\r
+# Maximal time in [msec] a message can stay in the incoming message queue.\r
+# If there is more then one message in the queue and the last message\r
+# stayed in the queue more then this value any SA request will be \r
+# immediately returned with a BUSY status.\r
+max_msg_fifo_timeout 10000\r
+\r
+# Use a single thread for handling SA queries\r
+single_thread FALSE\r
+\r
+#\r
+# DEBUG FEATURES\r
+#\r
+# The log flags used\r
+log_flags 0x03\r
+\r
+# Force flush of the log file after each log message\r
+force_log_flush TRUE\r
+\r
+# Log file to be used\r
+log_file K:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1\osm.log\r
+\r
+accum_log_file TRUE\r
+\r
+# The directory to hold the file OpenSM dumps\r
+dump_files_dir C:\yael\trunk\\r
+\r
+# If TRUE if OpenSM should disable multicast support\r
+no_multicast_option FALSE\r
+\r
+# No multicast routing is performed if TRUE\r
+disable_multicast FALSE\r
+\r
+# If TRUE opensm will exit on fatal initialization issues\r
+exit_on_fatal TRUE\r
+\r
{
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;
{
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);
{
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;
{
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;
{
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);
}
{
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:
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 */
{
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 );
}
{
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;
}
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
"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;
}
"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 ) ),
{
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;
}
"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 ) ),
{
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;
}
{
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;
}
{
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;
}
#include <vendor/osm_vendor_api.h>
#include <opensm/osm_helper.h>
+#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
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 );
/* 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;
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;
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;
/* 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;
{
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 )
);
{
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 )
);
/* create a new MC Group */
*pp_mgrp = osm_mgrp_new(mlid);
-
if (*pp_mgrp == NULL)
{
osm_log( p_rcv->p_log, OSM_LOG_ERROR,
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 );
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 */
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++ )
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 !=
{
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
{
{
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:
}
else
{
- sprintf( line, " %s : %s : %s ", " ", " ", " " );
+ sprintf( line, " %s : %s : %s ", " ", " ", " " );
}
strcat( p_mgr->p_report_buf, line );
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;
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;
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);
__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);
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"
"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),
"# 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(
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,
{
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
{
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
);
{
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;
}
{
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;