[Pkg-ofed-commits] [opensm] 01/04: Imported Upstream version 3.3.19

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Thu Jul 23 09:29:42 UTC 2015


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to branch master
in repository opensm.

commit eafa3428d7c9467a02489012de89e640bbab4f10
Author: Ana Guerrero López <ana at ekaia.org>
Date:   Thu Jul 23 10:33:48 2015 +0200

    Imported Upstream version 3.3.19
---
 ChangeLog                           | 299 +++++++++++++++++++++++++++++++++++-
 complib/cl_dispatcher.c             |   5 +
 complib/libosmcomp.ver              |   2 +-
 configure                           |  25 +--
 configure.in                        |   5 +-
 doc/opensm_release_notes-3.3.txt    |  84 +++++++++-
 doc/partition-config.txt            |  75 +++++----
 doc/performance-manager-HOWTO.txt   |  48 ++++--
 include/config.h.in                 |   3 +
 include/iba/ib_types.h              |  44 ++++++
 include/opensm/osm_config.h         |   4 +
 include/opensm/osm_config.h.in      |   4 +
 include/opensm/osm_perfmgr.h        |   5 +
 include/opensm/osm_subnet.h         |  19 ++-
 include/opensm/osm_version.h        |   2 +-
 include/vendor/osm_vendor_ibumad.h  |   2 +-
 libvendor/libosmvendor.ver          |   2 +-
 libvendor/osm_vendor_ibumad.c       |  15 +-
 libvendor/osm_vendor_ibumad_sa.c    |   6 +-
 man/opensm.8                        |  79 +++++-----
 man/opensm.8.in                     |  79 +++++-----
 opensm.spec                         |   6 +-
 opensm/libopensm.ver                |   2 +-
 opensm/main.c                       |   2 +-
 opensm/osm_congestion_control.c     |  31 ++--
 opensm/osm_console.c                |  28 +++-
 opensm/osm_console_io.c             |   2 +-
 opensm/osm_drop_mgr.c               |   3 -
 opensm/osm_dump.c                   |   1 +
 opensm/osm_lid_mgr.c                |  28 ++--
 opensm/osm_link_mgr.c               |   3 +-
 opensm/osm_mcast_mgr.c              |  63 ++++++--
 opensm/osm_perfmgr.c                |  64 ++++++--
 opensm/osm_pkey_mgr.c               |   2 +-
 opensm/osm_port_info_rcv.c          |   3 +-
 opensm/osm_prtn.c                   |   2 +-
 opensm/osm_req.c                    |   2 +-
 opensm/osm_sa.c                     |  15 +-
 opensm/osm_sa_multipath_record.c    |  26 ++--
 opensm/osm_sa_path_record.c         |  31 ++--
 opensm/osm_sm_state_mgr.c           |  18 +--
 opensm/osm_state_mgr.c              |  41 ++++-
 opensm/osm_subnet.c                 |  20 ++-
 opensm/osm_switch.c                 |   5 +-
 opensm/osm_ucast_mgr.c              |   4 +-
 osmeventplugin/src/osmeventplugin.c |   1 +
 osmtest/main.c                      |   2 +-
 osmtest/osmtest.c                   |  13 +-
 48 files changed, 933 insertions(+), 292 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e74a8a8..cf775b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,302 @@
 
-** Version: HEAD
+** Version: opensm-3.3.19
+
+Wed Dec 17 20:01:21 2014 +0200 Hal Rosenstock
+fa92807d9c0d60b6aaa66c5303b19a8c5ec101c6
+
+	* Update opensm_release_notes-3.3.txt
+
+Wed Dec 17 19:41:39 2014 +0200 Hal Rosenstock
+2a30f922f4414763aac72d7f55c00c919bd2e63b
+
+	* Update package number for OpenSM to 3.3.19 for release
+
+Wed Dec 17 19:38:29 2014 +0200 Hal Rosenstock
+e29f77a6996da847e235b75316be9577b081f498
+
+	* Update (internal) shared library versions
+
+Sat Dec 13 18:19:13 2014 +0200 Hal Rosenstock
+28fd4eefb2e112039a3ac0081890adb4d6fd3597
+
+	* osm_[subnet congestion_control].c: Cosmetic commentary change
+
+Sat Dec 13 16:54:51 2014 +0200 Hal Rosenstock
+391c244f350b91a03a4b3a0591737f27ca3bbb33
+
+	* osm_congestion_control.c: Added Mellanox copyright
+
+Sat Dec 13 16:49:48 2014 +0200 Hal Rosenstock
+7e08621264f70af7f9875409bae86938f0aaa448
+
+	* osm_congestion_control.c: In cc_rcv_mad, add attribute ID and modifier to log message
+
+Sat Dec 13 16:37:31 2014 +0200 Hal Rosenstock
+62075d689bee0fd75beb5ecdace97424670930f4
+
+	* osm_perfmgr.c: Fix endian of MAD status in pc_recv_process
+
+Sat Dec 13 16:36:03 2014 +0200 Hal Rosenstock
+cd94c9cc7c4d096c4450e760b392f0c23cdc6753
+
+	* osm_congestion_control.c: Fix endian of MAD status in cc_rcv_mad
+
+Sat Dec 13 16:31:44 2014 +0200 Hal Rosenstock
+cb5df8bbbbb67aceb6ddfd15fbff4979d5bed437
+
+	* osm_congestion_control.c: Fix endian of node and port GUIDs in some log messages
+
+Sat Dec 13 16:11:34 2014 +0200 Hal Rosenstock
+68887fb2388a6f1c7154ffa70bc89eab43177f98
+
+	* osm_congestion_control.c: Cosmetic changes
+
+Tue Dec 9 19:32:18 2014 +0200 Daniel Klein
+5077198d156636c547f2a4ab4099439ddccd390e
+
+	* osm_perfmgr.c: Reset physp_discovered before discovery
+
+Wed Dec 10 09:30:50 2014 +0200 Shlomi Nimrodi
+1331a46b017ff83e819f85bdbd3d1659182c3225
+
+	* osm_subnet.[h c]: Fix possibility for open file descriptor issue
+
+Mon Dec 8 10:39:12 2014 -0800 Albert Chu
+ce15bb76b58e50f2606e1c96077d40216a610bcc
+
+	* osm_perfmgr.c: Output remote port on perfmgr error counter log messages
+
+Mon Dec 1 11:11:00 2014 +0200 Tomer Cohen
+030ac82209e920f09ff24ebe101a41e5c9bb3103
+
+	* osm_sa.c: Improve ERR 4C05 log message
+
+Tue Dec 2 14:01:33 2014 +0200 Daniel Klein
+fbb63d6c3d9b7bcaf34c47a7840b74d39b0c8807
+
+	* osm_subnet.c: Update MEPI supported devices white list
+
+Tue Dec 2 20:52:21 2014 +0200 Hal Rosenstock
+0774229f1f2ec90665b6798456921c6b661b7d76
+
+	* osm_subnet.c: Cosmetic formatting change
+
+Tue Nov 18 16:14:22 2014 +0200 Daniel Klein
+5871ef71c177de927f105caa7c6a56aadc3d3d1d
+
+	* osm_sa.c: Check return value from chmod in opensm_dump_to_file
+
+Thu Nov 20 11:15:11 2014 +0200 Daniel Klein
+8d51ae5dabdbe66f8e276ad372c8f4adcada85b2
+
+	* osm_state_mgr.c: Avoid continuing discovery when SM port is unresponsive
+
+Mon Nov 17 19:18:39 2014 +0200 Daniel Klein
+61cd0cfb9760904d1d49cf190bbaffe4c058d781
+
+	* osm_switch.c: Fix potential memory leak due to misuse of realloc
+
+Tue Dec 11 12:27:03 2012 +0200 Alex Netes
+c78adde242ddcd67f8f1a84ab8721d25fa886f03
+
+	* osm_req.c: Initialize dest_port_guid in req_determine_mkey
+
+Tue Nov 4 16:03:21 2014 +0200 Daniel Klein
+dd5e5dff8e1865a6c2d06ebbdf2a303562885a85
+
+	* osm_mcast_mgr.c: Add MLID to error 0A06 log message
+
+Thu Apr 25 19:20:31 2013 +0300 Alex Netes
+f017063f57ce2abaedd24c420915c72db9815c91
+
+	* Better way to handle polling other MASTER SM
+
+Thu Oct 30 16:30:15 2014 +0200 Hal Rosenstock
+63900bcc9fdba2c02b32a8ace2123f28ffaf276e
+
+	* osm_vendor_ibumad.h: Use UMAD_MAX_DEVICES for OSM_UMAD_MAX_CAS
+
+Tue Oct 14 08:53:08 2014 +0200 Daniel Klein
+25e5ee52cc2df4fba81483d0c9d220b5dbbbf975
+
+	* complib/cl_dispatcher.c: Check registrations vector size when searching for handlers
+
+Tue Oct 7 16:17:47 2014 +0200 Dan Ben Yosef
+a5c0200ea101a24f3f1753e608cb0b677403a562
+
+	* iba/ib_types.h: Add support for new MAD SM:PortInfoExtended and for modifying PM:PortExtendedSpeedsCounters
+
+Tue Oct 21 17:18:21 2014 +0200 Hal Rosenstock
+3f9953573f0cecb482d17d01da7cb8e2f867a85e
+
+	* osm_port_info_rcv.c: In osm_pi_rcv_process, move assert before first log message
+
+Tue Oct 21 10:26:02 2014 +0200 Vladimir Koushnir
+6b0fb4d1881e3c227d4c2950b1bee208728a81d9
+
+	* osm_lid_mgr.c: Send client reregistration in case of SM LID change
+
+Sun Oct 19 18:25:09 2014 +0200 Shlomi Nimrodi
+5d231f8791fc166ceba6a5171d122e7409f2524c
+
+	* osm_pkey_mgr.c: Use calloc instead of malloc in pkey_mgr_process_physical_port
+
+Mon Oct 13 15:29:24 2014 +0200 Vladimir Koushnir
+985859e552dcb8802b1bad1250cf848745f2373d
+
+	* Fix turning on first_time_master_sweep flag
+
+Tue Oct 7 10:01:10 2014 +0200 Daniel Klein
+4629e80e48d6a618e55b372a191d884b556738b3
+
+	* osm_mcast_mgr.c: Invalidate cache due to multicast routing errors
+
+Tue Sep 16 16:32:38 2014 +0300 Daniel Klein
+a0b94442bfb217fbecf2f108781cc0863ae8da08
+
+	* Change osm_subn_t.log_max_size type to uint32_t
+
+Thu Sep 25 17:40:40 2014 +0300 Hal Rosenstock
+b5abaa2883ecb3973febe97bcc15c7ce45b3c97d
+
+	* osmeventplugin.c: Add include of osm_config.h as first OpenSM include
+
+Sat Sep 20 14:43:04 2014 +0300 Hal Rosenstock
+ecce4e36ac1c1cc270a266195add5fe257e5b1e8
+
+	* osm_console.c: Handle LinkSpeed[Ext]Active 0 for portstatus command
+
+Sat Sep 20 14:40:14 2014 +0300 Hal Rosenstock
+f6228104335e429a3803facba6daa3e79fd86061
+
+	* osm_console.c: Fix unknown speed/width port reporting for portstatus command
+
+Sat Sep 20 00:59:21 2014 +0300 Hal Rosenstock
+ffdd042751408e73c722e12658fccc44bb8a5778
+
+	* osm_console_io.c: In is_authorized, STRING_UNKNOWN is define
+
+Mon Sep 15 14:29:06 2014 +0300 Tomer Cohen
+a6ba88828ae6ca19689b10e5802e7d60967a8d00
+
+	* Add missing keyword in partition definition in man page and partition.txt doc
+
+Wed Sep 17 14:14:55 2014 +0300 Hal Rosenstock
+7444e5e2e83d69aa8842217bd5b5e32ca1ecd52f
+
+	* Fix the difference in osm_opensm struct size between OpenSM and plugin(s)
+
+Sun Sep 14 15:13:18 2014 +0300 Hal Rosenstock
+caf764fc02e8ec5997436f3ceafa5ae2abdb291c
+
+	* osm_subnet.h: Fixed commentary typo
+
+Thu Sep 11 18:13:56 2014 +0300 Vladimir Koushnir
+117bc826b396acc118974f66cbf00e27741344fe
+
+	* osm_prtn.c: Change message verbosity for log message in osm_prtn_add_port
+
+Sun Sep 7 11:34:17 2014 +0300 Daniel Klein
+b6a1dd4741bc4c49ccd15bf5de8003bf097ee068
+
+	* osm_state_mgr.c: Avoid ucast cache invalidation due to errors during initialization
+
+Mon Sep 1 17:49:48 2014 +0300 Tomer Cohen
+3b172ab597516e05aa691aae22f210d73016257a
+
+	* osm_config.h.in: Fixed the difference in osm_opensm_t struct size between opensm and plugins
+
+Thu Sep 4 20:46:25 2014 +0300 Hal Rosenstock
+d13d4bdbab25aefa58762d371b55d03b613868f1
+
+	* osm_console.c: Track and report unknown/speed width ports
+
+Thu Aug 28 14:44:39 2014 +0300 Hal Rosenstock
+d63e7f6d79ebbf3bb2ce43eb2ab5e22fefb6d8dc
+
+	* osm_sa_path_record.c: Cosmetic formatting changes
+
+Mon Aug 18 18:57:57 2014 +0300 Hal Rosenstock
+48d159b7b9f631d6b2e62360bf351e0fe9c2d77c
+
+	* libvendor/osm_vendor_ibumad.c: Remove GID index 0 check in umad_receiver
+
+Tue Aug 12 17:23:51 2014 +0300 Tomer Cohen
+d7f1d02bb4855d8941765ea2095c4f6ee945a63c
+
+	* libvendor/osm_vendor_ibumad.c: memset osm_mad_addr_t before setting fields
+
+Tue Aug 12 15:32:17 2014 +0300 Hal Rosenstock
+96f89d61f28a74256410e8b02203e0926ddaf9fa
+
+	* osm_console.c: Included unknown speed/width ports in "possible issues"
+
+Thu Aug 7 21:12:56 2014 +0300 Hal Rosenstock
+44df23554aeb7b498b0ed01c778371119575aa38
+
+	* osm_dump.c: In dump_topology_node, handle link_width_active of 4 for 8X
+
+Mon Aug 4 15:40:43 2014 +0300 Shlomi Nimrodi
+a1e58e03840fae6b334caf908a95da7c76c39b41
+
+	* osm_link_mgr.c: Fix bug in mlnx extended port info setting
+
+Wed Aug 6 23:25:18 2014 +0300 Hal Rosenstock
+fcb696784930ef2a2c9f665a90003da3ac5edd1e
+
+	* osm_subnet.c: Improve sweep_on_trap documentation in generated conf file
+
+Mon Aug 4 03:13:04 2014 +0300 Hal Rosenstock
+47a6b00477bff9d83376bf97452b8871c1fc08df
+
+	* osm_sa_multipath_record.c: Better logging for 4514, 4515, and 4505 error messages
+
+Mon Aug 4 03:10:52 2014 +0300 Hal Rosenstock
+115529be7bf139357e6554f54ccd342813448f2d
+
+	* osm_sa_path_record.c: Better logging for 1F02 error message
+
+Sun Aug 3 11:12:54 2014 +0300 Vladimir Koushnir
+fe079dfe054d35fcb107df4bca6fa95f79ec2cce
+
+	* osm_sa_path_record.c: Better logging for 1F05 and 1F03 error messages
+
+Sun Aug 3 02:22:33 2014 +0300 Hal Rosenstock
+43c378f4b5ca4856995722998f985f46a6437c3e
+
+	* osm_ucast_mgr.c: A couple of cosmetic log message changes in ucast_mgr_route
+
+Thu Jul 24 14:18:01 2014 +0300 Hal Rosenstock
+9a5e51405392ba13770bd5d909f1d6aee40cb599
+
+	* osmtest/osmtest.c: Cosmetic formatting change
+
+Tue Jul 22 17:32:15 2014 +0300 Hal Rosenstock
+90db6c3da1947de2b0860319a50e1df451e21572
+
+	* osm_state_mgr.c: Cosmetic formatting changes
+
+Tue Jul 22 14:16:11 2014 +0300 Hal Rosenstock
+e7139affd49237d3e5ed1ef55154772053958f69
+
+	* osmtest/osmtest.c: Fix osmtest_get_sm_gid when running osmtest on node other than SM node
+
+Tue Jul 22 04:27:58 2014 +0300 Hal Rosenstock
+83ea812d714e50601dc2aa89fd30e55a3d6ef84c
+
+	* doc/performance-manager-HOWTO.txt: Update perfmgr config options documentation
+
+Mon Jul 21 18:52:22 2014 +0300 Hal Rosenstock
+d4d5af39285fc7fd720c412455c58b494065bc16
+
+	* libvendor/osm_vendor_ibumad_sa.c: Fixed endian in debug log message
+
+Mon Jul 21 18:49:47 2014 +0300 Hal Rosenstock
+c1080b9cc58fb0b1db7b3c3a4a8c7338f91cf31c
+
+	* osmtest/main.c: Cosmetic change to output for consistency
+
+** Version: opensm-3.3.18
 
 Wed Jul 16 22:28:15 2014 +0300 Hal Rosenstock
 77f713a8fdb1ce31a24488b370b14dd6f3cf7aaf
diff --git a/complib/cl_dispatcher.c b/complib/cl_dispatcher.c
index 6736d67..1255c83 100644
--- a/complib/cl_dispatcher.c
+++ b/complib/cl_dispatcher.c
@@ -302,6 +302,11 @@ cl_status_t cl_disp_post(IN const cl_disp_reg_handle_t handle,
 
 	cl_spinlock_acquire(&p_disp->lock);
 	/* Check that the recipient exists. */
+	if (cl_ptr_vector_get_size(&p_disp->reg_vec) <= msg_id) {
+		cl_spinlock_release(&p_disp->lock);
+		return (CL_NOT_FOUND);
+	}
+
 	p_dest_reg = cl_ptr_vector_get(&p_disp->reg_vec, msg_id);
 	if (!p_dest_reg) {
 		cl_spinlock_release(&p_disp->lock);
diff --git a/complib/libosmcomp.ver b/complib/libosmcomp.ver
index 552d0cd..3ff0471 100644
--- a/complib/libosmcomp.ver
+++ b/complib/libosmcomp.ver
@@ -6,4 +6,4 @@
 # API_REV - advance on any added API
 # RUNNING_REV - advance any change to the vendor files
 # AGE - number of backward versions the API still supports
-LIBVERSION=3:8:0
+LIBVERSION=3:9:0
diff --git a/configure b/configure
index 1b6d413..f5f8949 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for opensm 3.3.18.
+# Generated by GNU Autoconf 2.69 for opensm 3.3.19.
 #
 # Report bugs to <linux-rdma at vger.kernel.org>.
 #
@@ -729,8 +729,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='opensm'
 PACKAGE_TARNAME='opensm'
-PACKAGE_VERSION='3.3.18'
-PACKAGE_STRING='opensm 3.3.18'
+PACKAGE_VERSION='3.3.19'
+PACKAGE_STRING='opensm 3.3.19'
 PACKAGE_BUGREPORT='linux-rdma at vger.kernel.org'
 PACKAGE_URL=''
 
@@ -1498,7 +1498,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures opensm 3.3.18 to adapt to many kinds of systems.
+\`configure' configures opensm 3.3.19 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1568,7 +1568,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of opensm 3.3.18:";;
+     short | recursive ) echo "Configuration of opensm 3.3.19:";;
    esac
   cat <<\_ACEOF
 
@@ -1715,7 +1715,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-opensm configure 3.3.18
+opensm configure 3.3.19
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2138,7 +2138,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by opensm $as_me 3.3.18, which was
+It was created by opensm $as_me 3.3.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2957,7 +2957,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='opensm'
- VERSION='3.3.18'
+ VERSION='3.3.19'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2998,7 +2998,7 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
 
-RELEASE=${RELEASE:-unknown}
+RELEASE=${RELEASE:-${VERSION}}
 
 TARBALL=${TARBALL:-${PACKAGE}-${VERSION}.tar.gz}
 
@@ -11412,6 +11412,9 @@ if test x$debug = xtrue ; then
 
 $as_echo "#define OSM_DEBUG 1" >>confdefs.h
 
+
+$as_echo "#define _DEBUG_ 1" >>confdefs.h
+
 fi
  if test x$debug = xtrue; then
   DEBUG_TRUE=
@@ -12686,7 +12689,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by opensm $as_me 3.3.18, which was
+This file was extended by opensm $as_me 3.3.19, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -12752,7 +12755,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-opensm config.status 3.3.18
+opensm config.status 3.3.19
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.in b/configure.in
index 8d8f05b..0555b90 100644
--- a/configure.in
+++ b/configure.in
@@ -1,14 +1,14 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
-AC_INIT(opensm, 3.3.18, linux-rdma at vger.kernel.org)
+AC_INIT(opensm, 3.3.19, linux-rdma at vger.kernel.org)
 AC_CONFIG_SRCDIR([opensm/osm_opensm.c])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(config)
 AC_CONFIG_HEADERS(include/config.h include/opensm/osm_config.h)
 AM_INIT_AUTOMAKE
 
-AC_SUBST(RELEASE, ${RELEASE:-unknown})
+AC_SUBST(RELEASE, ${RELEASE:-${VERSION}})
 AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
 
 default_rdma_service=openibd
@@ -102,6 +102,7 @@ AC_ARG_ENABLE(debug,    [  --enable-debug          Turn on debugging],
 esac],debug=false)
 if test x$debug = xtrue ; then
 	AC_DEFINE(OSM_DEBUG, 1, [ define 1 if OpenSM build is in a debug mode ])
+	AC_DEFINE(_DEBUG_, 1, [ define 1 if OpenSM build is in a debug mode ])
 fi
 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
 
diff --git a/doc/opensm_release_notes-3.3.txt b/doc/opensm_release_notes-3.3.txt
index 4177b83..708ae50 100644
--- a/doc/opensm_release_notes-3.3.txt
+++ b/doc/opensm_release_notes-3.3.txt
@@ -3,14 +3,14 @@
 
 Version: OpenSM 3.3.x
 Repo:    git://git.openfabrics.org/~halr/opensm.git
-Date:    July 2014
+Date:    December 2014
 
 1 Overview
 ----------
 This document describes the contents of the OpenSM 3.3 release.
 OpenSM is an InfiniBand compliant Subnet Manager and Administration,
 and runs on top of OpenIB. The OpenSM version for this release
-is opensm-3.3.18.
+is opensm-3.3.19.
 
 This document includes the following sections:
 1 This Overview section (describing new features and software
@@ -87,7 +87,7 @@ This document includes the following sections:
 * Extended speed support
   This provides support for FDR and EDR speeds.
 
-* Congestion control support
+* Congestion control support (experimental)
 
 * Many code improvements, optimizations and cleanups.
 
@@ -512,6 +512,19 @@ information regarding each compliance statement.
 
 4.1 Major Bug Fixes
 
+5077198 osm_perfmgr.c: Reset physp_discovered before discovery
+8d51ae5 osm_state_mgr.c: Avoid continuing discovery when SM port is
+unresponsive
+f017063 Better way to handle polling other MASTER SM
+25e5ee5 complib/cl_dispatcher.c: Check registrations vector size when
+searching for handlers
+6b0fb4d osm_lid_mgr.c: Send client reregistration in case of SM LID change
+5d231f8 osm_pkey_mgr.c: Use calloc instead of malloc in
+pkey_mgr_process_physical_port
+985859e Fix turning on first_time_master_sweep flag
+4629e80 osm_mcast_mgr.c: Invalidate cache due to multicast routing errors
+b6a1dd4 osm_state_mgr.c: Avoid ucast cache invalidation due to errors during
+initialization
 db69cd8 osm_perfmgr.c: Fix perfmgr sweep_state race
 b42f11f osm_vendor_ibumad.c: Better match table eviction strategy
 cc0d61b libvendor/osm_vendor_ibumad.c: Check the next CA if an error is
@@ -702,6 +715,71 @@ f37bf3c opensm/perfmgr: skip data counters when only printing errors
 
 4.2 Other Bug Fixes
 
+28fd4ee osm_[subnet congestion_control].c: Cosmetic commentary change
+391c244 osm_congestion_control.c: Added Mellanox copyright
+7e08621 osm_congestion_control.c: In cc_rcv_mad, add attribute ID and modifier
+to log message
+62075d6 osm_perfmgr.c: Fix endian of MAD status in pc_recv_process
+cd94c9c osm_congestion_control.c: Fix endian of MAD status in cc_rcv_mad
+cb5df8b osm_congestion_control.c: Fix endian of node and port GUIDs in some
+log messages
+68887fb osm_congestion_control.c: Cosmetic changes
+1331a46 osm_subnet.[h c]: Fix possibility for open file descriptor issue
+ce15bb7 osm_perfmgr.c: Output remote port on perfmgr error counter log
+messages
+030ac82 osm_sa.c: Improve ERR 4C05 log message
+fbb63d6 osm_subnet.c: Update MEPI supported devices white list
+0774229 osm_subnet.c: Cosmetic formatting change
+5871ef7 osm_sa.c: Check return value from chmod in opensm_dump_to_file
+61cd0cf osm_switch.c: Fix potential memory leak due to misuse of realloc
+c78adde osm_req.c: Initialize dest_port_guid in req_determine_mkey
+dd5e5df osm_mcast_mgr.c: Add MLID to error 0A06 log message
+63900bc osm_vendor_ibumad.h: Use UMAD_MAX_DEVICES for OSM_UMAD_MAX_CAS
+a5c0200 iba/ib_types.h: Add support for new MAD SM:PortInfoExtended and for
+modifying PM:PortExtendedSpeedsCounters
+3f99535 osm_port_info_rcv.c: In osm_pi_rcv_process, move assert before first
+log message
+a0b9444 Change osm_subn_t.log_max_size type to uint32_t
+b5abaa2 osmeventplugin.c: Add include of osm_config.h as first OpenSM include
+ecce4e3 osm_console.c: Handle LinkSpeed[Ext]Active 0 for portstatus command
+f622810 osm_console.c: Fix unknown speed/width port reporting for portstatus
+command
+ffdd042 osm_console_io.c: In is_authorized, STRING_UNKNOWN is define
+a6ba888 Add missing keyword in partition definition in man page and
+partition.txt doc
+7444e5e Fix the difference in osm_opensm struct size between OpenSM and
+plugin(s)
+caf764f osm_subnet.h: Fixed commentary typo
+117bc82 osm_prtn.c: Change message verbosity for log message in
+osm_prtn_add_port
+3b172ab osm_config.h.in: Fixed the difference in osm_opensm_t struct size
+between opensm and plugins
+d13d4bd osm_console.c: Track and report unknown/speed width ports
+d63e7f6 osm_sa_path_record.c: Cosmetic formatting changes
+48d159b libvendor/osm_vendor_ibumad.c: Remove GID index 0 check in
+umad_receiver
+d7f1d02 libvendor/osm_vendor_ibumad.c: memset osm_mad_addr_t before setting
+fields
+96f89d6 osm_console.c: Included unknown speed/width ports in "possible issues"
+44df235 osm_dump.c: In dump_topology_node, handle link_width_active of 4 for
+8X
+a1e58e0 osm_link_mgr.c: Fix bug in mlnx extended port info setting
+fcb6967 osm_subnet.c: Improve sweep_on_trap documentation in generated conf
+file
+47a6b00 osm_sa_multipath_record.c: Better logging for 4514, 4515, and 4505
+error messages
+115529b osm_sa_path_record.c: Better logging for 1F02 error message
+fe079df osm_sa_path_record.c: Better logging for 1F05 and 1F03 error messages
+43c378f osm_ucast_mgr.c: A couple of cosmetic log message changes in
+ucast_mgr_route
+9a5e514 osmtest/osmtest.c: Cosmetic formatting change
+90db6c3 osm_state_mgr.c: Cosmetic formatting changes
+e7139af osmtest/osmtest.c: Fix osmtest_get_sm_gid when running osmtest on node
+other than SM node
+83ea812 doc/performance-manager-HOWTO.txt: Update perfmgr config options
+documentation
+d4d5af3 libvendor/osm_vendor_ibumad_sa.c: Fixed endian in debug log message
+c1080b9 osmtest/main.c: Cosmetic change to output for consistency
 179fbac Add support for additional Mellanox OUI
 be3e4f1 osm_subnet.c: Remove duplicate strcmp check in
 osm_subn_rescan_conf_files method
diff --git a/doc/partition-config.txt b/doc/partition-config.txt
index 3581ef6..6dba596 100644
--- a/doc/partition-config.txt
+++ b/doc/partition-config.txt
@@ -38,21 +38,25 @@ General file format:
      Partition Definition:
        [PartitionName][=PKey][,ipoib_bc_flags][,defmember=full|limited|both]
 
-        PartitionName  - string, will be used with logging. When omitted
-                         empty string will be used.
-        PKey           - P_Key value for this partition. Only low 15 bits will
-                         be used. When omitted will be autogenerated.
-        ipoib_bc_flags - used to indicate/specify IPoIB capability of this partition.
+        PartitionName  - string, will be used with logging. When
+                         omitted, empty string will be used.
+        PKey           - P_Key value for this partition. Only low 15
+                         bits will be used. When omitted will be
+                         autogenerated.
+        ipoib_bc_flags - used to indicate/specify IPoIB capability of
+                         this partition.
 
-        defmember=full|limited|both - specifies default membership for port guid
-                         list. Default is limited.
+        defmember=full|limited|both - specifies default membership for
+                         port guid list. Default is limited.
 
      ipoib_bc_flags:
         ipoib_flag|[mgroup_flag]*
 
-        ipoib_flag - indicates that this partition may be used for IPoIB, as
-		     a result the IPoIB broadcast group will be created with
-		     the flags given, if any.
+        ipoib_flag:
+		ipoib  - indicates that this partition may be used for
+                         IPoIB, as a result the IPoIB broadcast group will
+                         be created with the mgroup_flag flags given,
+                         if any.
 
      Partition Properties:
        [<Port list>|<MCast Group>]* | <Port list>
@@ -63,22 +67,26 @@ General file format:
      Port Specifier:
         <PortGUID>[=[full|limited|both]]
 
-        PortGUID         - GUID of partition member EndPort. Hexadecimal
-                           numbers should start from 0x, decimal numbers
-                           are accepted too.
-        full or          - indicates full and/or limited membership for this port. When
-        limited or         omitted (or unrecognized) limited membership is assumed.
-        both               Both indicates both full and limited membership for this port.
+        PortGUID         - GUID of partition member EndPort.
+                           Hexadecimal numbers should start from
+                           0x, decimal numbers are accepted too.
+        full or          - indicates full and/or limited membership for
+        limited or         this port.  When omitted (or unrecognized)
+        both               limited membership is assumed.  Both
+                           indicates both full and limited membership
+                           for this port.
 
      MCast Group:
         mgid=gid[,mgroup_flag]*<newline>
 
-	            - gid specified is verified to be a Multicast address
-		      IP groups are verified to match the rate and mtu of the
-		      broadcast group.  The P_Key bits of the mgid for IP
-		      groups are verified to either match the P_Key specified
-		      in by "Partition Definition" or if they are 0x0000 the
-		      P_Key will be copied into those bits.
+                    - gid specified is verified to be a Multicast
+                      address.  IP groups are verified to match
+                      the rate and mtu of the broadcast group.
+                      The P_Key bits of the mgid for IP groups are
+                      verified to either match the P_Key specified
+                      in by "Partition Definition" or if they are
+                      0x0000 the P_Key will be copied into those
+                      bits.
 
      mgroup_flag:
         rate=<val>  - specifies rate for this MC group
@@ -88,24 +96,23 @@ General file format:
         sl=<val>    - specifies SL for this MC group
                       (default is 0)
         scope=<val> - specifies scope for this MC group
-                      (default is 2 (link local)).  Multiple scope settings
-                      are permitted for a partition.
-		      NOTE: This overwrites the scope nibble of the specified
-			    mgid.  Furthermore specifying multiple scope
-			    settings will result in multiple MC groups
-			    being created.
+                      (default is 2 (link local)).  Multiple scope
+                      settings are permitted for a partition.
+                      NOTE: This overwrites the scope nibble of the
+                            specified mgid.  Furthermore specifying
+                            multiple scope settings will result in
+                            multiple MC groups being created.
         Q_Key=<val>     - specifies the Q_Key for this MC group
-                          (default: 0x0b1b for IP groups, 0 for other groups)
-                          WARNING: changing this for the broadcast group may
-			           break IPoIB on client nodes!!!
+                          (default: 0x0b1b for IP groups, 0 for other
+                           groups)
+                          WARNING: changing this for the broadcast
+                                   group may break IPoIB on client
+                                   nodes!!!
         TClass=<val>    - specifies tclass for this MC group
                           (default is 0)
         FlowLabel=<val> - specifies FlowLabel for this MC group
                           (default is 0)
 
-     newline: '\n'
-
-
 Note that values for rate, mtu, and scope, for both partitions and multicast
 groups, should be specified as defined in the IBTA specification (for example,
 mtu=4 for 2048).
diff --git a/doc/performance-manager-HOWTO.txt b/doc/performance-manager-HOWTO.txt
index bf5f778..d63d830 100644
--- a/doc/performance-manager-HOWTO.txt
+++ b/doc/performance-manager-HOWTO.txt
@@ -4,17 +4,17 @@ OpenSM Performance manager HOWTO
 Introduction
 ============
 
-OpenSM now includes a performance manager which collects Port counters from
+OpenSM now includes a performance manager which collects port counters from
 the subnet and stores them internally in OpenSM.
 
 Some of the features of the performance manager are:
 
-	1) Collect port data and error counters per v1.2 spec and store in
+	1) Collect port data and error counters per v1.2.1 spec and store in
 	   64 bit internal counts.
-	2) Automatic reset of counters when they reach approximatly 3/4 full.
-	   (While not guarenteeing that counts will not be missed this does
+	2) Automatic reset of counters when they reach approximately 3/4 full.
+	   (While not guaranteeing that counts will not be missed, this does
 	   keep counts incrementing as best as possible given the current
-	   hardware limitations.)
+	   spec limitations.)
 	3) Basic warnings in the OpenSM log on "critical" errors like symbol
 	   errors.
 	4) Automatically detects "outside" resets of counters and adjusts to
@@ -45,10 +45,10 @@ Using the Performance Manager consists of 3 steps:
 Step 1: Compile in support for the Performance Manager
 ------------------------------------------------------
 
-At this time it is really best to enable the console socket option as well.
+At this time, it is really best to enable the console socket option as well.
 OpenSM can be run in an "interactive" mode.  But with the console socket
 option turned on one can also make a connection to a running OpenSM.  By
-default only "loopback" is enabled with the console with socket being a
+default, only "loopback" is enabled with the console with socket being a
 compile time option.  Regardless, please be aware of your network security
 configuration for as the commands presented in the console can affect the
 operation of your subnet.
@@ -61,19 +61,45 @@ Turning the Performance Manager on is pretty easy, set the following options in
 the opensm.conf config file.  (Default location is
 /usr/local/etc/opensm/opensm.conf)
 
-	# Turn it all on.
+	# Turn it all on
 	perfmgr TRUE
 
+	# redirection enable
+	perfmgr_redir TRUE
+
 	# sweep time in seconds
 	perfmgr_sweep_time_s 180
 
+	# Max outstanding queries
+	perfmgr_max_outstanding_queries 500
+
+	# Ignore CAs on sweep
+	perfmgr_ignore_cas FALSE
+
+	# Remove missing nodes from DB
+	perfmgr_rm_nodes TRUE
+
+	# Log error counters to opensm.log
+	perfmgr_log_errors TRUE
+
+	# Query PerfMgt Get(ClassPortInfo) for extended capabilities
+	# Extended capabilities include 64 bit extended counters
+	# and transmit wait support
+	perfmgr_query_cpi TRUE
+
+	# Log xmit_wait errors
+	perfmgr_xmit_wait_log FALSE
+
+	# If logging xmit_wait's; set threshold
+	perfmgr_xmit_wait_threshold 65535
+
 	# Dump file to dump the events to
 	event_db_dump_file /var/log/opensm_port_counters.log
 
-Also enable the console socket and configure the port for it to listen to if
+Also, enable the console socket and configure the port for it to listen to if
 desired.
 
-	# console [off|local|loopback]
+	# console [off|local|loopback|socket]
 	console socket
 
 	# Telnet port for console (default 10000)
@@ -82,7 +108,7 @@ desired.
 	"local" is only useful if you run OpenSM in the foreground.
 
 
-Step 3: retrieve data which has been collected
+Step 3: Retrieve data which has been collected
 ----------------------------------------------
 
 Step 3a: Using console dump function
diff --git a/include/config.h.in b/include/config.h.in
index 35f45f0..515ae4c 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -146,6 +146,9 @@
    `char[]'. */
 #undef YYTEXT_POINTER
 
+/* define 1 if OpenSM build is in a debug mode */
+#undef _DEBUG_
+
 /* mark config.h inclusion */
 #undef _OSM_CONFIG_H_
 
diff --git a/include/iba/ib_types.h b/include/iba/ib_types.h
index a0bb31c..93c706e 100644
--- a/include/iba/ib_types.h
+++ b/include/iba/ib_types.h
@@ -3528,6 +3528,9 @@ typedef struct _ib_class_port_info {
 #define IB_PM_EXT_WIDTH_NOIETF_SUP		(CL_HTON16(((uint16_t)1)<<10))
 #define IB_PM_SAMPLES_ONLY_SUP			(CL_HTON16(((uint16_t)1)<<11))
 #define IB_PM_PC_XMIT_WAIT_SUP			(CL_HTON16(((uint16_t)1)<<12))
+#define IS_PM_INH_LMTD_PKEY_MC_CONSTR_ERR	(CL_HTON16(((uint16_t)1)<<13))
+#define IS_PM_RSFEC_COUNTERS_SUP		(CL_HTON16(((uint16_t)1)<<14))
+#define IB_PM_IS_QP1_DROP_SUP			(CL_HTON16(((uint16_t)1)<<15))
 
 /****f* IBA Base: Types/ib_class_set_resp_time_val
 * NAME
@@ -4660,6 +4663,37 @@ typedef struct _ib_port_info {
 #define IB_PORT_CAP_HAS_MCAST_FDB_TOP (CL_HTON32(0x40000000))
 #define IB_PORT_CAP_HAS_HIER_INFO (CL_HTON32(0x80000000))
 
+#define IB_PORT_CAP2_IS_SET_NODE_DESC_SUPPORTED (CL_HTON16(0x0001))
+#define IB_PORT_CAP2_IS_PORT_INFO_EXT_SUPPORTED (CL_HTON16(0x0002))
+
+/****s* IBA Base: Types/ib_port_info_ext_t
+* NAME
+*	ib_port_info_ext_t
+*
+* DESCRIPTION
+*	IBA defined PortInfoExtended. (14.2.5.19)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_port_info_ext {
+	ib_net32_t cap_mask;
+	ib_net16_t fec_mode_active;
+	ib_net16_t fdr_fec_mode_sup;
+	ib_net16_t fdr_fec_mode_enable;
+	ib_net16_t edr_fec_mode_sup;
+	ib_net16_t edr_fec_mode_enable;
+	uint8_t reserved[50];
+} PACK_SUFFIX ib_port_info_ext_t;
+#include <complib/cl_packoff.h>
+/************/
+
+#define IB_PORT_EXT_NO_FEC_MODE_ACTIVE		    0
+#define IB_PORT_EXT_FIRE_CODE_FEC_MODE_ACTIVE	    (CL_HTON16(0x0001))
+#define IB_PORT_EXT_RS_FEC_MODE_ACTIVE		    (CL_HTON16(0x0002))
+#define IB_PORT_EXT_LOW_LATENCY_RS_FEC_MODE_ACTIVE  (CL_HTON16(0x0003))
+
+#define IB_PORT_EXT_CAP_IS_FEC_MODE_SUPPORTED (CL_HTON32(0x00000001))
 /****f* IBA Base: Types/ib_port_info_get_port_state
 * NAME
 *	ib_port_info_get_port_state
@@ -5092,6 +5126,7 @@ ib_port_info_get_link_speed_active(IN const ib_port_info_t * const p_pi)
 #define IB_LINK_WIDTH_ACTIVE_4X			2
 #define IB_LINK_WIDTH_ACTIVE_8X			4
 #define IB_LINK_WIDTH_ACTIVE_12X 		8
+#define IB_LINK_SPEED_ACTIVE_EXTENDED		0
 #define IB_LINK_SPEED_ACTIVE_2_5		1
 #define IB_LINK_SPEED_ACTIVE_5			2
 #define IB_LINK_SPEED_ACTIVE_10			4
@@ -6357,6 +6392,15 @@ typedef struct _ib_portinfo_record {
 #include <complib/cl_packoff.h>
 
 #include <complib/cl_packon.h>
+typedef struct _ib_portinfoext_record {
+	ib_net16_t lid;
+	uint8_t port_num;
+	uint8_t options;
+	ib_port_info_ext_t port_info_ext;
+} PACK_SUFFIX ib_portinfoext_record_t;
+#include <complib/cl_packoff.h>
+
+#include <complib/cl_packon.h>
 typedef struct _ib_link_record {
 	ib_net16_t from_lid;
 	uint8_t from_port_num;
diff --git a/include/opensm/osm_config.h b/include/opensm/osm_config.h
index 418a808..4467ed8 100644
--- a/include/opensm/osm_config.h
+++ b/include/opensm/osm_config.h
@@ -13,6 +13,7 @@
 
 /* define 1 if OpenSM build is in a debug mode */
 /* #undef OSM_DEBUG */
+/* #undef _DEBUG_ */
 
 /* Define as 1 if you want Dual Sided RMPP Support */
 #define DUAL_SIDED_RMPP 1
@@ -62,4 +63,7 @@
 /* Define as 1 if you want Vendor RMPP Support */
 #define VENDOR_RMPP_SUPPORT 1
 
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#define HAVE_LIBPTHREAD 1
+
 #endif /* _OSM_CONFIG_H_ */
diff --git a/include/opensm/osm_config.h.in b/include/opensm/osm_config.h.in
index b12006f..e499554 100644
--- a/include/opensm/osm_config.h.in
+++ b/include/opensm/osm_config.h.in
@@ -12,6 +12,7 @@
 
 /* define 1 if OpenSM build is in a debug mode */
 #undef OSM_DEBUG
+#undef _DEBUG_
 
 /* Define as 1 if you want Dual Sided RMPP Support */
 #undef DUAL_SIDED_RMPP
@@ -61,4 +62,7 @@
 /* Define as 1 if you want Vendor RMPP Support */
 #undef VENDOR_RMPP_SUPPORT
 
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
 #endif /* _OSM_CONFIG_H_ */
diff --git a/include/opensm/osm_perfmgr.h b/include/opensm/osm_perfmgr.h
index 44a278d..ec12eb6 100644
--- a/include/opensm/osm_perfmgr.h
+++ b/include/opensm/osm_perfmgr.h
@@ -105,6 +105,11 @@ typedef struct monitored_port {
 	/* ClassPortInfo fields */
 	boolean_t cpi_valid;
 	ib_net16_t cap_mask;
+	/* Remote end connected to */
+	boolean_t remote_valid;
+	uint64_t remote_guid;
+	char *remote_name;
+	uint8_t remote_port;
 } monitored_port_t;
 
 /* Node to store information about nodes being monitored */
diff --git a/include/opensm/osm_subnet.h b/include/opensm/osm_subnet.h
index a4ce2ed..585295d 100644
--- a/include/opensm/osm_subnet.h
+++ b/include/opensm/osm_subnet.h
@@ -287,7 +287,7 @@ typedef struct osm_subn_opt {
 	uint8_t log_flags;
 	char *dump_files_dir;
 	char *log_file;
-	unsigned long log_max_size;
+	uint32_t log_max_size;
 	char *partition_config_file;
 	boolean_t no_partition_enforcement;
 	char *part_enforce;
@@ -677,7 +677,7 @@ typedef struct osm_subn_opt {
 *		configuration setting.
 *
 *	cc_sw_cong_setting_credit_starvation_threshold
-*		Congestion Control Switch Congestion Setting Credit Staraction Threshold
+*		Congestion Control Switch Congestion Setting Credit Starvation Threshold
 *		configuration setting.
 *
 *	cc_sw_cong_setting_credit_starvation_return_delay
@@ -764,6 +764,7 @@ typedef struct osm_subn {
 	boolean_t force_heavy_sweep;
 	boolean_t force_reroute;
 	boolean_t in_sweep_hop_0;
+	boolean_t force_first_time_master_sweep;
 	boolean_t first_time_master_sweep;
 	boolean_t coming_out_of_standby;
 	boolean_t sweeping_enabled;
@@ -872,6 +873,16 @@ typedef struct osm_subn {
 *		switch info we need to signal somehow not to continue
 *		the sweeping.
 *
+*	force_first_time_master_sweep
+*		This flag is used to avoid race condition when Master SM being
+*		in the middle of very long configuration stage of the heavy sweep,
+*		receives HANDOVER from another MASTER SM. When the current heavy sweep
+*		is finished, new heavy sweep will be started immediately.
+*		At the beginning of the sweep, opensm will set first_time_master_sweep,
+*		force_heavy_sweep and coming_out_of_standby flags in order to allow full
+*		reconfiguration of the fabric. This is required as another MASTER SM could
+*		change configuration of the fabric before sending HANDOVER to MASTER SM.
+*
 *	first_time_master_sweep
 *		This flag is used for the PortInfo setting. On the first
 *		sweep as master (meaning after moving from Standby|Discovering
@@ -1557,7 +1568,7 @@ int osm_subn_rescan_conf_files(IN osm_subn_t * p_subn);
 *
 * SYNOPSIS
 */
-int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opt);
+void osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opt);
 /*
 * PARAMETERS
 *
@@ -1568,7 +1579,7 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opt);
 *		[in] Pointer to the subnet options structure.
 *
 * RETURN VALUES
-*	0 on success, negative value otherwise
+*	This method does not return a value
 *********/
 
 /****f* OpenSM: Subnet/osm_subn_write_conf_file
diff --git a/include/opensm/osm_version.h b/include/opensm/osm_version.h
index f70ea07..c5d4a78 100644
--- a/include/opensm/osm_version.h
+++ b/include/opensm/osm_version.h
@@ -45,7 +45,7 @@
 *
 * SYNOPSIS
 */
-#define OSM_VERSION "OpenSM 3.3.18"
+#define OSM_VERSION "OpenSM 3.3.19"
 /********/
 
 #endif				/* _OSM_VERSION_H_ */
diff --git a/include/vendor/osm_vendor_ibumad.h b/include/vendor/osm_vendor_ibumad.h
index c33a187..847ef8a 100644
--- a/include/vendor/osm_vendor_ibumad.h
+++ b/include/vendor/osm_vendor_ibumad.h
@@ -64,7 +64,7 @@ BEGIN_C_DECLS
 *
 *********/
 #define OSM_DEFAULT_RETRY_COUNT 3
-#define OSM_UMAD_MAX_CAS	32
+#define OSM_UMAD_MAX_CAS	UMAD_MAX_DEVICES
 #define OSM_UMAD_MAX_PORTS_PER_CA	2
 #define OSM_UMAD_MAX_AGENTS	32
 
diff --git a/libvendor/libosmvendor.ver b/libvendor/libosmvendor.ver
index a2b6766..1b8a6cf 100644
--- a/libvendor/libosmvendor.ver
+++ b/libvendor/libosmvendor.ver
@@ -6,4 +6,4 @@
 # API_REV - advance on any added API
 # RUNNING_REV - advance any change to the vendor files
 # AGE - number of backward versions the API still supports
-LIBVERSION=4:0:0
+LIBVERSION=4:1:0
diff --git a/libvendor/osm_vendor_ibumad.c b/libvendor/osm_vendor_ibumad.c
index e05db8d..6708a78 100644
--- a/libvendor/osm_vendor_ibumad.c
+++ b/libvendor/osm_vendor_ibumad.c
@@ -277,9 +277,9 @@ ib_mad_addr_conv(ib_user_mad_t * umad, osm_mad_addr_t * osm_mad_addr,
 {
 	ib_mad_addr_t *ib_mad_addr = umad_get_mad_addr(umad);
 
+	memset(osm_mad_addr, 0, sizeof(osm_mad_addr_t));
 	osm_mad_addr->dest_lid = ib_mad_addr->lid;
 	osm_mad_addr->path_bits = ib_mad_addr->path_bits;
-	osm_mad_addr->static_rate = 0;
 
 	if (is_smi) {
 		osm_mad_addr->addr_type.smi.source_lid = osm_mad_addr->dest_lid;
@@ -300,10 +300,6 @@ ib_mad_addr_conv(ib_user_mad_t * umad, osm_mad_addr_t * osm_mad_addr,
 						  ib_mad_addr->flow_label);
 		memcpy(&osm_mad_addr->addr_type.gsi.grh_info.dest_gid,
 		       &ib_mad_addr->gid, 16);
-	} else {
-		osm_mad_addr->addr_type.gsi.global_route = 0;
-		memset(&osm_mad_addr->addr_type.gsi.grh_info, 0,
-		       sizeof osm_mad_addr->addr_type.gsi.grh_info);
 	}
 }
 
@@ -331,7 +327,6 @@ static void *umad_receiver(void *p_ptr)
 	osm_mad_addr_t osm_addr;
 	osm_madw_t *p_madw, *p_req_madw;
 	ib_mad_t *p_mad, *p_req_mad;
-	ib_mad_addr_t *p_mad_addr;
 	void *umad = 0;
 	int mad_agent, length;
 
@@ -384,14 +379,6 @@ static void *umad_receiver(void *p_ptr)
 		}
 
 		p_mad = (ib_mad_t *) umad_get_mad(umad);
-		p_mad_addr = umad_get_mad_addr(umad);
-		/* Only support GID index 0 currently */
-		if (p_mad_addr->grh_present && p_mad_addr->gid_index) {
-			OSM_LOG(p_ur->p_log, OSM_LOG_ERROR, "ERR 5409: "
-				"GRH received on GID index %d for mgmt class 0x%x\n",
-				p_mad_addr->gid_index, p_mad->mgmt_class);
-			continue;
-		}
 
 		ib_mad_addr_conv(umad, &osm_addr,
 				 p_mad->mgmt_class == IB_MCLASS_SUBN_LID ||
diff --git a/libvendor/osm_vendor_ibumad_sa.c b/libvendor/osm_vendor_ibumad_sa.c
index 32e0d9e..615c58c 100644
--- a/libvendor/osm_vendor_ibumad_sa.c
+++ b/libvendor/osm_vendor_ibumad_sa.c
@@ -419,9 +419,9 @@ __osmv_send_sa_req(IN osmv_sa_bind_info_t * p_bind,
 	 */
 	if (p_query_req->with_grh) {
 		OSM_LOG(p_log, OSM_LOG_DEBUG, "sending sa query with GRH "
-			"GID : 0x%016" PRIx64 " 0x%016" PRIx64 "\n",
-			p_query_req->gid.unicast.prefix,
-			p_query_req->gid.unicast.interface_id);
+			"GID 0x%016" PRIx64 " 0x%016" PRIx64 "\n",
+			cl_ntoh64(p_query_req->gid.unicast.prefix),
+			cl_ntoh64(p_query_req->gid.unicast.interface_id));
 		p_madw->mad_addr.addr_type.gsi.global_route = 1;
 		memset(&p_madw->mad_addr.addr_type.gsi.grh_info, 0,
 		       sizeof(p_madw->mad_addr.addr_type.gsi.grh_info));
diff --git a/man/opensm.8 b/man/opensm.8
index e598c7e..1618d79 100644
--- a/man/opensm.8
+++ b/man/opensm.8
@@ -1,4 +1,4 @@
-.TH OPENSM 8 "July 4, 2014" "OpenIB" "OpenIB Management"
+.TH OPENSM 8 "Sept 15, 2014" "OpenIB" "OpenIB Management"
 
 .SH NAME
 opensm \- InfiniBand subnet manager and administration (SM/SA)
@@ -574,21 +574,25 @@ General file format:
      Partition Definition:
        [PartitionName][=PKey][,ipoib_bc_flags][,defmember=full|limited]
 
-        PartitionName  - string, will be used with logging. When omitted
-                         empty string will be used.
-        PKey           - P_Key value for this partition. Only low 15 bits will
-                         be used. When omitted will be autogenerated.
-        ipoib_bc_flags - used to indicate/specify IPoIB capability of this partition.
+        PartitionName  - string, will be used with logging. When
+                         omitted, empty string will be used.
+        PKey           - P_Key value for this partition. Only low 15
+                         bits will be used. When omitted will be
+                         autogenerated.
+        ipoib_bc_flags - used to indicate/specify IPoIB capability of
+                         this partition.
 
-        defmember=full|limited|both - specifies default membership for port guid
-                         list. Default is limited.
+        defmember=full|limited|both - specifies default membership for
+                         port guid list. Default is limited.
 
      ipoib_bc_flags:
         ipoib_flag|[mgroup_flag]*
 
-        ipoib_flag - indicates that this partition may be used for IPoIB, as
-                     a result the IPoIB broadcast group will be created with
-                     the flags given, if any.
+        ipoib_flag:
+            ipoib  - indicates that this partition may be used for
+                     IPoIB, as a result the IPoIB broadcast group will
+                     be created with the mgroup_flag flags given,
+                     if any.
 
      Partition Properties:
        [<Port list>|<MCast Group>]* | <Port list>
@@ -599,24 +603,26 @@ General file format:
      Port Specifier:
         <PortGUID>[=[full|limited|both]]
 
-        PortGUID         - GUID of partition member EndPort. Hexadecimal
-                           numbers should start from 0x, decimal numbers
-                           are accepted too.
-
-        full, limited,   - indicates full and/or limited membership for this
-        both               port.  When omitted (or unrecognized) limited
-                           membership is assumed. Both indicates both full
-                           and limited membership for this port.
+        PortGUID         - GUID of partition member EndPort.
+                           Hexadecimal numbers should start from
+                           0x, decimal numbers are accepted too.
+        full, limited,   - indicates full and/or limited membership for
+        both               this port.  When omitted (or unrecognized)
+                           limited membership is assumed.  Both
+                           indicates both full and limited membership
+                           for this port.
 
      MCast Group:
         mgid=gid[,mgroup_flag]*<newline>
 
-                         - gid specified is verified to be a Multicast address
-                           IP groups are verified to match the rate and mtu of the
-                           broadcast group.  The P_Key bits of the mgid for IP
-                           groups are verified to either match the P_Key specified
-                           in by "Partition Definition" or if they are 0x0000 the
-                           P_Key will be copied into those bits.
+                         - gid specified is verified to be a Multicast
+                           address.  IP groups are verified to match
+                           the rate and mtu of the broadcast group.
+                           The P_Key bits of the mgid for IP groups are
+                           verified to either match the P_Key specified
+                           in by "Partition Definition" or if they are
+                           0x0000 the P_Key will be copied into those
+                           bits.
 
      mgroup_flag:
         rate=<val>  - specifies rate for this MC group
@@ -626,22 +632,23 @@ General file format:
         sl=<val>    - specifies SL for this MC group
                       (default is 0)
         scope=<val> - specifies scope for this MC group
-                      (default is 2 (link local)).  Multiple scope settings
-                      are permitted for a partition.
-                      NOTE: This overwrites the scope nibble of the specified
-                            mgid.  Furthermore specifying multiple scope
-                            settings will result in multiple MC groups
-                            being created.
-        Q_Key=<val>      - specifies the Q_Key for this MC group
-                          (default: 0x0b1b for IP groups, 0 for other groups)
+                      (default is 2 (link local)).  Multiple scope
+                      settings are permitted for a partition.
+                      NOTE: This overwrites the scope nibble of the
+                            specified mgid.  Furthermore specifying
+                            multiple scope settings will result in
+                            multiple MC groups being created.
+        Q_Key=<val>     - specifies the Q_Key for this MC group
+                          (default: 0x0b1b for IP groups, 0 for other
+                           groups)
+                          WARNING: changing this for the broadcast
+                                   group may break IPoIB on client
+                                   nodes!! 
         TClass=<val>    - specifies tclass for this MC group
                           (default is 0)
         FlowLabel=<val> - specifies FlowLabel for this MC group
                           (default is 0)
 
-     newline: '\n'
-
-
 Note that values for rate, mtu, and scope, for both partitions and multicast
 groups, should be specified as defined in the IBTA specification (for example,
 mtu=4 for 2048).
diff --git a/man/opensm.8.in b/man/opensm.8.in
index 2be2690..c1092cc 100644
--- a/man/opensm.8.in
+++ b/man/opensm.8.in
@@ -1,4 +1,4 @@
-.TH OPENSM 8 "July 4, 2014" "OpenIB" "OpenIB Management"
+.TH OPENSM 8 "Sept 15, 2014" "OpenIB" "OpenIB Management"
 
 .SH NAME
 opensm \- InfiniBand subnet manager and administration (SM/SA)
@@ -574,21 +574,25 @@ General file format:
      Partition Definition:
        [PartitionName][=PKey][,ipoib_bc_flags][,defmember=full|limited]
 
-        PartitionName  - string, will be used with logging. When omitted
-                         empty string will be used.
-        PKey           - P_Key value for this partition. Only low 15 bits will
-                         be used. When omitted will be autogenerated.
-        ipoib_bc_flags - used to indicate/specify IPoIB capability of this partition.
+        PartitionName  - string, will be used with logging. When
+                         omitted, empty string will be used.
+        PKey           - P_Key value for this partition. Only low 15
+                         bits will be used. When omitted will be
+                         autogenerated.
+        ipoib_bc_flags - used to indicate/specify IPoIB capability of
+                         this partition.
 
-        defmember=full|limited|both - specifies default membership for port guid
-                         list. Default is limited.
+        defmember=full|limited|both - specifies default membership for
+                         port guid list. Default is limited.
 
      ipoib_bc_flags:
         ipoib_flag|[mgroup_flag]*
 
-        ipoib_flag - indicates that this partition may be used for IPoIB, as
-                     a result the IPoIB broadcast group will be created with
-                     the flags given, if any.
+        ipoib_flag:
+            ipoib  - indicates that this partition may be used for
+                     IPoIB, as a result the IPoIB broadcast group will
+                     be created with the mgroup_flag flags given,
+                     if any.
 
      Partition Properties:
        [<Port list>|<MCast Group>]* | <Port list>
@@ -599,24 +603,26 @@ General file format:
      Port Specifier:
         <PortGUID>[=[full|limited|both]]
 
-        PortGUID         - GUID of partition member EndPort. Hexadecimal
-                           numbers should start from 0x, decimal numbers
-                           are accepted too.
-
-        full, limited,   - indicates full and/or limited membership for this
-        both               port.  When omitted (or unrecognized) limited
-                           membership is assumed. Both indicates both full
-                           and limited membership for this port.
+        PortGUID         - GUID of partition member EndPort.
+                           Hexadecimal numbers should start from
+                           0x, decimal numbers are accepted too.
+        full, limited,   - indicates full and/or limited membership for
+        both               this port.  When omitted (or unrecognized)
+                           limited membership is assumed.  Both
+                           indicates both full and limited membership
+                           for this port.
 
      MCast Group:
         mgid=gid[,mgroup_flag]*<newline>
 
-                         - gid specified is verified to be a Multicast address
-                           IP groups are verified to match the rate and mtu of the
-                           broadcast group.  The P_Key bits of the mgid for IP
-                           groups are verified to either match the P_Key specified
-                           in by "Partition Definition" or if they are 0x0000 the
-                           P_Key will be copied into those bits.
+                         - gid specified is verified to be a Multicast
+                           address.  IP groups are verified to match
+                           the rate and mtu of the broadcast group.
+                           The P_Key bits of the mgid for IP groups are
+                           verified to either match the P_Key specified
+                           in by "Partition Definition" or if they are
+                           0x0000 the P_Key will be copied into those
+                           bits.
 
      mgroup_flag:
         rate=<val>  - specifies rate for this MC group
@@ -626,22 +632,23 @@ General file format:
         sl=<val>    - specifies SL for this MC group
                       (default is 0)
         scope=<val> - specifies scope for this MC group
-                      (default is 2 (link local)).  Multiple scope settings
-                      are permitted for a partition.
-                      NOTE: This overwrites the scope nibble of the specified
-                            mgid.  Furthermore specifying multiple scope
-                            settings will result in multiple MC groups
-                            being created.
-        Q_Key=<val>      - specifies the Q_Key for this MC group
-                          (default: 0x0b1b for IP groups, 0 for other groups)
+                      (default is 2 (link local)).  Multiple scope
+                      settings are permitted for a partition.
+                      NOTE: This overwrites the scope nibble of the
+                            specified mgid.  Furthermore specifying
+                            multiple scope settings will result in
+                            multiple MC groups being created.
+        Q_Key=<val>     - specifies the Q_Key for this MC group
+                          (default: 0x0b1b for IP groups, 0 for other
+                           groups)
+                          WARNING: changing this for the broadcast
+                                   group may break IPoIB on client
+                                   nodes!! 
         TClass=<val>    - specifies tclass for this MC group
                           (default is 0)
         FlowLabel=<val> - specifies FlowLabel for this MC group
                           (default is 0)
 
-     newline: '\n'
-
-
 Note that values for rate, mtu, and scope, for both partitions and multicast
 groups, should be specified as defined in the IBTA specification (for example,
 mtu=4 for 2048).
diff --git a/opensm.spec b/opensm.spec
index 8bdee43..1f7042d 100644
--- a/opensm.spec
+++ b/opensm.spec
@@ -1,4 +1,4 @@
-%define RELEASE 1
+%define RELEASE 3.3.19
 %define rel %{?CUSTOM_RELEASE}%{!?CUSTOM_RELEASE:%RELEASE}
 %if %{?_with_console_socket:1}%{!?_with_console_socket:0}
 %define _enable_console_socket --enable-console-socket
@@ -27,12 +27,12 @@
 
 Summary: InfiniBand subnet manager and administration
 Name: opensm
-Version: 3.3.18
+Version: 3.3.19
 Release: %rel%{?dist}
 License: GPLv2 or BSD
 Group: System Environment/Daemons
 URL: http://openfabrics.org/
-Source: http://www.openfabrics.org/downloads/management/opensm-3.3.18.tar.gz
+Source: http://www.openfabrics.org/downloads/management/opensm-3.3.19.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: libibumad-devel, libtool
 Requires: %{name}-libs = %{version}-%{release}, logrotate
diff --git a/opensm/libopensm.ver b/opensm/libopensm.ver
index 59322e3..bf36a78 100644
--- a/opensm/libopensm.ver
+++ b/opensm/libopensm.ver
@@ -6,4 +6,4 @@
 # API_REV - advance on any added API
 # RUNNING_REV - advance any change to the vendor files
 # AGE - number of backward versions the API still supports
-LIBVERSION=7:1:2
+LIBVERSION=7:2:2
diff --git a/opensm/main.c b/opensm/main.c
index a053b05..6551a37 100644
--- a/opensm/main.c
+++ b/opensm/main.c
@@ -908,7 +908,7 @@ int main(int argc, char *argv[])
 
 		case 'L':
 			opt.log_max_size = strtoul(optarg, NULL, 0);
-			printf(" Log file max size is %lu MBytes\n",
+			printf(" Log file max size is %u MBytes\n",
 			       opt.log_max_size);
 			break;
 
diff --git a/opensm/osm_congestion_control.c b/opensm/osm_congestion_control.c
index 9337af8..ead1888 100644
--- a/opensm/osm_congestion_control.c
+++ b/opensm/osm_congestion_control.c
@@ -2,6 +2,7 @@
  * Copyright (c) 2006-2009 Voltaire, Inc. All rights reserved.
  * Copyright (c) 2009 HNR Consulting. All rights reserved.
  * Copyright (c) 2012 Lawrence Livermore National Lab.  All rights reserved.
+ * Copyright (c) 2014 Mellanox Technologies LTD. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -173,7 +174,7 @@ static void cc_setup_mad_data(osm_sm_t * p_sm)
 
 	/* Congestion Control Table */
 
-	/* if no entries, we will always send atleast 1 mad to set ccti_limit = 0 */
+	/* if no entries, we will always send at least 1 mad to set ccti_limit = 0 */
 	if (!p_opt->cc_cct.entries_len)
 		p_cc->cc_tbl_mads = 1;
 	else {
@@ -440,7 +441,6 @@ static inline void decrement_outstanding_mads(osm_congestion_control_t *p_cc)
 	cl_event_signal(&p_cc->sig_mads_on_wire_continue);
 }
 
-
 static void cc_rcv_mad(void *context, void *data)
 {
 	osm_congestion_control_t *p_cc = context;
@@ -449,16 +449,19 @@ static void cc_rcv_mad(void *context, void *data)
 	ib_cc_mad_t *p_cc_mad;
 	osm_madw_context_t *p_mad_context = &p_madw->context;
 	ib_mad_t *p_mad = osm_madw_get_mad_ptr(p_madw);
-	uint64_t node_guid = p_mad_context->cc_context.node_guid;
-	uint64_t port_guid = p_mad_context->cc_context.port_guid;
+	ib_net64_t node_guid = p_mad_context->cc_context.node_guid;
+	ib_net64_t port_guid = p_mad_context->cc_context.port_guid;
 	uint8_t port = p_mad_context->cc_context.port;
 	osm_port_t *p_port;
 
 	OSM_LOG_ENTER(p_cc->log);
 
 	OSM_LOG(p_cc->log, OSM_LOG_VERBOSE,
-		"Processing received MAD status 0x%x context 0x%"
-		PRIx64 "port %u\n", p_mad->status, node_guid, port);
+		"Processing received MAD status 0x%x for "
+		"attr ID %u mod 0x%x node 0x%" PRIx64 " port %u\n",
+		cl_ntoh16(p_mad->status), cl_ntoh16(p_mad->attr_id),
+		cl_ntoh32(p_mad_context->cc_context.attr_mod),
+		cl_ntoh64(node_guid), port);
 
 	p_cc_mad = osm_madw_get_cc_mad_ptr(p_madw);
 
@@ -467,8 +470,8 @@ static void cc_rcv_mad(void *context, void *data)
 	p_port = osm_get_port_by_guid(p_cc->subn, port_guid);
 	if (!p_port) {
 		OSM_LOG(p_cc->log, OSM_LOG_ERROR, "ERR C109: "
-			"Port guid not in table 0x%" PRIx64 "\n",
-			   port_guid);
+			"Port GUID 0x%" PRIx64 " not in table\n",
+			cl_ntoh64(port_guid));
 		cl_plock_release(&p_osm->lock);
 		goto Exit;
 	}
@@ -507,8 +510,8 @@ static void cc_rcv_mad(void *context, void *data)
 	}
 	else
 		OSM_LOG(p_cc->log, OSM_LOG_ERROR, "ERR C10A: "
-			"Unexpected MAD attribute received: %u\n",
-			   p_cc_mad->header.attr_id);
+			"Unexpected MAD attribute ID %u received\n",
+			cl_ntoh16(p_cc_mad->header.attr_id));
 
 	cl_plock_release(&p_osm->lock);
 
@@ -540,7 +543,7 @@ wait:
 	} else
 		OSM_LOG(p_cc->log, OSM_LOG_ERROR, "ERR C104: "
 			"send failed to node 0x%" PRIx64 "port %u\n",
-			mad_context.cc_context.node_guid,
+			cl_ntoh64(mad_context.cc_context.node_guid),
 			mad_context.cc_context.port);
 }
 
@@ -674,8 +677,8 @@ static void cc_mad_send_err_callback(void *bind_context,
 	p_port = osm_get_port_by_guid(p_cc->subn, port_guid);
 	if (!p_port) {
 		OSM_LOG(p_cc->log, OSM_LOG_ERROR, "ERR C10B: "
-			"Port guid not in table 0x%" PRIx64 "\n",
-			port_guid);
+			"Port GUID 0x%" PRIx64 " not in table\n",
+			cl_ntoh64(port_guid));
 		cl_plock_release(&p_osm->lock);
 		goto Exit;
 	}
@@ -694,7 +697,7 @@ static void cc_mad_send_err_callback(void *bind_context,
 			ib_get_err_str(p_madw->status),
 			p_madw->p_mad->attr_id,
 			cl_ntoh16(p_madw->mad_addr.dest_lid),
-			node_guid,
+			cl_ntoh64(node_guid),
 			port,
 			cl_ntoh64(p_madw->p_mad->trans_id));
 
diff --git a/opensm/osm_console.c b/opensm/osm_console.c
index 1a05902..b2bd9d6 100644
--- a/opensm/osm_console.c
+++ b/opensm/osm_console.c
@@ -718,6 +718,7 @@ typedef struct {
 	uint64_t ports_8X;
 	uint64_t ports_12X;
 	uint64_t ports_unknown_width;
+	port_report_t *unknown_width_ports;
 	uint64_t ports_unenabled_width;
 	port_report_t *unenabled_width_ports;
 	uint64_t ports_reduced_width;
@@ -729,6 +730,7 @@ typedef struct {
 	uint64_t ports_fdr;
 	uint64_t ports_edr;
 	uint64_t ports_unknown_speed;
+	port_report_t *unknown_speed_ports;
 	uint64_t ports_unenabled_speed;
 	port_report_t *unenabled_speed_ports;
 	uint64_t ports_reduced_speed;
@@ -853,7 +855,12 @@ static void __get_stats(cl_map_item_t * const p_map_item, void *context)
 				}
 			}
 			break;
+		case IB_LINK_SPEED_ACTIVE_EXTENDED:
+			break;
 		default:
+			__tag_port_report(&(fs->unknown_speed_ports),
+					  cl_ntoh64(node->node_info.node_guid),
+					  port, node->print_desc);
 			fs->ports_unknown_speed++;
 			break;
 		}
@@ -881,7 +888,12 @@ static void __get_stats(cl_map_item_t * const p_map_item, void *context)
 			case IB_LINK_SPEED_EXT_ACTIVE_25:
 				fs->ports_edr++;
 				break;
+			case IB_LINK_SPEED_EXT_ACTIVE_NONE:
+				break;
 			default:
+				__tag_port_report(&(fs->unknown_speed_ports),
+						  cl_ntoh64(node->node_info.node_guid),
+						  port, node->print_desc);
 				fs->ports_unknown_speed++;
 				break;
 			}
@@ -900,6 +912,9 @@ static void __get_stats(cl_map_item_t * const p_map_item, void *context)
 			fs->ports_12X++;
 			break;
 		default:
+			__tag_port_report(&(fs->unknown_width_ports),
+					  cl_ntoh64(node->node_info.node_guid),
+					  port, node->print_desc);
 			fs->ports_unknown_width++;
 			break;
 		}
@@ -975,7 +990,8 @@ static void portstatus_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
 		fprintf(out, "   %" PRIu64 " at 25.78125 Gbps\n", fs.ports_edr);
 
 	if (fs.ports_disabled + fs.ports_reduced_speed + fs.ports_reduced_width
-	    + fs.ports_unenabled_width + fs.ports_unenabled_speed > 0) {
+	    + fs.ports_unenabled_width + fs.ports_unenabled_speed
+	    + fs.ports_unknown_width + fs.ports_unknown_speed > 0) {
 		fprintf(out, "\nPossible issues:\n");
 	}
 	if (fs.ports_disabled) {
@@ -992,6 +1008,11 @@ static void portstatus_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
 			fs.ports_reduced_speed);
 		__print_port_report(out, fs.reduced_speed_ports);
 	}
+	if (fs.ports_unknown_speed) {
+		fprintf(out, "   %" PRIu64 " with unknown speed\n",
+			fs.ports_unknown_speed);
+		__print_port_report(out, fs.unknown_speed_ports);
+	}
 	if (fs.ports_unenabled_width) {
 		fprintf(out, "   %" PRIu64 " with unenabled width\n",
 			fs.ports_unenabled_width);
@@ -1002,6 +1023,11 @@ static void portstatus_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
 			fs.ports_reduced_width);
 		__print_port_report(out, fs.reduced_width_ports);
 	}
+	if (fs.ports_unknown_width) {
+		fprintf(out, "   %" PRIu64 " with unknown width\n",
+			fs.ports_unknown_width);
+		__print_port_report(out, fs.unknown_width_ports);
+	}
 	fprintf(out, "\n");
 }
 
diff --git a/opensm/osm_console_io.c b/opensm/osm_console_io.c
index 2426b84..e358a55 100644
--- a/opensm/osm_console_io.c
+++ b/opensm/osm_console_io.c
@@ -167,7 +167,7 @@ int is_authorized(osm_console_t * p_oct)
 	/* allowed to use the console? */
 	p_oct->authorized = !is_remote(p_oct->client_type) ||
 	    hosts_ctl((char *)OSM_DAEMON_NAME, p_oct->client_hn, p_oct->client_ip,
-		      (char *)"STRING_UNKNOWN");
+		      (char *)STRING_UNKNOWN);
 	return p_oct->authorized;
 }
 #endif
diff --git a/opensm/osm_drop_mgr.c b/opensm/osm_drop_mgr.c
index ab06bf8..8441f89 100644
--- a/opensm/osm_drop_mgr.c
+++ b/opensm/osm_drop_mgr.c
@@ -257,9 +257,6 @@ static void drop_mgr_remove_port(osm_sm_t * sm, IN osm_port_t * p_port)
 		OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
 			"Cleaned SM for port guid 0x%016" PRIx64 "\n",
 			cl_ntoh64(port_guid));
-		/* clean up the polling_sm_guid */
-		if (sm->polling_sm_guid == p_sm->smi.guid)
-			sm->polling_sm_guid = 0;
 		free(p_sm);
 	}
 
diff --git a/opensm/osm_dump.c b/opensm/osm_dump.c
index 443030f..8da4279 100644
--- a/opensm/osm_dump.c
+++ b/opensm/osm_dump.c
@@ -473,6 +473,7 @@ static void dump_topology_node(cl_map_item_t * item, FILE * file, void *cxt)
 		fprintf(file, "PHY=%s LOG=%s SPD=%s\n",
 			p_physp->port_info.link_width_active == 1 ? "1x" :
 			p_physp->port_info.link_width_active == 2 ? "4x" :
+			p_physp->port_info.link_width_active == 4 ? "8x" :
 			p_physp->port_info.link_width_active == 8 ? "12x" :
 			"??",
 			port_state == IB_LINK_ACTIVE ? "ACT" :
diff --git a/opensm/osm_lid_mgr.c b/opensm/osm_lid_mgr.c
index f52c770..9f4858d 100644
--- a/opensm/osm_lid_mgr.c
+++ b/opensm/osm_lid_mgr.c
@@ -806,6 +806,7 @@ static int lid_mgr_set_physp_pi(IN osm_lid_mgr_t * p_mgr,
 	uint8_t op_vls;
 	uint8_t port_num;
 	boolean_t send_set = FALSE;
+	boolean_t send_client_rereg = FALSE;
 	boolean_t update_mkey = FALSE;
 	int ret = 0;
 
@@ -892,11 +893,17 @@ static int lid_mgr_set_physp_pi(IN osm_lid_mgr_t * p_mgr,
 		p_mgr->dirty = TRUE;
 	}
 
-	/* we are updating the ports with our local sm_base_lid */
+	/*
+	   We are updating the ports with our local sm_base_lid
+	   if for some reason currently received SM LID is different from our SM LID,
+	   need to send client reregister to this port
+	*/
 	p_pi->master_sm_base_lid = p_mgr->p_subn->sm_base_lid;
 	if (memcmp(&p_pi->master_sm_base_lid, &p_old_pi->master_sm_base_lid,
-		   sizeof(p_pi->master_sm_base_lid)))
+		   sizeof(p_pi->master_sm_base_lid))) {
+		send_client_rereg = TRUE;
 		send_set = TRUE;
+	}
 
 	p_pi->m_key_lease_period = p_mgr->p_subn->opt.m_key_lease_period;
 	if (memcmp(&p_pi->m_key_lease_period, &p_old_pi->m_key_lease_period,
@@ -1029,13 +1036,16 @@ static int lid_mgr_set_physp_pi(IN osm_lid_mgr_t * p_mgr,
 	context.pi_context.active_transition = FALSE;
 
 	/*
-	   We need to set the cli_rereg bit when we are in first_time_master_sweep
-	   for ports supporting the ClientReregistration Vol1 (v1.2) p811 14.4.11
-	   Also, if this port was just now discovered, then we should also set
-	   the cli_rereg bit. We know that the port was just discovered if its
-	   is_new field is set.
-	 */
-	if ((p_mgr->p_subn->first_time_master_sweep == TRUE || p_port->is_new)
+	  For ports supporting the ClientReregistration Vol1 (v1.2) p811 14.4.11:
+	  need to set the cli_rereg bit when current SM LID at the Host
+	  is different from our SM LID,
+	  also if we are in first_time_master_sweep,
+	  also if this port was just now discovered, then we should also set
+	  the cli_rereg bit (we know that the port was just discovered
+	  if its is_new field is set).
+	*/
+	if  ((send_client_rereg ||
+	    p_mgr->p_subn->first_time_master_sweep == TRUE || p_port->is_new)
 	    && !p_mgr->p_subn->opt.no_clients_rereg
 	    && (p_old_pi->capability_mask & IB_PORT_CAP_HAS_CLIENT_REREG)) {
 		OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
diff --git a/opensm/osm_link_mgr.c b/opensm/osm_link_mgr.c
index d5c7dde..0f52a2d 100644
--- a/opensm/osm_link_mgr.c
+++ b/opensm/osm_link_mgr.c
@@ -467,7 +467,7 @@ Send:
 		send_set = TRUE;
 
 	if (!send_set)
-		goto Exit;
+		goto SEND_EPI;
 
 	attr_mod = cl_hton32(port_num);
 	if (issue_ext)
@@ -487,6 +487,7 @@ Send:
 				     cl_ntoh64(p_physp->port_guid),
 				     cl_ntoh64(p_pi->m_key));
 
+SEND_EPI:
 	if (send_set2) {
 		status = osm_req_set(sm, osm_physp_get_dr_path_ptr(p_physp),
 				     payload2, sizeof(payload2),
diff --git a/opensm/osm_mcast_mgr.c b/opensm/osm_mcast_mgr.c
index ee5a145..8ed2d8f 100644
--- a/opensm/osm_mcast_mgr.c
+++ b/opensm/osm_mcast_mgr.c
@@ -462,7 +462,7 @@ static void mcast_mgr_subdivide(osm_sm_t * sm, uint16_t mlid_ho,
 	OSM_LOG_EXIT(sm->p_log);
 }
 
-static void mcast_mgr_purge_list(osm_sm_t * sm, cl_qlist_t * list)
+static void mcast_mgr_purge_list(osm_sm_t * sm, uint16_t mlid, cl_qlist_t * list)
 {
 	if (OSM_LOG_IS_ACTIVE_V2(sm->p_log, OSM_LOG_ERROR)) {
 		osm_mcast_work_obj_t *wobj;
@@ -471,8 +471,8 @@ static void mcast_mgr_purge_list(osm_sm_t * sm, cl_qlist_t * list)
 		     i = cl_qlist_next(i)) {
 			wobj = cl_item_obj(i, wobj, list_item);
 			OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A06: "
-				"Unable to route for port 0x%" PRIx64 "\n",
-				cl_ntoh64(osm_port_get_guid(wobj->p_port)));
+				"Unable to route MLID 0x%X for port 0x%" PRIx64 "\n",
+				mlid, cl_ntoh64(osm_port_get_guid(wobj->p_port)));
 		}
 	}
 	osm_mcast_drop_port_list(list);
@@ -523,7 +523,7 @@ static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, uint16_t mlid_ho,
 		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A21: "
 			"Maximal hops number is reached for MLID 0x%x."
 			" Break processing\n", mlid_ho);
-		mcast_mgr_purge_list(sm, p_list);
+		mcast_mgr_purge_list(sm, mlid_ho, p_list);
 		goto Exit;
 	}
 
@@ -543,7 +543,7 @@ static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, uint16_t mlid_ho,
 		/*
 		   Deallocate all the work objects on this branch of the tree.
 		 */
-		mcast_mgr_purge_list(sm, p_list);
+		mcast_mgr_purge_list(sm, mlid_ho, p_list);
 		goto Exit;
 	}
 
@@ -559,7 +559,7 @@ static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, uint16_t mlid_ho,
 		/*
 		   Deallocate all the work objects on this branch of the tree.
 		 */
-		mcast_mgr_purge_list(sm, p_list);
+		mcast_mgr_purge_list(sm, mlid_ho, p_list);
 		goto Exit;
 	}
 
@@ -576,7 +576,7 @@ static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, uint16_t mlid_ho,
 	if (list_array == NULL) {
 		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A16: "
 			"Unable to allocate list array\n");
-		mcast_mgr_purge_list(sm, p_list);
+		mcast_mgr_purge_list(sm, mlid_ho, p_list);
 		osm_mtree_destroy(p_mtn);
 		p_mtn = NULL;
 		goto Exit;
@@ -634,18 +634,14 @@ static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, uint16_t mlid_ho,
 			"Routing %zu destinations via switch port %u\n",
 			count, i);
 
-		/*
-		   This port routes frames for this mcast group.  Therefore,
-		   set the appropriate bit in the multicast forwarding
-		   table for this switch.
-		 */
-		osm_mcast_tbl_set(p_tbl, mlid_ho, i);
 		if (i == 0) {
 			/* This means we are adding the switch to the MC group.
 			   We do not need to continue looking at the remote
 			   port, just needed to add the port to the table */
 			CL_ASSERT(count == 1);
 
+			osm_mcast_tbl_set(p_tbl, mlid_ho, i);
+
 			p_wobj = (osm_mcast_work_obj_t *)
 			    cl_qlist_remove_head(p_port_list);
 			mcast_work_obj_delete(p_wobj);
@@ -654,8 +650,47 @@ static osm_mtree_node_t *mcast_mgr_branch(osm_sm_t * sm, uint16_t mlid_ho,
 
 		p_node = p_sw->p_node;
 		p_remote_node = osm_node_get_remote_node(p_node, i, NULL);
-		if (!p_remote_node)
+		if (!p_remote_node) {
+			/*
+			 * If we reached here, it means the minhop table has
+			 * invalid entries that leads to disconnected ports.
+			 *
+			 * A possible reason for the code to reach here is
+			 * that ucast cache is enabled, and a leaf switch that
+			 * is used as a non-leaf switch in a multicast has been
+			 * removed from the fabric.
+			 *
+			 * When it happens, we should invalidate the cache
+			 * and force rerouting of the fabric.
+			 */
+
+			OSM_LOG(sm->p_log, OSM_LOG_ERROR,
+				"ERR 0A1E: Tried to route MLID 0x%X through "
+				"disconnected switch 0x%" PRIx64 " port %d\n",
+				mlid_ho, cl_ntoh64(node_guid), i);
+
+			/* Free memory */
+			mcast_mgr_purge_list(sm, mlid_ho, p_port_list);
+
+			/* Invalidate ucast cache */
+			if (sm->ucast_mgr.p_subn->opt.use_ucast_cache &&
+			    sm->ucast_mgr.cache_valid) {
+				OSM_LOG(sm->p_log, OSM_LOG_INFO,
+					"Unicast Cache will be invalidated due "
+					"to multicast routing errors\n");
+				osm_ucast_cache_invalidate(&sm->ucast_mgr);
+				sm->p_subn->force_heavy_sweep = TRUE;
+			}
+
 			continue;
+		}
+
+		/*
+		   This port routes frames for this mcast group.  Therefore,
+		   set the appropriate bit in the multicast forwarding
+		   table for this switch.
+		 */
+		osm_mcast_tbl_set(p_tbl, mlid_ho, i);
 
 		if (osm_node_get_type(p_remote_node) == IB_NODE_TYPE_SWITCH) {
 			/*
diff --git a/opensm/osm_perfmgr.c b/opensm/osm_perfmgr.c
index d3fa1f7..55e2bfb 100644
--- a/opensm/osm_perfmgr.c
+++ b/opensm/osm_perfmgr.c
@@ -144,6 +144,7 @@ static void remove_marked_nodes(osm_perfmgr_t * pm)
 {
 	while (pm->remove_list) {
 		monitored_node_t *next = pm->remove_list->next;
+		int port;
 
 		cl_qmap_remove_item(&pm->monitored_map,
 				    (cl_map_item_t *) (pm->remove_list));
@@ -155,6 +156,14 @@ static void remove_marked_nodes(osm_perfmgr_t * pm)
 
 		if (pm->remove_list->name)
 			free(pm->remove_list->name);
+
+		for (port = pm->remove_list->esp0 ? 0 : 1;
+		     port < pm->remove_list->num_ports;
+		     port++) {
+			if (pm->remove_list->port[port].remote_name)
+				free(pm->remove_list->port[port].remote_name);
+		}
+
 		free(pm->remove_list);
 		pm->remove_list = next;
 	}
@@ -554,11 +563,24 @@ static void collect_guids(cl_map_item_t * p_map_item, void *context)
 				  ib_switch_info_is_enhanced_port0(&node->sw->
 								   switch_info));
 		for (port = mon_node->esp0 ? 0 : 1; port < num_ports; port++) {
-			mon_node->port[port].orig_lid = 0;
-			mon_node->port[port].valid = FALSE;
-			if (osm_physp_is_valid(&node->physp_table[port])) {
-				mon_node->port[port].orig_lid = get_base_lid(node, port);
-				mon_node->port[port].valid = TRUE;
+			monitored_port_t *mon_port = &mon_node->port[port];
+			osm_physp_t *p_physp = &node->physp_table[port];
+			osm_physp_t *p_remote_physp = p_physp->p_remote_physp;
+
+			mon_port->orig_lid = 0;
+			mon_port->valid = FALSE;
+			if (osm_physp_is_valid(p_physp)) {
+				mon_port->orig_lid = get_base_lid(node, port);
+				mon_port->valid = TRUE;
+			}
+			mon_port->remote_valid = FALSE;
+			mon_port->remote_name = NULL;
+			if (p_remote_physp && osm_physp_is_valid(p_remote_physp)) {
+				osm_node_t *p_remote_node = p_remote_physp->p_node;
+				mon_port->remote_valid = TRUE;
+				mon_port->remote_guid = p_remote_node->node_info.node_guid;
+				mon_port->remote_name = strdup(p_remote_node->print_desc);
+				mon_port->remote_port = p_remote_physp->port_num;
 			}
 		}
 
@@ -963,6 +985,9 @@ static void reset_node_count(cl_map_item_t * p_map_item, void *cxt)
 {
 	osm_node_t *p_node = (osm_node_t *) p_map_item;
 	p_node->discovery_count = 0;
+
+	memset(p_node->physp_discovered, 0,
+	       sizeof(uint8_t) * p_node->physp_tbl_size);
 }
 
 static void reset_port_count(cl_map_item_t * p_map_item, void *cxt)
@@ -1429,13 +1454,26 @@ static void perfmgr_log_errors(osm_perfmgr_t * pm,
 	}
 
 #define LOG_ERR_CNT(errname, errnum, counter_name) \
-	if (reading->counter_name > prev_read.counter_name) \
-		OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR %s: " \
-			"%s : %" PRIu64 " : node " \
-			"\"%s\" (NodeGUID: 0x%" PRIx64 ") : port %u\n", \
-			errnum, errname, \
-			reading->counter_name - prev_read.counter_name, \
-			mon_node->name, mon_node->guid, port);
+	if (reading->counter_name > prev_read.counter_name) { \
+		if (mon_node->port[port].remote_valid == TRUE) \
+			OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR %s: " \
+				"%s : %" PRIu64 " : node " \
+				"\"%s\" (NodeGUID: 0x%" PRIx64 ") : port %u " \
+				"connected to \"%s\" (NodeGUID: 0x%" PRIx64 ") : port %u\n", \
+				errnum, errname, \
+				reading->counter_name - prev_read.counter_name, \
+				mon_node->name, mon_node->guid, port, \
+				mon_node->port[port].remote_name, \
+				mon_node->port[port].remote_guid, \
+				mon_node->port[port].remote_port); \
+		else \
+			OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR %s: " \
+				"%s : %" PRIu64 " : node " \
+				"\"%s\" (NodeGUID: 0x%" PRIx64 ") : port %u\n", \
+				errnum, errname, \
+				reading->counter_name - prev_read.counter_name, \
+				mon_node->name, mon_node->guid, port); \
+	}
 
 	LOG_ERR_CNT("SymbolErrorCounter",           "5431", symbol_err_cnt);
 	LOG_ERR_CNT("LinkErrorRecoveryCounter",     "5432", link_err_recover);
@@ -1742,7 +1780,7 @@ static void pc_recv_process(void *context, void *data)
 
 	OSM_LOG(pm->log, OSM_LOG_VERBOSE,
 		"Processing received MAD status 0x%x context 0x%"
-		PRIx64 " port %u\n", p_mad->status, node_guid, port);
+		PRIx64 " port %u\n", cl_ntoh16(p_mad->status), node_guid, port);
 
 	CL_ASSERT(p_mad->attr_id == IB_MAD_ATTR_PORT_CNTRS ||
 		  p_mad->attr_id == IB_MAD_ATTR_PORT_CNTRS_EXT ||
diff --git a/opensm/osm_pkey_mgr.c b/opensm/osm_pkey_mgr.c
index 0809d1e..223b379 100644
--- a/opensm/osm_pkey_mgr.c
+++ b/opensm/osm_pkey_mgr.c
@@ -96,7 +96,7 @@ pkey_mgr_process_physical_port(IN osm_log_t * p_log,
 	osm_pending_pkey_t *p_pending;
 
 	p_pkey_tbl = &p_physp->pkeys;
-	p_pending = (osm_pending_pkey_t *) malloc(sizeof(osm_pending_pkey_t));
+	p_pending = (osm_pending_pkey_t *) calloc(1, sizeof(osm_pending_pkey_t));
 	if (!p_pending) {
 		OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0502: "
 			"Failed to allocate new pending pkey entry for node "
diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c
index 4d42470..934a543 100644
--- a/opensm/osm_port_info_rcv.c
+++ b/opensm/osm_port_info_rcv.c
@@ -651,9 +651,10 @@ void osm_pi_rcv_process(IN void *context, IN void *data)
 	ib_net64_t port_guid, node_guid;
 	uint8_t port_num;
 
+	CL_ASSERT(sm);
+
 	OSM_LOG_ENTER(sm->p_log);
 
-	CL_ASSERT(sm);
 	CL_ASSERT(p_madw);
 
 	p_smp = osm_madw_get_smp_ptr(p_madw);
diff --git a/opensm/osm_prtn.c b/opensm/osm_prtn.c
index bd0ac67..3d47ac0 100644
--- a/opensm/osm_prtn.c
+++ b/opensm/osm_prtn.c
@@ -149,7 +149,7 @@ ib_api_status_t osm_prtn_add_port(osm_log_t * p_log, osm_subn_t * p_subn,
 
 	if (p_subn->opt.allow_both_pkeys) {
 		if (cl_map_remove(p_tbl, guid))
-			OSM_LOG(p_log, OSM_LOG_ERROR, "port 0x%" PRIx64
+			OSM_LOG(p_log, OSM_LOG_VERBOSE, "port 0x%" PRIx64
 				" already in partition \'%s\' (0x%04x) full %d."
 				" Will overwrite\n",
 				cl_ntoh64(guid), p->name, cl_ntoh16(p->pkey),
diff --git a/opensm/osm_req.c b/opensm/osm_req.c
index b2cfefd..85d1c0f 100644
--- a/opensm/osm_req.c
+++ b/opensm/osm_req.c
@@ -69,7 +69,7 @@ static ib_net64_t req_determine_mkey(IN osm_sm_t * sm,
 	osm_node_t *p_node;
 	osm_port_t *p_sm_port;
 	osm_physp_t *p_physp;
-	ib_net64_t dest_port_guid, m_key;
+	ib_net64_t dest_port_guid = 0, m_key;
 	uint8_t hop;
 
 	OSM_LOG_ENTER(sm->p_log);
diff --git a/opensm/osm_sa.c b/opensm/osm_sa.c
index e3128c7..06a09a9 100644
--- a/opensm/osm_sa.c
+++ b/opensm/osm_sa.c
@@ -401,9 +401,11 @@ void osm_sa_respond(osm_sa_t *sa, osm_madw_t *madw, size_t attr_size,
 	 */
 	if (sa_mad->method == IB_MAD_METHOD_GET && num_rec > 1) {
 		OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4C05: "
-			"Got %u records for SubnAdmGet(%s) comp_mask 0x%016" PRIx64 "\n",
+			"Got %u records for SubnAdmGet(%s) comp_mask 0x%016" PRIx64
+			"from requester LID %u\n",
 			num_rec, ib_get_sa_attr_str(sa_mad->attr_id),
-			cl_ntoh64(sa_mad->comp_mask));
+			cl_ntoh64(sa_mad->comp_mask),
+			cl_ntoh16(madw->mad_addr.dest_lid));
 		osm_sa_send_error(sa, madw, IB_SA_MAD_STATUS_TOO_MANY_RECORDS);
 		goto Exit;
 	}
@@ -524,7 +526,14 @@ opensm_dump_to_file(osm_opensm_t * p_osm, const char *file_name,
 		return -1;
 	}
 
-	chmod(path_tmp, S_IRUSR | S_IWUSR);
+	if (chmod(path_tmp, S_IRUSR | S_IWUSR)) {
+		OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "ERR 4C0C: "
+			"cannot change access permissions of file "
+			"\'%s\' : %s\n",
+			path_tmp, strerror(errno));
+		fclose(file);
+		return -1;
+	}
 
 	dump_func(p_osm, file);
 
diff --git a/opensm/osm_sa_multipath_record.c b/opensm/osm_sa_multipath_record.c
index e63a489..6151876 100644
--- a/opensm/osm_sa_multipath_record.c
+++ b/opensm/osm_sa_multipath_record.c
@@ -139,6 +139,7 @@ static ib_api_status_t mpr_rcv_get_path_parms(IN osm_sa_t * sa,
 					      p_mpr,
 					      IN const osm_alias_guid_t * p_src_alias_guid,
 					      IN const osm_alias_guid_t * p_dest_alias_guid,
+					      IN const uint16_t src_lid_ho,
 					      IN const uint16_t dest_lid_ho,
 					      IN const ib_net64_t comp_mask,
 					      OUT osm_path_parms_t * p_parms)
@@ -216,9 +217,9 @@ static ib_api_status_t mpr_rcv_get_path_parms(IN osm_sa_t * sa,
 		p_physp = osm_switch_get_route_by_lid(p_node->sw, dest_lid);
 		if (p_physp == 0) {
 			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4514: "
-				"Can't find routing to LID %u on switch %s "
-				"(GUID 0x%016"PRIx64")\n", dest_lid_ho,
-				p_node->print_desc,
+				"Can't find routing from LID %u to LID %u on "
+				"switch %s (GUID 0x%016" PRIx64 ")\n",
+				src_lid_ho, dest_lid_ho, p_node->print_desc,
 				cl_ntoh64(osm_node_get_node_guid(p_node)));
 			status = IB_NOT_FOUND;
 			goto Exit;
@@ -261,9 +262,9 @@ static ib_api_status_t mpr_rcv_get_path_parms(IN osm_sa_t * sa,
 
 		if (p_dest_physp == 0) {
 			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4515: "
-				"Can't find routing to LID %u on switch %s "
-				"(GUID 0x%016"PRIx64")\n", dest_lid_ho,
-				p_node->print_desc,
+				"Can't find routing from LID %u to LID %u on "
+				"switch %s (GUID 0x%016" PRIx64 ")\n",
+				src_lid_ho, dest_lid_ho, p_node->print_desc,
 				cl_ntoh64(osm_node_get_node_guid(p_node)));
 			status = IB_NOT_FOUND;
 			goto Exit;
@@ -284,12 +285,11 @@ static ib_api_status_t mpr_rcv_get_path_parms(IN osm_sa_t * sa,
 		if (p_physp == 0) {
 			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4505: "
 				"Can't find remote phys port of %s (GUID "
-				"0x%016"PRIx64") port %d "
-				"while routing to LID %u",
+				"0x%016" PRIx64 ") port %d "
+				"while routing from LID %u to LID %u",
 				p_node->print_desc,
 				cl_ntoh64(osm_node_get_node_guid(p_node)),
-				tmp_pnum,
-				dest_lid_ho);
+				tmp_pnum, src_lid_ho, dest_lid_ho);
 			status = IB_ERROR;
 			goto Exit;
 		}
@@ -903,7 +903,8 @@ static osm_sa_item_t *mpr_rcv_get_lid_pair_path(IN osm_sa_t * sa,
 	memset(p_pr_item, 0, SA_MPR_RESP_SIZE);
 
 	status = mpr_rcv_get_path_parms(sa, p_mpr, p_src_alias_guid,
-					p_dest_alias_guid, dest_lid_ho,
+					p_dest_alias_guid,
+					src_lid_ho, dest_lid_ho,
 					comp_mask, &path_parms);
 
 	if (status != IB_SUCCESS) {
@@ -914,7 +915,8 @@ static osm_sa_item_t *mpr_rcv_get_lid_pair_path(IN osm_sa_t * sa,
 
 	/* now try the reversible path */
 	rev_path_status = mpr_rcv_get_path_parms(sa, p_mpr, p_dest_alias_guid,
-						 p_src_alias_guid, src_lid_ho,
+						 p_src_alias_guid,
+						 dest_lid_ho, src_lid_ho,
 						 comp_mask, &rev_path_parms);
 	path_parms.reversible = (rev_path_status == IB_SUCCESS);
 
diff --git a/opensm/osm_sa_path_record.c b/opensm/osm_sa_path_record.c
index 499ed8d..b7509ec 100644
--- a/opensm/osm_sa_path_record.c
+++ b/opensm/osm_sa_path_record.c
@@ -228,9 +228,9 @@ static ib_api_status_t pr_rcv_get_path_parms(IN osm_sa_t * sa,
 		p_physp = osm_switch_get_route_by_lid(p_node->sw, dest_lid);
 		if (p_physp == 0) {
 			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F02: "
-				"Cannot find routing to LID %u on switch "
-				"%s (GUID: 0x%016" PRIx64 ")\n", dest_lid_ho,
-				p_node->print_desc,
+				"Cannot find routing from LID %u to LID %u on "
+				"switch %s (GUID: 0x%016" PRIx64 ")\n",
+				src_lid_ho, dest_lid_ho, p_node->print_desc,
 				cl_ntoh64(osm_node_get_node_guid(p_node)));
 			status = IB_NOT_FOUND;
 			goto Exit;
@@ -272,9 +272,9 @@ static ib_api_status_t pr_rcv_get_path_parms(IN osm_sa_t * sa,
 
 		if (p_dest_physp == 0) {
 			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F03: "
-				"Cannot find routing to LID %u on switch "
-				"%s (GUID: 0x%016" PRIx64 ")\n", dest_lid_ho,
-				p_node->print_desc,
+				"Can't find routing from LID %u to LID %u on "
+				"switch %s (GUID: 0x%016" PRIx64 ")\n",
+				src_lid_ho, dest_lid_ho, p_node->print_desc,
 				cl_ntoh64(osm_node_get_node_guid(p_node)));
 			status = IB_NOT_FOUND;
 			goto Exit;
@@ -296,11 +296,10 @@ static ib_api_status_t pr_rcv_get_path_parms(IN osm_sa_t * sa,
 			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F05: "
 				"Can't find remote phys port of %s (GUID: "
 				"0x%016"PRIx64") port %d "
-				"while routing to LID %u\n",
+				"while routing from LID %u to LID %u\n",
 				p_node->print_desc,
 				cl_ntoh64(osm_node_get_node_guid(p_node)),
-				tmp_pnum,
-				dest_lid_ho);
+				tmp_pnum, src_lid_ho, dest_lid_ho);
 			status = IB_ERROR;
 			goto Exit;
 		}
@@ -1269,13 +1268,13 @@ static ib_net64_t find_router(const osm_sa_t *sa, ib_net64_t prefix)
 }
 
 ib_net16_t osm_pr_get_end_points(IN osm_sa_t * sa,
-					IN const ib_sa_mad_t *sa_mad,
-					OUT const osm_alias_guid_t ** pp_src_alias_guid,
-					OUT const osm_alias_guid_t ** pp_dest_alias_guid,
-					OUT const osm_port_t ** pp_src_port,
-					OUT const osm_port_t ** pp_dest_port,
-					OUT const ib_gid_t ** pp_sgid,
-					OUT const ib_gid_t ** pp_dgid)
+				 IN const ib_sa_mad_t *sa_mad,
+				 OUT const osm_alias_guid_t ** pp_src_alias_guid,
+				 OUT const osm_alias_guid_t ** pp_dest_alias_guid,
+				 OUT const osm_port_t ** pp_src_port,
+				 OUT const osm_port_t ** pp_dest_port,
+				 OUT const ib_gid_t ** pp_sgid,
+				 OUT const ib_gid_t ** pp_dgid)
 {
 	const ib_path_rec_t *p_pr = ib_sa_mad_get_payload_ptr(sa_mad);
 	ib_net64_t comp_mask = sa_mad->comp_mask;
diff --git a/opensm/osm_sm_state_mgr.c b/opensm/osm_sm_state_mgr.c
index 76ccf81..b543e7f 100644
--- a/opensm/osm_sm_state_mgr.c
+++ b/opensm/osm_sm_state_mgr.c
@@ -371,15 +371,10 @@ ib_api_status_t osm_sm_state_mgr_process(osm_sm_t * sm,
 			 * Update the state to MASTER, and start sweeping
 			 * OPTIONAL: send ACKNOWLEDGE
 			 */
-			/* Turn on the first_time_master_sweep flag */
+			/* Turn on the force_first_time_master_sweep flag */
+			/* We want full reconfiguration to occur on the first */
+			/* master sweep of this SM */
 			CL_PLOCK_EXCL_ACQUIRE(sm->p_lock);
-			sm->p_subn->first_time_master_sweep = TRUE;
-			/*
-			 * Turn on the force_heavy_sweep - we want a
-			 * heavy sweep to occur on the first sweep of this SM.
-			 */
-			sm->p_subn->force_heavy_sweep = TRUE;
-
 			/*
 			 * Make sure to set the subnet master_sm_base_lid
 			 * to the sm_base_lid value
@@ -387,8 +382,7 @@ ib_api_status_t osm_sm_state_mgr_process(osm_sm_t * sm,
 			sm->p_subn->master_sm_base_lid =
 			    sm->p_subn->sm_base_lid;
 
-			sm->p_subn->coming_out_of_standby = TRUE;
-
+			sm->p_subn->force_first_time_master_sweep = TRUE;
 			CL_PLOCK_RELEASE(sm->p_lock);
 
 			sm->p_subn->sm_state = IB_SMINFO_STATE_MASTER;
@@ -457,9 +451,7 @@ ib_api_status_t osm_sm_state_mgr_process(osm_sm_t * sm,
 				osm_get_sm_mgr_signal_str(signal));
 			CL_PLOCK_EXCL_ACQUIRE(sm->p_lock);
 			sm->polling_sm_guid = 0;
-			sm->p_subn->first_time_master_sweep = TRUE;
-			sm->p_subn->coming_out_of_standby = TRUE;
-			sm->p_subn->force_heavy_sweep = TRUE;
+			sm->p_subn->force_first_time_master_sweep = TRUE;
 			CL_PLOCK_RELEASE(sm->p_lock);
 			osm_sm_signal(sm, OSM_SIGNAL_SWEEP);
 			break;
diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c
index b9d2135..1fda3f6 100644
--- a/opensm/osm_state_mgr.c
+++ b/opensm/osm_state_mgr.c
@@ -373,6 +373,13 @@ static boolean_t state_mgr_is_sm_port_down(IN osm_sm_t * sm)
 		state = IB_LINK_ACTIVE;	/* base SP0 */
 	else
 		state = osm_physp_get_port_state(p_physp);
+
+	if (!p_port->discovery_count) {
+		OSM_LOG(sm->p_log, OSM_LOG_ERROR,
+			"ERR 330A: Failed to discover SM port\n");
+		state = IB_LINK_DOWN;
+	}
+
 	CL_PLOCK_RELEASE(sm->p_lock);
 
 Exit:
@@ -1162,6 +1169,13 @@ static void do_sweep(osm_sm_t * sm)
 	osm_remote_sm_t *p_remote_sm;
 	unsigned config_parsed = 0;
 
+	if (sm->p_subn->force_first_time_master_sweep) {
+		sm->p_subn->force_heavy_sweep = TRUE;
+		sm->p_subn->coming_out_of_standby = TRUE;
+		sm->p_subn->first_time_master_sweep = TRUE;
+		sm->p_subn->force_first_time_master_sweep = FALSE;
+	}
+
 	/* after subnet initialization error, run heavy sweep */
 	if (sm->p_subn->subnet_initialization_error)
 		sm->p_subn->force_heavy_sweep = TRUE;
@@ -1228,12 +1242,11 @@ static void do_sweep(osm_sm_t * sm)
 	}
 
 	/*
-	 * Unicast cache should be invalidated if there were errors
-	 * during initialization or if subnet re-route is requested.
+	 * Unicast cache should be invalidated when subnet re-route is
+	 * requested, and when OpenSM comes out of standby state.
 	 */
 	if (sm->p_subn->opt.use_ucast_cache &&
-	    (sm->p_subn->subnet_initialization_error ||
-	     sm->p_subn->force_reroute || sm->p_subn->coming_out_of_standby))
+	    (sm->p_subn->force_reroute || sm->p_subn->coming_out_of_standby))
 		osm_ucast_cache_invalidate(&sm->ucast_mgr);
 
 	/*
@@ -1314,7 +1327,8 @@ repeat_discovery:
 	if (state_mgr_is_sm_port_down(sm) == TRUE) {
 		if (sm->p_subn->last_sm_port_state) {
 			sm->p_subn->last_sm_port_state = 0;
-			osm_log_v2(sm->p_log, OSM_LOG_SYS, FILE_ID, "SM port is down\n");
+			osm_log_v2(sm->p_log, OSM_LOG_SYS, FILE_ID,
+				   "SM port is down\n");
 			OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE,
 					"SM PORT DOWN");
 		}
@@ -1331,7 +1345,8 @@ repeat_discovery:
 	} else {
 		if (!sm->p_subn->last_sm_port_state) {
 			sm->p_subn->last_sm_port_state = 1;
-			osm_log_v2(sm->p_log, OSM_LOG_SYS, FILE_ID, "SM port is up\n");
+			osm_log_v2(sm->p_log, OSM_LOG_SYS, FILE_ID,
+				   "SM port is up\n");
 			OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE,
 					"SM PORT UP");
 		}
@@ -1396,10 +1411,17 @@ repeat_discovery:
 				 * need to wait for that SM to relinquish control
 				 * of its portion of the subnet. C14-60.2.1.
 				 * Also - need to start polling on that SM. */
+				CL_PLOCK_EXCL_ACQUIRE(sm->p_lock);
 				sm->polling_sm_guid = p_remote_sm->smi.guid;
+				CL_PLOCK_RELEASE(sm->p_lock);
 				osm_sm_state_mgr_process(sm,
 							 OSM_SM_SIGNAL_WAIT_FOR_HANDOVER);
 				return;
+			} else if (sm->polling_sm_guid) {
+				/* Stop polling SM if it's not found */
+				osm_sm_state_mgr_process(sm,
+							 OSM_SM_SIGNAL_POLLING_TIMEOUT);
+				return;
 			}
 		}
 	}
@@ -1456,9 +1478,12 @@ repeat_discovery:
 	 */
 
 	if (!sm->ucast_mgr.cache_valid ||
-	    osm_ucast_cache_process(&sm->ucast_mgr))
-		if (osm_ucast_mgr_process(&sm->ucast_mgr))
+	    osm_ucast_cache_process(&sm->ucast_mgr)) {
+		if (osm_ucast_mgr_process(&sm->ucast_mgr)) {
+			osm_ucast_cache_invalidate(&sm->ucast_mgr);
 			return;
+		}
+	}
 
 	osm_qos_setup(sm->p_subn->p_osm);
 
diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
index ad9f80b..d577a69 100644
--- a/opensm/osm_subnet.c
+++ b/opensm/osm_subnet.c
@@ -255,7 +255,7 @@ static void opts_setup_log_max_size(osm_subn_t *p_subn, void *p_val)
 {
 	uint32_t log_max_size = *((uint32_t *) p_val);
 
-	p_subn->p_osm->log.max_size = log_max_size << 20; /* convert from MB to bytes */
+	p_subn->p_osm->log.max_size = (unsigned long)log_max_size << 20; /* convert from MB to bytes */
 }
 
 static void opts_setup_sminfo_polling_timeout(osm_subn_t *p_subn, void *p_val)
@@ -472,7 +472,7 @@ static void opts_parse_charp(IN osm_subn_t *p_subn, IN char *p_key,
 			     void (*pfn)(osm_subn_t *, void *))
 {
 	char **p_val1 = p_v1, **p_val2 = p_v2;
-	const char *current_str = *p_val1 ? *p_val1 : null_str ;
+	const char *current_str = *p_val1 ? *p_val1 : null_str;
 
 	if (p_val_str && strcmp(p_val_str, current_str)) {
 		char *new;
@@ -1474,9 +1474,9 @@ int is_mlnx_ext_port_info_supported(ib_net16_t devid)
 	uint16_t devid_ho;
 
 	devid_ho = cl_ntoh16(devid);
-	if (devid_ho == 0xc738)
+	if ((devid_ho >= 0xc738 && devid_ho <= 0xc73b) || devid_ho == 0xcb20)
 		return 1;
-	if (devid_ho >= 0x1003 && devid_ho <= 0x1011)
+	if (devid_ho >= 0x1003 && devid_ho <= 0x1013)
 		return 1;
 	return 0;
 }
@@ -2274,7 +2274,7 @@ int osm_subn_rescan_conf_files(IN osm_subn_t * p_subn)
 	return 0;
 }
 
-int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)
+void osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)
 {
 	int cacongoutputcount = 0;
 	int i;
@@ -2426,7 +2426,7 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)
 		"reassign_lids %s\n\n"
 		"# If TRUE forces every sweep to be a heavy sweep\n"
 		"force_heavy_sweep %s\n\n"
-		"# If TRUE every trap will cause a heavy sweep.\n"
+		"# If TRUE every trap 128 and 144 will cause a heavy sweep.\n"
 		"# NOTE: successive identical traps (>10) are suppressed\n"
 		"sweep_on_trap %s\n\n",
 		p_opts->sweep_interval,
@@ -2699,7 +2699,7 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)
 		"# Log file to be used\n"
 		"log_file %s\n\n"
 		"# Limit the size of the log file in MB. If overrun, log is restarted\n"
-		"log_max_size %lu\n\n"
+		"log_max_size %u\n\n"
 		"# If TRUE will accumulate the log over multiple OpenSM sessions\n"
 		"accum_log_file %s\n\n"
 		"# Per module logging configuration file\n"
@@ -2899,7 +2899,7 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)
 		}
 	}
 
-	/* If by chance all the CA Cong Settings are default, output atleast 1 chunk
+	/* If by chance all the CA Cong Settings are default, output at least 1 chunk
          * for illustration */
 	if (!cacongoutputcount)
 		fprintf(out,
@@ -2949,7 +2949,6 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)
 
 	/* optional string attributes ... */
 
-	return 0;
 }
 
 int osm_subn_write_conf_file(char *file_name, IN osm_subn_opt_t * p_opts)
@@ -2963,8 +2962,7 @@ int osm_subn_write_conf_file(char *file_name, IN osm_subn_opt_t * p_opts)
 		return -1;
 	}
 
-	if (osm_subn_output_conf(opts_file, p_opts) < 0)
-		return -1;
+	osm_subn_output_conf(opts_file, p_opts);
 
 	fclose(opts_file);
 
diff --git a/opensm/osm_switch.c b/opensm/osm_switch.c
index acc7b26..11efd54 100644
--- a/opensm/osm_switch.c
+++ b/opensm/osm_switch.c
@@ -619,6 +619,7 @@ static int alloc_lft(IN osm_switch_t * p_sw, uint16_t lids)
 int osm_switch_prepare_path_rebuild(IN osm_switch_t * p_sw, IN uint16_t max_lids)
 {
 	uint8_t **hops;
+	uint8_t *new_lft;
 	unsigned i;
 
 	if (alloc_lft(p_sw, max_lids))
@@ -629,9 +630,11 @@ int osm_switch_prepare_path_rebuild(IN osm_switch_t * p_sw, IN uint16_t max_lids
 
 	osm_switch_clear_hops(p_sw);
 
-	if (!(p_sw->new_lft = realloc(p_sw->new_lft, p_sw->lft_size)))
+	if (!(new_lft = realloc(p_sw->new_lft, p_sw->lft_size)))
 		return -1;
 
+	p_sw->new_lft = new_lft;
+
 	memset(p_sw->new_lft, OSM_NO_PATH, p_sw->lft_size);
 
 	if (!p_sw->hops) {
diff --git a/opensm/osm_ucast_mgr.c b/opensm/osm_ucast_mgr.c
index bb874de..43f053c 100644
--- a/opensm/osm_ucast_mgr.c
+++ b/opensm/osm_ucast_mgr.c
@@ -1070,7 +1070,7 @@ static int ucast_mgr_route(struct osm_routing_engine *r, osm_opensm_t * osm)
 
 	if (ret < 0) {
 		OSM_LOG(&osm->log, OSM_LOG_ERROR,
-			"%s: cannot build lid matrices.\n", r->name);
+			"%s: cannot build lid matrices\n", r->name);
 		return ret;
 	}
 
@@ -1080,7 +1080,7 @@ static int ucast_mgr_route(struct osm_routing_engine *r, osm_opensm_t * osm)
 
 	if (ret < 0) {
 		OSM_LOG(&osm->log, OSM_LOG_ERROR,
-			"%s: cannot build fwd tables.\n", r->name);
+			"%s: cannot build fwd tables\n", r->name);
 		return ret;
 	}
 
diff --git a/osmeventplugin/src/osmeventplugin.c b/osmeventplugin/src/osmeventplugin.c
index 23986db..d7975a3 100644
--- a/osmeventplugin/src/osmeventplugin.c
+++ b/osmeventplugin/src/osmeventplugin.c
@@ -44,6 +44,7 @@
 #include <time.h>
 #include <dlfcn.h>
 #include <stdint.h>
+#include <opensm/osm_config.h>
 #include <complib/cl_qmap.h>
 #include <complib/cl_passivelock.h>
 #include <opensm/osm_version.h>
diff --git a/osmtest/main.c b/osmtest/main.c
index 585b455..c4b90bf 100644
--- a/osmtest/main.c
+++ b/osmtest/main.c
@@ -451,7 +451,7 @@ int main(int argc, char *argv[])
 
 		case 'l':
 			opt.log_file = optarg;
-			printf("\tLog File:%s\n", opt.log_file);
+			printf("\tLog File: %s\n", opt.log_file);
 			break;
 
 		case 'v':
diff --git a/osmtest/osmtest.c b/osmtest/osmtest.c
index 1dcadea..4ef78eb 100644
--- a/osmtest/osmtest.c
+++ b/osmtest/osmtest.c
@@ -245,6 +245,8 @@ static const char ib_mad_status_str_insuf_comps[] =
     "IB_SA_MAD_STATUS_INSUF_COMPS";
 static const char generic_or_str[] = " | ";
 
+static ib_api_status_t osmtest_create_db(IN osmtest_t * const p_osmt);
+
 const char *ib_get_mad_status_str(IN const ib_mad_t * const p_mad)
 {
 	static char line[512];
@@ -5369,8 +5371,17 @@ osmtest_get_sm_gid(IN osmtest_t * const p_osmt)
 		cl_hton64(p_osmt->local_port_gid.unicast.prefix);
 
 	if (local_port->lid != local_port->sm_lid) {
+		status = osmtest_create_db(p_osmt);
+		if (status != IB_SUCCESS) {
+			OSM_LOG(&p_osmt->log, OSM_LOG_ERROR,
+				"ERR 0155: Database creation failed (%s)\n",
+				ib_get_err_str(status));
+			goto Exit;
+		}
+
 		p_tbl = &p_osmt->exp_subn.node_lid_tbl;
-		p_node = (node_t *) cl_qmap_get(p_tbl, local_port->sm_lid);
+		p_node = (node_t *) cl_qmap_get(p_tbl,
+						cl_hton16(local_port->sm_lid));
 		if (p_node == (node_t *) cl_qmap_end(p_tbl)) {
 			OSM_LOG(&p_osmt->log, OSM_LOG_ERROR,
 				"ERR 0154: SM LID 0x%X doesn't exist\n",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/opensm.git



More information about the Pkg-ofed-commits mailing list