diff --git a/.gitignore b/.gitignore
index 4dea307c..bbee270b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ aclocal.m4
 autom4te.cache/
 config.log
 config.status
+config/compile
 config/config.guess
 config/config.sub
 config/depcomp
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..a05dcfe7
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,20 @@
+language: c
+dist: xenial
+addons:
+  apt:
+    sources:
+    - ubuntu-toolchain-r-test
+    packages:
+    - bison
+    - flex
+    - autoconf
+    - automake
+    - gcc-8
+    - libtool-bin
+    - make
+    - sparse
+    - wget
+    - libibumad-dev
+script:
+  - scripts/travis-checkpatch
+  - scripts/travis-build
diff --git a/Makefile.am b/Makefile.am
index 63b34104..0bd48b48 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 
 # note that order matters: make the libs first then use them
-SUBDIRS = complib libvendor opensm osmtest include $(DEFAULT_EVENT_PLUGIN)
-DIST_SUBDIRS = complib libvendor opensm osmtest include osmeventplugin
+SUBDIRS = complib libopensm libvendor opensm osmtest include $(DEFAULT_EVENT_PLUGIN)
+DIST_SUBDIRS = complib libopensm libvendor opensm osmtest include osmeventplugin osmroutingplugin
 
 ACLOCAL_AMFLAGS = -I config
 
diff --git a/complib/cl_complib.c b/complib/cl_complib.c
index 286306d0..cfea01ea 100644
--- a/complib/cl_complib.c
+++ b/complib/cl_complib.c
@@ -74,6 +74,25 @@ _error:
 	exit(1);
 }
 
+cl_status_t complib_init_v2(void)
+{
+	cl_status_t status = CL_SUCCESS;
+
+	status = cl_spinlock_init(&cl_atomic_spinlock);
+	if (status != CL_SUCCESS)
+		goto _error;
+
+	status = __cl_timer_prov_create();
+	if (status != CL_SUCCESS)
+		goto _error;
+	return status;
+
+_error:
+	cl_msg_out("__init_v2: failed to create complib (%s)\n",
+		   CL_STATUS_MSG(status));
+	return status;
+}
+
 void complib_exit(void)
 {
 	__cl_timer_prov_destroy();
diff --git a/complib/cl_dispatcher.c b/complib/cl_dispatcher.c
index 1255c830..5e8c85ab 100644
--- a/complib/cl_dispatcher.c
+++ b/complib/cl_dispatcher.c
@@ -85,7 +85,7 @@ void __cl_disp_worker(IN void *context)
 		p_msg =
 		    (cl_disp_msg_t *) cl_qlist_remove_head(&p_disp->msg_fifo);
 
-		/* we track the tim ethe last message spent in the queue */
+		/* we track the time the last message spent in the queue */
 		p_disp->last_msg_queue_time_us =
 		    cl_get_time_stamp() - p_msg->in_time;
 
@@ -279,7 +279,6 @@ void cl_disp_unregister(IN const cl_disp_reg_handle_t handle)
 	cl_spinlock_acquire(&p_disp->lock);
 	/* Remove the registrant from the list. */
 	cl_qlist_remove_item(&p_disp->reg_list, (cl_list_item_t *) p_reg);
-	/* Return the registration info to the pool */
 	free(p_reg);
 
 	cl_spinlock_release(&p_disp->lock);
diff --git a/complib/cl_event_wheel.c b/complib/cl_event_wheel.c
index 27443f66..8950410f 100644
--- a/complib/cl_event_wheel.c
+++ b/complib/cl_event_wheel.c
@@ -39,6 +39,9 @@
 
 #include <math.h>
 #include <stdlib.h>
+#ifdef __CL_EVENT_WHEEL_TEST__
+#include <unistd.h>		/* sleep() */
+#endif
 #include <complib/cl_event_wheel.h>
 #include <complib/cl_debug.h>
 
@@ -90,7 +93,7 @@ static void __cl_event_wheel_callback(IN void *context)
 		/* the list is empty - nothing to do */
 		goto Exit;
 
-	/* we found such an item.  get the p_event */
+	/* we found such an item. get the p_event */
 	p_event =
 	    PARENT_STRUCT(p_list_item, cl_event_wheel_reg_info_t, list_item);
 
@@ -172,7 +175,7 @@ static void __cl_event_wheel_callback(IN void *context)
 		       "%u [msec]\n", new_timeout);
 		cl_status = cl_timer_start(&p_event_wheel->timer, new_timeout);
 		if (cl_status != CL_SUCCESS) {
-			CL_DBG("__cl_event_wheel_callback : ERR 6200: "
+			CL_DBG("__cl_event_wheel_callback: ERR 6200: "
 			       "Failed to start timer\n");
 		}
 	}
@@ -302,7 +305,7 @@ cl_status_t cl_event_wheel_reg(IN cl_event_wheel_t * const p_event_wheel,
 	/* Make sure such a key does not exists */
 	p_map_item = cl_qmap_get(&p_event_wheel->events_map, key);
 	if (p_map_item != cl_qmap_end(&p_event_wheel->events_map)) {
-		CL_DBG("cl_event_wheel_reg: Already exists key:0x%"
+		CL_DBG("cl_event_wheel_reg: Already existing key:0x%"
 		       PRIx64 "\n", key);
 
 		/* already there - remove it from the list as it is getting a new time */
@@ -320,6 +323,10 @@ cl_status_t cl_event_wheel_reg(IN cl_event_wheel_t * const p_event_wheel,
 		/* make a new one */
 		p_event = (cl_event_wheel_reg_info_t *)
 		    malloc(sizeof(cl_event_wheel_reg_info_t));
+		if (!p_event) {
+			cl_status = CL_ERROR;
+			goto Exit;
+		}
 		p_event->num_regs = 0;
 	}
 
@@ -505,17 +512,18 @@ void __cl_event_wheel_dump(IN cl_event_wheel_t * const p_event_wheel)
 static uint64_t __test_event_aging(uint64_t key, uint32_t num_regs, void *context)
 {
 	printf("*****************************************************\n");
-	printf("Aged key: 0x%" PRIx64 " Context:%s\n", key, (char *)context);
+	printf("Aged key: 0x%" PRIx64 " Context:%s\n", key, (char *) context);
 }
 
 int main()
 {
 	cl_event_wheel_t event_wheel;
-	/*  uint64_t key; */
 
 	/* init complib */
-	complib_init();
-
+	if (complib_init_v2() != CL_SUCCESS) {
+		printf("complib_init_v2 failed\n");
+		exit(1);
+	}
 	/* construct */
 	cl_event_wheel_construct(&event_wheel);
 
@@ -526,7 +534,7 @@ int main()
 	cl_event_wheel_reg(&event_wheel, 1,	/*  key */
 			   cl_get_time_stamp() + 3000000,	/*  3 sec lifetime */
 			   __test_event_aging,	/*  cb */
-			   "The first Aging Event");
+			   "The First Aging Event");
 
 	cl_event_wheel_reg(&event_wheel, 2,	/*  key */
 			   cl_get_time_stamp() + 3000000,	/*  3 sec lifetime */
@@ -534,7 +542,7 @@ int main()
 			   "The Second Aging Event");
 
 	cl_event_wheel_reg(&event_wheel, 3,	/*  key */
-			   cl_get_time_stamp() + 3500000,	/*  3 sec lifetime */
+			   cl_get_time_stamp() + 3500000,	/*  3.5 sec lifetime */
 			   __test_event_aging,	/*  cb */
 			   "The Third Aging Event");
 
@@ -542,7 +550,7 @@ int main()
 
 	sleep(2);
 	cl_event_wheel_reg(&event_wheel, 2,	/*  key */
-			   cl_get_time_stamp() + 8000000,	/*  3 sec lifetime */
+			   cl_get_time_stamp() + 8000000,	/*  8 sec lifetime */
 			   __test_event_aging,	/*  cb */
 			   "The Second Aging Event Moved");
 
diff --git a/complib/cl_heap.c b/complib/cl_heap.c
index 8f934403..b7715f98 100644
--- a/complib/cl_heap.c
+++ b/complib/cl_heap.c
@@ -91,7 +91,6 @@ cl_status_t cl_heap_init(IN cl_heap_t * const p_heap, IN const size_t max_size,
 		cl_heap_destroy(p_heap);
 
 	p_heap->branching_factor = d;
-	p_heap->element_array = NULL;
 	p_heap->size = 0;
 	p_heap->capacity = max_size;
 	p_heap->pfn_index_update = pfn_index_update;
diff --git a/complib/cl_vector.c b/complib/cl_vector.c
index f309a098..463cb901 100644
--- a/complib/cl_vector.c
+++ b/complib/cl_vector.c
@@ -118,8 +118,8 @@ static void cl_vector_copy8(OUT void *const p_dest,
  *	None
  *
  */
-void cl_vector_copy16(OUT void *const p_dest,
-		      IN const void *const p_src, IN const size_t size)
+static void cl_vector_copy16(OUT void *const p_dest,
+			     IN const void *const p_src, IN const size_t size)
 {
 	CL_ASSERT(size == sizeof(uint16_t));
 	UNUSED_PARAM(size);
@@ -143,8 +143,8 @@ void cl_vector_copy16(OUT void *const p_dest,
  *	None
  *
  */
-void cl_vector_copy32(OUT void *const p_dest,
-		      IN const void *const p_src, IN const size_t size)
+static void cl_vector_copy32(OUT void *const p_dest,
+			     IN const void *const p_src, IN const size_t size)
 {
 	CL_ASSERT(size == sizeof(uint32_t));
 	UNUSED_PARAM(size);
@@ -168,8 +168,8 @@ void cl_vector_copy32(OUT void *const p_dest,
  *	None
  *
  */
-void cl_vector_copy64(OUT void *const p_dest,
-		      IN const void *const p_src, IN const size_t size)
+static void cl_vector_copy64(OUT void *const p_dest,
+			     IN const void *const p_src, IN const size_t size)
 {
 	CL_ASSERT(size == sizeof(uint64_t));
 	UNUSED_PARAM(size);
diff --git a/complib/libosmcomp.map b/complib/libosmcomp.map
index 4a77ce45..e874c550 100644
--- a/complib/libosmcomp.map
+++ b/complib/libosmcomp.map
@@ -126,10 +126,6 @@ OSMCOMP_2.3 {
 		cl_timer_trim;
 		cl_get_time_stamp;
 		cl_get_time_stamp_sec;
-		cl_vector_copy_general;
-		cl_vector_copy16;
-		cl_vector_copy32;
-		cl_vector_copy64;
 		cl_vector_construct;
 		cl_vector_init;
 		cl_vector_destroy;
@@ -161,5 +157,6 @@ OSMCOMP_2.3 {
 		parse_node_map;
 		remap_node_name;
 		clean_nodedesc;
+		complib_init_v2;
 	local: *;
 };
diff --git a/complib/libosmcomp.ver b/complib/libosmcomp.ver
index 2262376f..6ecd5d88 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=4:0:0
+LIBVERSION=5:0:0
diff --git a/configure.ac b/configure.ac
index cba92934..791a01c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
-AC_INIT(opensm, 3.3.21, linux-rdma@vger.kernel.org)
+AC_INIT(opensm, 3.3.22, linux-rdma@vger.kernel.org)
 AC_CONFIG_SRCDIR([opensm/osm_opensm.c])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(config)
@@ -290,4 +290,4 @@ METIS_CHECK_LIB
 AC_CONFIG_FILES([man/opensm.8 man/torus-2QoS.8 man/torus-2QoS.conf.5 scripts/opensm.init scripts/redhat-opensm.init scripts/sldd.sh])
 
 dnl Create the following Makefiles
-AC_OUTPUT([include/opensm/osm_version.h Makefile include/Makefile complib/Makefile libvendor/Makefile opensm/Makefile osmeventplugin/Makefile osmtest/Makefile opensm.spec])
+AC_OUTPUT([include/opensm/osm_version.h Makefile include/Makefile complib/Makefile libopensm/Makefile libvendor/Makefile opensm/Makefile osmeventplugin/Makefile osmroutingplugin/Makefile osmtest/Makefile opensm.spec])
diff --git a/debian/changelog b/debian/changelog
index 0d56a980..7b89a987 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+opensm (3.3.22+git20190723.924f030-1) UNRELEASED; urgency=medium
+
+  * New upstream snapshot.
+  * Drop patch typo_fixes, present upstream.
+  * Drop patch Fix-various-typos.patch, present upstream.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 26 Sep 2019 05:02:08 +0000
+
 opensm (3.3.21-2) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/Fix-various-typos.patch b/debian/patches/Fix-various-typos.patch
deleted file mode 100644
index 4f7313af..00000000
--- a/debian/patches/Fix-various-typos.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 7b78a53dbaaf38970ee5530dec5537798bfd5281 Mon Sep 17 00:00:00 2001
-From: Benjamin Drung <benjamin.drung@cloud.ionos.com>
-Date: Mon, 10 Dec 2018 17:52:49 +0100
-Subject: [PATCH] Fix various typos
-
-lintian found more typos. Fix them all.
-
-Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
-Forwarded: https://github.com/linux-rdma/opensm/pull/6
----
- doc/current-routing.txt | 2 +-
- man/opensm.8.in         | 6 +++---
- opensm/main.c           | 2 +-
- opensm/osm_subnet.c     | 2 +-
- opensm/osm_ucast_nue.c  | 2 +-
- 5 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/doc/current-routing.txt b/doc/current-routing.txt
-index 0bacd1e6..c33bef16 100644
---- a/doc/current-routing.txt
-+++ b/doc/current-routing.txt
-@@ -51,7 +51,7 @@ in terms of the underlying topology.
- 
- 10. Nue unicast routing algorithm - a 100%-applicable and deadlock-free
- routing which can be used for any arbitrary or faulty network topology
--and any number of virtual lanes (this includes the absense of VLs as well).
-+and any number of virtual lanes (this includes the absence of VLs as well).
- Paths are globally balanced w.r.t the number of routes per link, and are
- kept as short as possible while enforcing deadlock-freedom within the VL
- constraint.
-diff --git a/man/opensm.8.in b/man/opensm.8.in
-index df557682..c9101324 100644
---- a/man/opensm.8.in
-+++ b/man/opensm.8.in
-@@ -178,7 +178,7 @@ This option sets the maximum number of VLs to use for the Nue routing engine.
- Every number greater or equal to 0 is allowed, and the default is 1 to enforce
- deadlock-freedom even if QoS is not enabled. If set to 0, then Nue routing will
- automatically determine and choose maximum supported by the fabric. And if set
--to any interger >= 1, then Nue uses min(max_supported,nue_max_num_vls).
-+to any integer >= 1, then Nue uses min(max_supported,nue_max_num_vls).
- Rule of thumb is: higher nue_max_num_vls results in better path balancing.
- .TP
- \fB\-A\fR, \fB\-\-ucast_cache\fR
-@@ -531,7 +531,7 @@ runs are consistent. The default directory used is /var/cache/opensm.
- The following files are included in it:
- 
-  guid2lid  - stores the LID range assigned to each GUID
-- guid2mkey - stores the MKey previously assiged to each GUID
-+ guid2mkey - stores the MKey previously assigned to each GUID
-  neighbors - stores a map of the GUIDs at either end of each link
-              in the fabric
- 
-@@ -932,7 +932,7 @@ in terms of the underlying topology.
- 
- 10. Nue unicast routing algorithm - a 100%-applicable and deadlock-free routing
- which can be used for any arbitrary or faulty network topology and any number
--of virtual lanes (this includes the absense of VLs as well). Paths are globally
-+of virtual lanes (this includes the absence of VLs as well). Paths are globally
- balanced w.r.t the number of routes per link, and are kept as short as possible
- while enforcing deadlock-freedom within the VL constraint.
- 
-diff --git a/opensm/main.c b/opensm/main.c
-index 8def799c..0b50b43d 100644
---- a/opensm/main.c
-+++ b/opensm/main.c
-@@ -198,7 +198,7 @@ static void show_usage(void)
- 	       "          Sets the maximum number of VLs to be used by Nue routing.\n"
- 	       "          Defaults to 1 to enforce deadlock-freedom even if QoS is not\n"
- 	       "          enabled. Set to 0 if Nue should automatically determine and\n"
--	       "          choose maximum supported by the fabric, or any interger >= 1.\n\n");
-+	       "          choose maximum supported by the fabric, or any integer >= 1.\n\n");
- 	printf("--connect_roots, -z\n"
- 	       "          This option enforces routing engines (up/down and \n"
- 	       "          fat-tree) to make connectivity between root switches\n"
-diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
-index f6a4a2c4..b8473fc5 100644
---- a/opensm/osm_subnet.c
-+++ b/opensm/osm_subnet.c
-@@ -2671,7 +2671,7 @@ void osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)
- 		"# Maximum number of VLs for Nue routing algorithm (default: 1; to enforce\n"
- 		"# deadlock-freedom even if QoS is not enabled). Set to 0 if Nue should\n"
- 		"# automatically determine and choose maximum supported by the fabric, or\n"
--		"# any interger >= 1 (then Nue uses min(max_supported,nue_max_num_vls)\n"
-+		"# any integer >= 1 (then Nue uses min(max_supported,nue_max_num_vls)\n"
- 		"nue_max_num_vls %u\n\n",
- 		p_opts->nue_max_num_vls);
- 
-diff --git a/opensm/osm_ucast_nue.c b/opensm/osm_ucast_nue.c
-index 0ef84ebc..c6955a08 100644
---- a/opensm/osm_ucast_nue.c
-+++ b/opensm/osm_ucast_nue.c
-@@ -39,7 +39,7 @@
-  * Abstract:
-  *    Implementation of Nue routing for OpenSM. Nue is a deadlock-free routing
-  *    engine which can be used for arbitrary network topologies and any number
-- *    of virtual lanes (this includes the absense of VLs as well). The paper
-+ *    of virtual lanes (this includes the absence of VLs as well). The paper
-  *    explaining the details of Nue routing is: [1] J. Domke, T. Hoefler and
-  *    S. Matsuoka "Routing on the Dependency Graph: A New Approach to
-  *    Deadlock-Free High-Performance Routing", HPDC'16. An in-depth explanation
--- 
-2.17.1
-
diff --git a/debian/patches/series b/debian/patches/series
index 81712ca0..e69de29b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +0,0 @@
-typo_fixes
-Fix-various-typos.patch
diff --git a/debian/patches/typo_fixes b/debian/patches/typo_fixes
deleted file mode 100644
index c034f6cc..00000000
--- a/debian/patches/typo_fixes
+++ /dev/null
@@ -1,46 +0,0 @@
-Description: a bunch of typo fixes
-Author: Ana Guerrero Lopez <ana@ekaia.org>
-Last-Update: 2018-12-10
-
---- opensm-3.3.20.orig/man/torus-2QoS.8.in
-+++ opensm-3.3.20/man/torus-2QoS.8.in
-@@ -381,7 +381,7 @@ will not be placed into the torus.
- .
- .SH QUALITY OF SERVICE CONFIGURATION
- .
--OpenSM will not program switchs and channel adapters with
-+OpenSM will not program switches and channel adapters with
- SL2VL maps or VL arbitration configuration unless it is invoked with -Q.
- Since torus-2QoS depends on such functionality for correct operation,
- always invoke OpenSM with -Q when torus-2QoS is in the list of routing
---- opensm-3.3.20.orig/opensm/osm_event_plugin.c
-+++ opensm-3.3.20/opensm/osm_event_plugin.c
-@@ -103,7 +103,7 @@ osm_epi_plugin_t *osm_epi_construct(osm_
- 	old_impl = (struct old_if *) rc->impl;
- 	if (old_impl->ver == OSM_ORIG_EVENT_PLUGIN_INTERFACE_VER) {
- 		OSM_LOG(&osm->log, OSM_LOG_ERROR, "Error loading plugin: "
--			"\'%s\' contains a depricated interface version %d\n"
-+			"\'%s\' contains a deprecated interface version %d\n"
- 			"   Please recompile with the new interface.\n",
- 			plugin_name, old_impl->ver);
- 		goto Exit;
---- opensm-3.3.20.orig/opensm/osm_ucast_ftree.c
-+++ opensm-3.3.20/opensm/osm_ucast_ftree.c
-@@ -3257,7 +3257,7 @@ static int rank_leaf_switches(IN ftree_f
- 			/* HCA connected directly to another HCA - not FatTree */
- 			OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_ERROR,
- 				"ERR AB0F: "
--				"CA conected directly to another CA: " "0x%016"
-+				"CA connected directly to another CA: " "0x%016"
- 				PRIx64 " <---> 0x%016" PRIx64 "\n",
- 				hca_get_guid_ho(p_hca),
- 				cl_ntoh64(osm_node_get_node_guid
-@@ -3377,7 +3377,7 @@ fabric_construct_hca_ports(IN ftree_fabr
- 			/* HCA connected directly to another HCA - not FatTree */
- 			OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_ERROR,
- 				"ERR AB11: "
--				"CA conected directly to another CA: " "0x%016"
-+				"CA connected directly to another CA: " "0x%016"
- 				PRIx64 " <---> 0x%016" PRIx64 "\n",
- 				cl_ntoh64(osm_node_get_node_guid(p_node)),
- 				cl_ntoh64(remote_node_guid));
diff --git a/doc/current-routing.txt b/doc/current-routing.txt
index 0bacd1e6..c33bef16 100644
--- a/doc/current-routing.txt
+++ b/doc/current-routing.txt
@@ -51,7 +51,7 @@ in terms of the underlying topology.
 
 10. Nue unicast routing algorithm - a 100%-applicable and deadlock-free
 routing which can be used for any arbitrary or faulty network topology
-and any number of virtual lanes (this includes the absense of VLs as well).
+and any number of virtual lanes (this includes the absence of VLs as well).
 Paths are globally balanced w.r.t the number of routes per link, and are
 kept as short as possible while enforcing deadlock-freedom within the VL
 constraint.
diff --git a/doc/opensm_release_notes-3.3.txt b/doc/opensm_release_notes-3.3.txt
index 517e8281..b054afbd 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://github.com/linux-rdma/opensm
-Date:    September 2018
+Date:    April 2019
 
 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.21.
+is opensm-3.3.22.
 
 This document includes the following sections:
 1 This Overview section (describing new features and software
@@ -121,6 +121,9 @@ This document includes the following sections:
 
 1.2 Minor New Features:
 
+82c3ea6 Add '--subnet_prefix' and '--dump_files_dir' options
+dfc383e osm_port_info_rcv.c: Optimize PKEY sending during heavy sweep
+6abbbcd osm_subnet.c: Add latest Bull device IDs to device white lists
 6a24bcd osm_subnet.c: Add additional device ID to is_mlnx_ext_port_info_supported
 0ab8d12 Add force_link_width option
 3f28045 Handle other 2x and/or HDR not supported SA rate cases
@@ -477,6 +480,10 @@ b73c378 opensm/perfmgr; add support for PortCountersExtended NOIETF
 
 1.3 Library API Changes
 
+2fd785f Deprecate complib_init() due to use of exit() function
+399fe25 Eliminate circular dependencies in shared libraries
+d7135b1 complib/cl_types.h: Remove unimplemented function cl_panic
+04b0c34 complib: cl_vector_copy16/32/64 should be static functions
 925e1ce Add timeout parameter for SM class set transactions
 f60e241 osm_madw.h: Remove unused bind_info in osm_madw structure
 aa63c3c complib: Add a d-ary heap
@@ -574,6 +581,9 @@ information regarding each compliance statement.
 -----------
 
 4.1 Major Bug Fixes
+
+73f6461 osm_opensm.c: Fix seg fault in destroy_routing_engine
+9a7fa48 osm_multicast.c: Fix potential crash in osm_mgrp_delete_port
 af9fc7a osm_sa_mcmember_record.c: Use neighbor MTU rather than MTUCap in mgrp_request_is_realizable
 9a4e79b dfsssp - detect and try to repair an odd network state
 85f841c osm_ucast_[dfsssp ftree].c: Fix memory leak when io/cn guid file have duplicated guids
@@ -856,6 +866,71 @@ f37bf3c opensm/perfmgr: skip data counters when only printing errors
 
 4.2 Other Bug Fixes
 
+1c57b7d libvendor/osm_vendor_ibumad.c: Fix type of array passed to umad_get_ca_portguids in libibumad
+f5c21ce osmtest.c: Remove ununsed osmtest_get_node_rec routine
+e3e49a9 osmtest/main.c: Fix show_usage declaration
+ef67b6a osmtest: Add missing static keywords
+2989b31 libvendor,osmtest: Use NULL instead of 0 in all places where it used as a pointer
+9b8bcc1 osmtest/main.c: Fix return type for getopt_long_only
+8e6d76c osm_[congestion_control perfmgr].c: Fix signed vs unsigned comparison
+476b822 osm_opensm.c: Fix static declaration
+6d49a7e libvendor/osm_vendor_mlx_sim.c: In osmv_transport_init, fix memory leaks on error
+e76b7ab libvendor/osm_vendor_mlx[_hca]_sim.c: Eliminate use of exit
+d34622f gen_chlog.sh: Update script to use git describe rather than git cat-file tag
+92a9c3e osm_[link_mgr trap_rcv].c: Check the return value of osm_get_port_by_guid
+06b168a main.c: Remove NO_EFFECT code
+20c135d osm_helper.c: Make "50" string proper fixed width in lsea_str_fixed_width
+df22e54 osm_helper.c: Fix lsea_str_fixed_width OVERRUN issue
+d289316 osm_trap_rcv.c: Fix missing log message when 10 traps are received from the same source within time window
+ceef038 man/opensm.8.in: Quiet some man warnings
+aae42c6 Fix various typos
+8e6abe9 Fix typo in OSM_DEFAULT_TRAP_SUPPRESSION_TIMEOUT
+6b71ec0 Fix a bunch of typos
+7c2dd40 osm_opensm.c: No need to check context for default routing engine in destroy_routing_engines
+7f98069 osm_opensm.c: destroy_routing_engines should destroy the default routing engine
+a66a09c osm_subnet.c: Free per_module_logging_file in subn_opt_destroy
+7c9521b osm_sa.c: Remove unneeded label in osm_sa_bind
+e000a2e osm_resp.c: No need to swap DR [D/S]LIDs in resp_make_resp_smp
+67799fa opensm/osm_service.h: Fix and add some comments
+5da75d8 opensm/osm_mlnx_ext_port_info_rcv.c: Check the pointer of osm_sm_t before accessing it
+406dc70 opensm/osm_mtree.h: Improve comment
+7b06728 opensm/osm_remote_sm.c: Improve comment
+d817750 opensm/osm_ucast_cache.h: Improve coding style and comments
+717312e opensm/osm_ucast_mgr.h: Add comment for 'max_lid' foeld in osm_ucast_mgr structure
+718c14b opensm/osm_multicast.h: Improve comments
+f538e69 opensm/osm_sa_mad_ctrl.h: Improve comments
+6173c97 opensm/osm_sm_mad_ctrl.h: Improve comments
+2414219 opensm/osm_remote_sm.h: Improve comments
+6f2cbdb opensm/osm_mtree.h: Improve comments
+242f0a8 opensm/osm_vl15intf.h: Minor update of comments
+a989601 opensm/osm_node.h: Improve comments
+519c2d1 opensm/osm_router.h: Improve comments
+537cbb9 Delete unused header opensm/osm_attrib_req.h
+688543e opensm/osm_path.h: Delete comments for non-existent struct field and function parameters
+4974027 Revert complib/cl_event_wheel.c: Fix memory leak in event_wheel mechanism
+f911f13 opensm/osm_base.h: Delete comments about non-existent "Base" class
+fb9c811 opensm/osm_base.h: Delete unused header complib/cl_types.h
+e316e0a complib/cl_event_wheel.c: Minor update to the sample test program
+ae1c005 complib/cl_event_wheel.h: Improve comment documentation
+1b1048b complib/cl_[dispatcher event_wheel].h: Fix commentary typo
+c11b31c complib/cl_event_wheel.c: Handle malloc failure in cl_event_wheel_reg
+7345086 complib/cl_event_wheel.h: Eliminate unneeded field in cl_event_wheel_reg_info_t
+be122bc complib/cl_event_wheel.c: Some cosmetic changes
+44afd73 complib/cl_event_wheel.c: Fix memory leak in event_wheel mechanism
+12c24d1 complib/cl_dispatcher.h: Improve comments
+b69dc33 complib/cl_dispatcher.c: Fix typo and delete one incorrect comment
+c558360 include/opensm: Remove some redundant includes
+169b144 include/complib: Delete documentation about 'p_nil'
+2c6c6b4 complib/cl_debug.h: Cosmetic formatting changes to some macros
+8a4172c complib/cl_heap.c: Remove redundant initialization statement
+b42bea6 complib/cl_heap.h: Replace 'shift_' with 'heap_' in the DESCRIPTION section
+5446e32 complib/cl_qcomppool.h: Improve max_objects comment
+d429d5f include/complib: Fix comments and documentation
+0877d07 complib/cl_ptr_vector.h: Fixed cut 'n paste error in cl_ptr_vector_remove NOTES
+329cb4a complib/cl_types.h: Cosmetic formatting changes
+250204d osm_db_files.c: Remove an obsolete GUID-length check on osm_db_restore
+15c1acc osm_sa_mcmember_record.c: Change level of log messages for port GID subnet prefix mismatches in join/leave
+2b9cf6f Use precision specifier for scanf
 43270a6 Replace hard coded constants with defines for force_link_xxx options
 901af61 osm_helper.h: Remove trailing whitespace in comment
 a0aee8b Revert osm_db_files.c: Fix bad free in osm_db_delete
diff --git a/gen_chlog.sh b/gen_chlog.sh
index ed74ed66..b28d1de8 100755
--- a/gen_chlog.sh
+++ b/gen_chlog.sh
@@ -27,7 +27,7 @@ mkchlog()
 	prev_tag=""
 
 	for tag in `git tag -l '*' | sort -V` ; do
-		obj=`git cat-file tag $tag | awk '/^object /{print $2}'`
+		obj=`git describe $tag`
 		base=`git merge-base $obj HEAD`
 		if [ -z "$base" -o "$base" != $obj ] ; then
 			continue
diff --git a/include/complib/cl_comppool.h b/include/complib/cl_comppool.h
index 503ae181..aef15731 100644
--- a/include/complib/cl_comppool.h
+++ b/include/complib/cl_comppool.h
@@ -113,8 +113,12 @@ typedef cl_status_t
 			    IN const uint32_t num_components, IN void *context);
 /*
 * PARAMETERS
-*	p_object
-*		[in] Pointer to an object to initialize.
+*	p_comp_array
+*		[in] Pointer to the first entry in an array of pointers, each of
+*		which points to a component that makes up a composite object.
+*
+*	num_components
+*		[in] Number of components in the composite array.
 *
 *	context
 *		[in] Context provided in a call to cl_cpool_init.
diff --git a/include/complib/cl_debug.h b/include/complib/cl_debug.h
index 05e9769b..10f5e86d 100644
--- a/include/complib/cl_debug.h
+++ b/include/complib/cl_debug.h
@@ -191,7 +191,7 @@ void cl_msg_out(IN const char *const message, IN ...);
 */
 #define	CL_DBG_DISABLE		0
 #define	CL_DBG_ERROR		0x80000000
-#define	CL_DBG_ALL			0xFFFFFFFF
+#define	CL_DBG_ALL		0xFFFFFFFF
 /*
 * VALUES
 *	CL_DBG_DISABLE
@@ -270,12 +270,12 @@ void cl_msg_out(IN const char *const message, IN ...);
 * SEE ALSO
 *	Debug Output, Debug Levels, CL_ENTER, CL_EXIT, CL_TRACE, CL_TRACE_EXIT
 *********/
-#define	CL_PRINT( DBG_LVL, CHK_LVL, STRING )								\
-	{																		\
-	if( DBG_LVL & CL_DBG_ERROR )											\
-		cl_dbg_out STRING;													\
-	else if( (DBG_LVL & CHK_LVL) == DBG_LVL )								\
-		cl_dbg_out STRING;													\
+#define	CL_PRINT( DBG_LVL, CHK_LVL, STRING )				\
+	{								\
+	if( DBG_LVL & CL_DBG_ERROR )					\
+		cl_dbg_out STRING;					\
+	else if( (DBG_LVL & CHK_LVL) == DBG_LVL )			\
+		cl_dbg_out STRING;					\
 	}
 
 /****d* Component Library: Debug Output/CL_ENTER
@@ -331,8 +331,8 @@ void cl_msg_out(IN const char *const message, IN ...);
 * SEE ALSO
 *	Debug Output, Debug Levels, CL_PRINT, CL_EXIT, CL_TRACE, CL_TRACE_EXIT
 *********/
-#define CL_ENTER( DBG_LVL, CHK_LVL )										\
-	CL_CHK_STK;																\
+#define CL_ENTER( DBG_LVL, CHK_LVL )			\
+	CL_CHK_STK;					\
 	CL_PRINT( DBG_LVL, CHK_LVL, _CL_DBG_ENTER );
 
 /****d* Component Library: Debug Output/CL_EXIT
@@ -391,7 +391,7 @@ void cl_msg_out(IN const char *const message, IN ...);
 * SEE ALSO
 *	Debug Output, Debug Levels, CL_PRINT, CL_ENTER, CL_TRACE, CL_TRACE_EXIT
 *********/
-#define CL_EXIT( DBG_LVL, CHK_LVL )											\
+#define CL_EXIT( DBG_LVL, CHK_LVL )			\
 	CL_PRINT( DBG_LVL, CHK_LVL, _CL_DBG_EXIT );
 
 /****d* Component Library: Debug Output/CL_TRACE
@@ -460,18 +460,18 @@ void cl_msg_out(IN const char *const message, IN ...);
 * SEE ALSO
 *	Debug Output, Debug Levels, CL_PRINT, CL_ENTER, CL_EXIT, CL_TRACE_EXIT
 *********/
-#define CL_TRACE( DBG_LVL, CHK_LVL, STRING )								\
-{																			\
-switch( DBG_LVL & CL_DBG_ERROR )											\
-{																			\
-	case CL_DBG_ERROR:														\
-		CL_PRINT( DBG_LVL, CHK_LVL, _CL_DBG_ERROR );						\
-		break;																\
-	default:																\
-		CL_PRINT( DBG_LVL, CHK_LVL, _CL_DBG_INFO );							\
-		break;																\
-}																			\
-CL_PRINT( DBG_LVL, CHK_LVL, STRING );										\
+#define CL_TRACE( DBG_LVL, CHK_LVL, STRING )			\
+{								\
+switch( DBG_LVL & CL_DBG_ERROR )				\
+{								\
+	case CL_DBG_ERROR:					\
+		CL_PRINT( DBG_LVL, CHK_LVL, _CL_DBG_ERROR );	\
+		break;						\
+	default:						\
+		CL_PRINT( DBG_LVL, CHK_LVL, _CL_DBG_INFO );	\
+		break;						\
+}								\
+CL_PRINT( DBG_LVL, CHK_LVL, STRING );				\
 }
 
 /****d* Component Library: Debug Output/CL_TRACE_EXIT
@@ -537,8 +537,8 @@ CL_PRINT( DBG_LVL, CHK_LVL, STRING );										\
 * SEE ALSO
 *	Debug Output, Debug Levels, CL_PRINT, CL_ENTER, CL_EXIT, CL_TRACE
 *********/
-#define CL_TRACE_EXIT( DBG_LVL, CHK_LVL, STRING )							\
-	CL_TRACE( DBG_LVL, CHK_LVL, STRING );									\
+#define CL_TRACE_EXIT( DBG_LVL, CHK_LVL, STRING )		\
+	CL_TRACE( DBG_LVL, CHK_LVL, STRING );			\
 	CL_EXIT( DBG_LVL, CHK_LVL );
 
 #else				/* defined(_DEBUG_) */
@@ -586,7 +586,9 @@ CL_PRINT( DBG_LVL, CHK_LVL, STRING );										\
 *	The above keywords are strings and make use of compilers' string
 *	concatenation ability.
 *********/
-void complib_init(void);
+
+void complib_init(void) __attribute__ ((deprecated));
+cl_status_t complib_init_v2(void);
 
 void complib_exit(void);
 
diff --git a/include/complib/cl_dispatcher.h b/include/complib/cl_dispatcher.h
index a5b4a289..25c811a7 100644
--- a/include/complib/cl_dispatcher.h
+++ b/include/complib/cl_dispatcher.h
@@ -77,7 +77,7 @@ BEGIN_C_DECLS
 *		cl_disp_construct, cl_disp_init, cl_disp_shutdown, cl_disp_destroy
 *
 *	Manipulation:
-*		cl_disp_post, cl_disp_reset, cl_disp_wait_on
+*		cl_disp_post, cl_disp_register, cl_disp_unregister
 *********/
 /****s* Component Library: Dispatcher/cl_disp_msgid_t
 * NAME
@@ -220,31 +220,28 @@ typedef struct _cl_dispatcher {
 } cl_dispatcher_t;
 /*
 * FIELDS
+*	lock
+*		Spinlock to guard internal structures.
+*
 *	reg_vec
 *		Vector of registration info objects.  Indexed by message msg_id.
 *
-*	lock
-*		Spinlock to guard internal structures.
+*	reg_list
+*		List of registration info objects.
+*
+*	worker_threads
+*		Thread pool of worker threads to dispose of posted messages.
 *
 *	msg_fifo
 *		FIFO of messages being processed by the Dispatcher.  New
 *		messages are posted to the tail of the FIFO.  Worker threads
 *		pull messages from the front.
 *
-*	worker_threads
-*		Thread pool of worker threads to dispose of posted messages.
-*
 *	msg_pool
 *		Pool of message objects to be processed through the FIFO.
 *
-*	reg_count
-*		Count of the number of registrants.
-*
-*	state
-*		Indicates the state of the object.
-*
-*       last_msg_queue_time_us
-*               The time that the last message spent in the Q in usec
+*	last_msg_queue_time_us
+*		The time that the last message spent in the Q in usec
 *
 * SEE ALSO
 *	Dispatcher
@@ -272,23 +269,17 @@ typedef struct _cl_disp_reg_info {
 } cl_disp_reg_info_t;
 /*
 * FIELDS
+* 	list_item
+* 		List linkage.  Must be first element in the structure!!
+*
 *	pfn_rcv_callback
 *		Client's message receive callback.
 *
 *	context
 *		Client's context for message receive callback.
 *
-*	rcv_thread_count
-*		Number of threads currently in the receive callback.
-*
-*	msg_done_thread_count
-*		Number of threads currently in the message done callback.
-*
-*	state
-*		State of this registration object.
-*			DISP_REGSTATE_INIT: initialized and inactive
-*			DISP_REGSTATE_ACTIVE: in active use
-*			DISP_REGSTATE_UNREGPEND: unregistration is pending
+*	ref_cnt
+*		Reference count.
 *
 *	msg_id
 *		Dispatcher message msg_id value for this registration object.
@@ -325,16 +316,16 @@ typedef struct _cl_disp_msg {
 *	item
 *		List & Pool linkage.  Must be first element in the structure!!
 *
-*	msg_id
-*		The message's numberic ID value.
-*
 *	p_data
 *		Pointer to the data payload for this message.  The payload
 *		is opaque to the Dispatcher.
 *
-*	p_reg_info
+*	p_src_reg
 *		Pointer to the registration info of the sender.
 *
+* 	p_dest_reg
+* 		Pointer to the registration info of the recipient.
+*
 *	pfn_xmt_callback
 *		Client's message done callback.
 *
@@ -419,7 +410,7 @@ cl_disp_init(IN cl_dispatcher_t * const p_disp,
 *	CL_SUCCESS if the operation is successful.
 *
 * SEE ALSO
-*	Dispatcher, cl_disp_destoy, cl_disp_register, cl_disp_unregister,
+*	Dispatcher, cl_disp_destroy, cl_disp_register, cl_disp_unregister,
 *	cl_disp_post
 *********/
 
@@ -597,7 +588,7 @@ cl_disp_post(IN const cl_disp_reg_handle_t handle,
 *	cl_disp_get_queue_status
 *
 * DESCRIPTION
-*	This function posts a message to a Dispatcher object.
+*	This function gets queue status of a Dispatcher object.
 *
 * SYNOPSIS
 */
@@ -610,13 +601,13 @@ cl_disp_get_queue_status(IN const cl_disp_reg_handle_t handle,
 *   handle
 *     [in] cl_disp_reg_handle_t value return by cl_disp_register.
 *
+*   p_num_queued_msgs
+*     [out] number of messages in the queue
+*
 *   p_last_msg_queue_time_ms
 *     [out] pointer to a variable to hold the time the last popped up message
 *           spent in the queue
 *
-*   p_num_queued_msgs
-*     [out] number of messages in the queue
-*
 * RETURN VALUE
 *	Thr time the last popped up message stayed in the queue, in msec
 *
diff --git a/include/complib/cl_event_wheel.h b/include/complib/cl_event_wheel.h
index 48833532..20fec0fb 100644
--- a/include/complib/cl_event_wheel.h
+++ b/include/complib/cl_event_wheel.h
@@ -137,7 +137,6 @@ typedef uint64_t
 typedef struct _cl_event_wheel {
 	cl_spinlock_t lock;
 	cl_spinlock_t *p_external_lock;
-
 	cl_qmap_t events_map;
 	boolean_t closing;
 	cl_qlist_t events_wheel;
@@ -189,7 +188,6 @@ typedef struct _cl_event_wheel_reg_info {
 	uint64_t aging_time;
 	uint32_t num_regs;
 	void *context;
-	cl_event_wheel_t *p_event_wheel;
 } cl_event_wheel_reg_info_t;
 /*
 * FIELDS
@@ -214,9 +212,6 @@ typedef struct _cl_event_wheel_reg_info {
 *	context
 *		Client's context for event-aged callback.
 *
-*	p_event_wheel
-*		Pointer to this event wheel object
-*
 * SEE ALSO
 *********/
 
@@ -225,7 +220,7 @@ typedef struct _cl_event_wheel_reg_info {
 *	cl_event_wheel_construct
 *
 * DESCRIPTION
-*	This function constructs a Event_Wheel object.
+*	This function constructs an Event_Wheel object.
 *
 * SYNOPSIS
 */
@@ -233,7 +228,7 @@ void cl_event_wheel_construct(IN cl_event_wheel_t * const p_event_wheel);
 /*
 * PARAMETERS
 *	p_event_wheel
-*		[in] Pointer to a Event_Wheel.
+*		[in] Pointer to an Event_Wheel.
 *
 * RETURN VALUE
 *	This function does not return a value.
@@ -250,7 +245,7 @@ void cl_event_wheel_construct(IN cl_event_wheel_t * const p_event_wheel);
 *	cl_event_wheel_init
 *
 * DESCRIPTION
-*	This function initializes a Event_Wheel object.
+*	This function initializes an Event_Wheel object.
 *
 * SYNOPSIS
 */
@@ -260,22 +255,22 @@ cl_event_wheel_init(IN cl_event_wheel_t * const p_event_wheel);
 /*
 * PARAMETERS
 *	p_event_wheel
-*		[in] Pointer to a Event_Wheel.
+*		[in] Pointer to an Event_Wheel.
 *
 * RETURN VALUE
 *	CL_SUCCESS if the operation is successful.
 *
 * SEE ALSO
-*	Event_Wheel, cl_event_wheel_destoy, cl_event_wheel_reg, cl_event_wheel_unreg
+*	Event_Wheel, cl_event_wheel_destroy, cl_event_wheel_reg, cl_event_wheel_unreg
 *
 *********/
 
-/****f* Component Library: Event_Wheel/cl_event_wheel_init
+/****f* Component Library: Event_Wheel/cl_event_wheel_init_ex
 * NAME
-*	cl_event_wheel_init
+*	cl_event_wheel_init_ex
 *
 * DESCRIPTION
-*	This function initializes a Event_Wheel object.
+*	This function initializes an Event_Wheel object with an external spinlock
 *
 * SYNOPSIS
 */
@@ -286,7 +281,7 @@ cl_event_wheel_init_ex(IN cl_event_wheel_t * const p_event_wheel,
 /*
 * PARAMETERS
 *	p_event_wheel
-*		[in] Pointer to a Event_Wheel.
+*		[in] Pointer to an Event_Wheel.
 *
 *	p_external_lock
 *		[in] Reference to external spinlock to guard internal structures
@@ -296,7 +291,7 @@ cl_event_wheel_init_ex(IN cl_event_wheel_t * const p_event_wheel,
 *	CL_SUCCESS if the operation is successful.
 *
 * SEE ALSO
-*	Event_Wheel, cl_event_wheel_destoy, cl_event_wheel_reg, cl_event_wheel_unreg
+*	Event_Wheel, cl_event_wheel_destroy, cl_event_wheel_reg, cl_event_wheel_unreg
 *
 *********/
 
@@ -305,7 +300,7 @@ cl_event_wheel_init_ex(IN cl_event_wheel_t * const p_event_wheel,
 *	cl_event_wheel_destroy
 *
 * DESCRIPTION
-*	This function destroys a Event_Wheel object.
+*	This function destroys an Event_Wheel object.
 *
 * SYNOPSIS
 */
@@ -313,7 +308,7 @@ void cl_event_wheel_destroy(IN cl_event_wheel_t * const p_event_wheel);
 /*
 * PARAMETERS
 *	p_event_wheel
-*		[in] Pointer to a Event_Wheel.
+*		[in] Pointer to an Event_Wheel.
 *
 * RETURN VALUE
 *	This function does not return a value.
@@ -339,7 +334,7 @@ void cl_event_wheel_dump(IN cl_event_wheel_t * const p_event_wheel);
 /*
 * PARAMETERS
 *	p_event_wheel
-*		[in] Pointer to a Event_Wheel.
+*		[in] Pointer to an Event_Wheel.
 *
 * RETURN VALUE
 *	This function does not return a value.
@@ -357,7 +352,7 @@ void cl_event_wheel_dump(IN cl_event_wheel_t * const p_event_wheel);
 *	cl_event_wheel_reg
 *
 * DESCRIPTION
-*	This function registers a client with a Event_Wheel object.
+*	This function registers a client with an Event_Wheel object.
 *
 * SYNOPSIS
 */
@@ -370,7 +365,7 @@ cl_event_wheel_reg(IN cl_event_wheel_t * const p_event_wheel,
 /*
 * PARAMETERS
 *	p_event_wheel
-*		[in] Pointer to a Event_Wheel.
+*		[in] Pointer to an Event_Wheel.
 *
 *	key
 *		[in] The specifc Key by which events are registered.
@@ -387,7 +382,7 @@ cl_event_wheel_reg(IN cl_event_wheel_t * const p_event_wheel,
 *		function.
 *
 * RETURN VALUE
-*	On success a Event_Wheel CL_SUCCESS or CL_ERROR otherwise.
+*	On success an Event_Wheel CL_SUCCESS or CL_ERROR otherwise.
 *
 * SEE ALSO
 *	Event_Wheel, cl_event_wheel_unreg
@@ -398,7 +393,7 @@ cl_event_wheel_reg(IN cl_event_wheel_t * const p_event_wheel,
 *	cl_event_wheel_unreg
 *
 * DESCRIPTION
-*	This function unregisters a client event from a Event_Wheel.
+*	This function unregisters a client event from an Event_Wheel.
 *
 * SYNOPSIS
 */
@@ -408,7 +403,7 @@ cl_event_wheel_unreg(IN cl_event_wheel_t * const p_event_wheel,
 /*
 * PARAMETERS
 *	p_event_wheel
-*		[in] Pointer to a Event_Wheel.
+*		[in] Pointer to an Event_Wheel.
 *
 *	key
 *		[in] The key used for registering the event
@@ -440,7 +435,7 @@ cl_event_wheel_num_regs(IN cl_event_wheel_t * const p_event_wheel,
 /*
 * PARAMETERS
 *	p_event_wheel
-*		[in] Pointer to a Event_Wheel.
+*		[in] Pointer to an Event_Wheel.
 *
 *	key
 *		[in] The key used for registering the event
diff --git a/include/complib/cl_fleximap.h b/include/complib/cl_fleximap.h
index 89bc7c0f..dfe4745f 100644
--- a/include/complib/cl_fleximap.h
+++ b/include/complib/cl_fleximap.h
@@ -142,10 +142,6 @@ typedef struct _cl_fmap_item {
 *	p_up
 *		Pointer to the map item that is the parent of the node.
 *
-*	p_nil
-*		Pointer to the map's NIL item, used as a terminator for leaves.
-*		The NIL sentinel is in the cl_fmap_t structure.
-*
 *	color
 *		Indicates whether a node is red or black in the map.
 *
@@ -737,6 +733,10 @@ cl_fmap_remove_item(IN cl_fmap_t * const p_map,
 		    IN cl_fmap_item_t * const p_item);
 /*
 * PARAMETERS
+*	p_map
+*		[in] Pointer to a cl_fmap_t structure from which to
+*		remove item.
+*
 *	p_item
 *		[in] Pointer to a map item to remove from its flexi map.
 *
diff --git a/include/complib/cl_heap.h b/include/complib/cl_heap.h
index c2d0f7b9..37810082 100644
--- a/include/complib/cl_heap.h
+++ b/include/complib/cl_heap.h
@@ -76,7 +76,7 @@ BEGIN_C_DECLS
 *	decrease_key, and delete, are provided and referencing an element,
 *	e.g., for deletion is done via indices. The implication is, that
 *	the caller needs to be informed about index changes, e.g., after
-*	internal reordering through shift_[up | down], to always know the
+*	internal reordering through heap_[up | down], to always know the
 *	index of each element in the heap. Therefore, the caller has to
 *	provide a callback function, which forwards the context of an element
 *	and the new index in the heap back to the caller. The caller is
@@ -84,7 +84,7 @@ BEGIN_C_DECLS
 *
 *	An implementation of heapify is omitted, because the caller should not
 *	be able to allocate and provide an unsorted array. All heapify
-*	operations with shift_up and shift_down are done internally after the
+*	operations with heap_up and heap_down are done internally after the
 *	caller manipulated the heap with the provided functions.
 *
 *	Heaps are used extensively in some routing functions, such as [DF]SSSP
@@ -366,7 +366,7 @@ void cl_heap_destroy(IN cl_heap_t * const p_heap);
 *	The cl_heap_modify_key function changes the key of an element in the
 *	heap identified by an index. The result could be invalidate the heap
 *	property for the stored elements. Therefore, the cl_heap_modify_key
-*	function calls shift_[up | down] internally to reconstruct a valid
+*	function calls heap_[up | down] internally to reconstruct a valid
 *	heap.
 *
 * SYNOPSIS
diff --git a/include/complib/cl_list.h b/include/complib/cl_list.h
index 5d40b19b..62f674f3 100644
--- a/include/complib/cl_list.h
+++ b/include/complib/cl_list.h
@@ -1034,10 +1034,6 @@ static inline cl_list_iterator_t cl_list_next(IN cl_list_iterator_t iterator)
 
 /*
 * PARAMETERS
-*	p_list
-*		[in] Pointer to a cl_list_t structure for which the iterator for the
-*		next object is to be returned.
-*
 *	iterator
 *		[in] cl_list_iterator_t returned by a previous call to cl_list_head,
 *		cl_list_tail, cl_list_next, or cl_list_prev.
@@ -1076,10 +1072,6 @@ static inline cl_list_iterator_t cl_list_prev(IN cl_list_iterator_t iterator)
 
 /*
 * PARAMETERS
-*	p_list
-*		[in] Pointer to a cl_list_t structure for which the iterator for the
-*		next object is to be returned.
-*
 *	iterator
 *		[in] cl_list_iterator_t returned by a previous call to cl_list_head,
 *		cl_list_tail, cl_list_next, or cl_list_prev.
diff --git a/include/complib/cl_ptr_vector.h b/include/complib/cl_ptr_vector.h
index c767f31c..93c217e0 100644
--- a/include/complib/cl_ptr_vector.h
+++ b/include/complib/cl_ptr_vector.h
@@ -572,7 +572,7 @@ void *cl_ptr_vector_remove(IN cl_ptr_vector_t * const p_vector,
 *	Value of the pointer stored at the specified index.
 *
 * NOTES
-*	cl_ptr_vector_get does not perform boundary checking. Callers are
+*	cl_ptr_vector_remove does not perform boundary checking. Callers are
 *	responsible for providing an index that is within the range of the pointer
 *	vector.
 *
diff --git a/include/complib/cl_qcomppool.h b/include/complib/cl_qcomppool.h
index 58862e39..0400b00f 100644
--- a/include/complib/cl_qcomppool.h
+++ b/include/complib/cl_qcomppool.h
@@ -188,7 +188,7 @@ typedef cl_status_t
 *		which points to a component that makes up a composite object.
 *
 *	num_components
-*		[in] Number of components that in the component array.
+*		[in] Number of components in the component array.
 *
 *	context
 *		[in] Context provided in a call to cl_qcpool_init.
@@ -311,6 +311,9 @@ typedef struct _cl_qcpool {
 *	num_objects
 *		Number of objects managed by the pool
 *
+*	max_objects
+*		Maximum number of objects allowed to be created in pool
+*
 *	grow_size
 *		Number of objects to add when automatically growing the pool.
 *
@@ -660,7 +663,7 @@ cl_qcpool_put_list(IN cl_qcpool_t * const p_pool, IN cl_qlist_t * const p_list)
 	CL_ASSERT(p_list);
 
 #ifdef _DEBUG_
-	/* Chech that all items in the list came from this pool. */
+	/* Check that all items in the list came from this pool. */
 	p_item = cl_qlist_head(p_list);
 	while (p_item != cl_qlist_end(p_list)) {
 		CL_ASSERT(((cl_pool_item_t *) p_item)->p_pool == p_pool);
@@ -668,7 +671,6 @@ cl_qcpool_put_list(IN cl_qcpool_t * const p_pool, IN cl_qlist_t * const p_list)
 	}
 #endif
 
-	/* return these lil' doggies to the pool */
 	cl_qlist_insert_list_head(&p_pool->free_list, p_list);
 }
 
diff --git a/include/complib/cl_qmap.h b/include/complib/cl_qmap.h
index 130c2efc..7d86fe70 100644
--- a/include/complib/cl_qmap.h
+++ b/include/complib/cl_qmap.h
@@ -165,10 +165,6 @@ typedef struct _cl_map_item {
 *	p_up
 *		Pointer to the map item that is the parent of the node.
 *
-*	p_nil
-*		Pointer to the map's NIL item, used as a terminator for leaves.
-*		The NIL sentinel is in the cl_qmap_t structure.
-*
 *	color
 *		Indicates whether a node is red or black in the map.
 *
@@ -770,6 +766,10 @@ cl_qmap_remove_item(IN cl_qmap_t * const p_map,
 		    IN cl_map_item_t * const p_item);
 /*
 * PARAMETERS
+*	p_map
+*		[in] Pointer to a cl_qmap_t structure from which to
+*		remove item.
+*
 *	p_item
 *		[in] Pointer to a map item to remove from its quick map.
 *
diff --git a/include/complib/cl_qpool.h b/include/complib/cl_qpool.h
index f144cb35..d0d5ad8f 100644
--- a/include/complib/cl_qpool.h
+++ b/include/complib/cl_qpool.h
@@ -119,6 +119,11 @@ typedef cl_status_t
 *	context
 *		[in] Context provided in a call to cl_qpool_init.
 *
+*	pp_pool_item
+*		[out] Users should set this pointer to reference the cl_pool_item_t
+*		structure that represents the composite object.  This pointer must
+*		not be NULL if the function returns CL_SUCCESS.
+*
 * RETURN VALUES
 *	Return CL_SUCCESS to indicate that initialization of the object
 *	was successful and that initialization of further objects may continue.
diff --git a/include/complib/cl_types.h b/include/complib/cl_types.h
index a773e51c..70af7f83 100644
--- a/include/complib/cl_types.h
+++ b/include/complib/cl_types.h
@@ -191,11 +191,11 @@ typedef uint64_t net64_t;
 #endif
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%                  Function Returns And Completion Codes					 %%
-%%																			 %%
-%% The text for any addition to this enumerated type must be added to the	 %%
-%% string array defined in <cl_statustext.c>.								 %%
-%%																			 %%
+%%                  Function Returns And Completion Codes                    %%
+%%                                                                           %%
+%% The text for any addition to this enumerated type must be added to the    %%
+%% string array defined in <cl_statustext.c>.                                %%
+%%                                                                           %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /****d* Component Library/Data Types
@@ -295,38 +295,6 @@ typedef int cl_status_t;
 /* Status values above converted to text for easier printing. */
 extern const char *cl_status_text[];
 
-#ifndef cl_panic
-/****f* Component Library: Error Trapping/cl_panic
-* NAME
-*	cl_panic
-*
-* DESCRIPTION
-*	Halts execution of the current process.  Halts the system if called in
-*	from the kernel.
-*
-* SYNOPSIS
-*/
-void cl_panic(IN const char *const message, IN ...);
-/*
-* PARAMETERS
-*	message
-*		[in] ANSI string formatted identically as for a call to the standard C
-*		function printf describing the cause for the panic.
-*
-*	...
-*		[in] Extra parameters for string formatting, as defined for the
-*		standard C function printf.
-*
-* RETURN VALUE
-*	This function does not return.
-*
-* NOTES
-*	The formatting of the message string is the same as for printf
-*
-*	cl_panic sends the message to the current message logging target.
-*********/
-#endif				/* cl_panic */
-
 /****d* Component Library: Data Types/CL_STATUS_MSG
 * NAME
 *	CL_STATUS_MSG
diff --git a/include/iba/ib_types.h b/include/iba/ib_types.h
index fb1c3f9c..025f9714 100644
--- a/include/iba/ib_types.h
+++ b/include/iba/ib_types.h
@@ -2256,25 +2256,23 @@ static inline boolean_t OSM_API ib_pkey_is_invalid(IN const ib_net16_t pkey)
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef union _ib_gid {
 	uint8_t raw[16];
 	struct _ib_gid_unicast {
 		ib_gid_prefix_t prefix;
 		ib_net64_t interface_id;
-	} PACK_SUFFIX unicast;
+	} unicast;
 	struct _ib_gid_multicast {
 		uint8_t header[2];
 		uint8_t raw_group_id[14];
-	} PACK_SUFFIX multicast;
+	} multicast;
 	struct _ib_gid_ip_multicast {
 		uint8_t header[2];
 		ib_net16_t signature;
 		ib_net16_t p_key;
 		uint8_t group_id[10];
-	} PACK_SUFFIX ip_multicast;
-} PACK_SUFFIX ib_gid_t;
-#include <complib/cl_packoff.h>
+	} ip_multicast;
+} ib_gid_t;
 /*
 * FIELDS
 *	raw
@@ -2500,7 +2498,6 @@ ib_gid_get_guid(IN const ib_gid_t * const p_gid)
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_path_rec {
 	ib_net64_t service_id;
 	ib_gid_t dgid;
@@ -2517,8 +2514,7 @@ typedef struct _ib_path_rec {
 	uint8_t pkt_life;
 	uint8_t preference;
 	uint8_t resv2[6];
-} PACK_SUFFIX ib_path_rec_t;
-#include <complib/cl_packoff.h>
+} ib_path_rec_t;
 /*
 * FIELDS
 *	service_id
@@ -3488,7 +3484,6 @@ ib_path_rec_hop_limit(IN const ib_path_rec_t * const p_rec)
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_class_port_info {
 	uint8_t base_ver;
 	uint8_t class_ver;
@@ -3506,8 +3501,7 @@ typedef struct _ib_class_port_info {
 	ib_net16_t trap_pkey;
 	ib_net32_t trap_hop_qp;
 	ib_net32_t trap_qkey;
-} PACK_SUFFIX ib_class_port_info_t;
-#include <complib/cl_packoff.h>
+} ib_class_port_info_t;
 /*
 * FIELDS
 *	base_ver
@@ -3807,7 +3801,6 @@ ib_sminfo_get_state(IN const ib_sm_info_t * const p_smi)
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_mad {
 	uint8_t base_ver;
 	uint8_t mgmt_class;
@@ -3819,8 +3812,7 @@ typedef struct _ib_mad {
 	ib_net16_t attr_id;
 	ib_net16_t resv;
 	ib_net32_t attr_mod;
-} PACK_SUFFIX ib_mad_t;
-#include <complib/cl_packoff.h>
+} ib_mad_t;
 /*
 * FIELDS
 *	base_ver
@@ -4128,7 +4120,6 @@ ib_rmpp_get_resp_time(IN const ib_rmpp_mad_t * const p_rmpp_mad)
 * SYNOPSIS
 */
 #define IB_SMP_DATA_SIZE 64
-#include <complib/cl_packon.h>
 typedef struct _ib_smp {
 	uint8_t base_ver;
 	uint8_t mgmt_class;
@@ -4148,8 +4139,7 @@ typedef struct _ib_smp {
 	uint8_t data[IB_SMP_DATA_SIZE];
 	uint8_t initial_path[IB_SUBNET_PATH_HOPS_MAX];
 	uint8_t return_path[IB_SUBNET_PATH_HOPS_MAX];
-} PACK_SUFFIX ib_smp_t;
-#include <complib/cl_packoff.h>
+} ib_smp_t;
 /*
 * FIELDS
 *	base_ver
@@ -4587,14 +4577,12 @@ ib_node_info_get_vendor_id(IN const ib_node_info_t * const p_ni)
 
 #define IB_NODE_DESCRIPTION_SIZE 64
 
-#include <complib/cl_packon.h>
 typedef struct _ib_node_desc {
 	// Node String is an array of UTF-8 characters
 	// that describe the node in text format
 	// Note that this string is NOT NULL TERMINATED!
 	uint8_t description[IB_NODE_DESCRIPTION_SIZE];
-} PACK_SUFFIX ib_node_desc_t;
-#include <complib/cl_packoff.h>
+} ib_node_desc_t;
 
 #include <complib/cl_packon.h>
 typedef struct _ib_node_record_t {
@@ -4615,7 +4603,6 @@ typedef struct _ib_node_record_t {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_port_info {
 	ib_net64_t m_key;
 	ib_net64_t subnet_prefix;
@@ -4652,8 +4639,7 @@ typedef struct _ib_port_info {
 	ib_net16_t capability_mask2;
 	uint8_t link_speed_ext;	/* LinkSpeedExtActive and LinkSpeedExtSupported */
 	uint8_t link_speed_ext_enabled; /* reserv(3b), LinkSpeedExtEnabled(5b) */
-} PACK_SUFFIX ib_port_info_t;
-#include <complib/cl_packoff.h>
+} ib_port_info_t;
 /************/
 
 #define IB_PORT_STATE_MASK			0x0F
@@ -4726,7 +4712,6 @@ typedef struct _ib_port_info {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_port_info_ext {
 	ib_net32_t cap_mask;
 	ib_net16_t fec_mode_active;
@@ -4737,8 +4722,7 @@ typedef struct _ib_port_info_ext {
 	ib_net16_t hdr_fec_mode_sup;
 	ib_net16_t hdr_fec_mode_enable;
 	uint8_t reserved[46];
-} PACK_SUFFIX ib_port_info_ext_t;
-#include <complib/cl_packoff.h>
+} ib_port_info_ext_t;
 /************/
 
 #define IB_PORT_EXT_NO_FEC_MODE_ACTIVE		    0
@@ -6563,7 +6547,6 @@ static inline uint8_t OSM_API ib_get_highest_link_width(IN const uint8_t widths)
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_mlnx_ext_port_info {
 	uint8_t resvd1[3];
 	uint8_t state_change_enable;
@@ -6574,13 +6557,11 @@ typedef struct _ib_mlnx_ext_port_info {
 	uint8_t resvd4[3];
 	uint8_t link_speed_active;
 	uint8_t resvd5[48];
-} PACK_SUFFIX ib_mlnx_ext_port_info_t;
-#include <complib/cl_packoff.h>
+} ib_mlnx_ext_port_info_t;
 /************/
 
 typedef uint8_t ib_svc_name_t[64];
 
-#include <complib/cl_packon.h>
 typedef struct _ib_service_record {
 	ib_net64_t service_id;
 	ib_gid_t service_gid;
@@ -6593,8 +6574,7 @@ typedef struct _ib_service_record {
 	ib_net16_t service_data16[8];
 	ib_net32_t service_data32[4];
 	ib_net64_t service_data64[2];
-} PACK_SUFFIX ib_service_record_t;
-#include <complib/cl_packoff.h>
+} ib_service_record_t;
 
 #include <complib/cl_packon.h>
 typedef struct _ib_portinfo_record {
@@ -6606,24 +6586,20 @@ typedef struct _ib_portinfo_record {
 } PACK_SUFFIX ib_portinfo_record_t;
 #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>
+} ib_portinfoext_record_t;
 
-#include <complib/cl_packon.h>
 typedef struct _ib_link_record {
 	ib_net16_t from_lid;
 	uint8_t from_port_num;
 	uint8_t to_port_num;
 	ib_net16_t to_lid;
 	uint8_t pad[2];
-} PACK_SUFFIX ib_link_record_t;
-#include <complib/cl_packoff.h>
+} ib_link_record_t;
 
 #include <complib/cl_packon.h>
 typedef struct _ib_sminfo_record {
@@ -6643,14 +6619,12 @@ typedef struct _ib_sminfo_record {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_lft_record {
 	ib_net16_t lid;
 	ib_net16_t block_num;
 	uint32_t resv0;
 	uint8_t lft[64];
-} PACK_SUFFIX ib_lft_record_t;
-#include <complib/cl_packoff.h>
+} ib_lft_record_t;
 /************/
 
 /****s* IBA Base: Types/ib_mft_record_t
@@ -6662,14 +6636,12 @@ typedef struct _ib_lft_record {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_mft_record {
 	ib_net16_t lid;
 	ib_net16_t position_block_num;
 	uint32_t resv0;
 	ib_net16_t mft[IB_MCAST_BLOCK_SIZE];
-} PACK_SUFFIX ib_mft_record_t;
-#include <complib/cl_packoff.h>
+} ib_mft_record_t;
 /************/
 
 /****s* IBA Base: Types/ib_switch_info_t
@@ -6681,7 +6653,6 @@ typedef struct _ib_mft_record {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_switch_info {
 	ib_net16_t lin_cap;
 	ib_net16_t rand_cap;
@@ -6696,17 +6667,14 @@ typedef struct _ib_switch_info {
 	uint8_t flags;
 	uint8_t resvd;
 	ib_net16_t mcast_top;
-} PACK_SUFFIX ib_switch_info_t;
-#include <complib/cl_packoff.h>
+} ib_switch_info_t;
 /************/
 
-#include <complib/cl_packon.h>
 typedef struct _ib_switch_info_record {
 	ib_net16_t lid;
 	uint16_t resv0;
 	ib_switch_info_t switch_info;
-} PACK_SUFFIX ib_switch_info_record_t;
-#include <complib/cl_packoff.h>
+} ib_switch_info_record_t;
 
 #define IB_SWITCH_PSC 0x04
 
@@ -6895,26 +6863,21 @@ ib_switch_info_is_enhanced_port0(IN const ib_switch_info_t * const p_si)
 */
 #define	GUID_TABLE_MAX_ENTRIES		8
 
-#include <complib/cl_packon.h>
 typedef struct _ib_guid_info {
 	ib_net64_t guid[GUID_TABLE_MAX_ENTRIES];
-} PACK_SUFFIX ib_guid_info_t;
-#include <complib/cl_packoff.h>
+} ib_guid_info_t;
 /************/
 
-#include <complib/cl_packon.h>
 typedef struct _ib_guidinfo_record {
 	ib_net16_t lid;
 	uint8_t block_num;
 	uint8_t resv;
 	uint32_t reserved;
 	ib_guid_info_t guid_info;
-} PACK_SUFFIX ib_guidinfo_record_t;
-#include <complib/cl_packoff.h>
+} ib_guidinfo_record_t;
 
 #define IB_MULTIPATH_MAX_GIDS 11	/* Support max that can fit into first MAD (for now) */
 
-#include <complib/cl_packon.h>
 typedef struct _ib_multipath_rec_t {
 	ib_net32_t hop_flow_raw;
 	uint8_t tclass;
@@ -6930,8 +6893,7 @@ typedef struct _ib_multipath_rec_t {
 	uint8_t dgid_count;
 	uint8_t service_id_56lsb[7];
 	ib_gid_t gids[IB_MULTIPATH_MAX_GIDS];
-} PACK_SUFFIX ib_multipath_rec_t;
-#include <complib/cl_packoff.h>
+} ib_multipath_rec_t;
 /*
 * FIELDS
 *       hop_flow_raw
@@ -7391,11 +7353,9 @@ ib_multipath_rec_service_id(IN const ib_multipath_rec_t * const p_rec)
 * SYNOPSIS
 */
 
-#include <complib/cl_packon.h>
 typedef struct _ib_pkey_table {
 	ib_net16_t pkey_entry[IB_NUM_PKEY_ELEMENTS_IN_BLOCK];
-} PACK_SUFFIX ib_pkey_table_t;
-#include <complib/cl_packoff.h>
+} ib_pkey_table_t;
 /************/
 
 /****s* IBA Base: Types/ib_pkey_table_record_t
@@ -7407,7 +7367,6 @@ typedef struct _ib_pkey_table {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_pkey_table_record {
 	ib_net16_t lid;		// for CA: lid of port, for switch lid of port 0
 	ib_net16_t block_num;
@@ -7415,8 +7374,7 @@ typedef struct _ib_pkey_table_record {
 	uint8_t reserved1;
 	uint16_t reserved2;
 	ib_pkey_table_t pkey_tbl;
-} PACK_SUFFIX ib_pkey_table_record_t;
-#include <complib/cl_packoff.h>
+} ib_pkey_table_record_t;
 /************/
 
 #define IB_DROP_VL 15
@@ -7430,11 +7388,9 @@ typedef struct _ib_pkey_table_record {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_slvl_table {
 	uint8_t raw_vl_by_sl[IB_MAX_NUM_VLS / 2];
-} PACK_SUFFIX ib_slvl_table_t;
-#include <complib/cl_packoff.h>
+} ib_slvl_table_t;
 /************/
 
 /****s* IBA Base: Types/ib_slvl_table_record_t
@@ -7446,15 +7402,13 @@ typedef struct _ib_slvl_table {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_slvl_table_record {
 	ib_net16_t lid;		// for CA: lid of port, for switch lid of port 0
 	uint8_t in_port_num;	// reserved for CAs
 	uint8_t out_port_num;	// reserved for CAs
 	uint32_t resv;
 	ib_slvl_table_t slvl_tbl;
-} PACK_SUFFIX ib_slvl_table_record_t;
-#include <complib/cl_packoff.h>
+} ib_slvl_table_record_t;
 /************/
 
 /****f* IBA Base: Types/ib_slvl_table_set
@@ -7553,12 +7507,10 @@ ib_slvl_table_get(IN const ib_slvl_table_t * p_slvl_tbl, IN uint8_t sl_index)
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_vl_arb_element {
 	uint8_t vl;
 	uint8_t weight;
-} PACK_SUFFIX ib_vl_arb_element_t;
-#include <complib/cl_packoff.h>
+} ib_vl_arb_element_t;
 /************/
 
 #define IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK 32
@@ -7572,11 +7524,9 @@ typedef struct _ib_vl_arb_element {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_vl_arb_table {
 	ib_vl_arb_element_t vl_entry[IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK];
-} PACK_SUFFIX ib_vl_arb_table_t;
-#include <complib/cl_packoff.h>
+} ib_vl_arb_table_t;
 /************/
 
 /****s* IBA Base: Types/ib_vl_arb_table_record_t
@@ -7588,21 +7538,18 @@ typedef struct _ib_vl_arb_table {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_vl_arb_table_record {
 	ib_net16_t lid;		// for CA: lid of port, for switch lid of port 0
 	uint8_t port_num;
 	uint8_t block_num;
 	uint32_t reserved;
 	ib_vl_arb_table_t vl_arb_tbl;
-} PACK_SUFFIX ib_vl_arb_table_record_t;
-#include <complib/cl_packoff.h>
+} ib_vl_arb_table_record_t;
 /************/
 
 /*
  *	Global route header information received with unreliable datagram messages
  */
-#include <complib/cl_packon.h>
 typedef struct _ib_grh {
 	ib_net32_t ver_class_flow;
 	ib_net16_t resv1;
@@ -7610,8 +7557,7 @@ typedef struct _ib_grh {
 	uint8_t hop_limit;
 	ib_gid_t src_gid;
 	ib_gid_t dest_gid;
-} PACK_SUFFIX ib_grh_t;
-#include <complib/cl_packoff.h>
+} ib_grh_t;
 
 /****f* IBA Base: Types/ib_grh_get_ver_class_flow
 * NAME
@@ -7719,7 +7665,6 @@ ib_grh_set_ver_class_flow(IN const uint8_t ver,
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_member_rec {
 	ib_gid_t mgid;
 	ib_gid_t port_gid;
@@ -7735,8 +7680,7 @@ typedef struct _ib_member_rec {
 	uint8_t proxy_join:1;
 	uint8_t reserved[2];
 	uint8_t pad[4];
-} PACK_SUFFIX ib_member_rec_t;
-#include <complib/cl_packoff.h>
+} ib_member_rec_t;
 /*
 * FIELDS
 *	mgid
@@ -8599,14 +8543,12 @@ typedef struct _ib_inform_info_record {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_perfmgt_mad {
 	ib_mad_t header;
 	uint8_t resv[40];
 #define	IB_PM_DATA_SIZE		192
 	uint8_t data[IB_PM_DATA_SIZE];
-} PACK_SUFFIX ib_perfmgt_mad_t;
-#include <complib/cl_packoff.h>
+} ib_perfmgt_mad_t;
 /*
 * FIELDS
 *	header
@@ -8632,7 +8574,6 @@ typedef struct _ib_perfmgt_mad {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_port_counters {
 	uint8_t reserved;
 	uint8_t port_select;
@@ -8655,8 +8596,7 @@ typedef struct _ib_port_counters {
 	ib_net32_t xmit_pkts;
 	ib_net32_t rcv_pkts;
 	ib_net32_t xmit_wait;
-} PACK_SUFFIX ib_port_counters_t;
-#include <complib/cl_packoff.h>
+} ib_port_counters_t;
 
 #define PC_LINK_INT(integ_buf_over) ((integ_buf_over & 0xF0) >> 4)
 #define PC_BUF_OVERRUN(integ_buf_over) (integ_buf_over & 0x0F)
@@ -8670,7 +8610,6 @@ typedef struct _ib_port_counters {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_port_counters_ext {
 	uint8_t reserved;
 	uint8_t port_select;
@@ -8698,8 +8637,7 @@ typedef struct _ib_port_counters_ext {
 	ib_net64_t vl15_dropped;
 	ib_net64_t xmit_wait;
 	ib_net64_t qp1_dropped;
-} PACK_SUFFIX ib_port_counters_ext_t;
-#include <complib/cl_packoff.h>
+} ib_port_counters_ext_t;
 
 /****s* IBA Base: Types/ib_port_samples_control
 * NAME
@@ -8767,7 +8705,6 @@ typedef struct _ib_port_samples_control {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_port_samples_result {
 	ib_net16_t tag;
 	ib_net16_t sample_status;	/* 14 bits res : 2 bits sample_status */
@@ -8786,8 +8723,7 @@ typedef struct _ib_port_samples_result {
 	ib_net32_t counter12;
 	ib_net32_t counter13;
 	ib_net32_t counter14;
-} PACK_SUFFIX ib_port_samples_result_t;
-#include <complib/cl_packoff.h>
+} ib_port_samples_result_t;
 
 /****s* IBA Base: Types/ib_port_xmit_data_sl
 * NAME
@@ -8798,15 +8734,13 @@ typedef struct _ib_port_samples_result {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_port_xmit_data_sl {
 	uint8_t reserved;
 	uint8_t port_select;
 	ib_net16_t counter_select;
 	ib_net32_t port_xmit_data_sl[16];
 	uint8_t resv[124];
-} PACK_SUFFIX ib_port_xmit_data_sl_t;
-#include <complib/cl_packoff.h>
+} ib_port_xmit_data_sl_t;
 
 /****s* IBA Base: Types/ib_port_rcv_data_sl
 * NAME
@@ -8817,15 +8751,13 @@ typedef struct _ib_port_xmit_data_sl {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_port_rcv_data_sl {
 	uint8_t reserved;
 	uint8_t port_select;
 	ib_net16_t counter_select;
 	ib_net32_t port_rcv_data_sl[16];
 	uint8_t resv[124];
-} PACK_SUFFIX ib_port_rcv_data_sl_t;
-#include <complib/cl_packoff.h>
+} ib_port_rcv_data_sl_t;
 
 /****d* IBA Base: Types/DM_SVC_NAME
 * NAME
@@ -8850,14 +8782,12 @@ typedef struct _ib_port_rcv_data_sl {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_dm_mad {
 	ib_mad_t header;
 	uint8_t resv[40];
 #define	IB_DM_DATA_SIZE		192
 	uint8_t data[IB_DM_DATA_SIZE];
-} PACK_SUFFIX ib_dm_mad_t;
-#include <complib/cl_packoff.h>
+} ib_dm_mad_t;
 /*
 * FIELDS
 *	header
@@ -8883,7 +8813,6 @@ typedef struct _ib_dm_mad {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_iou_info {
 	ib_net16_t change_id;
 	uint8_t max_controllers;
@@ -8894,8 +8823,7 @@ typedef struct _ib_iou_info {
 #define	IOC_INSTALLED			0x1
 //              Reserved values                         0x02-0xE
 #define	SLOT_DOES_NOT_EXIST		0xF
-} PACK_SUFFIX ib_iou_info_t;
-#include <complib/cl_packoff.h>
+} ib_iou_info_t;
 /*
 * FIELDS
 *	change_id
@@ -9023,7 +8951,6 @@ ioc_at_slot(IN const ib_iou_info_t * const p_iou_info, IN uint8_t slot)
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_ioc_profile {
 	ib_net64_t ioc_guid;
 	ib_net32_t vend_id;
@@ -9057,8 +8984,7 @@ typedef struct _ib_ioc_profile {
 	uint8_t resv6[9];
 #define	CTRL_ID_STRING_LEN	64
 	char id_string[CTRL_ID_STRING_LEN];
-} PACK_SUFFIX ib_ioc_profile_t;
-#include <complib/cl_packoff.h>
+} ib_ioc_profile_t;
 /*
 * FIELDS
 *	ioc_guid
@@ -9142,13 +9068,11 @@ ib_ioc_profile_set_vend_id(IN ib_ioc_profile_t * const p_ioc_profile,
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_svc_entry {
 #define	MAX_SVC_ENTRY_NAME_LEN		40
 	char name[MAX_SVC_ENTRY_NAME_LEN];
 	ib_net64_t id;
-} PACK_SUFFIX ib_svc_entry_t;
-#include <complib/cl_packoff.h>
+} ib_svc_entry_t;
 /*
 * FIELDS
 *	name
@@ -9170,12 +9094,10 @@ typedef struct _ib_svc_entry {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_svc_entries {
 #define	SVC_ENTRY_COUNT			4
 	ib_svc_entry_t service_entry[SVC_ENTRY_COUNT];
-} PACK_SUFFIX ib_svc_entries_t;
-#include <complib/cl_packoff.h>
+} ib_svc_entries_t;
 /*
 * FIELDS
 *	service_entry
@@ -9203,7 +9125,6 @@ ib_dm_get_slot_lo_hi(IN const ib_net32_t slot_lo_hi,
 /*
  *	IBA defined information describing an I/O controller
  */
-#include <complib/cl_packon.h>
 typedef struct _ib_ioc_info {
 	ib_net64_t module_guid;
 	ib_net64_t iou_guid;
@@ -9211,8 +9132,7 @@ typedef struct _ib_ioc_info {
 	ib_net64_t access_key;
 	uint16_t initiators_conf;
 	uint8_t resv[38];
-} PACK_SUFFIX ib_ioc_info_t;
-#include <complib/cl_packoff.h>
+} ib_ioc_info_t;
 
 /*
  *	The following definitions are shared between the Access Layer and VPD
@@ -11569,14 +11489,12 @@ typedef struct _ib_ci_op {
 #define IB_CC_MAD_HDR_SIZE (sizeof(ib_sa_mad_t) - IB_CC_LOG_DATA_SIZE \
 						- IB_CC_MGT_DATA_SIZE)
 
-#include <complib/cl_packon.h>
 typedef struct _ib_cc_mad {
 	ib_mad_t header;
 	ib_net64_t cc_key;
 	uint8_t log_data[IB_CC_LOG_DATA_SIZE];
 	uint8_t mgt_data[IB_CC_MGT_DATA_SIZE];
-} PACK_SUFFIX ib_cc_mad_t;
-#include <complib/cl_packoff.h>
+} ib_cc_mad_t;
 /*
 * FIELDS
 *	header
@@ -11688,13 +11606,11 @@ ib_cc_mad_get_mgt_data_ptr(IN const ib_cc_mad_t * const p_cc_mad)
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_cong_info {
 	uint8_t cong_info;
 	uint8_t resv;
 	uint8_t ctrl_table_cap;
-} PACK_SUFFIX ib_cong_info_t;
-#include <complib/cl_packoff.h>
+} ib_cong_info_t;
 /*
 * FIELDS
 *	cong_info
@@ -11751,14 +11667,12 @@ typedef struct _ib_cong_key_info {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_cong_log_event_sw {
 	ib_net16_t slid;
 	ib_net16_t dlid;
 	ib_net32_t sl;
 	ib_net32_t time_stamp;
-} PACK_SUFFIX ib_cong_log_event_sw_t;
-#include <complib/cl_packoff.h>
+} ib_cong_log_event_sw_t;
 /*
 * FIELDS
 *	slid
@@ -11787,15 +11701,13 @@ typedef struct _ib_cong_log_event_sw {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_cong_log_event_ca {
 	ib_net32_t local_qp_resv0;
 	ib_net32_t remote_qp_sl_service_type;
 	ib_net16_t remote_lid;
 	ib_net16_t resv1;
 	ib_net32_t time_stamp;
-} PACK_SUFFIX ib_cong_log_event_ca_t;
-#include <complib/cl_packoff.h>
+} ib_cong_log_event_ca_t;
 /*
 * FIELDS
 *	resv0_local_qp
@@ -11895,7 +11807,6 @@ typedef struct _ib_cong_log {
 * SYNOPSIS
 */
 #define IB_CC_PORT_MASK_DATA_SIZE 32
-#include <complib/cl_packon.h>
 typedef struct _ib_sw_cong_setting {
 	ib_net32_t control_map;
 	uint8_t victim_mask[IB_CC_PORT_MASK_DATA_SIZE];
@@ -11905,8 +11816,7 @@ typedef struct _ib_sw_cong_setting {
 	ib_net16_t cs_threshold_resv;
 	ib_net16_t cs_return_delay;
 	ib_net16_t marking_rate;
-} PACK_SUFFIX ib_sw_cong_setting_t;
-#include <complib/cl_packoff.h>
+} ib_sw_cong_setting_t;
 /*
 * FIELDS
 *
@@ -11960,13 +11870,11 @@ typedef struct _ib_sw_cong_setting {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_sw_port_cong_setting_element {
 	uint8_t valid_ctrl_type_res_threshold;
 	uint8_t packet_size;
 	ib_net16_t cong_param;
-} PACK_SUFFIX ib_sw_port_cong_setting_element_t;
-#include <complib/cl_packoff.h>
+} ib_sw_port_cong_setting_element_t;
 /*
 * FIELDS
 *
@@ -12023,11 +11931,9 @@ typedef ib_sw_port_cong_setting_element_t ib_sw_port_cong_setting_block_t[IB_CC_
 * SYNOPSIS
 */
 
-#include <complib/cl_packon.h>
 typedef struct _ib_sw_port_cong_setting {
 	ib_sw_port_cong_setting_block_t block;
-} PACK_SUFFIX ib_sw_port_cong_setting_t;
-#include <complib/cl_packoff.h>
+} ib_sw_port_cong_setting_t;
 /*
 * FIELDS
 *
@@ -12047,7 +11953,6 @@ typedef struct _ib_sw_port_cong_setting {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_ca_cong_entry {
 	ib_net16_t ccti_timer;
 	uint8_t ccti_increase;
@@ -12055,8 +11960,7 @@ typedef struct _ib_ca_cong_entry {
 	uint8_t ccti_min;
 	uint8_t resv0;
 	ib_net16_t resv1;
-} PACK_SUFFIX ib_ca_cong_entry_t;
-#include <complib/cl_packoff.h>
+} ib_ca_cong_entry_t;
 /*
 * FIELDS
 *
@@ -12089,13 +11993,11 @@ typedef struct _ib_ca_cong_entry {
 * SYNOPSIS
 */
 #define IB_CA_CONG_ENTRY_DATA_SIZE 16
-#include <complib/cl_packon.h>
 typedef struct _ib_ca_cong_setting {
 	ib_net16_t port_control;
 	ib_net16_t control_map;
 	ib_ca_cong_entry_t entry_list[IB_CA_CONG_ENTRY_DATA_SIZE];
-} PACK_SUFFIX ib_ca_cong_setting_t;
-#include <complib/cl_packoff.h>
+} ib_ca_cong_setting_t;
 /*
 * FIELDS
 *
@@ -12125,11 +12027,9 @@ typedef struct _ib_ca_cong_setting {
 *
 * SYNOPSIS
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_cc_tbl_entry {
 	ib_net16_t shift_multiplier;
-} PACK_SUFFIX ib_cc_tbl_entry_t;
-#include <complib/cl_packoff.h>
+} ib_cc_tbl_entry_t;
 /*
 * FIELDS
 *
@@ -12153,13 +12053,11 @@ typedef struct _ib_cc_tbl_entry {
 * SYNOPSIS
 */
 #define IB_CC_TBL_ENTRY_LIST_MAX 64
-#include <complib/cl_packon.h>
 typedef struct _ib_cc_tbl {
 	ib_net16_t ccti_limit;
 	ib_net16_t resv;
 	ib_cc_tbl_entry_t entry_list[IB_CC_TBL_ENTRY_LIST_MAX];
-} PACK_SUFFIX ib_cc_tbl_t;
-#include <complib/cl_packoff.h>
+} ib_cc_tbl_t;
 /*
 * FIELDS
 *
@@ -12182,11 +12080,9 @@ typedef struct _ib_cc_tbl {
 *
 * SOURCE
 */
-#include <complib/cl_packon.h>
 typedef struct _ib_time_stamp {
 	ib_net32_t value;
-} PACK_SUFFIX ib_time_stamp_t;
-#include <complib/cl_packoff.h>
+} ib_time_stamp_t;
 /*
 * FIELDS
 *
diff --git a/include/opensm/osm_attrib_req.h b/include/opensm/osm_attrib_req.h
deleted file mode 100644
index c9c4886c..00000000
--- a/include/opensm/osm_attrib_req.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. 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
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#ifndef _OSM_ATTRIB_REQ_H_
-#define _OSM_ATTRIB_REQ_H_
-
-#include <opensm/osm_path.h>
-
-#ifdef __cplusplus
-#  define BEGIN_C_DECLS extern "C" {
-#  define END_C_DECLS   }
-#else				/* !__cplusplus */
-#  define BEGIN_C_DECLS
-#  define END_C_DECLS
-#endif				/* __cplusplus */
-
-BEGIN_C_DECLS
-/*
- * Abstract:
- * 	Declaration of the attribute request object.  This object
- *  encapsulates information needed by the generic request controller
- *  to request an attribute from a node.
- *	These objects are part of the OpenSM family of objects.
- */
-/****h* OpenSM/Attribute Request
-* NAME
-*	Attribute Request
-*
-* DESCRIPTION
-*	The Attribute Request structure encapsulates
-*   encapsulates information needed by the generic request controller
-*   to request an attribute from a node.
-*
-*	This structure allows direct access to member variables.
-*
-* AUTHOR
-*	Steve King, Intel
-*
-*********/
-/****s* OpenSM: Attribute Request/osm_attrib_req_t
-* NAME
-*	osm_attrib_req_t
-*
-* DESCRIPTION
-*	Attribute request structure.
-*
-*	This structure allows direct access to member variables.
-*
-* SYNOPSIS
-*/
-typedef struct osm_attrib_req {
-	uint16_t attrib_id;
-	uint32_t attrib_mod;
-	osm_madw_context_t context;
-	osm_dr_path_t path;
-	cl_disp_msgid_t err_msg;
-} osm_attrib_req_t;
-/*
-* FIELDS
-*	attrib_id
-*		Attribute ID for this request.
-*
-*	attrib_mod
-*		Attribute modifier for this request.
-*
-*	context
-*		Context to insert in outbound mad wrapper context.
-*
-*	path
-*		The directed route path to the node.
-*
-* SEE ALSO
-*********/
-
-END_C_DECLS
-#endif				/* _OSM_ATTRIB_REQ_H_ */
diff --git a/include/opensm/osm_base.h b/include/opensm/osm_base.h
index 041c493d..7d0addd1 100644
--- a/include/opensm/osm_base.h
+++ b/include/opensm/osm_base.h
@@ -36,9 +36,7 @@
 
 /*
  * Abstract:
- * 	Basic OpenSM definitions and structures.
- *	This object represents an OpenSM "base class".
- *	This object is part of the OpenSM family of objects.
+ * 	Basic OpenSM definitions.
  */
 
 #ifndef _OSM_BASE_H_
@@ -52,7 +50,6 @@
 #include <vendor/winosm_common.h>
 #endif
 
-#include <complib/cl_types.h>
 #include <iba/ib_types.h>
 
 #ifdef __cplusplus
@@ -75,23 +72,7 @@ BEGIN_C_DECLS
 *	Steve King, Intel
 *
 *********/
-/****h* OpenSM/Base
-* NAME
-*	Base
-*
-* DESCRIPTION
-*	The Base object encapsulates basic information needed by the
-*	OpenSM to manage objects.  Each OpenSM object includes the
-*	Base object as the first member.
-*
-*	This object should be treated as opaque and should be
-*	manipulated only through the provided functions.
-*
-* AUTHOR
-*	Steve King, Intel
-*
-*********/
-/****s* OpenSM: Base/OSM_DEFAULT_M_KEY
+/****d* OpenSM: OSM_DEFAULT_M_KEY
 * NAME
 *	OSM_DEFAULT_M_KEY
 *
@@ -102,7 +83,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_M_KEY 0
 /********/
-/****s* OpenSM: Base/OSM_DEFAULT_SM_KEY
+/****d* OpenSM: OSM_DEFAULT_SM_KEY
 * NAME
 *	OSM_DEFAULT_SM_KEY
 *
@@ -113,7 +94,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_SM_KEY CL_HTON64(1)
 /********/
-/****s* OpenSM: Base/OSM_DEFAULT_SA_KEY
+/****d* OpenSM: OSM_DEFAULT_SA_KEY
 * NAME
 *	OSM_DEFAULT_SA_KEY
 *
@@ -124,7 +105,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_SA_KEY OSM_DEFAULT_SM_KEY
 /********/
-/****s* OpenSM: Base/OSM_DEFAULT_LMC
+/****d* OpenSM: OSM_DEFAULT_LMC
 * NAME
 *	OSM_DEFAULT_LMC
 *
@@ -135,7 +116,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_LMC 0
 /********/
-/****s* OpenSM: Base/OSM_DEFAULT_MAX_OP_VLS
+/****d* OpenSM: OSM_DEFAULT_MAX_OP_VLS
 * NAME
 *	OSM_DEFAULT_MAX_OP_VLS
 *
@@ -148,7 +129,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_MAX_OP_VLS 5
 /********/
-/****s* OpenSM: Base/OSM_DEFAULT_SL
+/****d* OpenSM: OSM_DEFAULT_SL
 * NAME
 *	OSM_DEFAULT_SL
 *
@@ -159,7 +140,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_SL 0
 /********/
-/****s* OpenSM: Base/OSM_DEFAULT_SCATTER_PORTS
+/****d* OpenSM: OSM_DEFAULT_SCATTER_PORTS
 * NAME
 *	OSM_DEFAULT_SCATTER_PORTS
 *
@@ -170,7 +151,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_SCATTER_PORTS 0
 /********/
-/****s* OpenSM: Base/OSM_DEFAULT_SM_PRIORITY
+/****d* OpenSM: OSM_DEFAULT_SM_PRIORITY
 * NAME
 *	OSM_DEFAULT_SM_PRIORITY
 *
@@ -182,7 +163,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_SM_PRIORITY 0
 /********/
-/****d* OpenSM: Base/OSM_DEFAULT_TMP_DIR
+/****d* OpenSM: OSM_DEFAULT_TMP_DIR
 * NAME
 *	OSM_DEFAULT_TMP_DIR
 *
@@ -198,7 +179,7 @@ BEGIN_C_DECLS
 #define OSM_DEFAULT_TMP_DIR "/var/log/"
 #endif
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_CACHE_DIR
+/****d* OpenSM: OSM_DEFAULT_CACHE_DIR
 * NAME
 *	OSM_DEFAULT_CACHE_DIR
 *
@@ -213,7 +194,7 @@ BEGIN_C_DECLS
 #define OSM_DEFAULT_CACHE_DIR "/var/cache/opensm"
 #endif
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_LOG_FILE
+/****d* OpenSM: OSM_DEFAULT_LOG_FILE
 * NAME
 *	OSM_DEFAULT_LOG_FILE
 *
@@ -229,7 +210,7 @@ BEGIN_C_DECLS
 #endif
 /***********/
 
-/****d* OpenSM: Base/OSM_DEFAULT_CONFIG_FILE
+/****d* OpenSM: OSM_DEFAULT_CONFIG_FILE
 * NAME
 *	OSM_DEFAULT_CONFIG_FILE
 *
@@ -247,7 +228,7 @@ BEGIN_C_DECLS
 #endif
 /***********/
 
-/****d* OpenSM: Base/OSM_DEFAULT_PARTITION_CONFIG_FILE
+/****d* OpenSM: OSM_DEFAULT_PARTITION_CONFIG_FILE
 * NAME
 *	OSM_DEFAULT_PARTITION_CONFIG_FILE
 *
@@ -265,7 +246,7 @@ BEGIN_C_DECLS
 #endif
 /***********/
 
-/****d* OpenSM: Base/OSM_DEFAULT_QOS_POLICY_FILE
+/****d* OpenSM: OSM_DEFAULT_QOS_POLICY_FILE
 * NAME
 *	OSM_DEFAULT_QOS_POLICY_FILE
 *
@@ -283,7 +264,7 @@ BEGIN_C_DECLS
 #endif
 /***********/
 
-/****d* OpenSM: Base/OSM_DEFAULT_TORUS_CONF_FILE
+/****d* OpenSM: OSM_DEFAULT_TORUS_CONF_FILE
 * NAME
 *	OSM_DEFAULT_TORUS_CONF_FILE
 *
@@ -301,7 +282,7 @@ BEGIN_C_DECLS
 #endif /* __WIN__ */
 /***********/
 
-/****d* OpenSM: Base/OSM_DEFAULT_PREFIX_ROUTES_FILE
+/****d* OpenSM: OSM_DEFAULT_PREFIX_ROUTES_FILE
 * NAME
 *	OSM_DEFAULT_PREFIX_ROUTES_FILE
 *
@@ -319,7 +300,7 @@ BEGIN_C_DECLS
 #endif
 /***********/
 
-/****d* OpenSM: Base/OSM_DEFAULT_PER_MOD_LOGGING_CONF_FILE
+/****d* OpenSM: OSM_DEFAULT_PER_MOD_LOGGING_CONF_FILE
 * NAME
 *	OSM_DEFAULT_PER_MOD_LOGGING_CONF_FILE
 *
@@ -337,7 +318,7 @@ BEGIN_C_DECLS
 #endif /* __WIN__ */
 /***********/
 
-/****d* OpenSM: Base/OSM_DEFAULT_SWEEP_INTERVAL_SECS
+/****d* OpenSM: OSM_DEFAULT_SWEEP_INTERVAL_SECS
 * NAME
 *	OSM_DEFAULT_SWEEP_INTERVAL_SECS
 *
@@ -348,7 +329,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_SWEEP_INTERVAL_SECS 10
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC
+/****d* OpenSM: OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC
 * NAME
 *	OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC
 *
@@ -359,7 +340,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_TRANS_TIMEOUT_MILLISEC 200
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_LONG_TRANS_TIMEOUT_MILLISEC
+/****d* OpenSM: OSM_DEFAULT_LONG_TRANS_TIMEOUT_MILLISEC
 * NAME
 *       OSM_DEFAULT_LONG_TRANS_TIMEOUT_MILLISEC
 *
@@ -370,7 +351,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_LONG_TRANS_TIMEOUT_MILLISEC 500
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_SUBNET_TIMEOUT
+/****d* OpenSM: OSM_DEFAULT_SUBNET_TIMEOUT
 * NAME
 *	OSM_DEFAULT_SUBNET_TIMEOUT
 *
@@ -383,7 +364,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_SUBNET_TIMEOUT 0x12
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_SWITCH_PACKET_LIFE
+/****d* OpenSM: OSM_DEFAULT_SWITCH_PACKET_LIFE
 * NAME
 *	OSM_DEFAULT_SWITCH_PACKET_LIFE
 *
@@ -397,7 +378,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_SWITCH_PACKET_LIFE 0x12
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_HEAD_OF_QUEUE_LIFE
+/****d* OpenSM: OSM_DEFAULT_HEAD_OF_QUEUE_LIFE
 * NAME
 *	OSM_DEFAULT_HEAD_OF_QUEUE_LIFE
 *
@@ -410,7 +391,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_HEAD_OF_QUEUE_LIFE 0x12
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE
+/****d* OpenSM: OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE
 * NAME
 *	OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE
 *
@@ -423,7 +404,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_LEAF_HEAD_OF_QUEUE_LIFE 0x10
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_VL_STALL_COUNT
+/****d* OpenSM: OSM_DEFAULT_VL_STALL_COUNT
 * NAME
 *	OSM_DEFAULT_LEAF_VL_COUNT
 *
@@ -436,7 +417,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_VL_STALL_COUNT 0x7
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_LEAF_VL_STALL_COUNT
+/****d* OpenSM: OSM_DEFAULT_LEAF_VL_STALL_COUNT
 * NAME
 *	OSM_DEFAULT_LEAF_VL_STALL_COUNT
 *
@@ -450,9 +431,9 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_LEAF_VL_STALL_COUNT 0x7
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT
+/****d* OpenSM: OSM_DEFAULT_TRAP_SUPPRESSION_TIMEOUT
 * NAME
-*	OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT
+*	OSM_DEFAULT_TRAP_SUPPRESSION_TIMEOUT
 *
 * DESCRIPTION
 *	Specifies the default timeout for ignoring same trap.
@@ -461,9 +442,10 @@ BEGIN_C_DECLS
 *
 * SYNOPSIS
 */
-#define OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT 5000000
+#define OSM_DEFAULT_TRAP_SUPPRESSION_TIMEOUT 5000000
+#define OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT OSM_DEFAULT_TRAP_SUPPRESSION_TIMEOUT
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_UNHEALTHY_TIMEOUT
+/****d* OpenSM: OSM_DEFAULT_UNHEALTHY_TIMEOUT
 * NAME
 *	OSM_DEFAULT_UNHEALTHY_TIMEOUT
 *
@@ -476,7 +458,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_UNHEALTHY_TIMEOUT 60000000
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_ERROR_THRESHOLD
+/****d* OpenSM: OSM_DEFAULT_ERROR_THRESHOLD
 * NAME
 *	OSM_DEFAULT_ERROR_THRESHOLD
 *
@@ -487,7 +469,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_ERROR_THRESHOLD 0x08
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_SMP_MAX_ON_WIRE
+/****d* OpenSM: OSM_DEFAULT_SMP_MAX_ON_WIRE
 * NAME
 *	OSM_DEFAULT_SMP_MAX_ON_WIRE
 *
@@ -499,7 +481,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_SMP_MAX_ON_WIRE 4
 /***********/
-/****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_RCV_SIZE
+/****d* OpenSM: OSM_SM_DEFAULT_QP0_RCV_SIZE
 * NAME
 *	OSM_SM_DEFAULT_QP0_RCV_SIZE
 *
@@ -510,7 +492,7 @@ BEGIN_C_DECLS
 */
 #define OSM_SM_DEFAULT_QP0_RCV_SIZE 256
 /***********/
-/****d* OpenSM: Base/OSM_SM_DEFAULT_QP0_SEND_SIZE
+/****d* OpenSM: OSM_SM_DEFAULT_QP0_SEND_SIZE
 * NAME
 *	OSM_SM_DEFAULT_QP0_SEND_SIZE
 *
@@ -521,7 +503,7 @@ BEGIN_C_DECLS
 */
 #define OSM_SM_DEFAULT_QP0_SEND_SIZE 256
 /***********/
-/****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_RCV_SIZE
+/****d* OpenSM: OSM_SM_DEFAULT_QP1_RCV_SIZE
 * NAME
 *   OSM_SM_DEFAULT_QP1_RCV_SIZE
 *
@@ -532,7 +514,7 @@ BEGIN_C_DECLS
 */
 #define OSM_SM_DEFAULT_QP1_RCV_SIZE 256
 /***********/
-/****d* OpenSM: Base/OSM_SM_DEFAULT_QP1_SEND_SIZE
+/****d* OpenSM: OSM_SM_DEFAULT_QP1_SEND_SIZE
 * NAME
 *   OSM_SM_DEFAULT_QP1_SEND_SIZE
 *
@@ -542,7 +524,7 @@ BEGIN_C_DECLS
 * SYNOPSIS
 */
 #define OSM_SM_DEFAULT_QP1_SEND_SIZE 256
-/****d* OpenSM: Base/OSM_PM_DEFAULT_QP1_RCV_SIZE
+/****d* OpenSM: OSM_PM_DEFAULT_QP1_RCV_SIZE
 * NAME
 *   OSM_PM_DEFAULT_QP1_RCV_SIZE
 *
@@ -553,7 +535,7 @@ BEGIN_C_DECLS
 */
 #define OSM_PM_DEFAULT_QP1_RCV_SIZE 256
 /***********/
-/****d* OpenSM: Base/OSM_PM_DEFAULT_QP1_SEND_SIZE
+/****d* OpenSM: OSM_PM_DEFAULT_QP1_SEND_SIZE
 * NAME
 *   OSM_PM_DEFAULT_QP1_SEND_SIZE
 *
@@ -563,7 +545,7 @@ BEGIN_C_DECLS
 * SYNOPSIS
 */
 #define OSM_PM_DEFAULT_QP1_SEND_SIZE 256
-/****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS
+/****d* OpenSM: OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS
 * NAME
 *   OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS
 *
@@ -575,7 +557,7 @@ BEGIN_C_DECLS
 */
 #define OSM_SM_DEFAULT_POLLING_TIMEOUT_MILLISECS 10000
 /**********/
-/****d* OpenSM: Base/OSM_SM_DEFAULT_POLLING_RETRY_NUMBER
+/****d* OpenSM: OSM_SM_DEFAULT_POLLING_RETRY_NUMBER
 * NAME
 *   OSM_SM_DEFAULT_POLLING_RETRY_NUMBER
 *
@@ -622,7 +604,7 @@ BEGIN_C_DECLS
 */
 #define OSM_DEFAULT_MGRP_SCOPE IB_MC_SCOPE_LINK_LOCAL
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_QOS_MAX_VLS
+/****d* OpenSM: OSM_DEFAULT_QOS_MAX_VLS
  * Name
  *       OSM_DEFAULT_QOS_MAX_VLS
  *
@@ -633,7 +615,7 @@ BEGIN_C_DECLS
  */
 #define OSM_DEFAULT_QOS_MAX_VLS 15
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_QOS_HIGH_LIMIT
+/****d* OpenSM: OSM_DEFAULT_QOS_HIGH_LIMIT
  * Name
  *       OSM_DEFAULT_QOS_HIGH_LIMIT
  *
@@ -644,7 +626,7 @@ BEGIN_C_DECLS
  */
 #define OSM_DEFAULT_QOS_HIGH_LIMIT 0
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_QOS_VLARB_HIGH
+/****d* OpenSM: OSM_DEFAULT_QOS_VLARB_HIGH
  * Name
  *       OSM_DEFAULT_QOS_VLARB_HIGH
  *
@@ -655,7 +637,7 @@ BEGIN_C_DECLS
  */
 #define OSM_DEFAULT_QOS_VLARB_HIGH "0:4,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0"
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_QOS_VLARB_LOW
+/****d* OpenSM: OSM_DEFAULT_QOS_VLARB_LOW
  * Name
  *       OSM_DEFAULT_QOS_VLARB_LOW
  *
@@ -666,7 +648,7 @@ BEGIN_C_DECLS
  */
 #define OSM_DEFAULT_QOS_VLARB_LOW "0:0,1:4,2:4,3:4,4:4,5:4,6:4,7:4,8:4,9:4,10:4,11:4,12:4,13:4,14:4"
 /***********/
-/****d* OpenSM: Base/OSM_DEFAULT_QOS_SL2VL
+/****d* OpenSM: OSM_DEFAULT_QOS_SL2VL
  * Name
  *       OSM_DEFAULT_QOS_SL2VL
  *
@@ -677,7 +659,7 @@ BEGIN_C_DECLS
  */
 #define OSM_DEFAULT_QOS_SL2VL "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,7"
 /***********/
-/****d* OpenSM: Base/OSM_NO_PATH
+/****d* OpenSM: OSM_NO_PATH
 * NAME
 *	OSM_NO_PATH
 *
@@ -688,7 +670,7 @@ BEGIN_C_DECLS
 */
 #define OSM_NO_PATH			0xFF
 /**********/
-/****d* OpenSM: Base/OSM_NODE_DESC_UNKNOWN
+/****d* OpenSM: OSM_NODE_DESC_UNKNOWN
 * NAME
 *	OSM_NODE_DESC_UNKNOWN
 *
@@ -699,7 +681,7 @@ BEGIN_C_DECLS
 */
 #define OSM_NODE_DESC_UNKNOWN "<unknown>"
 /**********/
-/****d* OpenSM: Base/osm_thread_state_t
+/****d* OpenSM: osm_thread_state_t
 * NAME
 *	osm_thread_state_t
 *
@@ -721,7 +703,7 @@ typedef enum _osm_thread_state {
  * OSM_CAP are from IBA 1.2.1 Table 117 and Table 188
  */
 
-/****d* OpenSM: Base/OSM_CAP_IS_TRAP_SUP
+/****d* OpenSM: OSM_CAP_IS_TRAP_SUP
 * Name
 *	OSM_CAP_IS_SUBN_TRAP_SUP
 *
@@ -733,7 +715,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP_IS_SUBN_TRAP_SUP (1 << 0)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP_IS_GET_SET_NOTICE_SUP
+/****d* OpenSM: OSM_CAP_IS_GET_SET_NOTICE_SUP
 * Name
 *	OSM_CAP_IS_GET_SET_NOTICE_SUP
 *
@@ -745,7 +727,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP_IS_SUBN_GET_SET_NOTICE_SUP (1 << 1)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP_IS_SUBN_OPT_RECS_SUP
+/****d* OpenSM: OSM_CAP_IS_SUBN_OPT_RECS_SUP
 * Name
 *	OSM_CAP_IS_SUBN_OPT_RECS_SUP
 *
@@ -758,7 +740,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP_IS_SUBN_OPT_RECS_SUP (1 << 8)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP_IS_UD_MCAST_SUP
+/****d* OpenSM: OSM_CAP_IS_UD_MCAST_SUP
 * Name
 *	OSM_CAP_IS_UD_MCAST_SUP
 *
@@ -770,7 +752,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP_IS_UD_MCAST_SUP (1 << 9)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP_IS_MULTIPATH_SUP
+/****d* OpenSM: OSM_CAP_IS_MULTIPATH_SUP
 * Name
 *	OSM_CAP_IS_MULTIPATH_SUP
 *
@@ -782,7 +764,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP_IS_MULTIPATH_SUP (1 << 10)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP_IS_REINIT_SUP
+/****d* OpenSM: OSM_CAP_IS_REINIT_SUP
 * Name
 *	OSM_CAP_IS_REINIT_SUP
 *
@@ -794,7 +776,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP_IS_REINIT_SUP (1 << 11)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
+/****d* OpenSM: OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
 * Name
 *	OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED
 *
@@ -814,7 +796,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP_IS_PORT_INFO_CAPMASK_MATCH_SUPPORTED (1 << 13)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP2_IS_QOS_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_QOS_SUPPORTED
 * Name
 *	OSM_CAP2_IS_QOS_SUPPORTED
 *
@@ -826,7 +808,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP2_IS_QOS_SUPPORTED (1 << 1)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP2_IS_REVERSE_PATH_PKEY_SUPPPORTED
+/****d* OpenSM: OSM_CAP2_IS_REVERSE_PATH_PKEY_SUPPPORTED
 * Name
 *	OSM_CAP2_IS_REVERSE_PATH_PKEY_SUPPPORTED
 *
@@ -838,7 +820,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP2_IS_REVERSE_PATH_PKEY_SUPPPORTED (1 << 2)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP2_IS_MCAST_TOP_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_MCAST_TOP_SUPPORTED
 * Name
 *	OSM_CAP2_IS_MCAST_TOP_SUPPORTED
 *
@@ -850,7 +832,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP2_IS_MCAST_TOP_SUPPORTED (1 << 3)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP2_IS_HIERARCHY_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_HIERARCHY_SUPPORTED
 * Name
 *
 * DESCRIPTION
@@ -861,7 +843,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP2_IS_HIERARCHY_SUPPORTED (1 << 4)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP2_IS_ALIAS_GUIDS_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_ALIAS_GUIDS_SUPPORTED
 * Name
 *
 * DESCRIPTION
@@ -872,7 +854,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP2_IS_ALIAS_GUIDS_SUPPORTED (1 << 5)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP2_IS_FULL_PORTINFO_REC_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_FULL_PORTINFO_REC_SUPPORTED
 * Name
 *	OSM_CAP2_IS_FULL_PORTINFO_REC_SUPPORTED
 *
@@ -884,7 +866,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP2_IS_FULL_PORTINFO_REC_SUPPORTED (1 << 6)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP2_IS_EXTENDED_SPEEDS_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_EXTENDED_SPEEDS_SUPPORTED
 * Name
 *	OSM_CAP2_IS_EXTENDED_SPEEDS_SUPPORTED
 *
@@ -896,7 +878,7 @@ typedef enum _osm_thread_state {
 #define OSM_CAP2_IS_EXTENDED_SPEEDS_SUPPORTED (1 << 7)
 /***********/
 
-/****d* OpenSM: Base/OSM_CAP2_IS_MULTICAST_SERVICE_RECS_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_MULTICAST_SERVICE_RECS_SUPPORTED
  * Name
  *	OSM_CAP2_IS_MULTICAST_SERVICE_RECS_SUPPORTED
  *
@@ -907,7 +889,7 @@ typedef enum _osm_thread_state {
  */
 #define OSM_CAP2_IS_MULTICAST_SERVICE_RECS_SUPPORTED (1 << 8)
 
-/****d* OpenSM: Base/OSM_CAP2_IS_PORT_INFO_CAPMASK2_MATCH_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_PORT_INFO_CAPMASK2_MATCH_SUPPORTED
  * Name
  *	OSM_CAP2_IS_PORT_INFO_CAPMASK2_MATCH_SUPPORTED
  *
@@ -918,7 +900,7 @@ typedef enum _osm_thread_state {
  */
 #define OSM_CAP2_IS_PORT_INFO_CAPMASK2_MATCH_SUPPORTED (1 << 10)
 
-/****d* OpenSM: Base/OSM_CAP2_IS_SEND_ONLY_FULL_MEMBER_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_SEND_ONLY_FULL_MEMBER_SUPPORTED
  * Name
  *	OSM_CAP2_IS_SEND_ONLY_FULL_MEMBER_SUPPORTED
  *
@@ -929,7 +911,7 @@ typedef enum _osm_thread_state {
  */
 #define OSM_CAP2_IS_SEND_ONLY_FULL_MEMBER_SUPPORTED (1 << 12)
 
-/****d* OpenSM: Base/OSM_CAP2_IS_LINK_WIDTH_2X_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_LINK_WIDTH_2X_SUPPORTED
  * Name
  *	OSM_CAP2_IS_LINK_WIDTH_2X_SUPPORTED
  *
@@ -940,7 +922,7 @@ typedef enum _osm_thread_state {
  */
 #define OSM_CAP2_IS_LINK_WIDTH_2X_SUPPORTED (1 << 13)
 
-/****d* OpenSM: Base/OSM_CAP2_IS_LINK_SPEED_HDR_SUPPORTED
+/****d* OpenSM: OSM_CAP2_IS_LINK_SPEED_HDR_SUPPORTED
  * Name
  *	OSM_CAP2_IS_LINK_SPEED_HDR_SUPPORTED
  *
@@ -951,7 +933,7 @@ typedef enum _osm_thread_state {
  */
 #define OSM_CAP2_IS_LINK_SPEED_HDR_SUPPORTED (1 << 15)
 
-/****d* OpenSM: Base/osm_signal_t
+/****d* OpenSM: osm_signal_t
 * NAME
 *	osm_signal_t
 *
@@ -973,7 +955,7 @@ typedef enum _osm_thread_state {
 typedef unsigned int osm_signal_t;
 /***********/
 
-/****d* OpenSM: Base/osm_sm_signal_t
+/****d* OpenSM: osm_sm_signal_t
 * NAME
 *	osm_sm_signal_t
 *
@@ -998,7 +980,7 @@ typedef enum _osm_sm_signal {
 } osm_sm_signal_t;
 /***********/
 
-/****s* OpenSM: Base/MAX_GUID_FILE_LINE_LENGTH
+/****d* OpenSM: MAX_GUID_FILE_LINE_LENGTH
 * NAME
 *	MAX_GUID_FILE_LINE_LENGTH
 *
@@ -1010,7 +992,7 @@ typedef enum _osm_sm_signal {
 #define MAX_GUID_FILE_LINE_LENGTH 120
 /**********/
 
-/****s* OpenSM: Base/VendorOUIs
+/****d* OpenSM: VendorOUIs
 * NAME
 *	VendorOUIs
 *
diff --git a/include/opensm/osm_congestion_control.h b/include/opensm/osm_congestion_control.h
index 78e4a642..c59bf888 100644
--- a/include/opensm/osm_congestion_control.h
+++ b/include/opensm/osm_congestion_control.h
@@ -51,7 +51,6 @@
 #include <opensm/osm_subnet.h>
 #include <opensm/osm_log.h>
 #include <opensm/osm_sm.h>
-#include <opensm/osm_opensm.h>
 #include <opensm/osm_base.h>
 
 /****s* OpenSM: Base/OSM_DEFAULT_CC_KEY
diff --git a/include/opensm/osm_mtree.h b/include/opensm/osm_mtree.h
index 32f51790..ad47af6d 100644
--- a/include/opensm/osm_mtree.h
+++ b/include/opensm/osm_mtree.h
@@ -124,6 +124,7 @@ typedef struct osm_mtree_node {
 *	child_array
 *		Array (indexed by port number) of pointers to the
 *		child osm_mtree_node_t objects of this tree node, if any.
+*		MUST BE LAST ELEMENT!!!
 *
 * SEE ALSO
 *********/
@@ -133,7 +134,7 @@ typedef struct osm_mtree_node {
 *	osm_mtree_node_new
 *
 * DESCRIPTION
-*	Returns an initialized a Multicast Tree object for use.
+*	Returns an initialized Multicast Tree object for use.
 *
 * SYNOPSIS
 */
@@ -258,9 +259,6 @@ static inline const osm_switch_t *osm_mtree_node_get_switch_ptr(IN const
 *	p_mtn
 *		[in] Pointer to the multicast tree node.
 *
-*	child
-*		[in] Index of the child to retrieve.
-*
 * RETURN VALUES
 *	Returns a pointer to the switch object represented by this tree node.
 *
diff --git a/include/opensm/osm_multicast.h b/include/opensm/osm_multicast.h
index 5b9f427f..380f3063 100644
--- a/include/opensm/osm_multicast.h
+++ b/include/opensm/osm_multicast.h
@@ -54,7 +54,6 @@
 #include <opensm/osm_mcm_port.h>
 #include <opensm/osm_subnet.h>
 #include <opensm/osm_log.h>
-#include <opensm/osm_sm.h>
 
 #ifdef __cplusplus
 #  define BEGIN_C_DECLS extern "C" {
@@ -136,6 +135,9 @@ typedef struct osm_mgrp {
 *		is created during the initialization of SM/SA and will be
 *		present even if there are no ports for this group
 *
+* 	full_members
+*		Number of full members in the Multicast Group.
+*
 * SEE ALSO
 *********/
 
@@ -339,6 +341,12 @@ osm_mcm_port_t *osm_mgrp_add_port(osm_subn_t *subn, osm_log_t *log,
 				  IN ib_member_rec_t *mcmr, IN boolean_t proxy);
 /*
 * PARAMETERS
+*	subn
+*		[in] Pointer to the subnet object
+*
+*	log
+*		[in] The log object pointer
+*
 *	mgrp
 *		[in] Pointer to an osm_mgrp_t object to initialize.
 *
@@ -427,7 +435,6 @@ void osm_mgrp_delete_port(IN osm_subn_t * subn, IN osm_log_t * log,
 			  IN osm_mgrp_t * mgrp, IN osm_port_t * port);
 /*
 * PARAMETERS
-*
 *	subn
 *		[in] Pointer to the subnet object
 *
diff --git a/include/opensm/osm_node.h b/include/opensm/osm_node.h
index 1d349048..b6e5e00a 100644
--- a/include/opensm/osm_node.h
+++ b/include/opensm/osm_node.h
@@ -234,7 +234,7 @@ static inline osm_physp_t *osm_node_get_physp_ptr(IN osm_node_t * p_node,
 * RETURN VALUES
 *	Returns a pointer to the physical port object at the
 *	specified local port number.
-*	A return value of zero means the port number was out of range.
+*	A return value of NULL means the port number was out of range.
 *
 * NOTES
 *
@@ -454,6 +454,9 @@ void osm_node_init_physp(IN osm_node_t * p_node, uint8_t port_num,
 *	p_node
 *		[in] Pointer to an osm_node_t object.
 *
+*	port_num
+*		[in] Local port number.
+*
 *	p_madw
 *		[in] Pointer to a osm_madw_t object containing a mad with
 *		the node's NodeInfo attribute as discovered through the
@@ -517,7 +520,7 @@ void osm_node_link(IN osm_node_t * p_node, IN uint8_t port_num,
 *		[in] Port number in p_node through which to create the link.
 *
 *	p_remote_node
-*		[in] Pointer to the remote port object.
+*		[in] Pointer to the remote node object.
 *
 *	remote_port_num
 *		[in] Port number in the remote's node through which to
@@ -553,7 +556,7 @@ void osm_node_unlink(IN osm_node_t * p_node, IN uint8_t port_num,
 *		[in] Port number in p_node through which to unlink.
 *
 *	p_remote_node
-*		[in] Pointer to the remote port object.
+*		[in] Pointer to the remote node object.
 *
 *	remote_port_num
 *		[in] Port number in the remote's node through which to unlink.
@@ -590,7 +593,7 @@ boolean_t osm_node_link_exists(IN osm_node_t * p_node, IN uint8_t port_num,
 *		[in] Port number in p_node through which to check the link.
 *
 *	p_remote_node
-*		[in] Pointer to the remote port object.
+*		[in] Pointer to the remote node object.
 *
 *	remote_port_num
 *		[in] Port number in the remote's node through which to
@@ -660,6 +663,13 @@ boolean_t osm_node_link_has_valid_ports(IN osm_node_t * p_node,
 *	port_num
 *		[in] Port number in p_node through which to check the link.
 *
+*	p_remote_node
+*		[in] Pointer to the remote node object.
+*
+*	remote_port_num
+*		[in] Port number in the remote's node through which to
+*		check this link.
+*
 * RETURN VALUES
 *	Return TRUE if both ports in the link are valid (initialized).
 *	Returns FALSE otherwise.
diff --git a/include/opensm/osm_opensm.h b/include/opensm/osm_opensm.h
index 2c016fa8..5c8dcf48 100644
--- a/include/opensm/osm_opensm.h
+++ b/include/opensm/osm_opensm.h
@@ -4,6 +4,7 @@
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2009-2011 ZIH, TU Dresden, Federal Republic of Germany. All rights reserved.
  * Copyright (C) 2012-2017 Tokyo Institute of Technology. All rights reserved.
+ * Copyright (c) 2019 Fabriscale Technologies AS. 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
@@ -113,7 +114,8 @@ typedef enum _osm_routing_engine_type {
 	OSM_ROUTING_ENGINE_TYPE_NUE,
 	OSM_ROUTING_ENGINE_TYPE_SSSP,
 	OSM_ROUTING_ENGINE_TYPE_DFSSSP,
-	OSM_ROUTING_ENGINE_TYPE_UNKNOWN
+	OSM_ROUTING_ENGINE_TYPE_UNKNOWN,
+	OSM_ROUTING_ENGINE_TYPE_EXTERNAL
 } osm_routing_engine_type_t;
 /***********/
 
@@ -127,7 +129,7 @@ typedef enum _osm_routing_engine_type {
 *	routing engine structure - multicast callbacks may be
 *	added later.
 */
-struct osm_routing_engine {
+typedef struct osm_routing_engine {
 	osm_routing_engine_type_t type;
 	const char *name;
 	void *context;
@@ -147,7 +149,7 @@ struct osm_routing_engine {
 					     IN OUT osm_mgrp_box_t *mgb);
 	void (*destroy) (void *context);
 	struct osm_routing_engine *next;
-};
+} osm_routing_engine_t;
 /*
 * FIELDS
 *	name
@@ -198,6 +200,37 @@ struct osm_routing_engine {
 *		Pointer to next routing engine in the list.
 */
 
+/****s* OpenSM: OpenSM/external_routing_engine_module_t
+ * NAME
+ *	external_routing_engine_module_t
+ *
+ * DESCRIPTION
+ *	External routing engine module structure.
+ *
+ *	This structure is used to register a new external routing engine
+ *
+ * SYNOPSIS
+ */
+typedef struct external_routing_engine_module {
+	const char *name;
+	int (*setup)(struct osm_routing_engine *re, struct osm_opensm *osm);
+	void *context;
+} external_routing_engine_module_t;
+/*
+ * FIELDS
+ *	name
+ *		Name of the external routing engine
+ *
+ *	setup
+ *		function to setup the external routing engine's callbacks
+ *
+ *	context
+ *		User defined context
+ *
+ *	SEE ALSO
+ *		osm_register_external_routing_engine
+ *********/
+
 /****s* OpenSM: OpenSM/osm_opensm_t
 * NAME
 *	osm_opensm_t
@@ -603,6 +636,37 @@ osm_opensm_wait_for_subnet_up(IN osm_opensm_t * p_osm, IN uint32_t wait_us,
 * SEE ALSO
 *********/
 
+/****f* OpenSM: OpenSM/osm_register_external_routing_engine
+ * NAME
+ *	osm_register_external_routing_engine
+ *
+ * DESCRIPTION
+ *	Register a new external routing engine.
+ *
+ * SYNOPSIS
+ */
+cl_status_t osm_register_external_routing_engine(
+	IN osm_opensm_t *osm,
+	IN const external_routing_engine_module_t *module,
+	IN void *context);
+/*
+ * PARAMETERS
+ *	type
+ *      [in] Pointer to a osm_opensm_t object
+ *      [in] Pointer to a external_routing_engine_module_t object to be registered.
+ *      [in] Pointer to a user context that will be set in osm_routing_engine_t
+ *
+ * RETURN VALUES
+ *	CL_SUCCESS if the routing engine was registered successfully.
+ *	CL_DUPLICATE if a routing engine with the same name
+ *               or type was already registered.
+ *
+ * NOTES
+ *
+ * SEE ALSO
+ *    external_routing_engine_module_t
+ *********/
+
 /****f* OpenSM: OpenSM/osm_routing_engine_type_str
 * NAME
 *	osm_routing_engine_type_str
diff --git a/include/opensm/osm_path.h b/include/opensm/osm_path.h
index b69e5f9c..1c2d32dd 100644
--- a/include/opensm/osm_path.h
+++ b/include/opensm/osm_path.h
@@ -85,9 +85,6 @@ typedef struct osm_dr_path {
 } osm_dr_path_t;
 /*
 * FIELDS
-*	h_bind
-*		Bind handle for port to which this path applies.
-*
 *	hop_count
 *		The number of hops in this path.
 *
@@ -108,7 +105,6 @@ typedef struct osm_dr_path {
 */
 static inline void osm_dr_path_construct(IN osm_dr_path_t * p_path)
 {
-	/* The first location in the path array is reserved. */
 	memset(p_path, 0, sizeof(*p_path));
 }
 
@@ -117,15 +113,6 @@ static inline void osm_dr_path_construct(IN osm_dr_path_t * p_path)
 *	p_path
 *		[in] Pointer to a directed route path object to initialize.
 *
-*	h_bind
-*		[in] Bind handle for the port on which this path applies.
-*
-*	hop_count
-*		[in] Hop count needed to reach this node.
-*
-*	path
-*		[in] Directed route path to reach this node.
-*
 * RETURN VALUE
 *	None.
 *
@@ -159,9 +146,6 @@ osm_dr_path_init(IN osm_dr_path_t * p_path, IN uint8_t hop_count,
 *	p_path
 *		[in] Pointer to a directed route path object to initialize.
 *
-*	h_bind
-*		[in] Bind handle for the port on which this path applies.
-*
 *	hop_count
 *		[in] Hop count needed to reach this node.
 *
diff --git a/include/opensm/osm_remote_sm.h b/include/opensm/osm_remote_sm.h
index e7d52fa2..53affe4d 100644
--- a/include/opensm/osm_remote_sm.h
+++ b/include/opensm/osm_remote_sm.h
@@ -35,7 +35,7 @@
 
 /*
  * Abstract:
- * 	Declaration of osm_sm_t, osm_remote_sm_t.
+ * 	Declaration of osm_remote_sm_t.
  *	This object represents an IBA subnet.
  *	This object is part of the OpenSM family of objects.
  */
@@ -93,8 +93,6 @@ typedef struct osm_remote_sm {
 * FIELDS
 *	map_item
 *		Linkage for the cl_qmap container.  MUST BE FIRST ELEMENT!!
-*	p_port
-*		Pointer to the port object for this SM.
 *
 *	smi
 *		The SMInfo attribute for this SM.
@@ -174,9 +172,6 @@ void osm_remote_sm_init(IN osm_remote_sm_t * p_sm, IN const ib_sm_info_t * p_smi
 *	p_sm
 *		[in] Pointer to an osm_remote_sm_t object to initialize.
 *
-*	p_port
-*		[in] Pointer to the Remote SM's port object.
-*
 *	p_smi
 *		[in] Pointer to the SMInfo attribute for this SM.
 *
diff --git a/include/opensm/osm_router.h b/include/opensm/osm_router.h
index b5512210..11e34b64 100644
--- a/include/opensm/osm_router.h
+++ b/include/opensm/osm_router.h
@@ -120,7 +120,8 @@ void osm_router_delete(IN OUT osm_router_t ** pp_rtr);
 /*
 * PARAMETERS
 *	p_rtr
-*		[in] Pointer to the object to destroy.
+*		[in][out] Pointer to a pointer to the object to destroy.
+*		The pointer will be set to NULL on return.
 *
 * RETURN VALUE
 *	None.
diff --git a/include/opensm/osm_sa_mad_ctrl.h b/include/opensm/osm_sa_mad_ctrl.h
index 2c2513b0..d59fae03 100644
--- a/include/opensm/osm_sa_mad_ctrl.h
+++ b/include/opensm/osm_sa_mad_ctrl.h
@@ -136,9 +136,11 @@ typedef struct osm_sa_mad_ctrl {
 *	p_stats
 *		Pointer to the OpenSM statistics block.
 *
+*	p_subn
+*		Pointer to the OpenSM Subnet object.
+*
 * SEE ALSO
 *	SA MAD Controller object
-*	SA MADr object
 *********/
 
 /****f* OpenSM: SA MAD Controller/osm_sa_mad_ctrl_construct
@@ -235,6 +237,9 @@ ib_api_status_t osm_sa_mad_ctrl_init(IN osm_sa_mad_ctrl_t * p_ctrl,
 *	p_vendor
 *		[in] Pointer to the vendor specific interfaces object.
 *
+*	p_subn
+*		[in] Pointer to the OpenSM Subnet object.
+*
 *	p_log
 *		[in] Pointer to the log object.
 *
diff --git a/include/opensm/osm_service.h b/include/opensm/osm_service.h
index 446b8883..8ed97df7 100644
--- a/include/opensm/osm_service.h
+++ b/include/opensm/osm_service.h
@@ -96,10 +96,10 @@ typedef struct osm_svcr {
 } osm_svcr_t;
 /*
 * FIELDS
-*	map_item
-*		Map Item for qmap linkage.  Must be first element!!
+*	list_item
+*		List Item for Quick List linkage.  Must be first element!!
 *
-*	svc_rec
+*	service_record
 *		IB Service record structure
 *
 *	modified_time
@@ -128,7 +128,7 @@ osm_svcr_t *osm_svcr_new(IN const ib_service_record_t * p_svc_rec);
 *		[in] Pointer to IB Service Record
 *
 * RETURN VALUES
-*	pointer to osm_svcr_t structure.
+*	Pointer to osm_svcr_t structure.
 *
 * NOTES
 *	Allows calling other service record methods.
@@ -150,10 +150,11 @@ void osm_svcr_init(IN osm_svcr_t * p_svcr,
 		   IN const ib_service_record_t * p_svc_rec);
 /*
 * PARAMETERS
-*	p_svc_rec
+*	p_svcr
 *		[in] Pointer to osm_svcr_t structure
+*
 *	p_svc_rec
-*		[in] Pointer to the ib_service_record_t
+*		[in] Pointer to IB Service Record
 *
 * SEE ALSO
 *	Service Record
@@ -171,21 +172,102 @@ void osm_svcr_init(IN osm_svcr_t * p_svcr,
 void osm_svcr_delete(IN osm_svcr_t * p_svcr);
 /*
 * PARAMETERS
-*	p_svc_rec
+*	p_svcr
 *		[in] Pointer to osm_svcr_t structure
 *
 * SEE ALSO
 *	Service Record, osm_svcr_new
 *********/
 
+/****f* OpenSM: Service Record/osm_svcr_get_by_rid
+* NAME
+*	osm_svcr_get_by_rid
+*
+* DESCRIPTION
+*	Search the Service Record Database by record service_id,
+* service_gid and service_pkey (RID).
+*
+* SYNOPSIS
+*/
 osm_svcr_t *osm_svcr_get_by_rid(IN osm_subn_t const *p_subn,
 				IN osm_log_t * p_log,
 				IN ib_service_record_t * p_svc_rec);
+/*
+* PARAMETERS
+*	p_subn
+*		[in] Pointer to Subnet structure
+*
+*	p_log
+*		[in] Pointer to osm_log_t
+*
+*	p_svc_rec
+*		[in] Pointer to IB Service Record
+*
+* RETURN VALUES
+*	If a matching record is found, pointer to osm_svcr_t structure.
+*	Otherwise, pointer to NULL.
+*
+* SEE ALSO
+*	Service Record
+*********/
 
+/****f* OpenSM: Service Record/osm_svcr_insert_to_db
+* NAME
+*	osm_svcr_insert_to_db
+*
+* DESCRIPTION
+*	Insert new Service Record into Database
+*
+* SYNOPSIS
+*/
 void osm_svcr_insert_to_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log,
 			   IN osm_svcr_t * p_svcr);
+/*
+* PARAMETERS
+*	p_subn
+*		[in] Pointer to Subnet structure
+*
+*	p_log
+*		[in] Pointer to osm_log_t
+*
+*	p_svcr
+*		[in] Pointer to IB Service Record to be inserted
+*
+* RETURN VALUES
+*	This function does not return a value.
+*
+* SEE ALSO
+*	Service Record, osm_svcr_remove_from_db
+*********/
+
+/****f* OpenSM: Service Record/osm_svcr_remove_from_db
+* NAME
+*	osm_svcr_remove_from_db
+*
+* DESCRIPTION
+*	Remove a Service Record from Database
+*
+* SYNOPSIS
+*/
 void osm_svcr_remove_from_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log,
 			     IN osm_svcr_t * p_svcr);
+/*
+* PARAMETERS
+*	p_subn
+*		[in] Pointer to Subnet structure
+*
+*	p_log
+*		[in] Pointer to osm_log_t
+*
+*	p_svcr
+*		[in] Pointer to IB Service Record to be removed
+*
+* RETURN VALUES
+*	This function does not return a value.
+*
+* SEE ALSO
+*	Service Record, osm_svcr_insert_to_db
+*********/
 
 END_C_DECLS
 #endif				/* _OSM_SVCR_H_ */
diff --git a/include/opensm/osm_sm.h b/include/opensm/osm_sm.h
index f075abb2..d54cf75a 100644
--- a/include/opensm/osm_sm.h
+++ b/include/opensm/osm_sm.h
@@ -61,7 +61,6 @@
 #include <opensm/osm_port.h>
 #include <opensm/osm_db.h>
 #include <opensm/osm_remote_sm.h>
-#include <opensm/osm_multicast.h>
 
 #ifdef __cplusplus
 #  define BEGIN_C_DECLS extern "C" {
diff --git a/include/opensm/osm_sm_mad_ctrl.h b/include/opensm/osm_sm_mad_ctrl.h
index 8969835b..4ec1e83a 100644
--- a/include/opensm/osm_sm_mad_ctrl.h
+++ b/include/opensm/osm_sm_mad_ctrl.h
@@ -115,6 +115,9 @@ typedef struct osm_sm_mad_ctrl {
 *	p_mad_pool
 *		Pointer to the MAD pool.
 *
+*	p_vl15
+*		Pointer to the VL15 interface object.
+*
 *	p_vendor
 *		Pointer to the vendor specific interfaces object.
 *
@@ -135,7 +138,6 @@ typedef struct osm_sm_mad_ctrl {
 *
 * SEE ALSO
 *	SM MAD Controller object
-*	SM MADr object
 *********/
 
 /****f* OpenSM: SM MAD Controller/osm_sm_mad_ctrl_construct
@@ -223,6 +225,9 @@ ib_api_status_t osm_sm_mad_ctrl_init(IN osm_sm_mad_ctrl_t * p_ctrl,
 *	p_ctrl
 *		[in] Pointer to an osm_sm_mad_ctrl_t object to initialize.
 *
+*	p_subn
+*		[in] Pointer to the subnet object.
+*
 *	p_mad_pool
 *		[in] Pointer to the MAD pool.
 *
diff --git a/include/opensm/osm_ucast_cache.h b/include/opensm/osm_ucast_cache.h
index e186590f..316a7f61 100644
--- a/include/opensm/osm_ucast_cache.h
+++ b/include/opensm/osm_ucast_cache.h
@@ -89,7 +89,7 @@ struct osm_ucast_mgr;
 *
 * SYNOPSIS
 */
-void osm_ucast_cache_invalidate(struct osm_ucast_mgr *p_mgr);
+void osm_ucast_cache_invalidate(IN struct osm_ucast_mgr *p_mgr);
 /*
 * PARAMETERS
 *	p_mgr
@@ -115,19 +115,27 @@ void osm_ucast_cache_invalidate(struct osm_ucast_mgr *p_mgr);
 *
 * SYNOPSIS
 */
-void osm_ucast_cache_check_new_link(struct osm_ucast_mgr *p_mgr,
-				    osm_node_t * p_node_1, uint8_t port_num_1,
-				    osm_node_t * p_node_2, uint8_t port_num_2);
+void osm_ucast_cache_check_new_link(IN struct osm_ucast_mgr *p_mgr,
+				    IN osm_node_t * p_node_1,
+				    IN uint8_t port_num_1,
+				    IN osm_node_t * p_node_2,
+				    IN uint8_t port_num_2);
 /*
 * PARAMETERS
 *	p_mgr
 *		[in] Pointer to the unicast manager object.
 *
-*	physp1
-*		[in] Pointer to the first physical port of the link.
+*	p_node_1
+*		[in] Pointer to the first node of the link.
 *
-*	physp2
-*		[in] Pointer to the second physical port of the link.
+*	port_num_1
+*		[in] Port number of the first node.
+*
+*	p_node_2
+*		[in] Pointer to the second node of the link.
+*
+*	port_num_2
+*		[in] Port number of the second node.
 *
 * RETURN VALUE
 *	This function does not return any value.
@@ -151,8 +159,9 @@ void osm_ucast_cache_check_new_link(struct osm_ucast_mgr *p_mgr,
 *
 * SYNOPSIS
 */
-void osm_ucast_cache_add_link(struct osm_ucast_mgr *p_mgr,
-			      osm_physp_t * physp1, osm_physp_t * physp2);
+void osm_ucast_cache_add_link(IN struct osm_ucast_mgr *p_mgr,
+			      IN osm_physp_t * physp1,
+			      IN osm_physp_t * physp2);
 /*
 * PARAMETERS
 *	p_mgr
@@ -188,7 +197,8 @@ void osm_ucast_cache_add_link(struct osm_ucast_mgr *p_mgr,
 *
 * SYNOPSIS
 */
-void osm_ucast_cache_add_node(struct osm_ucast_mgr *p_mgr, osm_node_t * p_node);
+void osm_ucast_cache_add_node(IN struct osm_ucast_mgr *p_mgr,
+			      IN osm_node_t * p_node);
 /*
 * PARAMETERS
 *	p_mgr
@@ -218,7 +228,7 @@ void osm_ucast_cache_add_node(struct osm_ucast_mgr *p_mgr, osm_node_t * p_node);
 *
 * SYNOPSIS
 */
-int osm_ucast_cache_process(struct osm_ucast_mgr *p_mgr);
+int osm_ucast_cache_process(IN struct osm_ucast_mgr *p_mgr);
 /*
 * PARAMETERS
 *	p_mgr
diff --git a/include/opensm/osm_ucast_mgr.h b/include/opensm/osm_ucast_mgr.h
index b9c1ca12..5f4ce460 100644
--- a/include/opensm/osm_ucast_mgr.h
+++ b/include/opensm/osm_ucast_mgr.h
@@ -116,12 +116,15 @@ typedef struct osm_ucast_mgr {
 *	p_lock
 *		Pointer to the serializing lock.
 *
-*	is_dor
-*		Dimension Order Routing (DOR) will be done
+*	max_lid
+*		Max LID of all the switches in the subnet.
 *
 *	port_order_list
 *		List of ports ordered for routing.
 *
+*	is_dor
+*		Dimension Order Routing (DOR) will be done
+*
 *	some_hop_count_set
 *		Initialized to FALSE at the beginning of each the min hop
 *		tables calculation iteration cycle, set to TRUE to indicate
diff --git a/include/opensm/osm_vl15intf.h b/include/opensm/osm_vl15intf.h
index b024b23a..589e03a3 100644
--- a/include/opensm/osm_vl15intf.h
+++ b/include/opensm/osm_vl15intf.h
@@ -92,7 +92,7 @@ BEGIN_C_DECLS
 *	osm_vl15_state_t
 *
 * DESCRIPTION
-*	Enumerates the possible states of SM object.
+*	Enumerates the possible states of OpenSM VL15 object.
 *
 * SYNOPSIS
 */
@@ -150,6 +150,9 @@ typedef struct osm_vl15 {
 *	signal
 *		Event on which the poller sleeps.
 *
+*	poller
+*		Worker thread pool that services the fifo to transmit VL15 MADs
+*
 *	rfifo
 *		First-in First-out queue for outbound VL15 MADs for which
 *		a response is expected, aka the "response fifo"
@@ -158,9 +161,6 @@ typedef struct osm_vl15 {
 *		First-in First-out queue for outbound VL15 MADs for which
 *		no response is expected, aka the "unicast fifo".
 *
-*	poller
-*		Worker thread pool that services the fifo to transmit VL15 MADs
-*
 *	lock
 *		Spinlock guarding the FIFO.
 *
@@ -224,8 +224,8 @@ void osm_vl15_destroy(IN osm_vl15_t * p_vl15, IN struct osm_mad_pool *p_pool);
 *	p_vl15
 *		[in] Pointer to a VL15 object to destroy.
 *
-*  p_pool
-*     [in] The pointer to the mad pool to return outstanding mads to
+*	p_pool
+*		[in] The pointer to the mad pool to return outstanding mads to
 *
 * RETURN VALUE
 *	This function does not return a value.
@@ -240,11 +240,6 @@ void osm_vl15_destroy(IN osm_vl15_t * p_vl15, IN struct osm_mad_pool *p_pool);
 *	VL15 object, osm_vl15_construct, osm_vl15_init
 *********/
 
-/*
-	Initialization.
-	Rate specifies the minimum number of microseconds between transmissions
-	on VL15.
-*/
 /****f* OpenSM: VL15/osm_vl15_init
 * NAME
 *	osm_vl15_init
@@ -372,8 +367,8 @@ void osm_vl15_shutdown(IN osm_vl15_t * p_vl, IN osm_mad_pool_t * p_mad_pool);
 *	p_vl15
 *		[in] Pointer to an osm_vl15_t object.
 *
-*  p_mad_pool
-*     [in] The MAD pool owning the mads.
+*	p_mad_pool
+*		[in] The MAD pool owning the mads.
 *
 * RETURN VALUES
 *	None.
diff --git a/include/vendor/osm_vendor_ibumad.h b/include/vendor/osm_vendor_ibumad.h
index 847ef8a7..e26afd3b 100644
--- a/include/vendor/osm_vendor_ibumad.h
+++ b/include/vendor/osm_vendor_ibumad.h
@@ -169,7 +169,7 @@ typedef struct _osm_vendor {
 	char issm_path[256];
 } osm_vendor_t;
 
-#define OSM_BIND_INVALID_HANDLE 0
+#define OSM_BIND_INVALID_HANDLE NULL
 
 typedef struct _osm_vend_wrap {
 	int agent;
diff --git a/libopensm/Makefile.am b/libopensm/Makefile.am
new file mode 100644
index 00000000..ded0cadb
--- /dev/null
+++ b/libopensm/Makefile.am
@@ -0,0 +1,29 @@
+
+AM_CPPFLAGS = -I$(srcdir)/../include
+
+lib_LTLIBRARIES = libopensm.la
+
+if DEBUG
+DBGFLAGS = -ggdb -D_DEBUG_
+else
+DBGFLAGS = -g
+endif
+
+libopensm_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_GNU_SOURCE=1
+
+if HAVE_LD_VERSION_SCRIPT
+    libopensm_version_script = -Wl,--version-script=$(srcdir)/libopensm.map
+else
+    libopensm_version_script =
+endif
+
+opensm_api_version=$(shell grep LIBVERSION= $(srcdir)/libopensm.ver | sed 's/LIBVERSION=//')
+
+libopensm_la_SOURCES = osm_log.c osm_helper.c
+
+libopensm_la_LIBADD = -L../complib -losmcomp
+libopensm_la_LDFLAGS = -version-info $(opensm_api_version) \
+	 -export-dynamic $(libopensm_version_script)
+libopensm_la_DEPENDENCIES = $(srcdir)/libopensm.map
+
+EXTRA_DIST = $(srcdir)/libopensm.map $(srcdir)/libopensm.ver
diff --git a/opensm/libopensm.map b/libopensm/libopensm.map
similarity index 93%
rename from opensm/libopensm.map
rename to libopensm/libopensm.map
index bd90dfbc..28a3e0aa 100644
--- a/opensm/libopensm.map
+++ b/libopensm/libopensm.map
@@ -6,13 +6,6 @@ OPENSM_1.5 {
 		osm_log_init;
 		osm_log_init_v2;
 		osm_log_reopen_file;
-		osm_mad_pool_construct;
-		osm_mad_pool_destroy;
-		osm_mad_pool_init;
-		osm_mad_pool_get;
-		osm_mad_pool_put;
-		osm_mad_pool_get_wrapper;
-		osm_mad_pool_get_wrapper_raw;
 		ib_get_sa_method_str;
 		ib_get_sm_method_str;
 		ib_get_sm_attr_str;
diff --git a/opensm/libopensm.ver b/libopensm/libopensm.ver
similarity index 95%
rename from opensm/libopensm.ver
rename to libopensm/libopensm.ver
index a2b4a6eb..db42512c 100644
--- a/opensm/libopensm.ver
+++ b/libopensm/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=8:0:0
+LIBVERSION=9:0:0
diff --git a/opensm/osm_helper.c b/libopensm/osm_helper.c
similarity index 99%
rename from opensm/osm_helper.c
rename to libopensm/osm_helper.c
index e6277582..9791172f 100644
--- a/opensm/osm_helper.c
+++ b/libopensm/osm_helper.c
@@ -3214,7 +3214,8 @@ static const char *lsea_str_fixed_width[] = {
 	"Std ",
 	"14  ",
 	"25  ",
-	"50"
+	"????",
+	"50  "
 };
 
 const char *osm_get_lsa_str(IN uint8_t lsa, IN uint8_t lsea, IN uint8_t state,
diff --git a/opensm/osm_log.c b/libopensm/osm_log.c
similarity index 100%
rename from opensm/osm_log.c
rename to libopensm/osm_log.c
diff --git a/libvendor/Makefile.am b/libvendor/Makefile.am
index 2ddf780d..f39545e2 100644
--- a/libvendor/Makefile.am
+++ b/libvendor/Makefile.am
@@ -27,7 +27,8 @@ COMM_HDRS= $(srcdir)/../include/vendor/osm_vendor_api.h \
 
 if OSMV_OPENIB
 libosmvendor_la_SOURCES = osm_vendor_ibumad.c \
-			  osm_vendor_ibumad_sa.c
+			  osm_vendor_ibumad_sa.c \
+			  osm_mad_pool.c
 HDRS =$(COMM_HDRS) $(srcdir)/../include/vendor/osm_vendor_ibumad.h
 endif
 if OSMV_SIM
@@ -40,7 +41,8 @@ libosmvendor_la_SOURCES = osm_vendor_mlx.c \
 		osm_vendor_mlx_sender.c \
 		osm_vendor_mlx_txn.c \
 		osm_vendor_mlx_sa.c \
-		osm_pkt_randomizer.c
+		osm_pkt_randomizer.c \
+		osm_mad_pool.c
 HDRS =$(COMM_HDRS) $(srcdir)/../include/vendor/osm_vendor_mlx.h \
 	$(srcdir)/../include/vendor/osm_pkt_randomizer.h
 endif
@@ -54,7 +56,8 @@ libosmvendor_la_SOURCES = osm_vendor_mlx.c \
 		osm_vendor_mlx_sender.c \
 		osm_vendor_mlx_ts.c \
 		osm_vendor_mlx_txn.c \
-		osm_vendor_mlx_sa.c
+		osm_vendor_mlx_sa.c \
+		osm_mad_pool.c
 HDRS =$(COMM_HDRS) $(srcdir)/../include/vendor/osm_vendor_mlx.h \
 	$(srcdir)/../include/vendor/osm_pkt_randomizer.h
 endif
@@ -68,12 +71,13 @@ libosmvendor_la_SOURCES = osm_vendor_mlx.c \
 		osm_vendor_mlx_sender.c \
 		osm_vendor_mlx_ibmgt.c \
 		osm_vendor_mlx_txn.c \
-		osm_vendor_mlx_sa.c
+		osm_vendor_mlx_sa.c \
+		osm_mad_pool.c
 HDRS =$(COMM_HDRS) $(srcdir)/../include/vendor/osm_vendor_mlx.h \
 	$(srcdir)/../include/vendor/osm_pkt_randomizer.h
 endif
 
-libosmvendor_la_LIBADD = -L../complib -losmcomp
+libosmvendor_la_LIBADD = -L../complib -losmcomp -L../libopensm -lopensm
 libosmvendor_la_LDFLAGS = -version-info $(osmvendor_api_version) \
 	-export-dynamic $(libosmvendor_version_script)
 libosmvendor_la_DEPENDENCIES = $(srcdir)/libosmvendor.map
diff --git a/libvendor/libosmvendor.map b/libvendor/libosmvendor.map
index 17416b35..f8b70af0 100644
--- a/libvendor/libosmvendor.map
+++ b/libvendor/libosmvendor.map
@@ -16,5 +16,12 @@ OSMVENDOR_2.0 {
 		osmv_bind_sa;
 		osmv_query_sa;
 		osm_vendor_get_guid_ca_and_port;
+		osm_mad_pool_construct;
+		osm_mad_pool_destroy;
+		osm_mad_pool_init;
+		osm_mad_pool_get;
+		osm_mad_pool_put;
+		osm_mad_pool_get_wrapper;
+		osm_mad_pool_get_wrapper_raw;
 	local: *;
 };
diff --git a/libvendor/libosmvendor.ver b/libvendor/libosmvendor.ver
index 9387d90b..0de127bf 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:3:0
+LIBVERSION=5:0:0
diff --git a/opensm/osm_mad_pool.c b/libvendor/osm_mad_pool.c
similarity index 98%
rename from opensm/osm_mad_pool.c
rename to libvendor/osm_mad_pool.c
index 9bd9a4b7..5e15944c 100644
--- a/opensm/osm_mad_pool.c
+++ b/libvendor/osm_mad_pool.c
@@ -150,8 +150,8 @@ osm_madw_t *osm_mad_pool_get_wrapper_raw(IN osm_mad_pool_t * p_pool)
 	if (!p_madw)
 		return NULL;
 
-	osm_madw_init(p_madw, 0, 0, 0);
-	osm_madw_set_mad(p_madw, 0);
+	osm_madw_init(p_madw, NULL, 0, NULL);
+	osm_madw_set_mad(p_madw, NULL);
 	cl_atomic_inc(&p_pool->mads_out);
 
 	return p_madw;
diff --git a/libvendor/osm_vendor_ibumad.c b/libvendor/osm_vendor_ibumad.c
index 92696d3e..74db9eb8 100644
--- a/libvendor/osm_vendor_ibumad.c
+++ b/libvendor/osm_vendor_ibumad.c
@@ -56,6 +56,7 @@
 #include <stdlib.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <linux/types.h>	/* for __be64 with older libibumad */
 
 #include <iba/ib_types.h>
 #include <complib/cl_qlist.h>
@@ -720,7 +721,7 @@ static int
 osm_vendor_open_port(IN osm_vendor_t * const p_vend,
 		     IN const ib_net64_t port_guid)
 {
-	ib_net64_t portguids[OSM_UMAD_MAX_PORTS_PER_CA + 1];
+	__be64 portguids[OSM_UMAD_MAX_PORTS_PER_CA + 1];
 	umad_ca_t umad_ca;
 	int i = 0, umad_port_id = -1;
 	char *name;
diff --git a/libvendor/osm_vendor_mlx_hca_sim.c b/libvendor/osm_vendor_mlx_hca_sim.c
index 15df23ee..a3055a3e 100644
--- a/libvendor/osm_vendor_mlx_hca_sim.c
+++ b/libvendor/osm_vendor_mlx_hca_sim.c
@@ -136,13 +136,10 @@ int __hca_sim_get_num_cas(void)
 		}
 		closedir(dp);
 	} else {
-		printf("__hca_sim_get_num_cas: ERROR : ail to open dir %s\n",
+		printf("__hca_sim_get_num_cas: ERROR: fail to open dir %s\n",
 		       __get_simulator_dir());
-		exit(1);
 	}
 
-	if (!num_cas)
-		exit(1);
 	return num_cas;
 }
 
diff --git a/libvendor/osm_vendor_mlx_sim.c b/libvendor/osm_vendor_mlx_sim.c
index c02c4de5..d2b2b647 100644
--- a/libvendor/osm_vendor_mlx_sim.c
+++ b/libvendor/osm_vendor_mlx_sim.c
@@ -167,6 +167,7 @@ osmv_transport_init(IN osm_bind_info_t * p_info,
 	   validate the target guid */
 	if (osm_vendor_get_guid_by_ca_and_port
 	    (p_bo->p_vendor, hca_id, p_bo->port_num, &port_guid)) {
+		free(p_mgr);
 		return IB_INVALID_GUID;
 	}
 
@@ -175,7 +176,8 @@ osmv_transport_init(IN osm_bind_info_t * p_info,
 			 (void *)p_bo);
 	if (!conHdl) {
 		printf("fail to connect to the server.\n");
-		exit(1);
+		free(p_mgr);
+		return IB_ERROR;
 	}
 
 	/*
diff --git a/man/opensm.8.in b/man/opensm.8.in
index df557682..2b6696de 100644
--- a/man/opensm.8.in
+++ b/man/opensm.8.in
@@ -11,6 +11,7 @@ opensm \- InfiniBand subnet manager and administration (SM/SA)
 [\-g(uid) <GUID in hex>]
 [\-l(mc) <LMC>]
 [\-p(riority) <PRIORITY>]
+[\-\-subnet_prefix <PREFIX in hex>]
 [\-\-smkey <SM_Key>]
 [\-\-sm_sl <SL number>]
 [\-r(eassign_lids)]
@@ -42,6 +43,7 @@ opensm \- InfiniBand subnet manager and administration (SM/SA)
 [\-w | \-\-hop_weights_file <path to file>]
 [\-O | \-\-port_search_ordering_file <path to file>]
 [\-O | \-\-dimn_ports_file <path to file>] (DEPRECATED)
+[\-\-dump_files_dir <directory-name>]
 [\-f <log file path> | \-\-log_file <log file path> ]
 [\-L | \-\-log_limit <size in MB>] [\-e(rase_log_file)]
 [\-P(config) <partition config file> ]
@@ -136,6 +138,11 @@ This will effect the handover cases, where master
 is chosen by priority and GUID.  Range goes from 0
 (default and lowest priority) to 15 (highest).
 .TP
+\fB\-\-subnet_prefix\fR <PREFIX in hex>
+This option specifies the subnet prefix to use in
+on the fabric.  The default prefix is
+0xfe80000000000000.
+.TP
 \fB\-\-smkey\fR <SM_Key value>
 This option specifies the SM\'s SM_Key (64 bits).
 This will effect SM authentication.
@@ -178,7 +185,7 @@ This option sets the maximum number of VLs to use for the Nue routing engine.
 Every number greater or equal to 0 is allowed, and the default is 1 to enforce
 deadlock-freedom even if QoS is not enabled. If set to 0, then Nue routing will
 automatically determine and choose maximum supported by the fabric. And if set
-to any interger >= 1, then Nue uses min(max_supported,nue_max_num_vls).
+to any integer >= 1, then Nue uses min(max_supported,nue_max_num_vls).
 Rule of thumb is: higher nue_max_num_vls results in better path balancing.
 .TP
 \fB\-A\fR, \fB\-\-ucast_cache\fR
@@ -359,6 +366,9 @@ when it comes out of Standby state, if such file exists
 under OSM_CACHE_DIR, and is valid.
 By default, this is FALSE.
 .TP
+\fB\-\-dump_files_dir <directory name>
+This option will set the directory to hold the file dumps.
+.TP
 \fB\-f\fR, \fB\-\-log_file\fR <file name>
 This option defines the log to be the given file.
 By default, the log goes to /var/log/opensm.log.
@@ -524,14 +534,16 @@ The following environment variables control opensm behavior:
 
 OSM_TMP_DIR - controls the directory in which the temporary files generated by
 opensm are created. These files are: opensm-subnet.lst, opensm.fdbs, and
-opensm.mcfdbs. By default, this directory is /var/log.
+opensm.mcfdbs. By default, this directory is /var/log. Note that
+\-\-dump_files_dir command line option or dump_file_dir option in
+option/config file takes precedence over this environment variable.
 
 OSM_CACHE_DIR - opensm stores certain data to the disk such that subsequent
 runs are consistent. The default directory used is /var/cache/opensm.
 The following files are included in it:
 
  guid2lid  - stores the LID range assigned to each GUID
- guid2mkey - stores the MKey previously assiged to each GUID
+ guid2mkey - stores the MKey previously assigned to each GUID
  neighbors - stores a map of the GUIDs at either end of each link
              in the fabric
 
@@ -581,7 +593,9 @@ General file format:
 <Partition Definition>:[<newline>]<Partition Properties>;
 
      Partition Definition:
+.nf
        [PartitionName][=PKey][,indx0][,ipoib_bc_flags][,defmember=full|limited]
+.fi
 
         PartitionName  - string, will be used with logging. When
                          omitted, empty string will be used.
@@ -745,8 +759,10 @@ Typical default values (hard-coded in OpenSM initialization) are:
 
  qos_max_vls 15
  qos_high_limit 0
+.nf
  qos_vlarb_low 0:0,1:4,2:4,3:4,4:4,5:4,6:4,7:4,8:4,9:4,10:4,11:4,12:4,13:4,14:4
  qos_vlarb_high 0:4,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0
+.fi
  qos_sl2vl 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,7
 
 The syntax is compatible with rest of OpenSM configuration options and
@@ -932,7 +948,7 @@ in terms of the underlying topology.
 
 10. Nue unicast routing algorithm - a 100%-applicable and deadlock-free routing
 which can be used for any arbitrary or faulty network topology and any number
-of virtual lanes (this includes the absense of VLs as well). Paths are globally
+of virtual lanes (this includes the absence of VLs as well). Paths are globally
 balanced w.r.t the number of routes per link, and are kept as short as possible
 while enforcing deadlock-freedom within the VL constraint.
 
@@ -1548,7 +1564,7 @@ To learn more about the Nue routing algorithm, see the article "Routing on the
 Dependency Graph: A New Approach to Deadlock-Free High-Performance Routing" by
 J. Domke, T. Hoefler and S. Matsuoka (published in HPDC'16).
 
-Modular Routine Engine
+Modular Routing Engine
 
 Modular routing engine structure allows for the ease of
 "plugging" new routing modules.
diff --git a/man/torus-2QoS.8.in b/man/torus-2QoS.8.in
index f1920668..2122a009 100644
--- a/man/torus-2QoS.8.in
+++ b/man/torus-2QoS.8.in
@@ -381,7 +381,7 @@ will not be placed into the torus.
 .
 .SH QUALITY OF SERVICE CONFIGURATION
 .
-OpenSM will not program switchs and channel adapters with
+OpenSM will not program switches and channel adapters with
 SL2VL maps or VL arbitration configuration unless it is invoked with -Q.
 Since torus-2QoS depends on such functionality for correct operation,
 always invoke OpenSM with -Q when torus-2QoS is in the list of routing
diff --git a/opensm.spec.in b/opensm.spec.in
index a96dbb54..470e63f9 100644
--- a/opensm.spec.in
+++ b/opensm.spec.in
@@ -31,8 +31,8 @@ Version: @VERSION@
 Release: %rel%{?dist}
 License: GPLv2 or BSD
 Group: System Environment/Daemons
-URL: http://openfabrics.org/
-Source: http://www.openfabrics.org/downloads/management/@TARBALL@
+URL: https://github.com/linux-rdma/opensm
+Source: https://github.com/linux-rdma/opensm/releases/download/@VERSION@/@TARBALL@
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: libibumad-devel, libtool, gcc, bison, flex
 Requires: %{name}-libs = %{version}-%{release}, logrotate
diff --git a/opensm/Makefile.am b/opensm/Makefile.am
index 658cc86d..8aa68273 100644
--- a/opensm/Makefile.am
+++ b/opensm/Makefile.am
@@ -3,30 +3,14 @@ AM_CPPFLAGS = $(OSMV_INCLUDES) $(METIS_INCLUDES)
 
 AM_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_GNU_SOURCE=1
 
-lib_LTLIBRARIES = libopensm.la
-
 if DEBUG
 DBGFLAGS = -ggdb -D_DEBUG_
 else
 DBGFLAGS = -g
 endif
 
-if HAVE_LD_VERSION_SCRIPT
-libopensm_version_script = -Wl,--version-script=$(srcdir)/libopensm.map
-else
-libopensm_version_script =
-endif
-
-opensm_api_version=$(shell grep LIBVERSION= $(srcdir)/libopensm.ver | sed 's/LIBVERSION=//')
-
-libopensm_la_SOURCES = osm_log.c osm_mad_pool.c osm_helper.c
-libopensm_la_LDFLAGS = -version-info $(opensm_api_version) \
-	-export-dynamic $(libopensm_version_script)
-libopensm_la_DEPENDENCIES = $(srcdir)/libopensm.map
-
 sbin_PROGRAMS = opensm
 opensm_LDFLAGS = -rdynamic
-opensm_DEPENDENCIES = libopensm.la
 opensm_SOURCES = main.c osm_console_io.c osm_console.c osm_db_files.c \
 		 osm_db_pack.c osm_drop_mgr.c osm_guid_info_rcv.c \
 		 osm_guid_mgr.c osm_inform.c osm_lid_mgr.c osm_lin_fwd_rcv.c \
@@ -64,12 +48,11 @@ AM_YFLAGS:= -d
 
 # we need to be able to load libraries from local build subtree before make install
 # we always give precedence to local tree libs and then use the pre-installed ones.
-opensm_LDADD = -L../complib -losmcomp -L../libvendor -losmvendor -L. -lopensm $(OSMV_LDADD) $(METIS_LDADD)
+opensm_LDADD = -L../complib -losmcomp -L../libopensm -lopensm -L../libvendor -losmvendor $(OSMV_LDADD) $(METIS_LDADD)
 
 opensmincludedir = $(includedir)/infiniband/opensm
 
 opensminclude_HEADERS = \
-	$(srcdir)/../include/opensm/osm_attrib_req.h \
 	$(srcdir)/../include/opensm/osm_base.h \
 	$(srcdir)/../include/opensm/osm_console.h \
 	$(srcdir)/../include/opensm/osm_console_io.h \
@@ -135,5 +118,4 @@ osm_version:
 	fi
 
 # files distributed as part of the srcdir
-EXTRA_DIST = $(srcdir)/libopensm.map $(srcdir)/libopensm.ver \
-	     $(srcdir)/ChangeLog
+EXTRA_DIST = $(srcdir)/ChangeLog
diff --git a/opensm/main.c b/opensm/main.c
index 2d23fe2b..6f4ecf27 100644
--- a/opensm/main.c
+++ b/opensm/main.c
@@ -161,6 +161,9 @@ static void show_usage(void)
 	       "          This will effect the handover cases, where master\n"
 	       "          is chosen by priority and GUID.  Range goes\n"
 	       "          from 0 (lowest priority) to 15 (highest).\n\n");
+	printf("--subnet_prefix <prefix>\n"
+	       "          Set the subnet prefix to something other than the\n"
+	       "          default value of 0xfe80000000000000\n\n");
 	printf("--smkey, -k <SM_Key>\n"
 	       "          This option specifies the SM's SM_Key (64 bits).\n"
 	       "          This will effect SM authentication.\n"
@@ -198,7 +201,7 @@ static void show_usage(void)
 	       "          Sets the maximum number of VLs to be used by Nue routing.\n"
 	       "          Defaults to 1 to enforce deadlock-freedom even if QoS is not\n"
 	       "          enabled. Set to 0 if Nue should automatically determine and\n"
-	       "          choose maximum supported by the fabric, or any interger >= 1.\n\n");
+	       "          choose maximum supported by the fabric, or any integer >= 1.\n\n");
 	printf("--connect_roots, -z\n"
 	       "          This option enforces routing engines (up/down and \n"
 	       "          fat-tree) to make connectivity between root switches\n"
@@ -319,6 +322,8 @@ static void show_usage(void)
 	       "          This option forces OpenSM to honor the guid2lid file,\n"
 	       "          when it comes out of Standby state, if such file exists\n"
 	       "          under OSM_CACHE_DIR, and is valid. By default, this is FALSE.\n\n");
+	printf("--dump_files_dir <directory-name>"
+	       "          The directory to hold the file dumps.\n");
 	printf("--log_file, -f <log-file-name>\n"
 	       "          This option defines the log to be the given file.\n"
 	       "          By default, the log goes to /var/log/opensm.log.\n"
@@ -499,7 +504,7 @@ static ib_net64_t get_port_guid(IN osm_opensm_t * p_osm, uint64_t port_guid)
 		fflush(stdout);
 		if (scanf("%u", &choice) <= 0) {
 			char junk[128];
-			if (scanf("%s", junk) <= 0)
+			if (scanf("%127s", junk) <= 0)
 				printf("\nError: Cannot scan!\n");
 		} else if (choice == 0)
 			return 0;
@@ -665,6 +670,7 @@ int main(int argc, char *argv[])
 		{"once", 0, NULL, 'o'},
 		{"reassign_lids", 0, NULL, 'r'},
 		{"priority", 1, NULL, 'p'},
+		{"subnet_prefix", 1, NULL, 16},
 		{"smkey", 1, NULL, 'k'},
 		{"routing_engine", 1, NULL, 'R'},
 		{"ucast_cache", 0, NULL, 'A'},
@@ -702,6 +708,7 @@ int main(int argc, char *argv[])
 		{"torus_config", 1, NULL, 10},
 		{"guid_routing_order_no_scatter", 0, NULL, 13},
 		{"nue_max_num_vls", 1, NULL, 15},
+		{"dump_files_dir", 1, NULL, 17},
 		{NULL, 0, NULL, 0}	/* Required at the end of the array */
 	};
 
@@ -1008,6 +1015,11 @@ int main(int argc, char *argv[])
 			printf(" Priority = %d\n", temp);
 			break;
 
+		case 16:
+			opt.subnet_prefix = cl_hton64(strtoull(optarg, NULL, 16));
+			printf(" Subnet_Prefix = <0x%" PRIx64 ">\n", cl_hton64(opt.subnet_prefix));
+			break;
+
 		case 'k':
 			sm_key = cl_hton64(strtoull(optarg, NULL, 16));
 			printf(" SM Key <0x%" PRIx64 ">\n", cl_hton64(sm_key));
@@ -1153,7 +1165,7 @@ int main(int argc, char *argv[])
 			break;
 		case 15:
 			temp = strtoul(optarg, NULL, 0);
-			if (temp < 0 || temp >= IB_MAX_NUM_VLS) {
+			if (temp >= IB_MAX_NUM_VLS) {
 				fprintf(stderr,
 					"ERROR: maximum #VLs for nue routing must be between 0 and %d\n",
 					IB_MAX_NUM_VLS);
@@ -1162,6 +1174,9 @@ int main(int argc, char *argv[])
 			opt.nue_max_num_vls = (uint8_t) temp;
 			printf(" Nue maximum #VLs = %d\n", opt.nue_max_num_vls);
 			break;
+		case 17:
+			SET_STR_OPT(opt.dump_files_dir, optarg);
+			break;
 		case 'h':
 		case '?':
 		case ':':
@@ -1203,7 +1218,10 @@ int main(int argc, char *argv[])
 		daemonize(&osm);
 	}
 
-	complib_init();
+	if (complib_init_v2() != CL_SUCCESS) {
+		printf("\ncomplib_init_v2 error\n");
+		return -1;
+	}
 
 	status = osm_opensm_init(&osm, &opt);
 	if (status != IB_SUCCESS) {
diff --git a/opensm/osm_congestion_control.c b/opensm/osm_congestion_control.c
index bfcd8a59..74a35c63 100644
--- a/opensm/osm_congestion_control.c
+++ b/opensm/osm_congestion_control.c
@@ -127,7 +127,7 @@ static void cc_setup_mad_data(osm_sm_t * p_sm)
 	osm_congestion_control_t *p_cc = &p_sm->p_subn->p_osm->cc;
 	osm_subn_opt_t *p_opt = &p_sm->p_subn->opt;
 	uint16_t ccti_limit;
-	int i;
+	unsigned i;
 
 	/* Switch Congestion Setting */
 	p_cc->sw_cong_setting.control_map = p_opt->cc_sw_cong_setting_control_map;
diff --git a/opensm/osm_db_files.c b/opensm/osm_db_files.c
index fd9f2fe3..f93fac91 100644
--- a/opensm/osm_db_files.c
+++ b/opensm/osm_db_files.c
@@ -67,18 +67,6 @@
 #define OSM_DB_MAX_LINE_LEN 1024
 /**********/
 
-/****d* Database/OSM_DB_MAX_GUID_LEN
- * NAME
- * OSM_DB_MAX_GUID_LEN
- *
- * DESCRIPTION
- * The Maximal word length allowed for the file (guid or lid)
- *
- * SYNOPSIS
- */
-#define OSM_DB_MAX_GUID_LEN 32
-/**********/
-
 /****s* OpenSM: Database/osm_db_domain_imp
  * NAME
  * osm_db_domain_imp
@@ -351,15 +339,6 @@ int osm_db_restore(IN osm_db_domain_t * p_domain)
 					status = 1;
 					goto EndParsing;
 				}
-				if (strlen(p_first_word) > OSM_DB_MAX_GUID_LEN) {
-					OSM_LOG(p_log, OSM_LOG_ERROR,
-						"ERR 610A: "
-						"Illegal key from line:%u : %s (file:%s)\n",
-						line_num, sLine,
-						p_domain_imp->file_name);
-					status = 1;
-					goto EndParsing;
-				}
 
 				p_key = malloc(sizeof(char) *
 					       (strlen(p_first_word) + 1));
diff --git a/opensm/osm_event_plugin.c b/opensm/osm_event_plugin.c
index ae73783e..ee62a2f2 100644
--- a/opensm/osm_event_plugin.c
+++ b/opensm/osm_event_plugin.c
@@ -103,7 +103,7 @@ osm_epi_plugin_t *osm_epi_construct(osm_opensm_t *osm, char *plugin_name)
 	old_impl = (struct old_if *) rc->impl;
 	if (old_impl->ver == OSM_ORIG_EVENT_PLUGIN_INTERFACE_VER) {
 		OSM_LOG(&osm->log, OSM_LOG_ERROR, "Error loading plugin: "
-			"\'%s\' contains a depricated interface version %d\n"
+			"\'%s\' contains a deprecated interface version %d\n"
 			"   Please recompile with the new interface.\n",
 			plugin_name, old_impl->ver);
 		goto Exit;
diff --git a/opensm/osm_link_mgr.c b/opensm/osm_link_mgr.c
index 64ddaf7d..ca693753 100644
--- a/opensm/osm_link_mgr.c
+++ b/opensm/osm_link_mgr.c
@@ -112,6 +112,7 @@ static int link_mgr_set_physp_pi(osm_sm_t * sm, IN osm_physp_t * p_physp,
 	OSM_LOG_ENTER(sm->p_log);
 
 	p_node = osm_physp_get_node_ptr(p_physp);
+	CL_ASSERT(p_node);
 
 	p_old_pi = &p_physp->port_info;
 
@@ -125,6 +126,7 @@ static int link_mgr_set_physp_pi(osm_sm_t * sm, IN osm_physp_t * p_physp,
 		if (!p_pi->base_lid) {
 			p_port = osm_get_port_by_guid(sm->p_subn,
 						      osm_physp_get_port_guid(p_physp));
+			CL_ASSERT(p_port);
 			p_pi->base_lid = p_port->lid;
 			sm->lid_mgr.dirty = TRUE;
 			send_set = TRUE;
diff --git a/opensm/osm_mlnx_ext_port_info_rcv.c b/opensm/osm_mlnx_ext_port_info_rcv.c
index 8151bbce..e4f8521e 100644
--- a/opensm/osm_mlnx_ext_port_info_rcv.c
+++ b/opensm/osm_mlnx_ext_port_info_rcv.c
@@ -73,9 +73,10 @@ void osm_mlnx_epi_rcv_process(IN void *context, IN void *data)
 	ib_net64_t port_guid, node_guid;
 	uint8_t port_num, portnum, start_port = 1;
 
+	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_multicast.c b/opensm/osm_multicast.c
index 83177614..38f4a680 100644
--- a/opensm/osm_multicast.c
+++ b/opensm/osm_multicast.c
@@ -428,8 +428,8 @@ void osm_mgrp_delete_port(osm_subn_t * subn, osm_log_t * log, osm_mgrp_t * mgrp,
 	boolean_t mgrp_deleted = FALSE;
 
 	next_mcm_alias_guid = (osm_mcm_alias_guid_t *) cl_qmap_head(&mgrp->mcm_alias_port_tbl);
-	while (next_mcm_alias_guid != (osm_mcm_alias_guid_t *) cl_qmap_end(&mgrp->mcm_alias_port_tbl) &&
-	      !mgrp_deleted) {
+	while (!mgrp_deleted &&
+	       next_mcm_alias_guid != (osm_mcm_alias_guid_t *) cl_qmap_end(&mgrp->mcm_alias_port_tbl)) {
 		mcm_alias_guid = next_mcm_alias_guid;
 		next_mcm_alias_guid = (osm_mcm_alias_guid_t *) cl_qmap_next(&next_mcm_alias_guid->map_item);
 		if (mcm_alias_guid->p_base_mcm_port->port == port) {
diff --git a/opensm/osm_opensm.c b/opensm/osm_opensm.c
index be867fee..34721e38 100644
--- a/opensm/osm_opensm.c
+++ b/opensm/osm_opensm.c
@@ -4,6 +4,7 @@
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2009-2011 ZIH, TU Dresden, Federal Republic of Germany. All rights reserved.
  * Copyright (C) 2012-2017 Tokyo Institute of Technology. All rights reserved.
+ * Copyright (c) 2019 Fabriscale Technologies AS. 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
@@ -50,6 +51,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <complib/cl_dispatcher.h>
+#include <complib/cl_list.h>
 #include <complib/cl_passivelock.h>
 #include <opensm/osm_file_ids.h>
 #define FILE_ID OSM_FILE_OPENSM_C
@@ -64,11 +66,9 @@
 #include <opensm/osm_event_plugin.h>
 #include <opensm/osm_congestion_control.h>
 
-struct routing_engine_module {
-	const char *name;
-	int (*setup) (struct osm_routing_engine *, osm_opensm_t *);
-};
-
+/*
+ * built-in routing engine setup functions
+ */
 extern int osm_ucast_minhop_setup(struct osm_routing_engine *, osm_opensm_t *);
 extern int osm_ucast_updn_setup(struct osm_routing_engine *, osm_opensm_t *);
 extern int osm_ucast_dnup_setup(struct osm_routing_engine *, osm_opensm_t *);
@@ -81,86 +81,329 @@ extern int osm_ucast_nue_setup(struct osm_routing_engine *, osm_opensm_t *);
 extern int osm_ucast_sssp_setup(struct osm_routing_engine *, osm_opensm_t *);
 extern int osm_ucast_dfsssp_setup(struct osm_routing_engine *, osm_opensm_t *);
 
-const static struct routing_engine_module routing_modules[] = {
-	{"minhop", osm_ucast_minhop_setup},
-	{"updn", osm_ucast_updn_setup},
-	{"dnup", osm_ucast_dnup_setup},
-	{"file", osm_ucast_file_setup},
-	{"ftree", osm_ucast_ftree_setup},
-	{"lash", osm_ucast_lash_setup},
-	{"dor", osm_ucast_dor_setup},
-	{"torus-2QoS", osm_ucast_torus2QoS_setup},
-	{"nue", osm_ucast_nue_setup},
-	{"dfsssp", osm_ucast_dfsssp_setup},
-	{"sssp", osm_ucast_sssp_setup},
-	{NULL, NULL}
+/*
+ * Local types
+ */
+
+typedef struct builtin_routing_engine_module {
+	const char *name;
+	osm_routing_engine_type_t type;
+	int (*setup)(struct osm_routing_engine *re, struct osm_opensm *osm);
+} builtin_routing_engine_module_t;
+
+typedef struct routing_engine_module {
+	char *name;
+	osm_routing_engine_type_t type;
+	int (*setup)(struct osm_routing_engine *re, struct osm_opensm *osm);
+	void *context;
+} routing_engine_module_t;
+
+
+/*
+ * Local variables
+ */
+static const char *unknown_routing_engine_name = "unknown";
+
+static cl_list_t routing_modules;
+
+static osm_routing_engine_type_t last_external_routing_engine_type =
+	OSM_ROUTING_ENGINE_TYPE_EXTERNAL;
+
+static builtin_routing_engine_module_t static_routing_modules[] = {
+	{
+		"none",
+		OSM_ROUTING_ENGINE_TYPE_NONE,
+		NULL
+	},
+	{
+		"minhop",
+		OSM_ROUTING_ENGINE_TYPE_MINHOP,
+		osm_ucast_minhop_setup
+	},
+	{
+		"updn",
+		OSM_ROUTING_ENGINE_TYPE_UPDN,
+		osm_ucast_updn_setup
+	},
+	{
+		"dnup",
+		OSM_ROUTING_ENGINE_TYPE_DNUP,
+		osm_ucast_dnup_setup
+	},
+	{
+		"file",
+		OSM_ROUTING_ENGINE_TYPE_FILE,
+		osm_ucast_file_setup
+	},
+	{
+		"ftree",
+		OSM_ROUTING_ENGINE_TYPE_FTREE,
+		osm_ucast_ftree_setup
+	},
+	{
+		"lash",
+		OSM_ROUTING_ENGINE_TYPE_LASH,
+		osm_ucast_lash_setup
+	},
+	{
+		"dor",
+		OSM_ROUTING_ENGINE_TYPE_DOR,
+		osm_ucast_dor_setup
+	},
+	{
+		"torus-2QoS",
+		OSM_ROUTING_ENGINE_TYPE_TORUS_2QOS,
+		osm_ucast_torus2QoS_setup
+	},
+	{
+		"nue",
+		OSM_ROUTING_ENGINE_TYPE_NUE,
+		osm_ucast_nue_setup
+	},
+	{
+		"dfsssp",
+		OSM_ROUTING_ENGINE_TYPE_DFSSSP,
+		osm_ucast_dfsssp_setup
+	},
+	{
+		"sssp",
+		OSM_ROUTING_ENGINE_TYPE_SSSP,
+		osm_ucast_sssp_setup
+	}
 };
 
+/*
+ * Forward declarations
+ */
+
+static cl_status_t _match_routing_engine_type(
+	IN const void *const p_object, IN void *context);
+
+static cl_status_t _match_routing_engine_str(
+	IN const void *const p_object, IN void *context);
+
+static void append_routing_engine(
+	osm_opensm_t *osm, struct osm_routing_engine *routing_engine);
+
+static struct osm_routing_engine *setup_routing_engine(
+	osm_opensm_t *osm, const char *name);
+
+static void dump_routing_engine(
+	IN void *const p_object, IN void *context);
+
+static void dump_routing_engines(
+	IN osm_opensm_t *osm);
+
+static void setup_routing_engines(
+	osm_opensm_t *osm, const char *engine_names);
+
+static cl_status_t register_builtin_routing_engine(
+	IN osm_opensm_t *osm,
+	IN const builtin_routing_engine_module_t *module);
+
+static cl_status_t register_routing_engine(
+	IN osm_opensm_t *osm,
+	IN const routing_engine_module_t *module);
+
+static void destroy_routing_engines(
+	osm_opensm_t *osm);
+
+static void __free_routing_module(
+	void *p_object, void *context);
+
+static const char *routing_engine_type(
+	IN osm_routing_engine_type_t type);
+
+/** =========================================================================
+ */
+
+cl_status_t osm_register_external_routing_engine(
+	IN osm_opensm_t *osm,
+	IN const external_routing_engine_module_t *module,
+	IN void *context)
+{
+	cl_status_t status;
+	routing_engine_module_t *copy = NULL;
+
+	if (!osm || !module)
+		return CL_INVALID_PARAMETER;
+
+	OSM_LOG(&osm->log, OSM_LOG_VERBOSE,
+		"Assign type '%d' to external routing engine with name: \'%s\'\n",
+		last_external_routing_engine_type,
+		module->name);
+
+	copy = (routing_engine_module_t *) malloc(sizeof(routing_engine_module_t));
+	if (!copy) {
+		OSM_LOG(&osm->log, OSM_LOG_ERROR, "memory allocation failed\n");
+		return CL_INSUFFICIENT_MEMORY;
+	}
+
+	copy->name = strdup(module->name);
+	if (!copy->name) {
+		OSM_LOG(&osm->log, OSM_LOG_ERROR, "memory allocation failed\n");
+		__free_routing_module(copy, NULL);
+		return CL_INSUFFICIENT_MEMORY;
+	}
+
+	copy->setup = module->setup;
+	copy->type = last_external_routing_engine_type++;
+	copy->context = context;
+
+	status = register_routing_engine(osm, copy);
+	if (status != CL_SUCCESS)
+		__free_routing_module(copy, NULL);
+	return status;
+}
+
+cl_status_t register_builtin_routing_engine(
+	IN osm_opensm_t *osm,
+	IN const builtin_routing_engine_module_t *module)
+{
+	cl_status_t status;
+	routing_engine_module_t *copy;
+
+	if (!osm || !module)
+		return CL_INVALID_PARAMETER;
+
+	copy = (routing_engine_module_t *) malloc(sizeof(routing_engine_module_t));
+	if (!copy) {
+		OSM_LOG(&osm->log, OSM_LOG_ERROR, "memory allocation failed\n");
+		return CL_INSUFFICIENT_MEMORY;
+	}
+
+	copy->name = strdup(module->name);
+	if (!copy->name) {
+		OSM_LOG(&osm->log, OSM_LOG_ERROR, "memory allocation failed\n");
+		__free_routing_module(copy, NULL);
+		return CL_INSUFFICIENT_MEMORY;
+	}
+
+	copy->setup = module->setup;
+	copy->type = module->type;
+	copy->context = NULL;
+
+	status = register_routing_engine(osm, copy);
+	if (status != CL_SUCCESS)
+		__free_routing_module(copy, NULL);
+	return status;
+}
+
+cl_status_t register_routing_engine(
+	IN osm_opensm_t *osm,
+	IN const routing_engine_module_t *module)
+{
+	cl_status_t status;
+	osm_routing_engine_type_t existing_type, new_type;
+	const char *existing_routing_engine_type, *new_routing_engine_type;
+	const char *existing_routing_engine_name, *new_name;
+
+	new_type = module->type;
+	new_name = module->name;
+	new_routing_engine_type = routing_engine_type(new_type);
+
+	/* check if another routine engine has already been registered with the same name */
+	existing_type = osm_routing_engine_type(new_name);
+	if (existing_type != OSM_ROUTING_ENGINE_TYPE_UNKNOWN) {
+		existing_routing_engine_type = routing_engine_type(existing_type);
+		OSM_LOG(&osm->log, OSM_LOG_ERROR,
+			"Failed to register %s routing engine with name \'%s\': "
+			"%s routing engine with same name was already registered with type: '%d'\n",
+			new_routing_engine_type,
+			new_name,
+			existing_routing_engine_type,
+			existing_type);
+		return CL_DUPLICATE;
+	}
+	/* check if another routine engine has already been registed with the same type */
+	existing_routing_engine_name = osm_routing_engine_type_str(new_type);
+	if (strcmp(existing_routing_engine_name, unknown_routing_engine_name) != 0) {
+		existing_type = new_type;
+		existing_routing_engine_type = routing_engine_type(existing_type);
+		OSM_LOG(&osm->log, OSM_LOG_ERROR,
+			"Failed to register %s routing engine with name \'%s\': "
+			"%s routing engine with type '%d' "
+			"was already registered with name: \'%s\'\n",
+			new_routing_engine_type,
+			new_name,
+			existing_routing_engine_type,
+			existing_type,
+			existing_routing_engine_name);
+		return CL_DUPLICATE;
+	}
+
+	OSM_LOG(&osm->log, OSM_LOG_VERBOSE,
+		"Register %s routine engine with name: \'%s\' and type: '%d'\n",
+		new_routing_engine_type,
+		new_name,
+		new_type);
+
+	status = cl_list_insert_tail(&routing_modules, module);
+	return status;
+}
+
+static cl_status_t _match_routing_engine_type(
+	IN const void *const p_object, IN void *context)
+{
+	osm_routing_engine_type_t type;
+	routing_engine_module_t *module;
+
+	type = (osm_routing_engine_type_t) context;
+	module = (routing_engine_module_t *) p_object;
+
+	return module->type == type ? CL_SUCCESS : CL_NOT_FOUND;
+}
+
 const char *osm_routing_engine_type_str(IN osm_routing_engine_type_t type)
 {
-	switch (type) {
-	case OSM_ROUTING_ENGINE_TYPE_NONE:
-		return "none";
-	case OSM_ROUTING_ENGINE_TYPE_MINHOP:
-		return "minhop";
-	case OSM_ROUTING_ENGINE_TYPE_UPDN:
-		return "updn";
-	case OSM_ROUTING_ENGINE_TYPE_DNUP:
-		return "dnup";
-	case OSM_ROUTING_ENGINE_TYPE_FILE:
-		return "file";
-	case OSM_ROUTING_ENGINE_TYPE_FTREE:
-		return "ftree";
-	case OSM_ROUTING_ENGINE_TYPE_LASH:
-		return "lash";
-	case OSM_ROUTING_ENGINE_TYPE_DOR:
-		return "dor";
-	case OSM_ROUTING_ENGINE_TYPE_TORUS_2QOS:
-		return "torus-2QoS";
-	case OSM_ROUTING_ENGINE_TYPE_NUE:
-		return "nue";
-	case OSM_ROUTING_ENGINE_TYPE_DFSSSP:
-		return "dfsssp";
-	case OSM_ROUTING_ENGINE_TYPE_SSSP:
-		return "sssp";
-	default:
-		break;
+	cl_list_iterator_t iter;
+	routing_engine_module_t *module;
+
+	iter = cl_list_find_from_head(
+		&routing_modules, _match_routing_engine_type, (void *)type);
+
+	if (iter != cl_list_end(&routing_modules)) {
+		module = (routing_engine_module_t *) cl_list_obj(iter);
+		return module->name;
 	}
-	return "unknown";
+	return unknown_routing_engine_name;
 }
 
-osm_routing_engine_type_t osm_routing_engine_type(IN const char *str)
+static cl_status_t _match_routing_engine_str(
+	IN const void *const p_object, IN void *context)
 {
+	const char *name = (char *) context;
+	routing_engine_module_t *module;
+
+	name = (char *) context;
+	module = (routing_engine_module_t *) p_object;
+
 	/* For legacy reasons, consider a NULL pointer and the string
 	 * "null" as the minhop routing engine.
 	 */
-	if (!str || !strcasecmp(str, "null")
-	    || !strcasecmp(str, "minhop"))
-		return OSM_ROUTING_ENGINE_TYPE_MINHOP;
-	else if (!strcasecmp(str, "none"))
-		return OSM_ROUTING_ENGINE_TYPE_NONE;
-	else if (!strcasecmp(str, "updn"))
-		return OSM_ROUTING_ENGINE_TYPE_UPDN;
-	else if (!strcasecmp(str, "dnup"))
-		return OSM_ROUTING_ENGINE_TYPE_DNUP;
-	else if (!strcasecmp(str, "file"))
-		return OSM_ROUTING_ENGINE_TYPE_FILE;
-	else if (!strcasecmp(str, "ftree"))
-		return OSM_ROUTING_ENGINE_TYPE_FTREE;
-	else if (!strcasecmp(str, "lash"))
-		return OSM_ROUTING_ENGINE_TYPE_LASH;
-	else if (!strcasecmp(str, "dor"))
-		return OSM_ROUTING_ENGINE_TYPE_DOR;
-	else if (!strcasecmp(str, "torus-2QoS"))
-		return OSM_ROUTING_ENGINE_TYPE_TORUS_2QOS;
-	else if (!strcasecmp(str, "nue"))
-		return OSM_ROUTING_ENGINE_TYPE_NUE;
-	else if (!strcasecmp(str, "sssp"))
-		return OSM_ROUTING_ENGINE_TYPE_SSSP;
-	else if (!strcasecmp(str, "dfsssp"))
-		return OSM_ROUTING_ENGINE_TYPE_DFSSSP;
+	if (!name || !strcasecmp(name, "null"))
+		name = "minhop";
+
+	if (strcasecmp(module->name, name) == 0)
+		return CL_SUCCESS;
 	else
-		return OSM_ROUTING_ENGINE_TYPE_UNKNOWN;
+		return CL_NOT_FOUND;
+}
+
+osm_routing_engine_type_t osm_routing_engine_type(IN const char *str)
+{
+	cl_list_iterator_t iter;
+	routing_engine_module_t *module;
+
+	iter = cl_list_find_from_head(
+		&routing_modules, _match_routing_engine_str, (void *)str);
+
+	if (iter != cl_list_end(&routing_modules)) {
+		module = (routing_engine_module_t *) cl_list_obj(iter);
+		return module->type;
+	}
+
+	return OSM_ROUTING_ENGINE_TYPE_UNKNOWN;
 }
 
 static void append_routing_engine(osm_opensm_t *osm,
@@ -186,14 +429,18 @@ static struct osm_routing_engine *setup_routing_engine(osm_opensm_t *osm,
 						       const char *name)
 {
 	struct osm_routing_engine *re;
-	const struct routing_engine_module *m;
+	routing_engine_module_t *m;
+	cl_list_iterator_t iter;
 
 	if (!strcmp(name, "no_fallback")) {
 		osm->no_fallback_routing_engine = TRUE;
 		return NULL;
 	}
 
-	for (m = routing_modules; m->name && *m->name; m++) {
+	for (iter = cl_list_head(&routing_modules);
+		 iter != cl_list_end(&routing_modules);
+		 iter = cl_list_next(iter)) {
+		m = (routing_engine_module_t *)cl_list_obj(iter);
 		if (!strcmp(m->name, name)) {
 			re = malloc(sizeof(struct osm_routing_engine));
 			if (!re) {
@@ -204,6 +451,11 @@ static struct osm_routing_engine *setup_routing_engine(osm_opensm_t *osm,
 			memset(re, 0, sizeof(struct osm_routing_engine));
 
 			re->name = m->name;
+			re->context = m->context;
+
+			OSM_LOG(&osm->log, OSM_LOG_VERBOSE,
+				"setup of routing engine \'%s\' ...\n", name);
+
 			re->type = osm_routing_engine_type(m->name);
 			if (m->setup(re, osm)) {
 				OSM_LOG(&osm->log, OSM_LOG_VERBOSE,
@@ -230,6 +482,8 @@ static void setup_routing_engines(osm_opensm_t *osm, const char *engine_names)
 	char *name, *str, *p;
 	struct osm_routing_engine *re;
 
+	dump_routing_engines(osm);
+
 	if (engine_names && *engine_names) {
 		str = strdup(engine_names);
 		name = strtok_r(str, ", \t\n", &p);
@@ -237,6 +491,9 @@ static void setup_routing_engines(osm_opensm_t *osm, const char *engine_names)
 			re = setup_routing_engine(osm, name);
 			if (re)
 				append_routing_engine(osm, re);
+			else
+				OSM_LOG(&osm->log, OSM_LOG_ERROR,
+					"Failed to setup routing engine \'%s\'\n", name);
 			name = strtok_r(NULL, ", \t\n", &p);
 		}
 		free(str);
@@ -245,10 +502,72 @@ static void setup_routing_engines(osm_opensm_t *osm, const char *engine_names)
 		setup_routing_engine(osm, "minhop");
 }
 
+static void dump_routing_engine(IN void *const p_object, IN void *context)
+{
+	osm_opensm_t *osm;
+	routing_engine_module_t *module;
+
+	osm = (osm_opensm_t *) context;
+	module = (routing_engine_module_t *) p_object;
+
+	OSM_LOG(&osm->log, OSM_LOG_VERBOSE,
+		"    name: %s - Type: %d\n",
+		module->name, module->type);
+}
+
+static void dump_routing_engines(IN osm_opensm_t *osm)
+{
+	cl_list_apply_func(
+		&routing_modules,
+		dump_routing_engine,
+		(void *) osm);
+}
+
+static const char *routing_engine_type(IN osm_routing_engine_type_t type)
+{
+	return type < OSM_ROUTING_ENGINE_TYPE_UNKNOWN ?
+		"built-in" : "external";
+}
+
+void osm_routing_modules_construct(IN osm_opensm_t *p_osm)
+{
+	size_t i, len;
+
+	len = sizeof(static_routing_modules) /
+		  sizeof(builtin_routing_engine_module_t);
+
+	cl_list_construct(&routing_modules);
+	cl_list_init(&routing_modules, len);
+	for (i = 0; i < len; i++) {
+		register_builtin_routing_engine(
+			p_osm, &(static_routing_modules[i]));
+	}
+}
+
+static void __free_routing_module(void *p_object, void *context)
+{
+	routing_engine_module_t *p_module;
+
+	p_module = (routing_engine_module_t *) p_object;
+	if (p_module) {
+		if (p_module->name)
+			free(p_module->name);
+		free(p_module);
+	}
+}
+
+void osm_routing_modules_destroy(IN osm_opensm_t *p_osm)
+{
+	cl_list_apply_func(&routing_modules, __free_routing_module, p_osm);
+	cl_list_remove_all(&routing_modules);
+	cl_list_destroy(&routing_modules);
+}
+
 void osm_opensm_construct(IN osm_opensm_t * p_osm)
 {
 	memset(p_osm, 0, sizeof(*p_osm));
 	p_osm->osm_version = OSM_VERSION;
+	osm_routing_modules_construct(p_osm);
 	osm_subn_construct(&p_osm->subn);
 	osm_db_construct(&p_osm->db);
 	osm_log_construct(&p_osm->log);
@@ -272,9 +591,21 @@ static void destroy_routing_engines(osm_opensm_t *osm)
 	while (next) {
 		r = next;
 		next = r->next;
+		if (r != osm->default_routing_engine) {
+			if (r->destroy)
+				r->destroy(r->context);
+			free(r);
+		} else /* do not free default_routing_engine */
+			r->next = NULL;
+	}
+	osm->routing_engine_list = NULL;
+
+	r = osm->default_routing_engine;
+	if (r) {
 		if (r->destroy)
 			r->destroy(r->context);
 		free(r);
+		osm->default_routing_engine = NULL;
 	}
 }
 
@@ -332,10 +663,11 @@ void osm_opensm_destroy(IN osm_opensm_t * p_osm)
 		osm_sa_db_file_dump(p_osm);
 
 	/* do the destruction in reverse order as init */
-	destroy_plugins(p_osm);
 	destroy_routing_engines(p_osm);
+	destroy_plugins(p_osm);
 	osm_sa_destroy(&p_osm->sa);
 	osm_sm_destroy(&p_osm->sm);
+	osm_routing_modules_destroy(p_osm);
 #ifdef ENABLE_OSM_PERF_MGR
 	osm_perfmgr_destroy(&p_osm->perfmgr);
 #endif				/* ENABLE_OSM_PERF_MGR */
@@ -528,7 +860,7 @@ ib_api_status_t osm_opensm_init_finish(IN osm_opensm_t * p_osm,
 
 	setup_routing_engines(p_osm, p_opt->routing_engine_names);
 
-	p_osm->routing_engine_used = OSM_ROUTING_ENGINE_TYPE_NONE;
+	p_osm->routing_engine_used = NULL;
 
 	p_osm->node_name_map = open_node_name_map(p_opt->node_name_map_name);
 
diff --git a/opensm/osm_perfmgr.c b/opensm/osm_perfmgr.c
index e7eca272..6f4444de 100644
--- a/opensm/osm_perfmgr.c
+++ b/opensm/osm_perfmgr.c
@@ -144,7 +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;
+		unsigned port;
 
 		cl_qmap_remove_item(&pm->monitored_map,
 				    (cl_map_item_t *) (pm->remove_list));
@@ -530,7 +530,7 @@ static void collect_guids(cl_map_item_t * p_map_item, void *context)
 	osm_perfmgr_t *pm = (osm_perfmgr_t *) context;
 	monitored_node_t *mon_node = NULL;
 	uint32_t num_ports;
-	int port;
+	unsigned port;
 
 	OSM_LOG_ENTER(pm->log);
 
@@ -1813,7 +1813,7 @@ static void pc_recv_process(void *context, void *data)
 		if (pm->query_cpi && cpi_valid) {
 			cl_plock_acquire(&pm->osm->lock);
 			if (p_mon_node->node_type == IB_NODE_TYPE_SWITCH) {
-				int i;
+				unsigned i;
 				for (i = p_mon_node->esp0 ? 0 : 1;
 				     i < p_mon_node->num_ports;
 				     i++) {
diff --git a/opensm/osm_port.c b/opensm/osm_port.c
index 1246edf9..7b1d58f9 100644
--- a/opensm/osm_port.c
+++ b/opensm/osm_port.c
@@ -303,6 +303,7 @@ static inline uint64_t ptr_to_key(void const *p)
 	return k;
 }
 
+#if 0
 static inline void *key_to_ptr(uint64_t k)
 {
 	void *p = 0;
@@ -310,6 +311,7 @@ static inline void *key_to_ptr(uint64_t k)
 	memcpy(&p, &k, sizeof(void *));
 	return p;
 }
+#endif
 
 /**********************************************************************
  Traverse the fabric from the SM node following the DR path given and
diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c
index 531a8fbe..d3eca8c8 100644
--- a/opensm/osm_port_info_rcv.c
+++ b/opensm/osm_port_info_rcv.c
@@ -792,6 +792,11 @@ void osm_pi_rcv_process(IN void *context, IN void *data)
 			else
 				pi_rcv_process_switch_ext_port(sm, p_node,
 							       p_physp, p_pi);
+
+			if (ib_port_info_get_port_state(p_pi) == IB_LINK_DOWN) {
+				CL_PLOCK_RELEASE(sm->p_lock);
+				goto Exit;
+			}
 			break;
 		default:
 			OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0F07: "
diff --git a/opensm/osm_remote_sm.c b/opensm/osm_remote_sm.c
index 4ebbd3fe..e081664b 100644
--- a/opensm/osm_remote_sm.c
+++ b/opensm/osm_remote_sm.c
@@ -35,7 +35,7 @@
 
 /*
  * Abstract:
- *    Implementation of osm_sm_t.
+ *    Implementation of osm_remote_sm_t.
  * This object represents the remote SM object.
  * This object is part of the opensm family of objects.
  */
diff --git a/opensm/osm_req.c b/opensm/osm_req.c
index c085fdaf..0664f624 100644
--- a/opensm/osm_req.c
+++ b/opensm/osm_req.c
@@ -51,7 +51,6 @@
 #include <opensm/osm_file_ids.h>
 #define FILE_ID OSM_FILE_REQ_C
 #include <opensm/osm_madw.h>
-#include <opensm/osm_attrib_req.h>
 #include <opensm/osm_log.h>
 #include <opensm/osm_helper.h>
 #include <opensm/osm_mad_pool.h>
diff --git a/opensm/osm_resp.c b/opensm/osm_resp.c
index 59a73e08..9a98df99 100644
--- a/opensm/osm_resp.c
+++ b/opensm/osm_resp.c
@@ -50,7 +50,6 @@
 #include <opensm/osm_file_ids.h>
 #define FILE_ID OSM_FILE_RESP_C
 #include <opensm/osm_madw.h>
-#include <opensm/osm_attrib_req.h>
 #include <opensm/osm_log.h>
 #include <opensm/osm_helper.h>
 #include <opensm/osm_mad_pool.h>
@@ -86,8 +85,6 @@ static void resp_make_resp_smp(IN osm_sm_t * sm, IN const ib_smp_t * p_src_smp,
 	if (p_src_smp->mgmt_class == IB_MCLASS_SUBN_DIR)
 		p_dest_smp->status |= IB_SMP_DIRECTION;
 
-	p_dest_smp->dr_dlid = p_dest_smp->dr_slid;
-	p_dest_smp->dr_slid = p_dest_smp->dr_dlid;
 	memcpy(&p_dest_smp->data, p_payload, IB_SMP_DATA_SIZE);
 
 Exit:
diff --git a/opensm/osm_sa.c b/opensm/osm_sa.c
index 24520a75..ca793aa3 100644
--- a/opensm/osm_sa.c
+++ b/opensm/osm_sa.c
@@ -336,10 +336,8 @@ ib_api_status_t osm_sa_bind(IN osm_sa_t * p_sa, IN ib_net64_t port_guid)
 		OSM_LOG(p_sa->p_log, OSM_LOG_ERROR, "ERR 4C03: "
 			"SA MAD Controller bind failed (%s)\n",
 			ib_get_err_str(status));
-		goto Exit;
 	}
 
-Exit:
 	OSM_LOG_EXIT(p_sa->p_log);
 	return status;
 }
diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c
index cf74308d..3a75a975 100644
--- a/opensm/osm_sa_mcmember_record.c
+++ b/opensm/osm_sa_mcmember_record.c
@@ -986,8 +986,8 @@ static void mcmr_rcv_leave_mgrp(IN osm_sa_t * sa, IN osm_madw_t * p_madw)
 	/* Validate the subnet prefix in the PortGID */
 	if (p_recvd_mcmember_rec->port_gid.unicast.prefix !=
 	    sa->p_subn->opt.subnet_prefix) {
-		OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
-			"PortGID subnet prefix 0x%" PRIx64
+		OSM_LOG(sa->p_log, OSM_LOG_ERROR,
+			"ERR 1B41: PortGID subnet prefix 0x%" PRIx64
 			" does not match configured prefix 0x%" PRIx64 "\n",
 			cl_ntoh64(p_recvd_mcmember_rec->port_gid.unicast.prefix),
 			cl_ntoh64(sa->p_subn->opt.subnet_prefix));
@@ -1169,8 +1169,8 @@ static void mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN osm_madw_t * p_madw)
 	/* Validate the subnet prefix in the PortGID */
 	if (p_recvd_mcmember_rec->port_gid.unicast.prefix !=
 	    sa->p_subn->opt.subnet_prefix) {
-		OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
-			"PortGID subnet prefix 0x%" PRIx64
+		OSM_LOG(sa->p_log, OSM_LOG_ERROR,
+			"ERR 1B40: PortGID subnet prefix 0x%" PRIx64
 			" does not match configured prefix 0x%" PRIx64 "\n",
 			cl_ntoh64(p_recvd_mcmember_rec->port_gid.unicast.prefix),
 			cl_ntoh64(sa->p_subn->opt.subnet_prefix));
diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
index 8d0d46f4..b8473fc5 100644
--- a/opensm/osm_subnet.c
+++ b/opensm/osm_subnet.c
@@ -1118,6 +1118,7 @@ static void subn_opt_destroy(IN osm_subn_opt_t * p_opt)
 	free(p_opt->node_name_map_name);
 	free(p_opt->prefix_routes_file);
 	free(p_opt->log_prefix);
+	free(p_opt->per_module_logging_file);
 	subn_destroy_qos_options(&p_opt->qos_options);
 	subn_destroy_qos_options(&p_opt->qos_ca_options);
 	subn_destroy_qos_options(&p_opt->qos_sw0_options);
@@ -1505,6 +1506,9 @@ int is_mlnx_ext_port_info_supported(ib_net32_t vendid, ib_net16_t devid)
 		if (devid_ho == 0x1ba0 ||
 		    (devid_ho >= 0x1bd0 && devid_ho <= 0x1bd5))
 			return 1;
+		/* Bull Quantum */
+		if (devid_ho == 0x1bf0)
+			return 1;
 		/* Bull Connect-X3 */
 		if (devid_ho == 0x1b33 || devid_ho == 0x1b73 ||
 		    devid_ho == 0x1b40 || devid_ho == 0x1b41 ||
@@ -1514,9 +1518,9 @@ int is_mlnx_ext_port_info_supported(ib_net32_t vendid, ib_net16_t devid)
 		if (devid_ho == 0x1b83 ||
 		    devid_ho == 0x1b93 || devid_ho == 0x1b94)
 			return 1;
-		/* Bull Connect-X4 */
+		/* Bull Connect-X4, Sequana HDR and HDR100 */
 		if (devid_ho == 0x1bb4 || devid_ho == 0x1bb5 ||
-		    devid_ho == 0x1bc4)
+		    (devid_ho >= 0x1bc4 && devid_ho <= 0x1bc6))
 			return 1;
 	}
 	return 0;
@@ -2667,7 +2671,7 @@ void osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts)
 		"# Maximum number of VLs for Nue routing algorithm (default: 1; to enforce\n"
 		"# deadlock-freedom even if QoS is not enabled). Set to 0 if Nue should\n"
 		"# automatically determine and choose maximum supported by the fabric, or\n"
-		"# any interger >= 1 (then Nue uses min(max_supported,nue_max_num_vls)\n"
+		"# any integer >= 1 (then Nue uses min(max_supported,nue_max_num_vls)\n"
 		"nue_max_num_vls %u\n\n",
 		p_opts->nue_max_num_vls);
 
diff --git a/opensm/osm_trap_rcv.c b/opensm/osm_trap_rcv.c
index 51a83698..527454bf 100644
--- a/opensm/osm_trap_rcv.c
+++ b/opensm/osm_trap_rcv.c
@@ -253,7 +253,16 @@ static int disable_port(osm_sm_t *sm, osm_physp_t *p)
 		if (!pi->base_lid) {
 			p_port = osm_get_port_by_guid(sm->p_subn,
 						      osm_physp_get_port_guid(p));
-			pi->base_lid = p_port->lid;
+			if (p_port)
+				pi->base_lid = p_port->lid;
+			else {
+				OSM_LOG(sm->p_log, OSM_LOG_ERROR,
+					"ERR 3804: Port 0x%" PRIx64
+					" not found, port set failed\n",
+					cl_ntoh64(osm_physp_get_port_guid(p)));
+				status = IB_ERROR;
+				goto EXIT;
+			}
 		}
 		pi->master_sm_base_lid = sm->p_subn->sm_base_lid;
 	}
@@ -263,6 +272,8 @@ static int disable_port(osm_sm_t *sm, osm_physp_t *p)
 			   cl_hton32(osm_physp_get_port_num(p)),
 			   FALSE, m_key,
 			   0, CL_DISP_MSGID_NONE, &context);
+
+EXIT:
 	return status;
 }
 
@@ -374,7 +385,7 @@ static void trap_rcv_process_request(IN osm_sm_t * sm,
 	boolean_t is_gsi = TRUE;
 	uint8_t port_num = 0;
 	boolean_t physp_change_trap = FALSE;
-	uint64_t event_wheel_timeout = OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT;
+	uint64_t event_wheel_timeout = OSM_DEFAULT_TRAP_SUPPRESSION_TIMEOUT;
 	boolean_t run_heavy_sweep = FALSE;
 	char buf[1024];
 	osm_dr_path_t *p_path;
@@ -493,7 +504,7 @@ static void trap_rcv_process_request(IN osm_sm_t * sm,
 						       trap_key);
 
 		/* Now we know how many times it provided this trap */
-		if (num_received > 10) {
+		if (num_received >= 10) {
 			if (print_num_received(num_received))
 				OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
 					"Received trap %u times consecutively\n",
@@ -529,7 +540,7 @@ static void trap_rcv_process_request(IN osm_sm_t * sm,
 					   NULL, NULL);
 
 		/* If was already registered do nothing more */
-		if (num_received > 10 && run_heavy_sweep == FALSE) {
+		if (num_received >= 10 && run_heavy_sweep == FALSE) {
 			if (print_num_received(num_received))
 				OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
 					"Ignoring noisy traps.\n");
diff --git a/opensm/osm_ucast_ftree.c b/opensm/osm_ucast_ftree.c
index 761e67bb..a4b32e5c 100644
--- a/opensm/osm_ucast_ftree.c
+++ b/opensm/osm_ucast_ftree.c
@@ -318,6 +318,7 @@ static inline ftree_tuple_key_t tuple_to_key(IN ftree_tuple_t tuple)
 	return key;
 }
 
+#if 0
 /***************************************************/
 
 static inline void tuple_from_key(IN ftree_tuple_t tuple,
@@ -325,6 +326,7 @@ static inline void tuple_from_key(IN ftree_tuple_t tuple,
 {
 	memcpy(tuple, &key, FTREE_TUPLE_LEN);
 }
+#endif
 
 /***************************************************
  **
@@ -3266,7 +3268,7 @@ static int rank_leaf_switches(IN ftree_fabric_t * p_ftree,
 			/* HCA connected directly to another HCA - not FatTree */
 			OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_ERROR,
 				"ERR AB0F: "
-				"CA conected directly to another CA: " "0x%016"
+				"CA connected directly to another CA: " "0x%016"
 				PRIx64 " <---> 0x%016" PRIx64 "\n",
 				hca_get_guid_ho(p_hca),
 				cl_ntoh64(osm_node_get_node_guid
@@ -3386,7 +3388,7 @@ fabric_construct_hca_ports(IN ftree_fabric_t * p_ftree, IN ftree_hca_t * p_hca)
 			/* HCA connected directly to another HCA - not FatTree */
 			OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_ERROR,
 				"ERR AB11: "
-				"CA conected directly to another CA: " "0x%016"
+				"CA connected directly to another CA: " "0x%016"
 				PRIx64 " <---> 0x%016" PRIx64 "\n",
 				cl_ntoh64(osm_node_get_node_guid(p_node)),
 				cl_ntoh64(remote_node_guid));
@@ -3866,7 +3868,9 @@ static void fabric_set_leaf_rank(IN ftree_fabric_t * p_ftree)
 			hca_get_guid_ho(p_hca));
 
 		for (i = 0; (i < p_hca->up_port_groups_num)
-		     && (!p_hca->up_port_groups[i]->is_cn); i++) ;
+		     && (!p_hca->up_port_groups[i]->is_cn); i++)
+			;
+
 		CL_ASSERT(i < p_hca->up_port_groups_num);
 		CL_ASSERT(p_hca->up_port_groups[i]->remote_node_type ==
 			  IB_NODE_TYPE_SWITCH);
diff --git a/opensm/osm_ucast_nue.c b/opensm/osm_ucast_nue.c
index 0ef84ebc..c6955a08 100644
--- a/opensm/osm_ucast_nue.c
+++ b/opensm/osm_ucast_nue.c
@@ -39,7 +39,7 @@
  * Abstract:
  *    Implementation of Nue routing for OpenSM. Nue is a deadlock-free routing
  *    engine which can be used for arbitrary network topologies and any number
- *    of virtual lanes (this includes the absense of VLs as well). The paper
+ *    of virtual lanes (this includes the absence of VLs as well). The paper
  *    explaining the details of Nue routing is: [1] J. Domke, T. Hoefler and
  *    S. Matsuoka "Routing on the Dependency Graph: A New Approach to
  *    Deadlock-Free High-Performance Routing", HPDC'16. An in-depth explanation
diff --git a/osmeventplugin/Makefile.am b/osmeventplugin/Makefile.am
index d86b6350..a314c9c6 100644
--- a/osmeventplugin/Makefile.am
+++ b/osmeventplugin/Makefile.am
@@ -23,7 +23,7 @@ osmeventplugin_api_version=$(shell grep LIBVERSION= $(srcdir)/libosmeventplugin.
 libosmeventplugin_la_SOURCES = src/osmeventplugin.c
 libosmeventplugin_la_LDFLAGS = -version-info $(osmeventplugin_api_version) \
 	 -export-dynamic $(libosmeventplugin_version_script)
-libosmeventplugin_la_LIBADD = -L../complib $(OSMV_LDADD) -losmcomp
+libosmeventplugin_la_LIBADD = -L../complib -losmcomp -L../libopensm -lopensm $(OSMV_LDADD)
 libosmeventplugin_la_DEPENDENCIES = $(srcdir)/libosmeventplugin.map
 
 libosmeventpluginincludedir = $(includedir)/infiniband/complib
diff --git a/osmroutingplugin/Makefile.am b/osmroutingplugin/Makefile.am
new file mode 100644
index 00000000..4cfceac3
--- /dev/null
+++ b/osmroutingplugin/Makefile.am
@@ -0,0 +1,34 @@
+
+AM_CPPFLAGS = -I$(srcdir)/../include \
+	      -I$(includedir)/infiniband
+
+lib_LTLIBRARIES = libosmroutingplugin.la
+
+if DEBUG
+DBGFLAGS = -ggdb -D_DEBUG_
+else
+DBGFLAGS = -g
+endif
+
+libosmroutingplugin_la_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_GNU_SOURCE=1
+
+if HAVE_LD_VERSION_SCRIPT
+    libosmroutingplugin_version_script = -Wl,--version-script=$(srcdir)/libosmroutingplugin.map
+else
+    libosmroutingplugin_version_script =
+endif
+
+osmroutingplugin_api_version=$(shell grep LIBVERSION= $(srcdir)/libosmroutingplugin.ver | sed 's/LIBVERSION=//')
+
+libosmroutingplugin_la_SOURCES = src/osmroutingplugin.c
+libosmroutingplugin_la_LDFLAGS = -version-info $(osmroutingplugin_api_version) \
+	 -export-dynamic $(libosmroutingplugin_version_script)
+libosmroutingplugin_la_LIBADD = -L../complib -losmcomp -L../libopensm -lopensm $(OSMV_LDADD)
+libosmroutingplugin_la_DEPENDENCIES = $(srcdir)/libosmroutingplugin.map
+
+libosmroutingpluginincludedir = $(includedir)/infiniband/complib
+
+libosmroutingplugininclude_HEADERS =
+
+# headers are distributed as part of the include dir
+EXTRA_DIST = $(srcdir)/libosmroutingplugin.map $(srcdir)/libosmroutingplugin.ver
diff --git a/osmroutingplugin/libosmroutingplugin.map b/osmroutingplugin/libosmroutingplugin.map
new file mode 100644
index 00000000..346d1f39
--- /dev/null
+++ b/osmroutingplugin/libosmroutingplugin.map
@@ -0,0 +1,5 @@
+OSMPMDB_1.0 {
+	global:
+	osm_event_plugin;
+	local: *;
+};
diff --git a/osmroutingplugin/libosmroutingplugin.ver b/osmroutingplugin/libosmroutingplugin.ver
new file mode 100644
index 00000000..f755ff6b
--- /dev/null
+++ b/osmroutingplugin/libosmroutingplugin.ver
@@ -0,0 +1,9 @@
+# In this file we track the current API version
+# of the vendor interface (and libraries)
+# The version is built of the following
+# tree numbers:
+# API_REV:RUNNING_REV:AGE
+# 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=1:0:0
diff --git a/osmroutingplugin/src/osmroutingplugin.c b/osmroutingplugin/src/osmroutingplugin.c
new file mode 100644
index 00000000..aa89975d
--- /dev/null
+++ b/osmroutingplugin/src/osmroutingplugin.c
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2019 Fabriscale Technologies AS. All rights reserved.
+ * Copyright (c) 2013 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 2008 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2007 The Regents of the University of California.
+ *
+ * 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
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#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>
+#include <opensm/osm_opensm.h>
+#include <opensm/osm_log.h>
+
+/*
+ * This is a simple routing engine plugin
+ * which implements the routing engine API
+ */
+
+struct  plugin_t {
+	osm_opensm_t *osm;
+};
+
+/*
+ * Forward declarations
+ */
+static void *construct(osm_opensm_t *osm);
+
+static void destroy(void *context);
+
+static int plugin_build_lid_matrices(
+	IN void *context);
+
+static int plugin_ucast_build_fwd_tables(
+	IN void *context);
+
+static void plugin_ucast_dump_tables(
+	IN void *context);
+
+static void plugin_update_sl2vl(
+	void *context,
+	IN osm_physp_t *port,
+	IN uint8_t in_port_num,
+	IN uint8_t out_port_num,
+	IN OUT ib_slvl_table_t *t);
+
+static void plugin_update_vlarb(
+	void *context,
+	IN osm_physp_t *port,
+	IN uint8_t port_num,
+	IN OUT ib_vl_arb_table_t *block,
+	unsigned int block_length,
+	unsigned int block_num);
+
+static uint8_t plugin_path_sl(
+	IN void *context,
+	IN uint8_t path_sl_hint,
+	IN const ib_net16_t slid,
+	IN const ib_net16_t dlid);
+
+static ib_api_status_t plugin_mcast_build_stree(
+	IN void *context,
+	IN OUT osm_mgrp_box_t *mgb);
+
+static void plugin_destroy_routing_engine(
+	IN void *context);
+
+static int routing_engine_setup(
+	osm_routing_engine_t *engine,
+	osm_opensm_t *osm);
+
+/*
+ * Implement plugin functions
+ */
+static void *construct(osm_opensm_t *osm)
+{
+	struct plugin_t *plugin;
+	cl_status_t status;
+
+	plugin = (struct plugin_t *) calloc(1, sizeof(struct plugin_t));
+	if (!plugin)
+		return NULL;
+
+	plugin->osm = osm;
+	external_routing_engine_module_t plugin_routing_engine_module = {
+		 "routing_engine_plugin",
+		  routing_engine_setup,
+		  plugin,
+	};
+
+	status = osm_register_external_routing_engine(
+		osm, &plugin_routing_engine_module, plugin);
+	if (status != CL_SUCCESS) {
+		destroy(plugin);
+		return NULL;
+	}
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+		"External routing engine '%s' has been registered with type '%d'\n",
+		plugin_routing_engine_module.name,
+		osm_routing_engine_type(plugin_routing_engine_module.name));
+
+	return ((void *)plugin);
+}
+
+static void destroy(void *context)
+{
+	struct plugin_t *plugin = (struct plugin_t *) context;
+
+	if (plugin) {
+		OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+			"Destroying plugin...\n");
+
+		free(plugin);
+	}
+}
+
+/*
+ * Implement routing engine functions
+ */
+int routing_engine_setup(
+	osm_routing_engine_t *engine,
+	osm_opensm_t *osm)
+{
+	struct plugin_t *plugin = (struct plugin_t *) engine->context;
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+		"Setting up the plugin as a new routing engine...\n");
+
+	engine->build_lid_matrices = plugin_build_lid_matrices;
+	engine->ucast_build_fwd_tables = plugin_ucast_build_fwd_tables;
+	engine->ucast_dump_tables = plugin_ucast_dump_tables;
+	engine->update_sl2vl = plugin_update_sl2vl;
+	engine->update_vlarb = plugin_update_vlarb;
+	engine->path_sl = plugin_path_sl;
+	engine->mcast_build_stree = plugin_mcast_build_stree;
+	engine->destroy = plugin_destroy_routing_engine;
+
+	return 0;
+}
+
+static int plugin_build_lid_matrices(
+	IN void *context)
+{
+	struct plugin_t *plugin = (struct plugin_t *) context;
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_ERROR,
+		"Building LID matrices...\n");
+
+	return 0;
+}
+
+static int plugin_ucast_build_fwd_tables(
+	IN void *context)
+{
+	struct plugin_t *plugin = (struct plugin_t *) context;
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+		"Building Forwarding tables...\n");
+	return 0;
+}
+
+static void plugin_ucast_dump_tables(
+	IN void *context)
+{
+	struct plugin_t *plugin = (struct plugin_t *) context;
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+		"Dumping Unicast forwarding tables...\n");
+}
+
+static void plugin_update_sl2vl(
+	void *context,
+	IN osm_physp_t *port,
+	IN uint8_t in_port_num, IN uint8_t out_port_num,
+	IN OUT ib_slvl_table_t *t)
+{
+	struct plugin_t *plugin = (struct plugin_t *) context;
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+		"Update Service Layer to Virtual Lanes mapping...\n");
+}
+
+static void plugin_update_vlarb(
+	void *context,
+	IN osm_physp_t *port,
+	IN uint8_t port_num,
+	IN OUT ib_vl_arb_table_t *block,
+	unsigned int block_length,
+	unsigned int block_num)
+{
+	struct plugin_t *plugin = (struct plugin_t *) context;
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+		"Update Virtual Lane arbritration...\n");
+}
+
+static uint8_t plugin_path_sl(
+	IN void *context,
+	IN uint8_t path_sl_hint,
+	IN const ib_net16_t slid,
+	IN const ib_net16_t dlid)
+{
+	struct plugin_t *plugin = (struct plugin_t *) context;
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+		"Computing Service Layer for the path LID %d -> LID %d with hint: %d...\n",
+		slid, dlid, path_sl_hint);
+	return 0;
+}
+
+static ib_api_status_t plugin_mcast_build_stree(
+	IN void *context,
+	IN OUT osm_mgrp_box_t *mgb)
+{
+	struct plugin_t *plugin = (struct plugin_t *) context;
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+		"Building spanning tree for MLID: %d\n",
+		mgb->mlid);
+	return IB_SUCCESS;
+}
+
+static void plugin_destroy_routing_engine(
+	IN void *context)
+{
+	struct plugin_t *plugin = (struct plugin_t *) context;
+
+	OSM_LOG(&plugin->osm->log, OSM_LOG_INFO,
+		"Destroying plugin routing engine\n");
+}
+
+/*
+ * Define the object symbol for loading
+ */
+
+#if OSM_EVENT_PLUGIN_INTERFACE_VER != 2
+#error OpenSM plugin interface version mismatch
+#endif
+
+osm_event_plugin_t osm_event_plugin = {
+	OSM_VERSION,
+	construct,
+	destroy
+};
diff --git a/osmtest/Makefile.am b/osmtest/Makefile.am
index 330c1ad3..360d6edd 100644
--- a/osmtest/Makefile.am
+++ b/osmtest/Makefile.am
@@ -14,7 +14,7 @@ if OSMV_VAPI
 osmtest_SOURCES += osmt_mtl_regular_qp.c
 endif
 osmtest_CFLAGS = -Wall -Wwrite-strings $(DBGFLAGS)
-osmtest_LDADD = -L../complib -losmcomp -L../libvendor -losmvendor -L../opensm -lopensm $(OSMV_LDADD)
+osmtest_LDADD = -L../complib -losmcomp -L../libopensm -lopensm -L../libvendor -losmvendor $(OSMV_LDADD)
 
 EXTRA_DIST = $(srcdir)/include/osmt_inform.h \
    $(srcdir)/include/osmtest_subnet.h \
diff --git a/osmtest/main.c b/osmtest/main.c
index c4b90bfa..c9f53a23 100644
--- a/osmtest/main.c
+++ b/osmtest/main.c
@@ -61,7 +61,7 @@
 #define OSMT_DEFAULT_TRAP_WAIT_TIMEOUT_SEC 10
 #define INVALID_GUID (0xFFFFFFFFFFFFFFFFULL)
 
-boolean_t osmt_is_debug(void)
+static boolean_t osmt_is_debug(void)
 {
 #if defined( _DEBUG_ )
 	return TRUE;
@@ -70,7 +70,7 @@ boolean_t osmt_is_debug(void)
 #endif				/* defined( _DEBUG_ ) */
 }
 
-void show_usage()
+static void show_usage(void)
 {
 	printf
 	    ("\n------- osmtest - Usage and options ----------------------\n");
@@ -234,7 +234,7 @@ static void print_all_guids(IN osmtest_t * p_osmt)
 		       cl_hton64(attr_array[i].port_guid));
 }
 
-ib_net64_t get_port_guid(IN osmtest_t * p_osmt, uint64_t port_guid)
+static ib_net64_t get_port_guid(IN osmtest_t * p_osmt, uint64_t port_guid)
 {
 	ib_api_status_t status;
 	uint32_t num_ports = MAX_LOCAL_IBPORTS;
@@ -280,7 +280,7 @@ int main(int argc, char *argv[])
 	uint32_t log_flags = OSM_LOG_ERROR | OSM_LOG_INFO;
 	int32_t vendor_debug = 0;
 	char flow_name[64];
-	uint32_t next_option;
+	int next_option;
 	const char *const short_option = "f:l:m:M:d:g:s:t:i:pcvGVh";
 
 	/*
@@ -582,7 +582,11 @@ int main(int argc, char *argv[])
 	if (vendor_debug)
 		osm_vendor_set_debug(osm_test.p_vendor, vendor_debug);
 
-	complib_init();
+	if (complib_init_v2() != CL_SUCCESS) {
+		printf("\ncomplib_init_v2 failed\n");
+		status = IB_ERROR;
+		goto Exit;
+	}
 
 	status = osmtest_init(&osm_test, &opt, (osm_log_level_t) log_flags);
 	if (status != IB_SUCCESS) {
diff --git a/osmtest/osmtest.c b/osmtest/osmtest.c
index 281b247a..6e39d9c0 100644
--- a/osmtest/osmtest.c
+++ b/osmtest/osmtest.c
@@ -149,7 +149,7 @@ typedef struct _osmtest_token {
 	const char *str;
 } osmtest_token_t;
 
-const osmtest_token_t token_array[] = {
+static const osmtest_token_t token_array[] = {
 	{OSMTEST_TOKEN_COMMENT, 1, "#"},
 	{OSMTEST_TOKEN_END, 3, "END"},
 	{OSMTEST_TOKEN_DEFINE_NODE, 11, "DEFINE_NODE"},
@@ -606,7 +606,7 @@ Exit:
 	return (status);
 }
 
-ib_api_status_t osmtest_validate_sa_class_port_info(IN osmtest_t * const p_osmt)
+static ib_api_status_t osmtest_validate_sa_class_port_info(IN osmtest_t * const p_osmt)
 {
 	ib_api_status_t status = IB_SUCCESS;
 	osmv_query_req_t req;
@@ -635,7 +635,7 @@ ib_api_status_t osmtest_validate_sa_class_port_info(IN osmtest_t * const p_osmt)
 	req.flags = OSM_SA_FLAGS_SYNC;
 	req.query_context = p_context;
 	req.pfn_query_cb = osmtest_query_res_cb;
-	req.p_query_input = 0;
+	req.p_query_input = NULL;
 	req.sm_key = 0;
 
 	if (p_osmt->opt.flow != OSMT_FLOW_CREATE_INVENTORY &&
@@ -697,85 +697,10 @@ Exit:
 	return (status);
 }
 
-ib_api_status_t
-osmtest_get_node_rec(IN osmtest_t * const p_osmt,
-		     IN ib_net64_t const node_guid,
-		     IN OUT osmtest_req_context_t * const p_context)
-{
-	ib_api_status_t status = IB_SUCCESS;
-	osmv_user_query_t user;
-	osmv_query_req_t req;
-	ib_node_record_t record;
-
-	OSM_LOG_ENTER(&p_osmt->log);
-
-	OSM_LOG(&p_osmt->log, OSM_LOG_VERBOSE,
-		"Getting node record for 0x%016" PRIx64 "\n",
-		cl_ntoh64(node_guid));
-
-	/*
-	 * Do a blocking query for this record in the subnet.
-	 * The result is returned in the result field of the caller's
-	 * context structure.
-	 *
-	 * The query structures are locals.
-	 */
-	memset(&req, 0, sizeof(req));
-	memset(&user, 0, sizeof(user));
-	memset(&record, 0, sizeof(record));
-
-	record.node_info.node_guid = node_guid;
-
-	p_context->p_osmt = p_osmt;
-	user.comp_mask = IB_NR_COMPMASK_NODEGUID;
-	user.attr_id = IB_MAD_ATTR_NODE_RECORD;
-	user.p_attr = &record;
-
-	req.query_type = OSMV_QUERY_USER_DEFINED;
-	req.timeout_ms = p_osmt->opt.transaction_timeout;
-	req.retry_cnt = p_osmt->opt.retry_count;
-	req.flags = OSM_SA_FLAGS_SYNC;
-	req.query_context = p_context;
-	req.pfn_query_cb = osmtest_query_res_cb;
-	req.p_query_input = &user;
-	req.sm_key = 0;
-
-	if (p_osmt->opt.with_grh) {
-		req.with_grh = 1;
-		memcpy(&req.gid, &p_osmt->sm_port_gid, 16);
-	}
-
-	status = osmv_query_sa(p_osmt->h_bind, &req);
-	if (status != IB_SUCCESS) {
-		OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 0071: "
-			"ib_query failed (%s)\n", ib_get_err_str(status));
-		goto Exit;
-	}
-
-	status = p_context->result.status;
-
-	if (status != IB_SUCCESS) {
-		OSM_LOG(&p_osmt->log, OSM_LOG_ERROR, "ERR 0072: "
-			"ib_query failed (%s)\n", ib_get_err_str(status));
-		if (status == IB_REMOTE_ERROR) {
-			OSM_LOG(&p_osmt->log, OSM_LOG_ERROR,
-				"Remote error = %s\n",
-				ib_get_mad_status_str(osm_madw_get_mad_ptr
-						      (p_context->result.
-						       p_result_madw)));
-		}
-		goto Exit;
-	}
-
-Exit:
-	OSM_LOG_EXIT(&p_osmt->log);
-	return (status);
-}
-
 /**********************************************************************
  * Get a node record by node LID
  **********************************************************************/
-ib_api_status_t
+static ib_api_status_t
 osmtest_get_node_rec_by_lid(IN osmtest_t * const p_osmt,
 			    IN ib_net16_t const lid,
 			    IN OUT osmtest_req_context_t * const p_context)
@@ -1123,7 +1048,7 @@ Exit:
 }
 #endif
 
-ib_api_status_t
+static ib_api_status_t
 osmtest_get_port_rec(IN osmtest_t * const p_osmt,
 		     IN ib_net16_t const lid,
 		     IN OUT osmtest_req_context_t * const p_context)
@@ -1199,7 +1124,7 @@ Exit:
 	return (status);
 }
 
-ib_api_status_t
+static ib_api_status_t
 osmtest_get_port_rec_by_num(IN osmtest_t * const p_osmt,
 			    IN ib_net16_t const lid,
 			    IN uint8_t const port_num,
@@ -1279,7 +1204,7 @@ Exit:
 	return (status);
 }
 
-ib_api_status_t
+static ib_api_status_t
 osmtest_stress_port_recs_large(IN osmtest_t * const p_osmt,
 			       OUT uint32_t * const p_num_recs,
 			       OUT uint32_t * const p_num_queries)
@@ -1340,7 +1265,7 @@ Exit:
 	return (status);
 }
 
-ib_api_status_t
+static ib_api_status_t
 osmtest_stress_node_recs_large(IN osmtest_t * const p_osmt,
 			       OUT uint32_t * const p_num_recs,
 			       OUT uint32_t * const p_num_queries)
@@ -1402,7 +1327,7 @@ Exit:
 	return (status);
 }
 
-ib_api_status_t
+static ib_api_status_t
 osmtest_stress_path_recs_large(IN osmtest_t * const p_osmt,
 			       OUT uint32_t * const p_num_recs,
 			       OUT uint32_t * const p_num_queries)
@@ -1463,7 +1388,7 @@ Exit:
 	return (status);
 }
 
-ib_api_status_t
+static ib_api_status_t
 osmtest_stress_path_recs_by_guid(IN osmtest_t * const p_osmt,
 				 OUT uint32_t * const p_num_recs,
 				 OUT uint32_t * const p_num_queries)
@@ -1573,7 +1498,7 @@ Exit:
 	return (status);
 }
 
-ib_api_status_t
+static ib_api_status_t
 osmtest_stress_port_recs_small(IN osmtest_t * const p_osmt,
 			       OUT uint32_t * const p_num_recs,
 			       OUT uint32_t * const p_num_queries)
@@ -1695,7 +1620,7 @@ Exit:
  * Use a wrong SM_Key in a simple port query and report success if
  * failed.
  **********************************************************************/
-ib_api_status_t osmtest_wrong_sm_key_ignored(IN osmtest_t * const p_osmt)
+static ib_api_status_t osmtest_wrong_sm_key_ignored(IN osmtest_t * const p_osmt)
 {
 	ib_api_status_t status = IB_SUCCESS;
 	osmv_user_query_t user;
@@ -2983,7 +2908,7 @@ Exit:
 	return (status);
 }
 
-ib_api_status_t
+static ib_api_status_t
 osmtest_stress_path_recs_by_lid(IN osmtest_t * const p_osmt,
 				OUT uint32_t * const p_num_recs,
 				OUT uint32_t * const p_num_queries)
@@ -4122,7 +4047,7 @@ Exit:
 }
 
 #ifdef VENDOR_RMPP_SUPPORT
-ib_net64_t portguid = 0;
+static ib_net64_t portguid;
 
 static ib_api_status_t
 osmtest_validate_all_node_recs(IN osmtest_t * const p_osmt)
@@ -4317,7 +4242,7 @@ Exit:
 /**********************************************************************
  * Get link record by LID
  **********************************************************************/
-ib_api_status_t
+static ib_api_status_t
 osmtest_get_link_rec_by_lid(IN osmtest_t * const p_osmt,
 			    IN ib_net16_t const from_lid,
 			    IN ib_net16_t const to_lid,
@@ -4405,7 +4330,7 @@ Exit:
 /**********************************************************************
  * Get GUIDInfo record by LID
  **********************************************************************/
-ib_api_status_t
+static ib_api_status_t
 osmtest_get_guidinfo_rec_by_lid(IN osmtest_t * const p_osmt,
 				IN ib_net16_t const lid,
 				IN OUT osmtest_req_context_t * const p_context)
@@ -4487,7 +4412,7 @@ Exit:
 /**********************************************************************
  * Get PKeyTable record by LID
  **********************************************************************/
-ib_api_status_t
+static ib_api_status_t
 osmtest_get_pkeytbl_rec_by_lid(IN osmtest_t * const p_osmt,
 			       IN ib_net16_t const lid,
 			       IN ib_net64_t const sm_key,
@@ -4570,7 +4495,7 @@ Exit:
 /**********************************************************************
  * Get SwitchInfo record by LID
  **********************************************************************/
-ib_api_status_t
+static ib_api_status_t
 osmtest_get_sw_info_rec_by_lid(IN osmtest_t * const p_osmt,
 			       IN ib_net16_t const lid,
 			       IN OUT osmtest_req_context_t * const p_context)
@@ -4653,7 +4578,7 @@ Exit:
 /**********************************************************************
  * Get LFT record by LID
  **********************************************************************/
-ib_api_status_t
+static ib_api_status_t
 osmtest_get_lft_rec_by_lid(IN osmtest_t * const p_osmt,
 			   IN ib_net16_t const lid,
 			   IN OUT osmtest_req_context_t * const p_context)
@@ -4736,7 +4661,7 @@ Exit:
 /**********************************************************************
  * Get MFT record by LID
  **********************************************************************/
-ib_api_status_t
+static ib_api_status_t
 osmtest_get_mft_rec_by_lid(IN osmtest_t * const p_osmt,
 			   IN ib_net16_t const lid,
 			   IN OUT osmtest_req_context_t * const p_context)
@@ -7352,7 +7277,7 @@ osmtest_get_user_port(IN osmtest_t * const p_osmt,
 		fflush(stdout);
 		if (scanf("%u", &choice) <= 0) {
 			char junk[256];
-			if (scanf("%s", junk) <= 0)
+			if (scanf("%255s", junk) <= 0)
 				printf("\nError: Cannot scan!\n");
 		} else if (choice && choice <= num_ports)
 			break;
diff --git a/scripts/travis-build b/scripts/travis-build
new file mode 100755
index 00000000..e48bc518
--- /dev/null
+++ b/scripts/travis-build
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+PATH=/home/`whoami`/.local/bin:$PATH
+DIR=$(readlink -f .)
+# Stop on error
+set -e
+# Echo all commands to Travis log
+set -x
+
+./autogen.sh
+
+
+# Clang doesn't like getting pointers from packed struct members, even if aligned.
+CC=clang CFLAGS="-Wno-address-of-packed-member"  ./configure
+make
+make clean
+
+# Run sparse on the subdirectories which are sparse clean
+CC=cgcc CFLAGS="-Werror" make > /dev/null 2>&1 | grep -v '^/usr/include' | tee out
+make clean
+# sparse does not fail gcc on messages
+if [ -s out ]; then
+   false
+fi
+
+CC=gcc-8 CFLAGS="" ./configure
+make
+make dist
diff --git a/scripts/travis-checkpatch b/scripts/travis-checkpatch
new file mode 100755
index 00000000..441d69a4
--- /dev/null
+++ b/scripts/travis-checkpatch
@@ -0,0 +1,29 @@
+#!/bin/bash
+# Copyright 2017 Mellanox Technologies Ltd.
+# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
+
+
+if [ "x$TRAVIS_EVENT_TYPE" != "xpull_request" ]; then
+	# Peform checkpatch checks on pull requests only
+	exit 0
+fi
+
+# The below "set" is commented, because the checkpatch.pl returns 1 (error) for warnings too.
+# And the rdma-core code is not mature enough to be warning safe
+# set -e
+
+if [ "x$TRAVIS_COMMIT_RANGE" != "x" ]; then
+	wget -q https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/checkpatch.pl \
+	        https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/spelling.txt
+	DIR_FOR_PATCHES_TO_CHECK=$(mktemp -d)
+	git format-patch --no-cover-letter $TRAVIS_COMMIT_RANGE ^$TRAVIS_BRANCH -o $DIR_FOR_PATCHES_TO_CHECK/
+	CHECKPATCH_OPT="--no-tree --ignore PREFER_KERNEL_TYPES,FILE_PATH_CHANGES,EXECUTE_PERMISSIONS,USE_NEGATIVE_ERRNO,CONST_STRUCT $DIR_FOR_PATCHES_TO_CHECK/*"
+	perl checkpatch.pl $CHECKPATCH_OPT
+	if [ $? -ne 0 ]; then
+		# We rerun checkpatch to simplify parsing and to understand if we failed for errors
+		# For example, the output on some arbitrary patchset of the following line without awk is:
+		# total: 1 errors, 3 warnings, 42 lines checked
+		NUMB_ERRRORS=$(perl checkpatch.pl --terse $CHECKPATCH_OPT | awk 'BEGIN {FS = "total:"} ; {sum+=$2} END {print sum}')
+		exit $NUMB_ERRRORS
+	fi
+fi