]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[OpenSM] -
authoreitan <eitan@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 22 Mar 2006 08:11:06 +0000 (08:11 +0000)
committereitan <eitan@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 22 Mar 2006 08:11:06 +0000 (08:11 +0000)
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

25 files changed:
trunk/ulp/opensm/user/include/iba/ib_types.h
trunk/ulp/opensm/user/include/opensm/osm_base.h
trunk/ulp/opensm/user/include/opensm/osm_subnet.h
trunk/ulp/opensm/user/include/vendor/winosm_common.h
trunk/ulp/opensm/user/libopensm/osm_helper.c
trunk/ulp/opensm/user/libvendor/osm_vendor_al.c
trunk/ulp/opensm/user/libvendor/winosm_common.c
trunk/ulp/opensm/user/opensm/main.c
trunk/ulp/opensm/user/opensm/opensm.opts [new file with mode: 0644]
trunk/ulp/opensm/user/opensm/osm_db_files.c
trunk/ulp/opensm/user/opensm/osm_lid_mgr.c
trunk/ulp/opensm/user/opensm/osm_mcast_mgr.c
trunk/ulp/opensm/user/opensm/osm_port.c
trunk/ulp/opensm/user/opensm/osm_sa_class_port_info.c
trunk/ulp/opensm/user/opensm/osm_sa_informinfo.c
trunk/ulp/opensm/user/opensm/osm_sa_lft_record.c
trunk/ulp/opensm/user/opensm/osm_sa_mcmember_record.c
trunk/ulp/opensm/user/opensm/osm_sa_service_record.c
trunk/ulp/opensm/user/opensm/osm_sm_mad_ctrl.c
trunk/ulp/opensm/user/opensm/osm_sm_state_mgr.c
trunk/ulp/opensm/user/opensm/osm_state_mgr.c
trunk/ulp/opensm/user/opensm/osm_subnet.c
trunk/ulp/opensm/user/opensm/osm_trap_rcv.c
trunk/ulp/opensm/user/opensm/osm_ucast_mgr.c
trunk/ulp/opensm/user/opensm/osm_ucast_updn.c

index e8c4be318d5b56c062b0a2042db73bbef3b9b5b6..cbbf4432b534732340173abf1919f8ac0b093e25 100644 (file)
@@ -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.
 *
index 3fcf619586c6011ed9c18bf33360ab550de4edde..f06331e6718a90a2444081779a9219d6e139ea15 100644 (file)
@@ -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
index dcbacddf5778dc333ef61e497af212c224dca8da..3ccce640689c0c71d48f851e6a635d5f9c6acfcc 100644 (file)
@@ -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
 *********/
index c20f3ddc92ae16a53f6a3eb02a971a92f1fc8b35..75738f909c9f170ac4f96c19f9e68f54997acfe4 100644 (file)
@@ -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 
index bed65851414fe379ff064585009f82933f5f3924..14718502ee999f06dd0b77eb714c41325bd546e6 100644 (file)
@@ -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 );
   }
index 891026ff86b18014639be5e45e33c3c8b82d5a85..04715b8b1f5ca27f1c03b6c21ff7b19bcb3c85fd 100644 (file)
@@ -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;
   }
 
index a12410ab813b408c32c5e5ba75498e56c64b35ec..361d2c0028ae1867f0367f1cd5a82b207ceeca04 100644 (file)
@@ -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,
index 34e5e4110860d25616af59847cdfa76e090f9f42..49671610a0601ee811135939472f80f534f646a9 100644 (file)
@@ -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 (file)
index 0000000..1e0a18b
--- /dev/null
@@ -0,0 +1,139 @@
+#\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
index 8527a57ee90896b38267d0becb6297bbdd321fba..0ac9234e88173bb960efd4dc324dd3cc9c2eb8bc 100644 (file)
@@ -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:
index c481dd58fb5a8c5fbd96a105aabccfd409b39abd..2f0752fdc0d73dd382683e185bcdf05b074966d5 100644 (file)
@@ -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 */
index 0c683de805de82334479c13cacc71bb50051a99b..fffb8e605a5d5d6690abc4cbc767d4597e4dcd85 100644 (file)
@@ -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;
   }
index 1cabf9228574ebdecb81090a176a3aa66f562ec3..45e84c928f19b83843e1fd0f08d38346e12e2e2c 100644 (file)
@@ -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;
   }
   
index 306144f60e914f145458218844165dc469b509f6..58d9dab75f64a0b1a60db76fb89c59439d4dfccf 100644 (file)
 #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
@@ -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;
index 6dd4876f50711a2387aaf75bcaee20899eb33359..a00ac1f88f8614473403f30677ae9b8301b41ca7 100644 (file)
@@ -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;
index 549a7c01ee08c2c3e0a8d4ed5d81c16ce7c32210..933eea73048697acc3eb9118575d2bfc6de25343 100644 (file)
@@ -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 )
              );
index 1460cc814865b81a6634a367a9e8a2cde3024f40..e69ed18f5847939e7bc87e4eacfad9036421fd0e 100644 (file)
@@ -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++ )
index 25c8b09dbf59396fc10f1a99306849c6834feef8..90fc71c250a3923fa140ecb0102535c240942add 100644 (file)
@@ -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 !=
index dfceb40d61379ed080f5f12151c25d1432cf83dd..29d3354b7116a67b0be68ea31379d5305a38e33a 100644 (file)
@@ -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
       {
index 2b420565919b8e0b485c520832b22fa1b70d2456..6791bf3f2a71380b7b319bd930855bf512185181 100644 (file)
@@ -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:
index e4590832bccd3d4a91a3ca97b36742071eff5977..79cf8b06319356ec198524cff2007c437b494417 100644 (file)
@@ -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 );
 
index 41a92da86ed4609b47a03a7e90a66798e2cce0f8..0d4ed6aa876a8f9911e2554d5daab2bc6f40ee2a 100644 (file)
@@ -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(
index 29d7228fa0d8ba6d00555524f7d1dc32a6cdb1ec..dcdef2eade6fb46574c04cb108deb8ac3487608b 100644 (file)
@@ -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
                    );
index 017d95c06f2b70a5c9dbd1652229fe5e5489edfe..02e881696fc9166be4a23c32b89a2af5c674cf17 100644 (file)
@@ -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;
   }
index 2aaea04a49c72814bb2bd1860e5639480afeaf58..24fea111ef13331baad86b143432cce357208cd8 100644 (file)
@@ -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;