[Pkg-ofed-commits] [infiniband-diags] 01/16: Imported Upstream version 1.6.4

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Tue Jul 1 12:10:49 UTC 2014


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

ana pushed a commit to branch master
in repository infiniband-diags.

commit 8823e02bc83e356db6470eae735fffa2a649565c
Author: Ana Guerrero López <ana at ekaia.org>
Date:   Tue Jul 1 10:58:18 2014 +0200

    Imported Upstream version 1.6.4
---
 AUTHORS                                     |   2 +-
 ChangeLog                                   | 824 ++++++++++++++++++++++++++
 Makefile.am                                 |  19 +-
 Makefile.in                                 | 268 +++++++--
 NEWS                                        |   2 +
 README                                      |  30 +-
 aclocal.m4                                  | 191 ++++++
 autogen.sh                                  |  11 +-
 config.h.in                                 |   8 +-
 config/compile                              |  21 +-
 config/config.guess                         | 866 +++++++++++++++-------------
 config/config.sub                           | 351 ++++++++---
 config/depcomp                              | 172 ++++--
 config/install-sh                           | 517 ++++++++++++-----
 config/missing                              | 104 ++--
 configure                                   | 506 +++++++++++++++-
 configure.in => configure.ac                |  25 +-
 doc/generate                                |  19 +-
 doc/man/check_lft_balance.8                 |   9 +-
 doc/man/check_lft_balance.8.in              |   9 +-
 doc/man/{dump_lfts.8 => dump_fts.8}         | 114 +++-
 doc/man/{dump_lfts.8.in => dump_fts.8.in}   | 114 +++-
 doc/man/dump_mfts.8                         | 170 ------
 doc/man/dump_mfts.8.in                      | 170 ------
 doc/man/ibaddr.8                            |  27 +-
 doc/man/ibaddr.8.in                         |  27 +-
 doc/man/ibcacheedit.8                       |  10 +-
 doc/man/ibcacheedit.8.in                    |  10 +-
 doc/man/ibccconfig.8                        |  20 +-
 doc/man/ibccconfig.8.in                     |  20 +-
 doc/man/ibccquery.8                         |  20 +-
 doc/man/ibccquery.8.in                      |  20 +-
 doc/man/ibclearcounters.8.in                | 101 ----
 doc/man/ibfindnodesusing.8                  |  18 +-
 doc/man/ibfindnodesusing.8.in               |  18 +-
 doc/man/ibhosts.8                           |  19 +-
 doc/man/ibhosts.8.in                        |  19 +-
 doc/man/ibidsverify.8                       |   6 +-
 doc/man/ibidsverify.8.in                    |   6 +-
 doc/man/iblinkinfo.8                        |  32 +-
 doc/man/iblinkinfo.8.in                     |  32 +-
 doc/man/ibnetdiscover.8                     |  36 +-
 doc/man/ibnetdiscover.8.in                  |  36 +-
 doc/man/ibnodes.8                           |  19 +-
 doc/man/ibnodes.8.in                        |  19 +-
 doc/man/ibping.8                            |  14 +-
 doc/man/ibping.8.in                         |  14 +-
 doc/man/ibportstate.8                       |  28 +-
 doc/man/ibportstate.8.in                    |  28 +-
 doc/man/ibqueryerrors.8                     |  38 +-
 doc/man/ibqueryerrors.8.in                  |  38 +-
 doc/man/ibroute.8                           |  88 ++-
 doc/man/ibroute.8.in                        |  88 ++-
 doc/man/ibrouters.8                         |  19 +-
 doc/man/ibrouters.8.in                      |  19 +-
 doc/man/ibstat.8                            |  15 +-
 doc/man/ibstat.8.in                         |  15 +-
 doc/man/ibstatus.8                          |   9 +-
 doc/man/ibstatus.8.in                       |   9 +-
 doc/man/ibswitches.8                        |  19 +-
 doc/man/ibswitches.8.in                     |  19 +-
 doc/man/ibsysstat.8                         |  36 +-
 doc/man/ibsysstat.8.in                      |  36 +-
 doc/man/ibtracert.8                         |  36 +-
 doc/man/ibtracert.8.in                      |  36 +-
 doc/man/infiniband-diags.8                  |  49 +-
 doc/man/infiniband-diags.8.in               |  49 +-
 doc/man/perfquery.8                         |  69 +--
 doc/man/perfquery.8.in                      |  69 +--
 doc/man/saquery.8                           |  66 +--
 doc/man/saquery.8.in                        |  66 +--
 doc/man/sminfo.8                            |  23 +-
 doc/man/sminfo.8.in                         |  23 +-
 doc/man/smpdump.8                           |  26 +-
 doc/man/smpdump.8.in                        |  26 +-
 doc/man/smpquery.8                          |  37 +-
 doc/man/smpquery.8.in                       |  37 +-
 doc/man/vendstat.8                          |  25 +-
 doc/man/vendstat.8.in                       |  25 +-
 doc/rst/dump_fts.8.in.rst                   |  85 +++
 doc/rst/dump_lfts.8.in.rst                  |  73 ---
 doc/rst/dump_mfts.8.in.rst                  |  64 --
 doc/rst/ibaddr.8.in.rst                     |   1 +
 doc/rst/ibclearcounters.8.in.rst            |  51 --
 doc/rst/ibfindnodesusing.8.in.rst           |   2 +-
 doc/rst/iblinkinfo.8.in.rst                 |   4 +-
 doc/rst/ibnetdiscover.8.in.rst              |   5 +-
 doc/rst/ibportstate.8.in.rst                |   6 +-
 doc/rst/ibqueryerrors.8.in.rst              |   5 +-
 doc/rst/ibqueryerrors.8.in.rst.orig         | 153 -----
 doc/rst/ibroute.8.in.rst                    |   2 +
 doc/rst/ibsysstat.8.in.rst                  |   1 +
 doc/rst/ibtracert.8.in.rst                  |   4 +-
 doc/rst/infiniband-diags.8.in.rst           |   2 +-
 doc/rst/perfquery.8.in.rst                  |  19 +-
 doc/rst/saquery.8.in.rst                    |   9 +-
 include/ibdiag_common.h                     |  64 +-
 include/{ibdiag_common.h => ibdiag_sa.h}    |  95 +--
 include/ibdiag_version.h                    |   2 +-
 infiniband-diags.spec                       |  10 +-
 infiniband-diags.spec.in                    |   6 +-
 libibnetdisc/Makefile.am                    |   5 +-
 libibnetdisc/Makefile.in                    |  11 +-
 libibnetdisc/include/infiniband/ibnetdisc.h |   5 +
 libibnetdisc/libibnetdisc.ver               |   2 +-
 libibnetdisc/src/ibnetdisc.c                | 128 ++--
 libibnetdisc/src/ibnetdisc_cache.c          |  32 +-
 libibnetdisc/src/internal.h                 |  15 +-
 libibnetdisc/src/libibnetdisc.map           |   1 +
 man/dump_lfts.8                             |   2 +
 man/dump_mfts.8                             |   2 +
 scripts/check_lft_balance.pl                |  16 +-
 scripts/dump_lfts.sh                        |  72 +--
 scripts/dump_lfts.sh.in                     |  12 +
 scripts/dump_mfts.sh                        |  72 +--
 scripts/dump_mfts.sh.in                     |  12 +
 scripts/ibcheckerrors                       |   6 +-
 scripts/ibcheckerrors.in                    |   6 +-
 scripts/ibcheckerrs                         |  12 +-
 scripts/ibcheckerrs.in                      |  12 +-
 scripts/ibchecknet                          |   6 +-
 scripts/ibchecknet.in                       |   6 +-
 scripts/ibchecknode                         |   8 +-
 scripts/ibchecknode.in                      |   8 +-
 scripts/ibcheckport                         |   8 +-
 scripts/ibcheckport.in                      |   8 +-
 scripts/ibcheckportstate                    |   8 +-
 scripts/ibcheckportstate.in                 |   8 +-
 scripts/ibcheckportwidth                    |   8 +-
 scripts/ibcheckportwidth.in                 |   8 +-
 scripts/ibcheckstate                        |   6 +-
 scripts/ibcheckstate.in                     |   6 +-
 scripts/ibcheckwidth                        |   6 +-
 scripts/ibcheckwidth.in                     |   6 +-
 scripts/ibclearcounters                     |   6 +-
 scripts/ibclearcounters.in                  |   6 +-
 scripts/ibclearerrors                       |   6 +-
 scripts/ibclearerrors.in                    |   6 +-
 scripts/ibdatacounters                      |   6 +-
 scripts/ibdatacounters.in                   |   6 +-
 scripts/ibdatacounts                        |   8 +-
 scripts/ibdatacounts.in                     |   8 +-
 scripts/ibhosts                             |   4 +-
 scripts/ibhosts.in                          |   4 +-
 scripts/ibnodes                             |   2 +-
 scripts/ibnodes.in                          |   2 +-
 scripts/ibrouters                           |   4 +-
 scripts/ibrouters.in                        |   4 +-
 scripts/ibstatus                            |   2 +-
 scripts/ibswitches                          |   4 +-
 scripts/ibswitches.in                       |   4 +-
 scripts/set_nodedesc.sh                     |   2 +-
 src/{ibroute.c => dump_fts.c}               | 288 +++++----
 src/ibaddr.c                                |   8 +-
 src/ibcacheedit.c                           |  18 +-
 src/ibccconfig.c                            |  29 +-
 src/ibccquery.c                             |  46 +-
 src/ibdiag_common.c                         | 183 +-----
 src/ibdiag_sa.c                             | 234 ++++++++
 src/iblinkinfo.c                            |   6 +-
 src/ibnetdiscover.c                         |  20 +-
 src/ibping.c                                |  10 +-
 src/ibportstate.c                           |  73 ++-
 src/ibqueryerrors.c                         |  92 ++-
 src/ibroute.c                               |  77 ++-
 src/ibsendtrap.c                            |   6 +-
 src/ibstat.c                                |  11 +-
 src/ibsysstat.c                             |  21 +-
 src/ibtracert.c                             |  40 +-
 src/perfquery.c                             |  97 +++-
 src/saquery.c                               | 396 +++++++++----
 src/sminfo.c                                |  10 +-
 src/smpquery.c                              |  50 +-
 src/vendstat.c                              |  40 +-
 174 files changed, 5701 insertions(+), 3555 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 66f9be2..e905758 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,4 +1,4 @@
 Shahar Frank		<shahar at voltaire.com>
 Hal Rosenstock		<halr at voltaire.com>
 Sasha Khapyorsky	<sashak at voltaire.com>
-Ira Weiny			<weiny2 at llnl.gov>
+Ira Weiny		<ira.weiny at intel.com>
diff --git a/ChangeLog b/ChangeLog
index 713c3ff..ec1b986 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,356 @@
 
 ** Version: HEAD
 
+Sat Jan 25 22:10:28 2014 -0800 Ira Weiny
+9a2cb335b77e164b7f849d0ff74b0b67cda20814
+
+	* update README for 1.6.4
+
+Sat Jan 25 22:01:39 2014 -0800 Ira Weiny
+4b2d64157c9c5cea173ea2484dd92919ec421338
+
+	* Revert "libibnetdisc/ibnetdisc.c: improve log information to stdout"
+
+Fri Jan 24 19:34:22 2014 -0800 Ira Weiny
+e0d80aa5636a4ef30c9df74f85d50ca44790b525
+
+	* update README for 1.6.3
+
+Fri Jan 24 19:39:10 2014 -0800 Ira Weiny
+5b0c23e2bd82756c09de46ed9e39e757fef0403b
+
+	* ibtracert.8.in: change default pre-built man page
+
+Tue Jan 21 17:15:13 2014 -0800 Al Chu
+21efdf6637f3460dfa5dea32ae3731a529560c60
+
+	* infiniband-diags: Check node-name-map strings when querying by name
+
+Thu Jan 2 08:44:15 2014 +0200 Dan Ben Yosef
+a3f2fcd468b459e0f3b1f5b7c35a7db181d22ee9
+
+	* libibnetdisc/ibnetdisc.c: improve log information to stdout
+
+Mon Dec 30 09:50:59 2013 -0500 Dan Ben Yosef
+ab0551a8cbdce73f193ecd88e732bc88347fb611
+
+	* libibnetdisc/ibnetdisc.c: fix insert of invalid lid 0xFFFF into lid_port hash_table
+
+Sun Oct 13 09:48:36 2013 +0200 Dan Ben Yosef
+59aab498181c6b486a85471d4c0ccb6544a4e83a
+
+	* ibtracert.c: Add 'force' flag to man page
+
+Tue Dec 17 17:27:24 2013 +0200 Dan Ben Yosef
+affc76fb39f0e1e53c0aa98d1073926dae662f8d
+
+	* infiniband-diags/vendstat: Fix GeneralInfo SW version
+
+Sun Oct 20 10:39:23 2013 +0200 Dan Ben Yosef
+b4216ab0359bd60f02eb7ca6de22e17f97ee2842
+
+	* ibportstate: on/off option is missing in help
+
+Thu Oct 10 16:21:12 2013 +0200 Dan Ben Yosef
+0d270e48c1a1d1b2af1aeed99ec9332d367abe54
+
+	* iblinkinfo: Remove "-R" option from man page
+
+Thu Oct 10 15:29:12 2013 +0200 Dan Ben Yosef
+11adcf2ce6db9da67326eab2196c1aaa35cdba0e
+
+	* ibaddr: Add missing -t option to manpage
+
+Mon Sep 16 10:19:58 2013 -0400 Hal Rosenstock
+ca5b23da0c6c8c6e5ad7c1eb3c7580c82235ef00
+
+	* ibdiag_sa.c: Output attribute ID in hex rather than decimal
+
+Tue Aug 20 08:10:59 2013 -0700 Ira Weiny
+914f4c0f4965fc690b3107d717890e3f5bf2b627
+
+	* infiniband-diags: fail configure if glib2 is not found
+
+Sun Aug 18 10:51:50 2013 +0200 Bart Van Assche
+a5f9dc0e3d6a1391b5034252abcc895100142828
+
+	* Fix errors triggered by autoregen.sh
+
+Sun Aug 18 10:57:07 2013 +0200 Bart Van Assche
+cfca87c20de5af4d3c43b1349ed991bf5b30d26a
+
+	* get_lid_from_name(): Remove an unused variable
+
+Sun Aug 18 00:37:02 2013 -0700 Ira Weiny
+df1eac51f6518c6b96d09b3cf6a42d856f99b9fe
+
+	* Update README and version to 1.6.2
+
+Thu Aug 1 14:11:06 2013 -0400 Hal Rosenstock
+1d79ffd1a57f2add170af87a68f0354f61a94cc4
+
+	* perfquery.c: Fix dumping of PortSamplesControl
+
+Mon Jul 15 10:32:40 2013 -0400 Hal Rosenstock
+374fd6660fa352501ac1379454abddc174a5a52b
+
+	* infiniband-diags: Eliminate unneeded clean_nodedesc calls
+
+Fri Jul 5 07:59:04 2013 -0700 Ira Weiny
+6825acdd106f2a40493bb5640c9a0ff6f70fea88
+
+	* infiniband-diags: convert IBERROR to IBEXIT
+
+Fri Jul 5 10:24:47 2013 -0400 Ira Weiny
+bae2ff4e7d5b965e63c0972f25022e4f198c8775
+
+	* infiniband-diags: umad_init needs to be called before sa_get_handle
+
+Sat Jun 22 10:07:27 2013 -0400 Hal Rosenstock
+08635c3c1b4799989f98ceb177c420ce8c403182
+
+	* saquery: Add SMInfoRecord support
+
+Sat May 25 09:36:27 2013 -0400 Hal Rosenstock
+9e3446c41dc0afd4fedca9dabd3ef2b687791098
+
+	* infiniband-diags: saquery: Dump SwitchInfoRecord based on IsSetMulticastFDBTopSupported SA capability
+
+Thu Jun 13 14:26:48 2013 -0700 Albert Chu
+6ac17c9927fcad25de1019f5dce99831c8415f95
+
+	* ibnetdiscover: Output vlcap in full output format
+
+Thu Jun 13 14:26:34 2013 -0700 Albert Chu
+5e4fe8c9ac0f73ff260eb61c239c9816ed32dcd0
+
+	* ibnetdiscover: Add missing -f option to manpage
+
+Wed Jun 12 16:39:56 2013 -0700 Ira Weiny
+eb5b498753015ca2cc287532e13fd408c388a593
+
+	* infiniband-diags: ibstat fix strncpy coverity check and -l bug
+
+Wed Jun 12 09:55:53 2013 -0400 Dan Ben Yosef
+e597637189950e433cf1d3e5a9c70984c99a369b
+
+	* saquery.c: resource leak
+
+Wed Jun 12 09:55:48 2013 -0400 Dan Ben Yosef
+37ca525199a16260cbd120fd6ae3f7bab59d6ac9
+
+	* ibtracert.c: Uninitialized variable
+
+Wed Jun 12 09:55:43 2013 -0400 Dan Ben Yosef
+914ebfe24987b4508c6c15b14471a075faaa5f91
+
+	* ibsysstat.c: fix resource leak
+
+Wed Jun 12 09:55:26 2013 -0400 Dan Ben Yosef
+fa7e7a68e0d5df5f87b6731e2bc9cd9c2f6d1ea8
+
+	* ibtracert.c: fix resource leak
+
+Wed Jun 12 07:04:15 2013 -0400 Hal Rosenstock
+274508084b59a30f7d2ea6867c54c4056658bb46
+
+	* libibnetdisc/Makefile.am: Add missing makefile dependency
+
+Wed May 29 08:22:18 2013 -0700 Ira Weiny
+77b235479dfe4762b3c6b92ec452b4ff5862ad1b
+
+	* infiniband-diags: Fix gen_ver.sh for use with new Autoconf file
+
+Tue May 21 15:57:18 2013 -0400 Hal Rosenstock
+c61ca16bb7abbd92d792a1be3e4325f045c8c493
+
+	* saquery: Add SwitchInfoRecord support
+
+Fri Apr 19 10:03:00 2013 -0700 Ira Weiny
+43074c0bf702344eadec6c79920990322db7d7fb
+
+	* infiniband-diags: remove doc/man/ibclearcounters.8.in
+
+Fri Apr 19 09:38:33 2013 -0700 Ira Weiny
+a6f5884c1b01013e4b7ad80c999283f9d3451841
+
+	* infiniband-diags: add .gitignore
+
+Wed Apr 3 13:01:01 2013 -0700 Ira Weiny
+91fda21bb8ee3e3ef6ba344d8195c490a7d2f09f
+
+	* infiniband-diags: updates for new autoconf tools
+
+Thu Mar 28 08:44:59 2013 -0700 Ira Weiny
+75f8e82c906cae079b0121a4b37d0f5f0b34b542
+
+	* infiniband-diags/dump_fts: fix block calculation for LFT's
+
+Thu Mar 28 07:55:40 2013 +0000 Dan Ben Yosef
+04a2cc00078af1cc6e264892e7f133ea8831bebd
+
+	* infiniband-diags/ibroute.c: fix pull extra block for LFT
+
+Tue Mar 19 13:12:55 2013 +0000 Dan Ben Yosef
+7d5c35a82d4516315641d6b5f374ec56382e486d
+
+	* infiniband-diags/ibportstate.c: Add ON and OFF options.
+
+Wed Mar 13 08:04:00 2013 -0700 Ira Weiny
+12258fba0bbc9dd2e3317bda8155d785db9646c6
+
+	* infiniband-diags: update emails in default pages
+
+Wed Mar 13 06:10:32 2013 -0700 Ira Weiny
+b08937cc51aa50f8e6d5033110cd372e6f53ec23
+
+	* infiniband-diags: update emails
+
+Fri Mar 8 18:07:42 2013 -0800 Ira Weiny
+a58cd2a53d2f91390918a8e160b8f724cf6c90d3
+
+	* infiniband-diags: fix rst2man when using upstream docutils
+
+Mon Mar 18 14:36:29 2013 -0700 Ira Weiny
+4649be571b45ca5ac85ee49f3f134a9104e215b3
+
+	* infiniband-diags: add skip-sl to default ibqueryerrors.8.in
+
+Thu Mar 14 14:52:46 2013 +0000 Dan Ben Yosef
+85f31755603200ed6b83e784ee7811410181384e
+
+	* infiniband-diags/ibqueryerrors.c: obtain destination sl before perf query
+
+Wed Feb 20 13:56:36 2013 -0500 Ira Weiny
+d40ad00d604ce8c5e4f337bf6837f11499bd85c7
+
+	* infiniband-diags: fix rpm requires for glib2
+
+Thu Feb 7 16:37:52 2013 -0500 Ira Weiny
+cd53e8aa935151768c3c1ffbb310425b5a84a1c3
+
+	* infiniband-diags: check_lft_balanc: support either DR or Lid based dump lfts output
+
+Sun Feb 3 19:33:06 2013 -0500 Ira Weiny
+209bf9d61788f845d5fed8133733fd25ab4b9d01
+
+	* infiniband-diags: deprecate dump_[m|l]fts.sh scripts
+
+Fri Feb 1 18:13:59 2013 -0500 Ira Weiny
+0ca4d899d57e21409a99c44f76b3fb5ad13c319f
+
+	* infiniband-diags: add dump_fts tool
+
+Fri Feb 1 17:32:47 2013 -0500 Ira Weiny
+3c03a5500635c9a2b4d267d9a271cbdc0ae9f0ae
+
+	* infiniband-diags: libibnetdisc add find node by lid
+
+Fri Feb 15 11:08:35 2013 -0500 Ira Weiny
+35bc343f3989cd6da6e3a420837ca99d6230b0cb
+
+	* infiniband-diags: add change to pregenerated saquery.8.in
+
+Wed Feb 13 19:43:27 2013 -0500 Hal Rosenstock
+33b590b37965ca16b0d38e0ac39ae85a01c57cd2
+
+	* infiniband-diags/saquery: Add support for ServiceID in PathRecord querying
+
+Wed Feb 13 18:29:38 2013 -0500 Ira Weiny
+7d3e8444739940c33fa332568f2755b180899267
+
+	* infiniband-diags: fix saquery rst/man page
+
+Wed Feb 13 17:16:10 2013 -0500 Hal Rosenstock
+de9775709aef452961cbf5f9ec782be6dc28a440
+
+	* infiniband-diags/saquery.c: Display NodeRecord LID in decimal
+
+Wed Feb 6 18:20:10 2013 -0500 Ira Weiny
+6ee7530f07a846ed7be68609f7147b692db370ed
+
+	* infiniband-diags: add comment for path_portid
+
+Sun Feb 3 17:30:11 2013 -0500 Ira Weiny
+47dc80e15b00ca8ecf9202c9a6a47c55332e22d6
+
+	* infiniband-diags: ibroute: add MAD status to query failure message
+
+Tue Jan 22 14:39:18 2013 -0800 Ira Weiny
+7bf6e54ffd57faf39ae2d608e0310b103a4a61db
+
+	* infiniband-diags: ibroute fix resolve failure message
+
+Fri Dec 14 09:11:14 2012 -0500 Hal Rosenstock
+4f572bf8e70be0e3ad32ed17952d3db144279aca
+
+	* infiniband-diags/ibportstate.c: Fix PortInfo sets with extended speeds
+
+Thu Nov 8 17:01:44 2012 -0800 Albert Chu
+9308516164b755a7b71e69eb3cd94e389f1465a5
+
+	* infiniband-diags: Support node-name-map in ibroute
+
+Thu Nov 15 18:57:52 2012 -0500 Ira Weiny
+b68bef7c919bdad0316032b260839c54527ae44a
+
+	* infiniband-diags: add make check target for shell scripts
+
+Mon Nov 5 19:02:40 2012 -0800 Garrett Cooper
+b57ae8989bffc815a3f8a7d9e1ae9f6b05a4d55c
+
+	* Remove bashisms from infiniband-diags
+
+Sun Nov 4 23:19:18 2012 -0500 Ira Weiny
+f381c2120318f88ddcf5a712dd699793fcf1a20e
+
+	* infiniband-diags: Fix ibsysstat man page
+
+Thu Nov 1 08:35:41 2012 -0400 Hal Rosenstock
+2101a9ffe62db5dd9a341238cb52595caa46b3cd
+
+	* infiniband-diags/ibsysstat.c: Fix non default OUI operation
+
+Tue Oct 16 11:45:25 2012 +0200 Dan Ben Yosef
+fa3b6875ff789245b23d90d94458a4c173c10f7d
+
+	* infiniband-diags/src/saquery.c: New option to saquery InformInfoRecord (IIR)
+
+Fri Sep 21 17:36:12 2012 -0400 Ira Weiny
+8f81201385bcf44a4b38bfa9bdfae4db06414a8c
+
+	* infiniband-diags: Fix SA error reporting for common MAD errors
+
+Thu Sep 20 23:59:48 2012 -0400 Ira Weiny
+2263d7e5c01d308702b2a3934e8b4a86a1203894
+
+	* infiniband-diags: fix bug with loop ports where SMP queries are needed
+
+Fri Sep 21 11:59:18 2012 -0400 Ira Weiny
+a9ae8f7bf47f9b91c5f4ec17a7fb3a69581526b3
+
+	* infiniband-diags: move sa query code into it's own common file
+
+Thu Sep 13 16:53:50 2012 -0700 Albert Chu
+75d54e8be81840b664a3aa031f01b794963a91d6
+
+	* infiniband-diags/src/perfquery.c: Fix all_ports corner case
+
+Thu Sep 13 16:13:05 2012 -0700 Albert Chu
+81c48ed47d5decae06b17a554c09b9e1b42da9b4
+
+	* infiniband-diags: Allow user to specify multiple ports
+
+Wed Aug 15 13:50:05 2012 -0400 Ira Weiny
+469d081c2be8eefc3316b6bf2be3d4a8e0356a83
+
+	* infiniband-diags: add default <man>.in files
+
+Tue Jul 24 13:45:53 2012 -0400 Ira Weiny
+0afac222172bba5b49e7e7767ed43db7bb20e2ec
+
+	* infiniband-diags: combine common alias option processing
+
 Mon Jul 30 16:20:55 2012 -0400 Ira Weiny
 f1fa20e2bec8d5866a60bda99dd62e292d2dd616
 
@@ -2857,6 +3207,480 @@ Sun May 11 15:37:11 2008 +0300 Yevgeny Kliteynik
 
 	* infiniband-diags/Makefile.am: fix location of ibdiag_version.h
 
+** Version: 1.6.4
+
+Sat Jan 25 22:10:28 2014 -0800 Ira Weiny
+9a2cb335b77e164b7f849d0ff74b0b67cda20814
+
+	* update README for 1.6.4
+
+Sat Jan 25 22:01:39 2014 -0800 Ira Weiny
+4b2d64157c9c5cea173ea2484dd92919ec421338
+
+	* Revert "libibnetdisc/ibnetdisc.c: improve log information to stdout"
+
+** Version: 1.6.3
+
+Fri Jan 24 19:34:22 2014 -0800 Ira Weiny
+e0d80aa5636a4ef30c9df74f85d50ca44790b525
+
+	* update README for 1.6.3
+
+Fri Jan 24 19:39:10 2014 -0800 Ira Weiny
+5b0c23e2bd82756c09de46ed9e39e757fef0403b
+
+	* ibtracert.8.in: change default pre-built man page
+
+Tue Jan 21 17:15:13 2014 -0800 Al Chu
+21efdf6637f3460dfa5dea32ae3731a529560c60
+
+	* infiniband-diags: Check node-name-map strings when querying by name
+
+Thu Jan 2 08:44:15 2014 +0200 Dan Ben Yosef
+a3f2fcd468b459e0f3b1f5b7c35a7db181d22ee9
+
+	* libibnetdisc/ibnetdisc.c: improve log information to stdout
+
+Mon Dec 30 09:50:59 2013 -0500 Dan Ben Yosef
+ab0551a8cbdce73f193ecd88e732bc88347fb611
+
+	* libibnetdisc/ibnetdisc.c: fix insert of invalid lid 0xFFFF into lid_port hash_table
+
+Sun Oct 13 09:48:36 2013 +0200 Dan Ben Yosef
+59aab498181c6b486a85471d4c0ccb6544a4e83a
+
+	* ibtracert.c: Add 'force' flag to man page
+
+Tue Dec 17 17:27:24 2013 +0200 Dan Ben Yosef
+affc76fb39f0e1e53c0aa98d1073926dae662f8d
+
+	* infiniband-diags/vendstat: Fix GeneralInfo SW version
+
+Sun Oct 20 10:39:23 2013 +0200 Dan Ben Yosef
+b4216ab0359bd60f02eb7ca6de22e17f97ee2842
+
+	* ibportstate: on/off option is missing in help
+
+Thu Oct 10 16:21:12 2013 +0200 Dan Ben Yosef
+0d270e48c1a1d1b2af1aeed99ec9332d367abe54
+
+	* iblinkinfo: Remove "-R" option from man page
+
+Thu Oct 10 15:29:12 2013 +0200 Dan Ben Yosef
+11adcf2ce6db9da67326eab2196c1aaa35cdba0e
+
+	* ibaddr: Add missing -t option to manpage
+
+Mon Sep 16 10:19:58 2013 -0400 Hal Rosenstock
+ca5b23da0c6c8c6e5ad7c1eb3c7580c82235ef00
+
+	* ibdiag_sa.c: Output attribute ID in hex rather than decimal
+
+Tue Aug 20 08:10:59 2013 -0700 Ira Weiny
+914f4c0f4965fc690b3107d717890e3f5bf2b627
+
+	* infiniband-diags: fail configure if glib2 is not found
+
+Sun Aug 18 10:51:50 2013 +0200 Bart Van Assche
+a5f9dc0e3d6a1391b5034252abcc895100142828
+
+	* Fix errors triggered by autoregen.sh
+
+Sun Aug 18 10:57:07 2013 +0200 Bart Van Assche
+cfca87c20de5af4d3c43b1349ed991bf5b30d26a
+
+	* get_lid_from_name(): Remove an unused variable
+
+** Version: 1.6.2
+
+Sun Aug 18 00:37:02 2013 -0700 Ira Weiny
+df1eac51f6518c6b96d09b3cf6a42d856f99b9fe
+
+	* Update README and version to 1.6.2
+
+Thu Aug 1 14:11:06 2013 -0400 Hal Rosenstock
+1d79ffd1a57f2add170af87a68f0354f61a94cc4
+
+	* perfquery.c: Fix dumping of PortSamplesControl
+
+Mon Jul 15 10:32:40 2013 -0400 Hal Rosenstock
+374fd6660fa352501ac1379454abddc174a5a52b
+
+	* infiniband-diags: Eliminate unneeded clean_nodedesc calls
+
+Fri Jul 5 07:59:04 2013 -0700 Ira Weiny
+6825acdd106f2a40493bb5640c9a0ff6f70fea88
+
+	* infiniband-diags: convert IBERROR to IBEXIT
+
+Fri Jul 5 10:24:47 2013 -0400 Ira Weiny
+bae2ff4e7d5b965e63c0972f25022e4f198c8775
+
+	* infiniband-diags: umad_init needs to be called before sa_get_handle
+
+Sat Jun 22 10:07:27 2013 -0400 Hal Rosenstock
+08635c3c1b4799989f98ceb177c420ce8c403182
+
+	* saquery: Add SMInfoRecord support
+
+Sat May 25 09:36:27 2013 -0400 Hal Rosenstock
+9e3446c41dc0afd4fedca9dabd3ef2b687791098
+
+	* infiniband-diags: saquery: Dump SwitchInfoRecord based on IsSetMulticastFDBTopSupported SA capability
+
+Thu Jun 13 14:26:48 2013 -0700 Albert Chu
+6ac17c9927fcad25de1019f5dce99831c8415f95
+
+	* ibnetdiscover: Output vlcap in full output format
+
+Thu Jun 13 14:26:34 2013 -0700 Albert Chu
+5e4fe8c9ac0f73ff260eb61c239c9816ed32dcd0
+
+	* ibnetdiscover: Add missing -f option to manpage
+
+Wed Jun 12 16:39:56 2013 -0700 Ira Weiny
+eb5b498753015ca2cc287532e13fd408c388a593
+
+	* infiniband-diags: ibstat fix strncpy coverity check and -l bug
+
+Wed Jun 12 09:55:53 2013 -0400 Dan Ben Yosef
+e597637189950e433cf1d3e5a9c70984c99a369b
+
+	* saquery.c: resource leak
+
+Wed Jun 12 09:55:48 2013 -0400 Dan Ben Yosef
+37ca525199a16260cbd120fd6ae3f7bab59d6ac9
+
+	* ibtracert.c: Uninitialized variable
+
+Wed Jun 12 09:55:43 2013 -0400 Dan Ben Yosef
+914ebfe24987b4508c6c15b14471a075faaa5f91
+
+	* ibsysstat.c: fix resource leak
+
+Wed Jun 12 09:55:26 2013 -0400 Dan Ben Yosef
+fa7e7a68e0d5df5f87b6731e2bc9cd9c2f6d1ea8
+
+	* ibtracert.c: fix resource leak
+
+Wed Jun 12 07:04:15 2013 -0400 Hal Rosenstock
+274508084b59a30f7d2ea6867c54c4056658bb46
+
+	* libibnetdisc/Makefile.am: Add missing makefile dependency
+
+Wed May 29 08:22:18 2013 -0700 Ira Weiny
+77b235479dfe4762b3c6b92ec452b4ff5862ad1b
+
+	* infiniband-diags: Fix gen_ver.sh for use with new Autoconf file
+
+Tue May 21 15:57:18 2013 -0400 Hal Rosenstock
+c61ca16bb7abbd92d792a1be3e4325f045c8c493
+
+	* saquery: Add SwitchInfoRecord support
+
+Fri Apr 19 10:03:00 2013 -0700 Ira Weiny
+43074c0bf702344eadec6c79920990322db7d7fb
+
+	* infiniband-diags: remove doc/man/ibclearcounters.8.in
+
+Fri Apr 19 09:38:33 2013 -0700 Ira Weiny
+a6f5884c1b01013e4b7ad80c999283f9d3451841
+
+	* infiniband-diags: add .gitignore
+
+Wed Apr 3 13:01:01 2013 -0700 Ira Weiny
+91fda21bb8ee3e3ef6ba344d8195c490a7d2f09f
+
+	* infiniband-diags: updates for new autoconf tools
+
+Thu Mar 28 08:44:59 2013 -0700 Ira Weiny
+75f8e82c906cae079b0121a4b37d0f5f0b34b542
+
+	* infiniband-diags/dump_fts: fix block calculation for LFT's
+
+Thu Mar 28 07:55:40 2013 +0000 Dan Ben Yosef
+04a2cc00078af1cc6e264892e7f133ea8831bebd
+
+	* infiniband-diags/ibroute.c: fix pull extra block for LFT
+
+Tue Mar 19 13:12:55 2013 +0000 Dan Ben Yosef
+7d5c35a82d4516315641d6b5f374ec56382e486d
+
+	* infiniband-diags/ibportstate.c: Add ON and OFF options.
+
+Wed Mar 13 08:04:00 2013 -0700 Ira Weiny
+12258fba0bbc9dd2e3317bda8155d785db9646c6
+
+	* infiniband-diags: update emails in default pages
+
+Wed Mar 13 06:10:32 2013 -0700 Ira Weiny
+b08937cc51aa50f8e6d5033110cd372e6f53ec23
+
+	* infiniband-diags: update emails
+
+Fri Mar 8 18:07:42 2013 -0800 Ira Weiny
+a58cd2a53d2f91390918a8e160b8f724cf6c90d3
+
+	* infiniband-diags: fix rst2man when using upstream docutils
+
+Mon Mar 18 14:36:29 2013 -0700 Ira Weiny
+4649be571b45ca5ac85ee49f3f134a9104e215b3
+
+	* infiniband-diags: add skip-sl to default ibqueryerrors.8.in
+
+Thu Mar 14 14:52:46 2013 +0000 Dan Ben Yosef
+85f31755603200ed6b83e784ee7811410181384e
+
+	* infiniband-diags/ibqueryerrors.c: obtain destination sl before perf query
+
+Wed Feb 20 13:56:36 2013 -0500 Ira Weiny
+d40ad00d604ce8c5e4f337bf6837f11499bd85c7
+
+	* infiniband-diags: fix rpm requires for glib2
+
+Thu Feb 7 16:37:52 2013 -0500 Ira Weiny
+cd53e8aa935151768c3c1ffbb310425b5a84a1c3
+
+	* infiniband-diags: check_lft_balanc: support either DR or Lid based dump lfts output
+
+Sun Feb 3 19:33:06 2013 -0500 Ira Weiny
+209bf9d61788f845d5fed8133733fd25ab4b9d01
+
+	* infiniband-diags: deprecate dump_[m|l]fts.sh scripts
+
+Fri Feb 1 18:13:59 2013 -0500 Ira Weiny
+0ca4d899d57e21409a99c44f76b3fb5ad13c319f
+
+	* infiniband-diags: add dump_fts tool
+
+Fri Feb 1 17:32:47 2013 -0500 Ira Weiny
+3c03a5500635c9a2b4d267d9a271cbdc0ae9f0ae
+
+	* infiniband-diags: libibnetdisc add find node by lid
+
+Fri Feb 15 11:08:35 2013 -0500 Ira Weiny
+35bc343f3989cd6da6e3a420837ca99d6230b0cb
+
+	* infiniband-diags: add change to pregenerated saquery.8.in
+
+Wed Feb 13 19:43:27 2013 -0500 Hal Rosenstock
+33b590b37965ca16b0d38e0ac39ae85a01c57cd2
+
+	* infiniband-diags/saquery: Add support for ServiceID in PathRecord querying
+
+Wed Feb 13 18:29:38 2013 -0500 Ira Weiny
+7d3e8444739940c33fa332568f2755b180899267
+
+	* infiniband-diags: fix saquery rst/man page
+
+Wed Feb 13 17:16:10 2013 -0500 Hal Rosenstock
+de9775709aef452961cbf5f9ec782be6dc28a440
+
+	* infiniband-diags/saquery.c: Display NodeRecord LID in decimal
+
+Wed Feb 6 18:20:10 2013 -0500 Ira Weiny
+6ee7530f07a846ed7be68609f7147b692db370ed
+
+	* infiniband-diags: add comment for path_portid
+
+Sun Feb 3 17:30:11 2013 -0500 Ira Weiny
+47dc80e15b00ca8ecf9202c9a6a47c55332e22d6
+
+	* infiniband-diags: ibroute: add MAD status to query failure message
+
+Tue Jan 22 14:39:18 2013 -0800 Ira Weiny
+7bf6e54ffd57faf39ae2d608e0310b103a4a61db
+
+	* infiniband-diags: ibroute fix resolve failure message
+
+Fri Dec 14 09:11:14 2012 -0500 Hal Rosenstock
+4f572bf8e70be0e3ad32ed17952d3db144279aca
+
+	* infiniband-diags/ibportstate.c: Fix PortInfo sets with extended speeds
+
+Thu Nov 8 17:01:44 2012 -0800 Albert Chu
+9308516164b755a7b71e69eb3cd94e389f1465a5
+
+	* infiniband-diags: Support node-name-map in ibroute
+
+Thu Nov 15 18:57:52 2012 -0500 Ira Weiny
+b68bef7c919bdad0316032b260839c54527ae44a
+
+	* infiniband-diags: add make check target for shell scripts
+
+Mon Nov 5 19:02:40 2012 -0800 Garrett Cooper
+b57ae8989bffc815a3f8a7d9e1ae9f6b05a4d55c
+
+	* Remove bashisms from infiniband-diags
+
+Sun Nov 4 23:19:18 2012 -0500 Ira Weiny
+f381c2120318f88ddcf5a712dd699793fcf1a20e
+
+	* infiniband-diags: Fix ibsysstat man page
+
+Thu Nov 1 08:35:41 2012 -0400 Hal Rosenstock
+2101a9ffe62db5dd9a341238cb52595caa46b3cd
+
+	* infiniband-diags/ibsysstat.c: Fix non default OUI operation
+
+Tue Oct 16 11:45:25 2012 +0200 Dan Ben Yosef
+fa3b6875ff789245b23d90d94458a4c173c10f7d
+
+	* infiniband-diags/src/saquery.c: New option to saquery InformInfoRecord (IIR)
+
+Fri Sep 21 17:36:12 2012 -0400 Ira Weiny
+8f81201385bcf44a4b38bfa9bdfae4db06414a8c
+
+	* infiniband-diags: Fix SA error reporting for common MAD errors
+
+Thu Sep 20 23:59:48 2012 -0400 Ira Weiny
+2263d7e5c01d308702b2a3934e8b4a86a1203894
+
+	* infiniband-diags: fix bug with loop ports where SMP queries are needed
+
+Fri Sep 21 11:59:18 2012 -0400 Ira Weiny
+a9ae8f7bf47f9b91c5f4ec17a7fb3a69581526b3
+
+	* infiniband-diags: move sa query code into it's own common file
+
+Thu Sep 13 16:53:50 2012 -0700 Albert Chu
+75d54e8be81840b664a3aa031f01b794963a91d6
+
+	* infiniband-diags/src/perfquery.c: Fix all_ports corner case
+
+Thu Sep 13 16:13:05 2012 -0700 Albert Chu
+81c48ed47d5decae06b17a554c09b9e1b42da9b4
+
+	* infiniband-diags: Allow user to specify multiple ports
+
+** Version: 1.6.1-4chaos
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+8c4b2ae71e6380bb36a46402ac748211a170bb4e
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+f5ffc5a5aaae6a25239058c5dceb412bbd06793f
+
+	* infiniband-diags: iblinkinfo add "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+af91e9dcb0801a80d2fae499270af163d7ff15e7
+
+	* infiniband-diags: add libibfabricconf
+
+Thu Oct 27 00:16:23 2011 -0700 Ira Weiny
+c37ee5cf7a6de87b4c9f5b2269006f99fbe3bb69
+
+	* Add META for chaos build bot
+
+Wed Sep 12 14:50:41 2012 -0700 Albert Chu
+bd51f1bd1d369089e5c51a6a11401949d77c5f89
+
+	* infiniband-diags: Allow user to specify multiple ports
+
+** Version: 1.6.1-3chaos
+
+Wed Sep 12 21:09:05 2012 -0400 Ira Weiny
+dfdcb7650b183764859c81761bbe8468ba2364a9
+
+	* tag it
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+0613aa22295a2df23199734ff2c1b61917f8801a
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+ff5a78e24ec6c0523ca656f914fd6d87e5a67c3d
+
+	* infiniband-diags: iblinkinfo add "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+ed35acf2fa6f44498bc836063c7393c90b353350
+
+	* infiniband-diags: add libibfabricconf
+
+Thu Oct 27 00:16:23 2011 -0700 Ira Weiny
+c1e7da8c7d07559489b5cd91253ee167ba6e9908
+
+	* Add META for chaos build bot
+
+Wed Sep 12 14:50:41 2012 -0700 Albert Chu
+8b0702445282dbfe323d0bb8542b4be59278870e
+
+	* infiniband-diags: Allow user to specify multiple ports
+
+** Version: 1.6.1-2chaos
+
+Wed Aug 15 14:53:35 2012 -0400 Ira Weiny
+cce9cba9838bf26e3e17c349ccddc1b6bff230e0
+
+	* fix meta
+
+Wed Aug 15 14:02:34 2012 -0400 Ira Weiny
+4498b1bf41d027973546751cc7057416816d4010
+
+	* update tag
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+4913eedb2aa840a4ab96e02a038d21dd560959cc
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+dbb117ddf807b48a0f65de859d0320acf2be3687
+
+	* infiniband-diags: iblinkinfo add "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+7f83e33a3ce6278df5ee52343b363e33650b30b2
+
+	* infiniband-diags: add libibfabricconf
+
+Thu Oct 27 00:16:23 2011 -0700 Ira Weiny
+49ecf1739809959f8c71f672813b755da9713a10
+
+	* Add META for chaos build bot
+
+Wed Aug 15 13:50:05 2012 -0400 Ira Weiny
+469d081c2be8eefc3316b6bf2be3d4a8e0356a83
+
+	* infiniband-diags: add default <man>.in files
+
+** Version: 1.6.1-1chaos
+
+Tue Aug 14 19:54:48 2012 -0400 Ira Weiny
+9aba1151d3aefb73724fd710cbf7257bf21c0949
+
+	* update
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+1307c52cad6b56dbf81faee00ce7835350224681
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+dd40322059ac2d207e2cdf58b92bfc66f96b5227
+
+	* infiniband-diags: iblinkinfo add "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+046b2dddd2cb1b9136417f93d40cd63ec776c0b2
+
+	* infiniband-diags: add libibfabricconf
+
+Thu Oct 27 00:16:23 2011 -0700 Ira Weiny
+4c3c4ba3d7abc7a285bb70db92ee5bb16041ba64
+
+	* Add META for chaos build bot
+
+Tue Jul 24 13:45:53 2012 -0400 Ira Weiny
+0afac222172bba5b49e7e7767ed43db7bb20e2ec
+
+	* infiniband-diags: combine common alias option processing
+
 ** Version: 1.6.1
 
 Mon Jul 30 16:20:55 2012 -0400 Ira Weiny
diff --git a/Makefile.am b/Makefile.am
index 33b5f90..f44b4d6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,7 +15,8 @@ sbin_PROGRAMS = src/ibaddr src/ibnetdiscover src/ibping src/ibportstate \
 	        src/perfquery src/sminfo src/smpdump src/smpquery \
 	        src/saquery src/vendstat src/iblinkinfo \
 		src/ibqueryerrors src/ibcacheedit src/ibccquery \
-		src/ibccconfig
+		src/ibccconfig \
+		src/dump_fts
 
 if ENABLE_TEST_UTILS
 sbin_PROGRAMS += src/ibsendtrap src/mcm_rereg_test
@@ -45,8 +46,7 @@ man_MANS = doc/man/ibaddr.8 \
 		doc/man/ibcacheedit.8 \
 		doc/man/ibccconfig.8 \
 		doc/man/ibccquery.8 \
-		doc/man/dump_lfts.8 \
-		doc/man/dump_mfts.8 \
+		doc/man/dump_fts.8 \
 		doc/man/iblinkinfo.8 \
 		doc/man/ibfindnodesusing.8 \
 		doc/man/ibhosts.8 \
@@ -69,7 +69,9 @@ man_MANS = doc/man/ibaddr.8 \
 		doc/man/smpdump.8 \
 		doc/man/smpquery.8 \
 		doc/man/vendstat.8 \
-		doc/man/infiniband-diags.8
+		doc/man/infiniband-diags.8 \
+		man/dump_lfts.8 \
+		man/dump_mfts.8
 
 # define this for the dist target
 compat_man_pages = man/ibdiscover.8 man/ibcheckerrors.8 man/ibcheckerrs.8 \
@@ -91,7 +93,7 @@ noinst_LIBRARIES = libcommon.a
 AM_CFLAGS = -Wall $(DBGFLAGS)
 LDADD = libcommon.a
 
-libcommon_a_SOURCES = src/ibdiag_common.c
+libcommon_a_SOURCES = src/ibdiag_common.c src/ibdiag_sa.c
 src_ibaddr_SOURCES = src/ibaddr.c
 src_ibnetdiscover_SOURCES = src/ibnetdiscover.c
 src_ibnetdiscover_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
@@ -118,6 +120,9 @@ src_ibqueryerrors_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
 src_ibcacheedit_SOURCES = src/ibcacheedit.c
 src_ibcacheedit_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
 
+src_dump_fts_SOURCES = src/dump_fts.c
+src_dump_fts_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
+
 BUILT_SOURCES = ibdiag_version
 ibdiag_version:
 	if [ -x $(top_srcdir)/gen_ver.sh ] ; then \
@@ -130,6 +135,10 @@ ibdiag_version:
 		fi ; \
 	fi
 
+if HAVE_DASH
+TESTS = tests/check_shells.sh
+endif
+
 EXTRA_DIST = doc scripts include infiniband-diags.spec.in infiniband-diags.spec \
 	$(man_MANS) $(compat_man_pages) autogen.sh etc/*
 
diff --git a/Makefile.in b/Makefile.in
index 0c8f077..b4e25cb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -45,7 +45,7 @@ sbin_PROGRAMS = src/ibaddr$(EXEEXT) src/ibnetdiscover$(EXEEXT) \
 	src/saquery$(EXEEXT) src/vendstat$(EXEEXT) \
 	src/iblinkinfo$(EXEEXT) src/ibqueryerrors$(EXEEXT) \
 	src/ibcacheedit$(EXEEXT) src/ibccquery$(EXEEXT) \
-	src/ibccconfig$(EXEEXT) $(am__EXEEXT_1)
+	src/ibccconfig$(EXEEXT) src/dump_fts$(EXEEXT) $(am__EXEEXT_1)
 @ENABLE_TEST_UTILS_TRUE at am__append_1 = src/ibsendtrap src/mcm_rereg_test
 @ENABLE_COMPAT_UTILS_TRUE at am__append_2 = scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode \
 @ENABLE_COMPAT_UTILS_TRUE@		scripts/ibcheckport scripts/ibcheckportwidth scripts/ibcheckportstate \
@@ -65,8 +65,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
 	$(srcdir)/infiniband-diags.spec.in $(top_srcdir)/configure \
 	$(top_srcdir)/doc/man/check_lft_balance.8.in \
-	$(top_srcdir)/doc/man/dump_lfts.8.in \
-	$(top_srcdir)/doc/man/dump_mfts.8.in \
+	$(top_srcdir)/doc/man/dump_fts.8.in \
 	$(top_srcdir)/doc/man/ibaddr.8.in \
 	$(top_srcdir)/doc/man/ibcacheedit.8.in \
 	$(top_srcdir)/doc/man/ibccconfig.8.in \
@@ -95,6 +94,8 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(top_srcdir)/doc/man/smpquery.8.in \
 	$(top_srcdir)/doc/man/vendstat.8.in \
 	$(top_srcdir)/include/ibdiag_version.h.in \
+	$(top_srcdir)/scripts/dump_lfts.sh.in \
+	$(top_srcdir)/scripts/dump_mfts.sh.in \
 	$(top_srcdir)/scripts/ibcheckerrors.in \
 	$(top_srcdir)/scripts/ibcheckerrs.in \
 	$(top_srcdir)/scripts/ibchecknet.in \
@@ -114,7 +115,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(top_srcdir)/scripts/ibqueryerrors.pl.in \
 	$(top_srcdir)/scripts/ibrouters.in \
 	$(top_srcdir)/scripts/ibswitches.in AUTHORS COPYING ChangeLog \
-	config/compile config/config.guess config/config.sub \
+	NEWS config/compile config/config.guess config/config.sub \
 	config/depcomp config/install-sh config/ltmain.sh \
 	config/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -122,7 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
-	$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.in
+	$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -138,10 +139,10 @@ CONFIG_CLEAN_FILES = infiniband-diags.spec include/ibdiag_version.h \
 	scripts/ibdatacounts scripts/ibdatacounters scripts/ibhosts \
 	scripts/ibnodes scripts/ibswitches scripts/ibrouters \
 	scripts/iblinkinfo.pl scripts/ibqueryerrors.pl \
-	doc/man/ibaddr.8 doc/man/check_lft_balance.8 \
-	doc/man/ibcacheedit.8 doc/man/ibccconfig.8 doc/man/ibccquery.8 \
-	doc/man/dump_lfts.8 doc/man/dump_mfts.8 doc/man/ibhosts.8 \
-	doc/man/ibidsverify.8 doc/man/iblinkinfo.8 \
+	scripts/dump_lfts.sh scripts/dump_mfts.sh doc/man/ibaddr.8 \
+	doc/man/check_lft_balance.8 doc/man/ibcacheedit.8 \
+	doc/man/ibccconfig.8 doc/man/ibccquery.8 doc/man/dump_fts.8 \
+	doc/man/ibhosts.8 doc/man/ibidsverify.8 doc/man/iblinkinfo.8 \
 	doc/man/ibfindnodesusing.8 doc/man/ibnetdiscover.8 \
 	doc/man/ibnodes.8 doc/man/ibping.8 doc/man/ibportstate.8 \
 	doc/man/ibqueryerrors.8 doc/man/ibroute.8 doc/man/ibrouters.8 \
@@ -155,18 +156,25 @@ LIBRARIES = $(noinst_LIBRARIES)
 ARFLAGS = cru
 libcommon_a_AR = $(AR) $(ARFLAGS)
 libcommon_a_LIBADD =
-am_libcommon_a_OBJECTS = ibdiag_common.$(OBJEXT)
+am_libcommon_a_OBJECTS = ibdiag_common.$(OBJEXT) ibdiag_sa.$(OBJEXT)
 libcommon_a_OBJECTS = $(am_libcommon_a_OBJECTS)
 @ENABLE_TEST_UTILS_TRUE at am__EXEEXT_1 = src/ibsendtrap$(EXEEXT) \
 @ENABLE_TEST_UTILS_TRUE@	src/mcm_rereg_test$(EXEEXT)
 am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" \
 	"$(DESTDIR)$(man8dir)"
 PROGRAMS = $(sbin_PROGRAMS)
+am_src_dump_fts_OBJECTS = dump_fts.$(OBJEXT)
+src_dump_fts_OBJECTS = $(am_src_dump_fts_OBJECTS)
+src_dump_fts_LDADD = $(LDADD)
+src_dump_fts_DEPENDENCIES = libcommon.a
+src_dump_fts_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(src_dump_fts_LDFLAGS) $(LDFLAGS) -o $@
+am__dirstamp = $(am__leading_dot)dirstamp
 am_src_ibaddr_OBJECTS = ibaddr.$(OBJEXT)
 src_ibaddr_OBJECTS = $(am_src_ibaddr_OBJECTS)
 src_ibaddr_LDADD = $(LDADD)
 src_ibaddr_DEPENDENCIES = libcommon.a
-am__dirstamp = $(am__leading_dot)dirstamp
 am_src_ibcacheedit_OBJECTS = ibcacheedit.$(OBJEXT)
 src_ibcacheedit_OBJECTS = $(am_src_ibcacheedit_OBJECTS)
 src_ibcacheedit_LDADD = $(LDADD)
@@ -294,28 +302,30 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
-SOURCES = $(libcommon_a_SOURCES) $(src_ibaddr_SOURCES) \
-	$(src_ibcacheedit_SOURCES) $(src_ibccconfig_SOURCES) \
-	$(src_ibccquery_SOURCES) $(src_iblinkinfo_SOURCES) \
-	$(src_ibnetdiscover_SOURCES) $(src_ibping_SOURCES) \
-	$(src_ibportstate_SOURCES) $(src_ibqueryerrors_SOURCES) \
-	$(src_ibroute_SOURCES) $(src_ibsendtrap_SOURCES) \
-	$(src_ibstat_SOURCES) $(src_ibsysstat_SOURCES) \
-	$(src_ibtracert_SOURCES) $(src_mcm_rereg_test_SOURCES) \
-	$(src_perfquery_SOURCES) $(src_saquery_SOURCES) \
-	$(src_sminfo_SOURCES) $(src_smpdump_SOURCES) \
-	$(src_smpquery_SOURCES) $(src_vendstat_SOURCES)
-DIST_SOURCES = $(libcommon_a_SOURCES) $(src_ibaddr_SOURCES) \
-	$(src_ibcacheedit_SOURCES) $(src_ibccconfig_SOURCES) \
-	$(src_ibccquery_SOURCES) $(src_iblinkinfo_SOURCES) \
-	$(src_ibnetdiscover_SOURCES) $(src_ibping_SOURCES) \
-	$(src_ibportstate_SOURCES) $(src_ibqueryerrors_SOURCES) \
-	$(src_ibroute_SOURCES) $(src_ibsendtrap_SOURCES) \
-	$(src_ibstat_SOURCES) $(src_ibsysstat_SOURCES) \
-	$(src_ibtracert_SOURCES) $(src_mcm_rereg_test_SOURCES) \
-	$(src_perfquery_SOURCES) $(src_saquery_SOURCES) \
-	$(src_sminfo_SOURCES) $(src_smpdump_SOURCES) \
-	$(src_smpquery_SOURCES) $(src_vendstat_SOURCES)
+SOURCES = $(libcommon_a_SOURCES) $(src_dump_fts_SOURCES) \
+	$(src_ibaddr_SOURCES) $(src_ibcacheedit_SOURCES) \
+	$(src_ibccconfig_SOURCES) $(src_ibccquery_SOURCES) \
+	$(src_iblinkinfo_SOURCES) $(src_ibnetdiscover_SOURCES) \
+	$(src_ibping_SOURCES) $(src_ibportstate_SOURCES) \
+	$(src_ibqueryerrors_SOURCES) $(src_ibroute_SOURCES) \
+	$(src_ibsendtrap_SOURCES) $(src_ibstat_SOURCES) \
+	$(src_ibsysstat_SOURCES) $(src_ibtracert_SOURCES) \
+	$(src_mcm_rereg_test_SOURCES) $(src_perfquery_SOURCES) \
+	$(src_saquery_SOURCES) $(src_sminfo_SOURCES) \
+	$(src_smpdump_SOURCES) $(src_smpquery_SOURCES) \
+	$(src_vendstat_SOURCES)
+DIST_SOURCES = $(libcommon_a_SOURCES) $(src_dump_fts_SOURCES) \
+	$(src_ibaddr_SOURCES) $(src_ibcacheedit_SOURCES) \
+	$(src_ibccconfig_SOURCES) $(src_ibccquery_SOURCES) \
+	$(src_iblinkinfo_SOURCES) $(src_ibnetdiscover_SOURCES) \
+	$(src_ibping_SOURCES) $(src_ibportstate_SOURCES) \
+	$(src_ibqueryerrors_SOURCES) $(src_ibroute_SOURCES) \
+	$(src_ibsendtrap_SOURCES) $(src_ibstat_SOURCES) \
+	$(src_ibsysstat_SOURCES) $(src_ibtracert_SOURCES) \
+	$(src_mcm_rereg_test_SOURCES) $(src_perfquery_SOURCES) \
+	$(src_saquery_SOURCES) $(src_sminfo_SOURCES) \
+	$(src_smpdump_SOURCES) $(src_smpquery_SOURCES) \
+	$(src_vendstat_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
 	install-dvi-recursive install-exec-recursive \
@@ -333,6 +343,8 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
 	distdir dist dist-all distcheck
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
@@ -394,6 +406,8 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GREP = @GREP@
 IBDIAG_CONFIG_PATH = @IBDIAG_CONFIG_PATH@
 IBSCRIPTPATH = @IBSCRIPTPATH@
@@ -427,6 +441,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_INSTALLDIR = @PERL_INSTALLDIR@
+PKG_CONFIG = @PKG_CONFIG@
 RANLIB = @RANLIB@
 RELEASE = @RELEASE@
 SED = @SED@
@@ -458,6 +473,7 @@ datarootdir = @datarootdir@
 docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
+have_dash = @have_dash@
 have_rst2man = @have_rst2man@
 host = @host@
 host_alias = @host_alias@
@@ -503,7 +519,7 @@ sbin_SCRIPTS = scripts/ibhosts scripts/ibswitches scripts/ibnodes \
 	$(am__append_2)
 man_MANS = doc/man/ibaddr.8 doc/man/check_lft_balance.8 \
 	doc/man/ibcacheedit.8 doc/man/ibccconfig.8 doc/man/ibccquery.8 \
-	doc/man/dump_lfts.8 doc/man/dump_mfts.8 doc/man/iblinkinfo.8 \
+	doc/man/dump_fts.8 doc/man/iblinkinfo.8 \
 	doc/man/ibfindnodesusing.8 doc/man/ibhosts.8 \
 	doc/man/ibidsverify.8 doc/man/ibnetdiscover.8 \
 	doc/man/ibnodes.8 doc/man/ibping.8 doc/man/ibportstate.8 \
@@ -512,7 +528,8 @@ man_MANS = doc/man/ibaddr.8 doc/man/check_lft_balance.8 \
 	doc/man/ibsysstat.8 doc/man/ibtracert.8 doc/man/perfquery.8 \
 	doc/man/saquery.8 doc/man/sminfo.8 doc/man/smpdump.8 \
 	doc/man/smpquery.8 doc/man/vendstat.8 \
-	doc/man/infiniband-diags.8 $(am__append_3)
+	doc/man/infiniband-diags.8 man/dump_lfts.8 man/dump_mfts.8 \
+	$(am__append_3)
 
 # define this for the dist target
 compat_man_pages = man/ibdiscover.8 man/ibcheckerrors.8 man/ibcheckerrs.8 \
@@ -527,7 +544,7 @@ compat_man_pages = man/ibdiscover.8 man/ibcheckerrors.8 man/ibcheckerrs.8 \
 noinst_LIBRARIES = libcommon.a
 AM_CFLAGS = -Wall $(DBGFLAGS)
 LDADD = libcommon.a
-libcommon_a_SOURCES = src/ibdiag_common.c
+libcommon_a_SOURCES = src/ibdiag_common.c src/ibdiag_sa.c
 src_ibaddr_SOURCES = src/ibaddr.c
 src_ibnetdiscover_SOURCES = src/ibnetdiscover.c
 src_ibnetdiscover_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
@@ -553,7 +570,10 @@ src_ibqueryerrors_SOURCES = src/ibqueryerrors.c
 src_ibqueryerrors_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
 src_ibcacheedit_SOURCES = src/ibcacheedit.c
 src_ibcacheedit_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
+src_dump_fts_SOURCES = src/dump_fts.c
+src_dump_fts_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
 BUILT_SOURCES = ibdiag_version
+ at HAVE_DASH_TRUE@TESTS = tests/check_shells.sh
 EXTRA_DIST = doc scripts include infiniband-diags.spec.in infiniband-diags.spec \
 	$(man_MANS) $(compat_man_pages) autogen.sh etc/*
 
@@ -655,6 +675,10 @@ scripts/iblinkinfo.pl: $(top_builddir)/config.status $(top_srcdir)/scripts/iblin
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 scripts/ibqueryerrors.pl: $(top_builddir)/config.status $(top_srcdir)/scripts/ibqueryerrors.pl.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
+scripts/dump_lfts.sh: $(top_builddir)/config.status $(top_srcdir)/scripts/dump_lfts.sh.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+scripts/dump_mfts.sh: $(top_builddir)/config.status $(top_srcdir)/scripts/dump_mfts.sh.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
 doc/man/ibaddr.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibaddr.8.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 doc/man/check_lft_balance.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/check_lft_balance.8.in
@@ -665,9 +689,7 @@ doc/man/ibccconfig.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibccco
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 doc/man/ibccquery.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibccquery.8.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
-doc/man/dump_lfts.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/dump_lfts.8.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-doc/man/dump_mfts.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/dump_mfts.8.in
+doc/man/dump_fts.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/dump_fts.8.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 doc/man/ibhosts.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibhosts.8.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
@@ -768,6 +790,9 @@ clean-sbinPROGRAMS:
 src/$(am__dirstamp):
 	@$(MKDIR_P) src
 	@: > src/$(am__dirstamp)
+src/dump_fts$(EXEEXT): $(src_dump_fts_OBJECTS) $(src_dump_fts_DEPENDENCIES) src/$(am__dirstamp)
+	@rm -f src/dump_fts$(EXEEXT)
+	$(src_dump_fts_LINK) $(src_dump_fts_OBJECTS) $(src_dump_fts_LDADD) $(LIBS)
 src/ibaddr$(EXEEXT): $(src_ibaddr_OBJECTS) $(src_ibaddr_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibaddr$(EXEEXT)
 	$(LINK) $(src_ibaddr_OBJECTS) $(src_ibaddr_LDADD) $(LIBS)
@@ -872,11 +897,13 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dump_fts.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibaddr.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibcacheedit.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibccconfig.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibccquery.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibdiag_common.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibdiag_sa.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/iblinkinfo.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibnetdiscover.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibping.Po at am__quote@
@@ -930,6 +957,34 @@ ibdiag_common.obj: src/ibdiag_common.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
 
+ibdiag_sa.o: src/ibdiag_sa.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibdiag_sa.o -MD -MP -MF $(DEPDIR)/ibdiag_sa.Tpo -c -o ibdiag_sa.o `test -f 'src/ibdiag_sa.c' || echo '$(srcdir)/'`src/ibdiag_sa.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibdiag_sa.Tpo $(DEPDIR)/ibdiag_sa.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_sa.c' object='ibdiag_sa.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibdiag_sa.o `test -f 'src/ibdiag_sa.c' || echo '$(srcdir)/'`src/ibdiag_sa.c
+
+ibdiag_sa.obj: src/ibdiag_sa.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibdiag_sa.obj -MD -MP -MF $(DEPDIR)/ibdiag_sa.Tpo -c -o ibdiag_sa.obj `if test -f 'src/ibdiag_sa.c'; then $(CYGPATH_W) 'src/ibdiag_sa.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_sa.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibdiag_sa.Tpo $(DEPDIR)/ibdiag_sa.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_sa.c' object='ibdiag_sa.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibdiag_sa.obj `if test -f 'src/ibdiag_sa.c'; then $(CYGPATH_W) 'src/ibdiag_sa.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_sa.c'; fi`
+
+dump_fts.o: src/dump_fts.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dump_fts.o -MD -MP -MF $(DEPDIR)/dump_fts.Tpo -c -o dump_fts.o `test -f 'src/dump_fts.c' || echo '$(srcdir)/'`src/dump_fts.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/dump_fts.Tpo $(DEPDIR)/dump_fts.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/dump_fts.c' object='dump_fts.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dump_fts.o `test -f 'src/dump_fts.c' || echo '$(srcdir)/'`src/dump_fts.c
+
+dump_fts.obj: src/dump_fts.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dump_fts.obj -MD -MP -MF $(DEPDIR)/dump_fts.Tpo -c -o dump_fts.obj `if test -f 'src/dump_fts.c'; then $(CYGPATH_W) 'src/dump_fts.c'; else $(CYGPATH_W) '$(srcdir)/src/dump_fts.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/dump_fts.Tpo $(DEPDIR)/dump_fts.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/dump_fts.c' object='dump_fts.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dump_fts.obj `if test -f 'src/dump_fts.c'; then $(CYGPATH_W) 'src/dump_fts.c'; else $(CYGPATH_W) '$(srcdir)/src/dump_fts.c'; fi`
+
 ibaddr.o: src/ibaddr.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibaddr.o -MD -MP -MF $(DEPDIR)/ibaddr.Tpo -c -o ibaddr.o `test -f 'src/ibaddr.c' || echo '$(srcdir)/'`src/ibaddr.c
 @am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibaddr.Tpo $(DEPDIR)/ibaddr.Po
@@ -1407,6 +1462,98 @@ GTAGS:
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    echo "$$grn$$dashes"; \
+	  else \
+	    echo "$$red$$dashes"; \
+	  fi; \
+	  echo "$$banner"; \
+	  test -z "$$skipped" || echo "$$skipped"; \
+	  test -z "$$report" || echo "$$report"; \
+	  echo "$$dashes$$std"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
 distdir: $(DISTFILES)
 	@list='$(MANS)'; if test -n "$$list"; then \
 	  list=`for p in $$list; do \
@@ -1543,7 +1690,7 @@ distcheck: dist
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	chmod -R a-w $(distdir); chmod u+w $(distdir)
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
@@ -1599,6 +1746,7 @@ distcleancheck: distclean
 	       $(distcleancheck_listfiles) ; \
 	       exit 1; } >&2
 check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) check-recursive
 all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h
@@ -1714,29 +1862,29 @@ uninstall-am: uninstall-man uninstall-sbinPROGRAMS \
 uninstall-man: uninstall-man8
 
 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
-	ctags-recursive install install-am install-data-am \
+	check-am ctags-recursive install install-am install-data-am \
 	install-strip tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-generic \
-	clean-libtool clean-noinstLIBRARIES clean-sbinPROGRAMS ctags \
-	ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
-	dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
-	distclean distclean-compile distclean-generic distclean-hdr \
-	distclean-libtool distclean-local distclean-tags \
-	distcleancheck distdir distuninstallcheck dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-data-hook install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-man8 \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-sbinPROGRAMS install-sbinSCRIPTS install-strip \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
-	uninstall-man uninstall-man8 uninstall-sbinPROGRAMS \
-	uninstall-sbinSCRIPTS
+	all all-am am--refresh check check-TESTS check-am clean \
+	clean-generic clean-libtool clean-noinstLIBRARIES \
+	clean-sbinPROGRAMS ctags ctags-recursive dist dist-all \
+	dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar dist-tarZ \
+	dist-xz dist-zip distcheck distclean distclean-compile \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-local distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am \
+	install-data-hook install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-man8 install-pdf \
+	install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
+	install-sbinSCRIPTS install-strip installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am uninstall-man \
+	uninstall-man8 uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
 
 ibdiag_version:
 	if [ -x $(top_srcdir)/gen_ver.sh ] ; then \
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..84c99e7
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,2 @@
+New automake requires this file.
+
diff --git a/README b/README
index 78cc96c..c4789ce 100644
--- a/README
+++ b/README
@@ -10,13 +10,37 @@ interface to this library is _not_ guaranteed to be stable (though we try.)
 
 Dependencies:
 
-	1) libibmad >= 1.3.9
+	1) libibmad >= 1.3.10
 	2) libibumad >= 1.3.7
 	3) opensm-libs >= 3.3.10
 	4) ib_umad kernel module
+	5) glib2
 
 
-Release notes v1.6.0 => 1.6.1
+Release notes v1.6.2 => 1.6.4
 
-   1) bug fixes and code clean up
+   1) bug fixes
+
+Authors since 1.6.2
+
+Al Chu <chu11 at llnl.gov>
+	infiniband-diags: Check node-name-map strings when querying by name
+
+Dan Ben Yosef <danby at mellanox.com>
+	libibnetdisc/ibnetdisc.c: fix insert of invalid lid 0xFFFF into lid_port hash_table
+	ibtracert.c: Add 'force' flag to man page
+	infiniband-diags/vendstat: Fix GeneralInfo SW version
+	ibportstate: on/off option is missing in help
+	iblinkinfo: Remove "-R" option from man page
+	ibaddr: Add missing -t option to manpage
+
+Hal Rosenstock <hal at dev.mellanox.co.il>
+	ibdiag_sa.c: Output attribute ID in hex rather than decimal
+
+Ira Weiny <ira.weiny at intel.com>
+	infiniband-diags: fail configure if glib2 is not found
+
+Bart Van Assche <bvanassche at acm.org>
+	Fix errors triggered by autoregen.sh
+	get_lid_from_name(): Remove an unused variable
 
diff --git a/aclocal.m4 b/aclocal.m4
index b5ac213..ad2460c 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -19,6 +19,162 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+		
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+		     [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+        else 
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+		[AC_MSG_RESULT([no])
+                $4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -651,6 +807,41 @@ AC_MSG_RESULT([$_am_result])
 rm -f confinc confmf
 ])
 
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
diff --git a/autogen.sh b/autogen.sh
index 7fd0f20..3745b11 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -3,15 +3,6 @@
 # create config dir if not exist
 test -d config || mkdir config
 
-rst2manexe=`which rst2man`
-if [ "$rst2manexe" == "" ]; then
-	echo "ERROR: Building from source requires rst2man to build the man pages"
-fi
-
 set -x
-aclocal -I config
-libtoolize --force --copy
-autoheader
 doc/generate
-automake --foreign --add-missing --copy
-autoconf
+autoreconf -ifv -I config
diff --git a/config.h.in b/config.h.in
index a3b72ae..fd649c3 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,4 +1,4 @@
-/* config.h.in.  Generated from configure.in by autoheader.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
@@ -9,6 +9,9 @@
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
+/* Define to 1 to indicate GLIB support */
+#undef HAVE_GLIB
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
@@ -82,6 +85,9 @@
    */
 #undef LT_OBJDIR
 
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
 /* Name of package */
 #undef PACKAGE
 
diff --git a/config/compile b/config/compile
index 1b1d232..c0096a7 100755
--- a/config/compile
+++ b/config/compile
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand `-c -o'.
 
-scriptversion=2005-05-14.22
+scriptversion=2009-10-06.20; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
+# Foundation, Inc.
 # Written by Tom Tromey <tromey at cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,8 +18,7 @@ scriptversion=2005-05-14.22
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -103,13 +103,13 @@ if test -z "$ofile" || test -z "$cfile"; then
 fi
 
 # Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
 
 # Create the lock directory.
-# Note: use `[/.-]' here to ensure that we don't use the same name
+# Note: use `[/\\:.-]' here to ensure that we don't use the same name
 # that we are using for the .o file.  Also, base the name on the expected
 # object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
 while true; do
   if mkdir "$lockdir" >/dev/null 2>&1; then
     break
@@ -124,9 +124,9 @@ trap "rmdir '$lockdir'; exit 1" 1 2 15
 ret=$?
 
 if test -f "$cofile"; then
-  mv "$cofile" "$ofile"
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
 elif test -f "${cofile}bj"; then
-  mv "${cofile}bj" "$ofile"
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
 fi
 
 rmdir "$lockdir"
@@ -138,5 +138,6 @@ exit $ret
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/config/config.guess b/config/config.guess
index 2fc3acc..dc84c68 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
 
-timestamp='2003-06-17'
+timestamp='2009-11-20'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,23 +18,25 @@ timestamp='2003-06-17'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Originally written by Per Bothner <per at bothner.com>.
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+
+# Originally written by Per Bothner.  Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # exits with 0.  Otherwise, it exits with 1.
 #
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -53,8 +56,8 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -66,11 +69,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )	# Use stdin as input.
@@ -104,7 +107,7 @@ set_cc_for_build='
 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -123,7 +126,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
 	;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi at noc.rutgers.edu 1994-08-24)
@@ -136,13 +139,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-## for Red Hat Linux
-if test -f /etc/redhat-release ; then
-    VENDOR=redhat ;
-else
-    VENDOR= ;
-fi
-
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -165,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
@@ -173,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep __ELF__ >/dev/null
+			| grep -q __ELF__
 		then
 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 		    # Return netbsd for either.  FIX?
@@ -203,50 +200,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
-	exit 0 ;;
-    amiga:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    arc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    hp300:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mac68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    macppc:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-	echo m88k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvmeppc:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    pmax:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sgi:OpenBSD:*:*)
-	echo mipseb-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sun3:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:OpenBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
     alpha:OSF1:*:*)
-	if test $UNAME_RELEASE = "V4.0"; then
+	case $UNAME_RELEASE in
+	*4.0)
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-	fi
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
 	# According to Compaq, /usr/sbin/psrinfo has been available on
 	# OSF/1 and Tru64 systems produced since 1995.  I hope that
 	# covers most systems running today.  This code pipes the CPU
@@ -284,42 +263,49 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    "EV7.9 (21364A)")
 		UNAME_MACHINE="alphaev79" ;;
 	esac
+	# A Pn.n version is a patched version.
 	# A Vn.n version is a released version.
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit 0 ;;
-    Alpha*:OpenVMS:*:*)
-	echo alpha-hp-vms
-	exit 0 ;;
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
 	# of the specific Alpha model?
 	echo alpha-pc-interix
-	exit 0 ;;
+	exit ;;
     21064:Windows_NT:50:3)
 	echo alpha-dec-winnt3.5
-	exit 0 ;;
+	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
-	exit 0;;
+	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-amigaos
-	exit 0 ;;
+	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-morphos
-	exit 0 ;;
+	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
-	exit 0 ;;
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit 0;;
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
-	exit 0;;
+	exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
 	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
 	if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -327,32 +313,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	else
 		echo pyramid-pyramid-bsd
 	fi
-	exit 0 ;;
+	exit ;;
     NILE*:*:*:dcosx)
 	echo pyramid-pyramid-svr4
-	exit 0 ;;
+	exit ;;
     DRS?6000:unix:4.0:6*)
 	echo sparc-icl-nx6
-	exit 0 ;;
-    DRS?6000:UNIX_SV:4.2*:7*)
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
 	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7 && exit 0 ;;
+	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
     sun4H:SunOS:5.*:*)
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
-    i86pc:SunOS:5.*:*)
-	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
 	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
 	    Series*|S4*)
@@ -361,10 +366,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
 	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit 0 ;;
+	exit ;;
     sun3*:SunOS:*:*)
 	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -376,10 +381,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		echo sparc-sun-sunos${UNAME_RELEASE}
 		;;
 	esac
-	exit 0 ;;
+	exit ;;
     aushp:SunOS:*:*)
 	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -390,37 +395,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
     powerpc:machten:*:*)
 	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
-	exit 0 ;;
+	exit ;;
     RISC*:ULTRIX:*:*)
 	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     VAX*:ULTRIX*:*:*)
 	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
 	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -444,32 +452,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	  exit (-1);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c \
-	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-	  && exit 0
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
 	echo mips-mips-riscos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
-	exit 0 ;;
+	exit ;;
     Motorola:*:4.3:PL8-*)
 	echo powerpc-harris-powermax
-	exit 0 ;;
+	exit ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 	echo powerpc-harris-powermax
-	exit 0 ;;
+	exit ;;
     Night_Hawk:Power_UNIX:*:*)
 	echo powerpc-harris-powerunix
-	exit 0 ;;
+	exit ;;
     m88k:CX/UX:7*:*)
 	echo m88k-harris-cxux7
-	exit 0 ;;
+	exit ;;
     m88k:*:4*:R4*)
 	echo m88k-motorola-sysv4
-	exit 0 ;;
+	exit ;;
     m88k:*:3*:R3*)
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -485,29 +494,29 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit 0 ;;
+ 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
-	exit 0 ;;
+	exit ;;
     M88*:*:R3*:*)
 	# Delta 88k system running SVR3
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
 	echo m88k-tektronix-sysv3
-	exit 0 ;;
+	exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
 	echo m68k-tektronix-bsd
-	exit 0 ;;
+	exit ;;
     *:IRIX*:*:*)
 	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit 0 ;;
+	exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
 	echo i386-ibm-aix
-	exit 0 ;;
+	exit ;;
     ia64:AIX:*:*)
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
@@ -515,7 +524,7 @@ EOF
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-	exit 0 ;;
+	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 		eval $set_cc_for_build
@@ -530,15 +539,19 @@ EOF
 			exit(0);
 			}
 EOF
-		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
-		echo rs6000-ibm-aix3.2.5
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
 		echo rs6000-ibm-aix3.2.4
 	else
 		echo rs6000-ibm-aix3.2
 	fi
-	exit 0 ;;
-    *:AIX:*:[45])
+	exit ;;
+    *:AIX:*:[456])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
@@ -551,28 +564,28 @@ EOF
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit 0 ;;
+	exit ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
-	exit 0 ;;
+	exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 	echo romp-ibm-bsd4.4
-	exit 0 ;;
+	exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
 	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit 0 ;;                           # report: romp-ibm BSD 4.3
+	exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
-	exit 0 ;;
+	exit ;;
     DPX/2?00:B.O.S.:*:*)
 	echo m68k-bull-sysv3
-	exit 0 ;;
+	exit ;;
     9000/[34]??:4.3bsd:1.*:*)
 	echo m68k-hp-bsd
-	exit 0 ;;
+	exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
 	echo m68k-hp-bsd4.4
-	exit 0 ;;
+	exit ;;
     9000/[34678]??:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	case "${UNAME_MACHINE}" in
@@ -634,9 +647,19 @@ EOF
 	esac
 	if [ ${HP_ARCH} = "hppa2.0w" ]
 	then
-	    # avoid double evaluation of $set_cc_for_build
-	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep -q __LP64__
 	    then
 		HP_ARCH="hppa2.0w"
 	    else
@@ -644,11 +667,11 @@ EOF
 	    fi
 	fi
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit 0 ;;
+	exit ;;
     ia64:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	echo ia64-hp-hpux${HPUX_REV}
-	exit 0 ;;
+	exit ;;
     3050*:HI-UX:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -676,208 +699,248 @@ EOF
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
 	echo unknown-hitachi-hiuxwe2
-	exit 0 ;;
+	exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
 	echo hppa1.1-hp-bsd
-	exit 0 ;;
+	exit ;;
     9000/8??:4.3bsd:*:*)
 	echo hppa1.0-hp-bsd
-	exit 0 ;;
+	exit ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 	echo hppa1.0-hp-mpeix
-	exit 0 ;;
+	exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
 	echo hppa1.1-hp-osf
-	exit 0 ;;
+	exit ;;
     hp8??:OSF1:*:*)
 	echo hppa1.0-hp-osf
-	exit 0 ;;
+	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
 	    echo ${UNAME_MACHINE}-unknown-osf1mk
 	else
 	    echo ${UNAME_MACHINE}-unknown-osf1
 	fi
-	exit 0 ;;
+	exit ;;
     parisc*:Lites*:*:*)
 	echo hppa1.1-hp-lites
-	exit 0 ;;
+	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit 0 ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit 0 ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit 0 ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit 0 ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit 0 ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*[A-Z]90:*:*:*)
 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*TS:*:*:*)
 	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*T3E:*:*:*)
 	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*SV1:*:*:*)
 	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     *:UNICOS/mp:*:*)
-	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 
-	exit 0 ;;
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit 0 ;;
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sparc*:BSD/OS:*:*)
 	echo sparc-unknown-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:BSD/OS:*:*)
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-	exit 0 ;;
-    *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
-	# Determine whether the default compiler uses glibc.
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <features.h>
-	#if __GLIBC__ >= 2
-	LIBC=gnu
-	#else
-	LIBC=
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
-	exit 0 ;;
+	exit ;;
+    *:FreeBSD:*:*)
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
-	exit 0 ;;
-    i*:MINGW*:*)
+	exit ;;
+    *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
-	exit 0 ;;
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
-	exit 0 ;;
-    x86:Interix*:[34]*)
-	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-	exit 0 ;;
+	exit ;;
+    *:Interix*:*)
+    	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    authenticamd | genuineintel | EM64T)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
-	exit 0 ;;
+	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
 	# UNAME_MACHINE based on the output of uname instead of i386?
 	echo i586-pc-interix
-	exit 0 ;;
+	exit ;;
     i*:UWIN*:*)
 	echo ${UNAME_MACHINE}-pc-uwin
-	exit 0 ;;
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
     p*:CYGWIN*:*)
 	echo powerpcle-unknown-cygwin
-	exit 0 ;;
+	exit ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     *:GNU:*:*)
+	# the GNU system
 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit 0 ;;
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
-	exit 0 ;;
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
     arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	else
+	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     cris:Linux:*:*)
 	echo cris-axis-linux-gnu
-	exit 0 ;;
-    ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
-	exit 0 ;;
-    m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
-    mips:Linux:*:*)
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
+	LIBC=gnu
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
-	#undef CPU
-	#undef mips
-	#undef mipsel
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=mipsel
-	#else
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=mips
-	#else
-	CPU=
-	#endif
+	#ifdef __dietlibc__
+	LIBC=dietlibc
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
-	;;
-    mips64:Linux:*:*)
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
 	#undef CPU
-	#undef mips64
-	#undef mips64el
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=mips64el
+	CPU=${UNAME_MACHINE}el
 	#else
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=mips64
+	CPU=${UNAME_MACHINE}
 	#else
 	CPU=
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
-    ppc:Linux:*:*)
-	echo powerpc-${VENDOR:-unknown}-linux-gnu
-	exit 0 ;;
-    ppc64:Linux:*:*)
-	echo powerpc64-${VENDOR:-unknown}-linux-gnu
-	exit 0 ;;
-    alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-	  EV5)   UNAME_MACHINE=alphaev5 ;;
-	  EV56)  UNAME_MACHINE=alphaev56 ;;
-	  PCA56) UNAME_MACHINE=alphapca56 ;;
-	  PCA57) UNAME_MACHINE=alphapca56 ;;
-	  EV6)   UNAME_MACHINE=alphaev6 ;;
-	  EV67)  UNAME_MACHINE=alphaev67 ;;
-	  EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-	exit 0 ;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -885,84 +948,40 @@ EOF
 	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
 	  *)    echo hppa-unknown-linux-gnu ;;
 	esac
-	exit 0 ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
-	exit 0 ;;
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
     sh64*:Linux:*:*)
     	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     sh*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-${VENDOR:-unknown}-linux-gnu
-	exit 0 ;;
-    i*86:Linux:*:*)
-	# The BFD linker knows what the default object file format is, so
-	# first see if it will tell us. cd to the root directory to prevent
-	# problems with other programs or directories called `ld' in the path.
-	# Set LC_ALL=C to ensure ld outputs messages in English.
-	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-			 | sed -ne '/supported targets:/!d
-				    s/[ 	][ 	]*/ /g
-				    s/.*supported targets: *//
-				    s/ .*//
-				    p'`
-        case "$ld_supported_targets" in
-	  elf32-i386)
-		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-		;;
-	  a.out-i386-linux)
-		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-		exit 0 ;;
-	  coff-i386)
-		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-		exit 0 ;;
-	  "")
-		# Either a pre-BFD a.out linker (linux-gnuoldld) or
-		# one that does not give us useful --help.
-		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-		exit 0 ;;
-	esac
-	# Determine whether the default compiler is a.out or elf
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <features.h>
-	#ifdef __ELF__
-	# ifdef __GLIBC__
-	#  if __GLIBC__ >= 2
-	LIBC=gnu
-	#  else
-	LIBC=gnulibc1
-	#  endif
-	# else
-	LIBC=gnulibc1
-	# endif
-	#else
-	#ifdef __INTEL_COMPILER
-	LIBC=gnu
-	#else
-	LIBC=gnuaout
-	#endif
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
-	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
-	;;
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    xtensa*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 	# earlier versions are messed up and put the nodename in both
 	# sysname and nodename.
 	echo i386-sequent-sysv4
-	exit 0 ;;
+	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
@@ -970,24 +989,27 @@ EOF
 	# I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit 0 ;;
+	exit ;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
 	echo ${UNAME_MACHINE}-pc-os2-emx
-	exit 0 ;;
+	exit ;;
     i*86:XTS-300:*:STOP)
 	echo ${UNAME_MACHINE}-unknown-stop
-	exit 0 ;;
+	exit ;;
     i*86:atheos:*:*)
 	echo ${UNAME_MACHINE}-unknown-atheos
-	exit 0 ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     i*86:*DOS:*:*)
 	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit 0 ;;
+	exit ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
 	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -995,15 +1017,16 @@ EOF
 	else
 		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
-	exit 0 ;;
-    i*86:*:5:[78]*)
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
 	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	exit 0 ;;
+	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1021,73 +1044,86 @@ EOF
 	else
 		echo ${UNAME_MACHINE}-pc-sysv32
 	fi
-	exit 0 ;;
+	exit ;;
     pc:*:*:*)
 	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-	echo i386-pc-msdosdjgpp
-        exit 0 ;;
+        # the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
+        exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
-	exit 0 ;;
+	exit ;;
     paragon:*:*:*)
 	echo i860-intel-osf1
-	exit 0 ;;
+	exit ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
 	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
 	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 	fi
-	exit 0 ;;
+	exit ;;
     mini*:CTIX:SYS*5:*)
 	# "miniframe"
 	echo m68010-convergent-sysv
-	exit 0 ;;
+	exit ;;
     mc68k:UNIX:SYSTEM5:3.51m)
 	echo m68k-convergent-sysv
-	exit 0 ;;
+	exit ;;
     M680?0:D-NIX:5.3:*)
 	echo m68k-diab-dnix
-	exit 0 ;;
-    M68*:*:R3V[567]*:*)
-	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
+          && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
-	exit 0 ;;
+	exit ;;
     TSUNAMI:LynxOS:2.*:*)
 	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
 	echo powerpc-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
-	exit 0 ;;
+	exit ;;
     RM*:SINIX-*:*:*)
 	echo mips-sni-sysv4
-	exit 0 ;;
+	exit ;;
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1095,68 +1131,94 @@ EOF
 	else
 		echo ns32k-sni-sysv
 	fi
-	exit 0 ;;
+	exit ;;
     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                       # says <Richard.M.Bartel at ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit 0 ;;
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes at openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
 	echo hppa1.1-stratus-sysv4
-	exit 0 ;;
+	exit ;;
     *:*:*:FTX*)
 	# From seanf at swdc.stratus.com.
 	echo i860-stratus-sysv4
-	exit 0 ;;
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
     *:VOS:*:*)
 	# From Paul.Green at stratus.com.
 	echo hppa1.1-stratus-vos
-	exit 0 ;;
+	exit ;;
     mc68*:A/UX:*:*)
 	echo m68k-apple-aux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
-	exit 0 ;;
+	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
 	        echo mips-nec-sysv${UNAME_RELEASE}
 	else
 	        echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-        exit 0 ;;
+        exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
-	exit 0 ;;
+	exit ;;
     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
 	echo powerpc-apple-beos
-	exit 0 ;;
+	exit ;;
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 	echo i586-pc-beos
-	exit 0 ;;
+	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SX-5:SUPER-UX:*:*)
 	echo sx5-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SX-6:SUPER-UX:*:*)
 	echo sx6-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
     Power*:Rhapsody:*:*)
 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Rhapsody:*:*)
 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Darwin:*:*)
-	case `uname -p` in
-	    *86) UNAME_PROCESSOR=i686 ;;
-	    powerpc) UNAME_PROCESSOR=powerpc ;;
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    i386)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		      grep IS_64BIT_ARCH >/dev/null
+		  then
+		      UNAME_PROCESSOR="x86_64"
+		  fi
+		fi ;;
+	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
 	if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1164,22 +1226,25 @@ EOF
 		UNAME_MACHINE=pc
 	fi
 	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
-	exit 0 ;;
-    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
 	echo nsr-tandem-nsk${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
-	exit 0 ;;
+	exit ;;
     BS2000:POSIX*:*:*)
 	echo bs2000-siemens-sysv
-	exit 0 ;;
+	exit ;;
     DS/*:UNIX_System_V:*:*)
 	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
 	# is converted to i386 for consistency with other x86
@@ -1190,28 +1255,50 @@ EOF
 	    UNAME_MACHINE="$cputype"
 	fi
 	echo ${UNAME_MACHINE}-unknown-plan9
-	exit 0 ;;
+	exit ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
-	exit 0 ;;
+	exit ;;
     *:TENEX:*:*)
 	echo pdp10-unknown-tenex
-	exit 0 ;;
+	exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 	echo pdp10-dec-tops20
-	exit 0 ;;
+	exit ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 	echo pdp10-xkl-tops20
-	exit 0 ;;
+	exit ;;
     *:TOPS-20:*:*)
 	echo pdp10-unknown-tops20
-	exit 0 ;;
+	exit ;;
     *:ITS:*:*)
 	echo pdp10-unknown-its
-	exit 0 ;;
+	exit ;;
     SEI:*:*:SEIUX)
         echo mips-sei-seiux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1243,7 +1330,7 @@ main ()
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
+  printf ("arm-acorn-riscix\n"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -1332,11 +1419,12 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -1345,22 +1433,22 @@ then
     case `getsysinfo -f cpu_type` in
     c1*)
 	echo c1-convex-bsd
-	exit 0 ;;
+	exit ;;
     c2*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-	exit 0 ;;
+	exit ;;
     c34*)
 	echo c34-convex-bsd
-	exit 0 ;;
+	exit ;;
     c38*)
 	echo c38-convex-bsd
-	exit 0 ;;
+	exit ;;
     c4*)
 	echo c4-convex-bsd
-	exit 0 ;;
+	exit ;;
     esac
 fi
 
@@ -1371,7 +1459,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-    ftp://ftp.gnu.org/pub/gnu/config/
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
diff --git a/config/config.sub b/config/config.sub
index 6b2ff9f..2a55a50 100755
--- a/config/config.sub
+++ b/config/config.sub
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
 
-timestamp='2003-06-18'
+timestamp='2009-11-20'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,22 +22,26 @@ timestamp='2003-06-18'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+
 # Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
 # Otherwise, we print the canonical config type on stdout and succeed.
 
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
 # that are meaningful with *any* GNU software.
@@ -70,8 +75,8 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -83,11 +88,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )	# Use stdin as input.
@@ -99,7 +104,7 @@ while test $# -gt 0 ; do
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit 0;;
+       exit ;;
 
     * )
        break ;;
@@ -118,7 +123,10 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -144,10 +152,13 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis)
+	-apple | -axis | -knuth | -cray | -microblaze)
 		os=
 		basic_machine=$1
 		;;
+        -bluegene*)
+	        os=-cnk
+		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
 		basic_machine=$1
@@ -169,6 +180,10 @@ case $os in
 	-hiux*)
 		os=-hiuxwe2
 		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco5)
 		os=-sco3.2v5
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -185,6 +200,10 @@ case $os in
 		# Don't forget version if it is 3.2v4 or newer.
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco*)
 		os=-sco3.2v2
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -228,54 +247,71 @@ case $basic_machine in
 	| a29k \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| fr30 | frv \
+	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
-	| ip2k \
-	| m32r | m68000 | m68k | m88k | mcore \
+	| ip2k | iq2000 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
-	| mips64vr | mips64vrel \
+	| mips64octeon | mips64octeonel \
 	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
 	| mips64vr4100 | mips64vr4100el \
 	| mips64vr4300 | mips64vr4300el \
 	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
 	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
+	| moxie \
+	| mt \
 	| msp430 \
+	| nios | nios2 \
 	| ns16k | ns32k \
-	| openrisc | or32 \
+	| or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 	| pyramid \
-	| s390 | s390x \
-	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| rx \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
-	| strongarm \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu | strongarm \
 	| tahoe | thumb | tic4x | tic80 | tron \
+	| ubicom32 \
 	| v850 | v850e \
 	| we32k \
-	| x86 | xscale | xstormy16 | xtensa \
-	| z8k)
+	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12)
+	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
 		# Motorola 68HC11/12.
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
 	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
 
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
@@ -295,55 +331,68 @@ case $basic_machine in
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* \
-	| bs2000-* \
+	| avr-* | avr32-* \
+	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
-	| clipper-* | cydra-* \
+	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
-	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
-	| ip2k-* \
-	| m32r-* \
+	| ip2k-* | iq2000-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | mcore-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
-	| mips64vr-* | mips64vrel-* \
+	| mips64octeon-* | mips64octeonel-* \
 	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
 	| mips64vr4100-* | mips64vr4100el-* \
 	| mips64vr4300-* | mips64vr4300el-* \
 	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
 	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
 	| msp430-* \
-	| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+	| nios-* | nios2-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 	| pyramid-* \
-	| romp-* | rs6000-* \
-	| s390-* | s390x-* \
-	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| romp-* | rs6000-* | rx-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
 	| tahoe-* | thumb-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
 	| tron-* \
+	| ubicom32-* \
 	| v850-* | v850e-* | vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
-	| xtensa-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa*-* \
 	| ymp-* \
-	| z8k-*)
+	| z8k-* | z80-*)
+		;;
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
@@ -361,6 +410,9 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
 	adobe68k)
 		basic_machine=m68010-adobe
 		os=-scout
@@ -378,6 +430,9 @@ case $basic_machine in
 	amd64)
 		basic_machine=x86_64-pc
 		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	amdahl)
 		basic_machine=580-amdahl
 		os=-sysv
@@ -401,6 +456,10 @@ case $basic_machine in
 		basic_machine=m68k-apollo
 		os=-bsd
 		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -409,10 +468,26 @@ case $basic_machine in
 		basic_machine=ns32k-sequent
 		os=-dynix
 		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
 		;;
+        cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
@@ -437,12 +512,27 @@ case $basic_machine in
 		basic_machine=j90-cray
 		os=-unicos
 		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16)
+		basic_machine=cr16-unknown
+		os=-elf
+		;;
 	crds | unos)
 		basic_machine=m68k-crds
 		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
 	cris | cris-* | etrax*)
 		basic_machine=cris-axis
 		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
 	da30 | da30-*)
 		basic_machine=m68k-da30
 		;;
@@ -465,6 +555,14 @@ case $basic_machine in
 		basic_machine=m88k-motorola
 		os=-sysv3
 		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
 	dpx20 | dpx20-*)
 		basic_machine=rs6000-bull
 		os=-bosx
@@ -615,6 +713,14 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
 	m88k-omron*)
 		basic_machine=m88k-omron
 		;;
@@ -626,10 +732,17 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
+        microblaze)
+		basic_machine=microblaze-xilinx
+		;;
 	mingw32)
 		basic_machine=i386-pc
 		os=-mingw32
 		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
@@ -643,10 +756,6 @@ case $basic_machine in
 	mips3*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
 		;;
-	mmix*)
-		basic_machine=mmix-knuth
-		os=-mmixware
-		;;
 	monitor)
 		basic_machine=m68k-rom68k
 		os=-coff
@@ -659,6 +768,9 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-msdos
 		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
@@ -727,10 +839,6 @@ case $basic_machine in
 	np1)
 		basic_machine=np1-gould
 		;;
-	nv1)
-		basic_machine=nv1-cray
-		os=-unicosmp
-		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
@@ -738,9 +846,12 @@ case $basic_machine in
 		basic_machine=hppa1.1-oki
 		os=-proelf
 		;;
-	or32 | or32-*)
+	openrisc | openrisc-*)
 		basic_machine=or32-unknown
-		os=-coff
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
 		;;
 	OSE68000 | ose68000)
 		basic_machine=m68000-ericsson
@@ -758,6 +869,14 @@ case $basic_machine in
 		basic_machine=i860-intel
 		os=-osf
 		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
 	pbd)
 		basic_machine=sparc-tti
 		;;
@@ -767,6 +886,12 @@ case $basic_machine in
 	pc532 | pc532-*)
 		basic_machine=ns32k-pc532
 		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	pentium | p5 | k5 | k6 | nexgen | viac3)
 		basic_machine=i586-pc
 		;;
@@ -823,6 +948,10 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
 	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
@@ -833,6 +962,12 @@ case $basic_machine in
 	rtpc | rtpc-*)
 		basic_machine=romp-ibm
 		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
 	sa29200)
 		basic_machine=a29k-amd
 		os=-udi
@@ -843,6 +978,10 @@ case $basic_machine in
 	sb1el)
 		basic_machine=mipsisa64sb1el-unknown
 		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
 	sei)
 		basic_machine=mips-sei
 		os=-seiux
@@ -854,6 +993,9 @@ case $basic_machine in
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
 	sh64)
 		basic_machine=sh64-unknown
 		;;
@@ -943,6 +1085,10 @@ case $basic_machine in
 		basic_machine=tic6x-unknown
 		os=-coff
 		;;
+	tile*)
+		basic_machine=tile-unknown
+		os=-linux-gnu
+		;;
 	tx39)
 		basic_machine=mipstx39-unknown
 		;;
@@ -956,6 +1102,10 @@ case $basic_machine in
 	tower | tower-32)
 		basic_machine=m68k-ncr
 		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
 	udi29k)
 		basic_machine=a29k-amd
 		os=-udi
@@ -999,6 +1149,10 @@ case $basic_machine in
 		basic_machine=hppa1.1-winbond
 		os=-proelf
 		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
@@ -1010,6 +1164,10 @@ case $basic_machine in
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
 	none)
 		basic_machine=none-none
 		os=-none
@@ -1029,6 +1187,9 @@ case $basic_machine in
 	romp)
 		basic_machine=romp-ibm
 		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
 	rs6000)
 		basic_machine=rs6000-ibm
 		;;
@@ -1045,13 +1206,10 @@ case $basic_machine in
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
-	sh64)
-		basic_machine=sh64-unknown
-		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b)
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
 		basic_machine=sparc-sun
 		;;
 	cydra)
@@ -1098,6 +1256,9 @@ case $os in
         # First match some system type aliases
         # that might get confused with valid system types.
 	# -solaris* is a basic system type, with this one exception.
+        -auroraux)
+	        os=-auroraux
+		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
@@ -1118,25 +1279,30 @@ case $os in
 	# Each alternative MUST END IN A *, to match a version number.
 	# -sysv* is not here because it comes later, after sysvr4.
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* \
+	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
-	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1154,12 +1320,15 @@ case $os in
 		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 		;;
 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
 	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 		;;
 	-mac*)
 		os=`echo $os | sed -e 's|mac|macos|'`
 		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
 	-linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
@@ -1172,6 +1341,9 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
+        -os400*)
+		os=-os400
+		;;
 	-wince*)
 		os=-wince
 		;;
@@ -1193,6 +1365,9 @@ case $os in
 	-atheos*)
 		os=-atheos
 		;;
+	-syllable*)
+		os=-syllable
+		;;
 	-386bsd)
 		os=-bsd
 		;;
@@ -1215,6 +1390,9 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
+        -tpf*)
+		os=-tpf
+		;;
 	-triton*)
 		os=-sysv3
 		;;
@@ -1251,6 +1429,12 @@ case $os in
 	-kaos*)
 		os=-kaos
 		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-dicos*)
+		os=-dicos
+		;;
 	-none)
 		;;
 	*)
@@ -1273,6 +1457,12 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
+        score-*)
+		os=-elf
+		;;
+        spu-*)
+		os=-elf
+		;;
 	*-acorn)
 		os=-riscix1.2
 		;;
@@ -1282,8 +1472,8 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-	c4x-* | tic4x-*)
-		os=-coff
+        c4x-* | tic4x-*)
+        	os=-coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
@@ -1310,6 +1500,9 @@ case $basic_machine in
 	m68*-cisco)
 		os=-aout
 		;;
+        mep-*)
+		os=-elf
+		;;
 	mips*-cisco)
 		os=-elf
 		;;
@@ -1328,9 +1521,15 @@ case $basic_machine in
 	*-be)
 		os=-beos
 		;;
+	*-haiku)
+		os=-haiku
+		;;
 	*-ibm)
 		os=-aix
 		;;
+    	*-knuth)
+		os=-mmixware
+		;;
 	*-wec)
 		os=-proelf
 		;;
@@ -1433,7 +1632,7 @@ case $basic_machine in
 			-sunos*)
 				vendor=sun
 				;;
-			-aix*)
+			-cnk*|-aix*)
 				vendor=ibm
 				;;
 			-beos*)
@@ -1463,9 +1662,15 @@ case $basic_machine in
 			-mvs* | -opened*)
 				vendor=ibm
 				;;
+			-os400*)
+				vendor=ibm
+				;;
 			-ptx*)
 				vendor=sequent
 				;;
+			-tpf*)
+				vendor=ibm
+				;;
 			-vxsim* | -vxworks* | -windiss*)
 				vendor=wrs
 				;;
@@ -1490,7 +1695,7 @@ case $basic_machine in
 esac
 
 echo $basic_machine$os
-exit 0
+exit
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/config/depcomp b/config/depcomp
index 04701da..df8eea7 100755
--- a/config/depcomp
+++ b/config/depcomp
@@ -1,9 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2005-07-09.11
+scriptversion=2009-04-28.21; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
+# Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,9 +17,7 @@ scriptversion=2005-07-09.11
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -86,12 +85,34 @@ if test "$depmode" = dashXmstdout; then
    depmode=dashmstdout
 fi
 
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
 ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
 ## it if -MD -MP comes after the -MF stuff.  Hmm.
-  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
   stat=$?
   if test $stat -eq 0; then :
   else
@@ -178,14 +199,14 @@ sgi)
 ' < "$tmpdepfile" \
     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
     tr '
-' ' ' >> $depfile
-    echo >> $depfile
+' ' ' >> "$depfile"
+    echo >> "$depfile"
 
     # The second pass generates a dummy entry for each header file.
     tr ' ' '
 ' < "$tmpdepfile" \
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> $depfile
+   >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -201,34 +222,39 @@ aix)
   # current directory.  Also, the AIX compiler puts `$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
-  tmpdepfile="$stripped.u"
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
     "$@" -Wc,-M
   else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
     "$@" -M
   fi
   stat=$?
 
-  if test -f "$tmpdepfile"; then :
-  else
-    stripped=`echo "$stripped" | sed 's,^.*/,,'`
-    tmpdepfile="$stripped.u"
-  fi
-
   if test $stat -eq 0; then :
   else
-    rm -f "$tmpdepfile"
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
 
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
   if test -f "$tmpdepfile"; then
-    outname="$stripped.o"
     # Each line is of the form `foo.o: dependent.h'.
     # Do two passes, one to just change these to
     # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
-    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -276,6 +302,51 @@ icc)
   rm -f "$tmpdepfile"
   ;;
 
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+	       s/^ *//
+	       s/ \\*$//
+	       s/$/:/
+	       p
+	     }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
 tru64)
    # The Tru64 compiler uses -MD to generate dependencies as a side
    # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@@ -288,13 +359,13 @@ tru64)
 
    if test "$libtool" = yes; then
       # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mecanism is used in libtool 1.4 series to
+      # static library.  This mechanism is used in libtool 1.4 series to
       # handle both shared and static libraries in a single compilation.
       # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
       #
       # With libtool 1.5 this exception was removed, and libtool now
       # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # compilations output dependencies in $dir.libs/$base.o.d and
       # in $dir$base.o.d.  We have to check for both files, because
       # one of the two compilations can be disabled.  We should prefer
       # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
@@ -345,7 +416,7 @@ dashmstdout)
 
   # Remove the call to Libtool.
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
@@ -396,32 +467,39 @@ makedepend)
   "$@" || exit $?
   # Remove any Libtool call
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
   fi
   # X makedepend
   shift
-  cleared=no
-  for arg in "$@"; do
+  cleared=no eat=no
+  for arg
+  do
     case $cleared in
     no)
       set ""; shift
       cleared=yes ;;
     esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
     case "$arg" in
     -D*|-I*)
       set fnord "$@" "$arg"; shift ;;
     # Strip any option that makedepend may not understand.  Remove
     # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
     -*|$object)
       ;;
     *)
       set fnord "$@" "$arg"; shift ;;
     esac
   done
-  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
@@ -441,7 +519,7 @@ cpp)
 
   # Remove the call to Libtool.
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
@@ -479,13 +557,27 @@ cpp)
 
 msvisualcpp)
   # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout, regardless of -o,
-  # because we must use -o when running libtool.
+  # always write the preprocessed file to stdout.
   "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
   IFS=" "
   for arg
   do
     case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
 	set fnord "$@"
 	shift
@@ -498,16 +590,23 @@ msvisualcpp)
 	;;
     esac
   done
-  "$@" -E |
-  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
   echo "	" >> "$depfile"
-  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 none)
   exec "$@"
   ;;
@@ -526,5 +625,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/config/install-sh b/config/install-sh
index 4d4a951..6781b98 100755
--- a/config/install-sh
+++ b/config/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2005-05-14.22
+scriptversion=2009-04-28.21; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -39,38 +39,68 @@ scriptversion=2005-05-14.22
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
 
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
 
-# put in absolute paths if you don't have them in your path; or use env. vars.
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
 
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
 
-chmodcmd="$chmodprog 0755"
-chowncmd=
 chgrpcmd=
-stripcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
 rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
 src=
 dst=
 dir_arg=
-dstarg=
+dst_arg=
+
+copy_on_change=false
 no_target_directory=
 
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
    or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    or: $0 [OPTION]... -d DIRECTORIES...
@@ -80,81 +110,86 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
 In the 4th, create DIRECTORIES.
 
 Options:
--c         (ignored)
--d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
---help     display this help and exit.
---version  display version info and exit.
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
 
 Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
 "
 
-while test -n "$1"; do
+while test $# -ne 0; do
   case $1 in
-    -c) shift
-        continue;;
+    -c) ;;
+
+    -C) copy_on_change=true;;
 
-    -d) dir_arg=true
-        shift
-        continue;;
+    -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
     --help) echo "$usage"; exit $?;;
 
-    -m) chmodcmd="$chmodprog $2"
-        shift
-        shift
-        continue;;
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
 
     -o) chowncmd="$chownprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
-    -s) stripcmd=$stripprog
-        shift
-        continue;;
+    -s) stripcmd=$stripprog;;
 
-    -t) dstarg=$2
-	shift
-	shift
-	continue;;
+    -t) dst_arg=$2
+	shift;;
 
-    -T) no_target_directory=true
-	shift
-	continue;;
+    -T) no_target_directory=true;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    *)  # When -d is used, all remaining arguments are directories to create.
-	# When -t is used, the destination is already specified.
-	test -n "$dir_arg$dstarg" && break
-        # Otherwise, the last argument is the destination.  Remove it from $@.
-	for arg
-	do
-          if test -n "$dstarg"; then
-	    # $@ is not empty: it contains at least $arg.
-	    set fnord "$@" "$dstarg"
-	    shift # fnord
-	  fi
-	  shift # arg
-	  dstarg=$arg
-	done
+    --)	shift
 	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
   esac
+  shift
 done
 
-if test -z "$1"; then
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
   if test -z "$dir_arg"; then
     echo "$0: no input file specified." >&2
     exit 1
@@ -164,24 +199,47 @@ if test -z "$1"; then
   exit 0
 fi
 
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
 for src
 do
   # Protect names starting with `-'.
   case $src in
-    -*) src=./$src ;;
+    -*) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
     dst=$src
-    src=
-
-    if test -d "$dst"; then
-      mkdircmd=:
-      chmodcmd=
-    else
-      mkdircmd=$mkdirprog
-    fi
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
   else
+
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
@@ -190,71 +248,199 @@ do
       exit 1
     fi
 
-    if test -z "$dstarg"; then
+    if test -z "$dst_arg"; then
       echo "$0: no destination specified." >&2
       exit 1
     fi
 
-    dst=$dstarg
+    dst=$dst_arg
     # Protect names starting with `-'.
     case $dst in
-      -*) dst=./$dst ;;
+      -*) dst=./$dst;;
     esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
       if test -n "$no_target_directory"; then
-	echo "$0: $dstarg: Is a directory" >&2
+	echo "$0: $dst_arg: Is a directory" >&2
 	exit 1
       fi
-      dst=$dst/`basename "$src"`
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
     fi
   fi
 
-  # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writeable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
 
-  # Make sure that the destination directory exists.
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
 
-  # Skip lots of stat calls in the usual case.
-  if test ! -d "$dstdir"; then
-    defaultIFS='
-	 '
-    IFS="${IFS-$defaultIFS}"
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
 
-    oIFS=$IFS
-    # Some sh's can't handle IFS=/ for some reason.
-    IFS='%'
-    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-    shift
-    IFS=$oIFS
+      case $dstdir in
+	/*) prefix='/';;
+	-*) prefix='./';;
+	*)  prefix='';;
+      esac
 
-    pathcomp=
+      eval "$initialize_posix_glob"
 
-    while test $# -ne 0 ; do
-      pathcomp=$pathcomp$1
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
       shift
-      if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
-	# mkdir can fail with a `File exist' error in case several
-	# install-sh are creating the directory concurrently.  This
-	# is OK.
-	test -d "$pathcomp" || exit
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test -z "$d" && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
       fi
-      pathcomp=$pathcomp/
-    done
+    fi
   fi
 
   if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
-      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
   else
-    dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
@@ -262,10 +448,9 @@ do
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-    trap '(exit $?); exit' 1 2 13 15
 
     # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -273,51 +458,63 @@ do
     # ignore errors from any of these, just make sure not to ignore
     # errors from the above "$doit $cpprog $src $dsttmp" command.
     #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
-    # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
-      || {
-	   # The rename failed, perhaps because mv can't rename something else
-	   # to itself, or perhaps because mv is so ancient that it does not
-	   # support -f.
-
-	   # Now remove or move aside any old file at destination location.
-	   # We try this two ways since rm can't unlink itself on some
-	   # systems and the destination file might be busy for other
-	   # reasons.  In this case, the final cleanup might fail but the new
-	   # file should still install successfully.
-	   {
-	     if test -f "$dstdir/$dstfile"; then
-	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-	       || {
-		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-		 (exit 1); exit 1
-	       }
-	     else
-	       :
-	     fi
-	   } &&
-
-	   # Now rename the file to the real destination.
-	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-	 }
-    }
-  fi || { (exit 1); exit 1; }
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
 done
 
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
-  (exit 0); exit 0
-}
-
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/config/missing b/config/missing
index 894e786..28055d2 100755
--- a/config/missing
+++ b/config/missing
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2005-06-08.21
+scriptversion=2009-04-28.21; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
-#   Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -18,9 +18,7 @@ scriptversion=2005-06-08.21
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -33,6 +31,8 @@ if test $# -eq 0; then
 fi
 
 run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
 
 # In the cases where this matters, `missing' is being run in the
 # srcdir already.
@@ -44,7 +44,7 @@ fi
 
 msg="missing on your system"
 
-case "$1" in
+case $1 in
 --run)
   # Try to run requested program, and just exit if it succeeds.
   run=
@@ -77,6 +77,7 @@ Supported PROGRAM values:
   aclocal      touch file \`aclocal.m4'
   autoconf     touch file \`configure'
   autoheader   touch file \`config.h.in'
+  autom4te     touch the output file, or create a stub one
   automake     touch all \`Makefile.in' files
   bison        create \`y.tab.[ch]', if possible, from existing .[ch]
   flex         create \`lex.yy.c', if possible, from existing .c
@@ -86,6 +87,9 @@ Supported PROGRAM values:
   tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
 
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
 Send bug reports to <bug-automake at gnu.org>."
     exit $?
     ;;
@@ -103,15 +107,22 @@ Send bug reports to <bug-automake at gnu.org>."
 
 esac
 
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
 # Now exit if we have it, but it failed.  Also exit now if we
 # don't have it and --version was passed (most likely to detect
-# the program).
-case "$1" in
-  lex|yacc)
+# the program).  This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+  lex*|yacc*)
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar)
+  tar*)
     if test -n "$run"; then
        echo 1>&2 "ERROR: \`tar' requires --run"
        exit 1
@@ -135,7 +146,7 @@ esac
 
 # If it does not exist, or fails to run (possibly an outdated version),
 # try to emulate it.
-case "$1" in
+case $program in
   aclocal*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
@@ -145,7 +156,7 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch aclocal.m4
     ;;
 
-  autoconf)
+  autoconf*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
          you modified \`${configure_ac}'.  You might want to install the
@@ -154,7 +165,7 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch configure
     ;;
 
-  autoheader)
+  autoheader*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
          you modified \`acconfig.h' or \`${configure_ac}'.  You might want
@@ -164,7 +175,7 @@ WARNING: \`$1' is $msg.  You should only need it if
     test -z "$files" && files="config.h"
     touch_files=
     for f in $files; do
-      case "$f" in
+      case $f in
       *:*) touch_files="$touch_files "`echo "$f" |
 				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
       *) touch_files="$touch_files $f.in";;
@@ -184,7 +195,7 @@ WARNING: \`$1' is $msg.  You should only need it if
 	   while read f; do touch "$f"; done
     ;;
 
-  autom4te)
+  autom4te*)
     echo 1>&2 "\
 WARNING: \`$1' is needed, but is $msg.
          You might have modified some files without having the
@@ -192,8 +203,8 @@ WARNING: \`$1' is needed, but is $msg.
          You can get \`$1' as part of \`Autoconf' from any GNU
          archive site."
 
-    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
-    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -f "$file"; then
 	touch $file
     else
@@ -207,80 +218,78 @@ WARNING: \`$1' is needed, but is $msg.
     fi
     ;;
 
-  bison|yacc)
+  bison*|yacc*)
     echo 1>&2 "\
 WARNING: \`$1' $msg.  You should only need it if
          you modified a \`.y' file.  You may need the \`Bison' package
          in order for those modifications to take effect.  You can get
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
-    if [ $# -ne 1 ]; then
+    if test $# -ne 1; then
         eval LASTARG="\${$#}"
-	case "$LASTARG" in
+	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" y.tab.c
 	    fi
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" y.tab.h
 	    fi
 	  ;;
 	esac
     fi
-    if [ ! -f y.tab.h ]; then
+    if test ! -f y.tab.h; then
 	echo >y.tab.h
     fi
-    if [ ! -f y.tab.c ]; then
+    if test ! -f y.tab.c; then
 	echo 'main() { return 0; }' >y.tab.c
     fi
     ;;
 
-  lex|flex)
+  lex*|flex*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
          you modified a \`.l' file.  You may need the \`Flex' package
          in order for those modifications to take effect.  You can get
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
-    if [ $# -ne 1 ]; then
+    if test $# -ne 1; then
         eval LASTARG="\${$#}"
-	case "$LASTARG" in
+	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" lex.yy.c
 	    fi
 	  ;;
 	esac
     fi
-    if [ ! -f lex.yy.c ]; then
+    if test ! -f lex.yy.c; then
 	echo 'main() { return 0; }' >lex.yy.c
     fi
     ;;
 
-  help2man)
+  help2man*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
 	 you modified a dependency of a manual page.  You may need the
 	 \`Help2man' package in order for those modifications to take
 	 effect.  You can get \`Help2man' from any GNU archive site."
 
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
-    if test -z "$file"; then
-	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
-    fi
-    if [ -f "$file" ]; then
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
 	touch $file
     else
 	test -z "$file" || exec >$file
 	echo ".ab help2man is required to generate this page"
-	exit 1
+	exit $?
     fi
     ;;
 
-  makeinfo)
+  makeinfo*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
          you modified a \`.texi' or \`.texinfo' file, or any other file
@@ -289,11 +298,17 @@ WARNING: \`$1' is $msg.  You should only need it if
          DU, IRIX).  You might want to install the \`Texinfo' package or
          the \`GNU make' package.  Grab either from any GNU archive site."
     # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -z "$file"; then
       # ... or it is the one specified with @setfilename ...
       infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      file=`sed -n '
+	/^@setfilename/{
+	  s/.* \([^ ]*\) *$/\1/
+	  p
+	  q
+	}' $infile`
       # ... or it is derived from the source name (dir/f.texi becomes f.info)
       test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
     fi
@@ -303,7 +318,7 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch $file
     ;;
 
-  tar)
+  tar*)
     shift
 
     # We have already tried tar in the generic part.
@@ -317,13 +332,13 @@ WARNING: \`$1' is $msg.  You should only need it if
     fi
     firstarg="$1"
     if shift; then
-	case "$firstarg" in
+	case $firstarg in
 	*o*)
 	    firstarg=`echo "$firstarg" | sed s/o//`
 	    tar "$firstarg" "$@" && exit 0
 	    ;;
 	esac
-	case "$firstarg" in
+	case $firstarg in
 	*h*)
 	    firstarg=`echo "$firstarg" | sed s/h//`
 	    tar "$firstarg" "$@" && exit 0
@@ -356,5 +371,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/configure b/configure
index ed78e7a..ed1e87d 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for infiniband-diags 1.6.1.
+# Generated by GNU Autoconf 2.63 for infiniband-diags 1.6.4.
 #
 # Report bugs to <linux-rdma at vger.kernel.org>.
 #
@@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='infiniband-diags'
 PACKAGE_TARNAME='infiniband-diags'
-PACKAGE_VERSION='1.6.1'
-PACKAGE_STRING='infiniband-diags 1.6.1'
+PACKAGE_VERSION='1.6.4'
+PACKAGE_STRING='infiniband-diags 1.6.4'
 PACKAGE_BUGREPORT='linux-rdma at vger.kernel.org'
 
 # Factoring default headers for most tests.
@@ -791,6 +791,11 @@ LTLIBOBJS
 have_rst2man
 BUILD_DATE
 ibnetdisc_api_version
+HAVE_GLIB_FALSE
+HAVE_GLIB_TRUE
+GLIB_LIBS
+GLIB_CFLAGS
+PKG_CONFIG
 IBSCRIPTPATH
 HAVE_LD_VERSION_SCRIPT_FALSE
 HAVE_LD_VERSION_SCRIPT_TRUE
@@ -802,6 +807,9 @@ ENABLE_TEST_UTILS_FALSE
 ENABLE_TEST_UTILS_TRUE
 IBDIAG_CONFIG_PATH
 LIBOBJS
+HAVE_DASH_FALSE
+HAVE_DASH_TRUE
+have_dash
 CPP
 OTOOL64
 OTOOL
@@ -935,7 +943,10 @@ CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
-CPP'
+CPP
+PKG_CONFIG
+GLIB_CFLAGS
+GLIB_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1488,7 +1499,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures infiniband-diags 1.6.1 to adapt to many kinds of systems.
+\`configure' configures infiniband-diags 1.6.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1559,7 +1570,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of infiniband-diags 1.6.1:";;
+     short | recursive ) echo "Configuration of infiniband-diags 1.6.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1598,6 +1609,9 @@ Some influential environment variables:
   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
+  GLIB_LIBS   linker flags for GLIB, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1665,7 +1679,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-infiniband-diags configure 1.6.1
+infiniband-diags configure 1.6.4
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1679,7 +1693,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by infiniband-diags $as_me 1.6.1, which was
+It was created by infiniband-diags $as_me 1.6.4, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -2531,7 +2545,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='infiniband-diags'
- VERSION='1.6.1'
+ VERSION='1.6.4'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3721,6 +3735,138 @@ else
 fi
 
 
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
 case `pwd` in
   *\ * | *\	*)
     { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@@ -4423,13 +4569,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:4426: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:4572: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4429: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:4575: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4432: output\"" >&5)
+  (eval echo "\"\$as_me:4578: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -5635,7 +5781,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5638 "configure"' > conftest.$ac_ext
+  echo '#line 5784 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7492,11 +7638,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7495: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7641: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7499: \$? = $ac_status" >&5
+   echo "$as_me:7645: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7831,11 +7977,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7834: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7980: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7838: \$? = $ac_status" >&5
+   echo "$as_me:7984: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7936,11 +8082,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7939: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8085: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7943: \$? = $ac_status" >&5
+   echo "$as_me:8089: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -7991,11 +8137,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7994: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8140: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7998: \$? = $ac_status" >&5
+   echo "$as_me:8144: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -10794,7 +10940,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10797 "configure"
+#line 10943 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10890,7 +11036,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10893 "configure"
+#line 11039 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11118,6 +11264,53 @@ CC="$lt_save_CC"
 
 
 
+# Extract the first word of "dash", so it can be a program name with args.
+set dummy dash; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_have_dash+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$have_dash"; then
+  ac_cv_prog_have_dash="$have_dash" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_have_dash="true"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_have_dash" && ac_cv_prog_have_dash="false"
+fi
+fi
+have_dash=$ac_cv_prog_have_dash
+if test -n "$have_dash"; then
+  { $as_echo "$as_me:$LINENO: result: $have_dash" >&5
+$as_echo "$have_dash" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test x$have_dash = xtrue; then
+  HAVE_DASH_TRUE=
+  HAVE_DASH_FALSE='#'
+else
+  HAVE_DASH_TRUE='#'
+  HAVE_DASH_FALSE=
+fi
+
+
 
 { $as_echo "$as_me:$LINENO: checking for umad_init in -libumad" >&5
 $as_echo_n "checking for umad_init in -libumad... " >&6; }
@@ -12832,6 +13025,209 @@ IBSCRIPTPATH_TMP2="`echo $IBSCRIPTPATH_TMP1 | sed 's/^NONE/$ac_default_prefix/'`
 IBSCRIPTPATH="${with_ibpath_override:-`eval echo $IBSCRIPTPATH_TMP2`}"
 
 
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:$LINENO: checking for GLIB" >&5
+$as_echo_n "checking for GLIB... " >&6; }
+
+if test -n "$GLIB_CFLAGS"; then
+    pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$GLIB_LIBS"; then
+    pkg_cv_GLIB_LIBS="$GLIB_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0" 2>&1`
+        else
+	        GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GLIB_PKG_ERRORS" >&5
+
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+                ac_glib=no
+elif test $pkg_failed = untried; then
+	ac_glib=no
+else
+	GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
+	GLIB_LIBS=$pkg_cv_GLIB_LIBS
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+	ac_glib=yes
+fi
+ if test "$ac_glib" = "yes"; then
+  HAVE_GLIB_TRUE=
+  HAVE_GLIB_FALSE='#'
+else
+  HAVE_GLIB_TRUE='#'
+  HAVE_GLIB_FALSE=
+fi
+
+if test "$ac_glib" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GLIB 1
+_ACEOF
+
+else
+   { { $as_echo "$as_me:$LINENO: error: glib not found; glib2 is required" >&5
+$as_echo "$as_me: error: glib not found; glib2 is required" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
 ibnetdisc_api_version=`grep LIBVERSION $srcdir/libibnetdisc/libibnetdisc.ver | sed 's/LIBVERSION=//'`
 if test -z $ibnetdisc_api_version; then
    echo "FAILED to find $srcdir/libibnetdisc/libibnetdisc.ver"
@@ -12878,6 +13274,45 @@ $as_echo "no" >&6; }
 fi
 
 
+if test x$have_rst2man != xyes; then
+# Extract the first word of "rst2man.py", so it can be a program name with args.
+set dummy rst2man.py; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_have_rst2man+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$have_rst2man"; then
+  ac_cv_prog_have_rst2man="$have_rst2man" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_have_rst2man=""yes""
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+have_rst2man=$ac_cv_prog_have_rst2man
+if test -n "$have_rst2man"; then
+  { $as_echo "$as_me:$LINENO: result: $have_rst2man" >&5
+$as_echo "$have_rst2man" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
 if test x$have_rst2man == xyes; then
 	doc/generate
 else
@@ -12889,7 +13324,7 @@ else
 	fi
 fi
 
-ac_config_files="$ac_config_files Makefile infiniband-diags.spec include/ibdiag_version.h scripts/ibcheckerrors scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode scripts/ibcheckport scripts/ibcheckportstate scripts/ibcheckportwidth scripts/ibcheckstate scripts/ibcheckwidth scripts/ibclearcounters scripts/ibclearerrors scripts/ibdatacounts scripts/ibdatacounters scripts/ibhosts scripts/ibnodes scripts/ibswitches scripts/ibrouters scripts/iblinkinfo.pl scripts/ibqueryerrors.pl doc [...]
+ac_config_files="$ac_config_files Makefile infiniband-diags.spec include/ibdiag_version.h scripts/ibcheckerrors scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode scripts/ibcheckport scripts/ibcheckportstate scripts/ibcheckportwidth scripts/ibcheckstate scripts/ibcheckwidth scripts/ibclearcounters scripts/ibclearerrors scripts/ibdatacounts scripts/ibdatacounters scripts/ibhosts scripts/ibnodes scripts/ibswitches scripts/ibrouters scripts/iblinkinfo.pl scripts/ibqueryerrors.pl scr [...]
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -13017,6 +13452,13 @@ $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${HAVE_DASH_TRUE}" && test -z "${HAVE_DASH_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_DASH\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"HAVE_DASH\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${ENABLE_TEST_UTILS_TRUE}" && test -z "${ENABLE_TEST_UTILS_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_TEST_UTILS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -13038,6 +13480,13 @@ $as_echo "$as_me: error: conditional \"HAVE_LD_VERSION_SCRIPT\" was never define
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${HAVE_GLIB_TRUE}" && test -z "${HAVE_GLIB_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_GLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"HAVE_GLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
@@ -13360,7 +13809,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by infiniband-diags $as_me 1.6.1, which was
+This file was extended by infiniband-diags $as_me 1.6.4, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -13423,7 +13872,7 @@ Report bugs to <bug-autoconf at gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-infiniband-diags config.status 1.6.1
+infiniband-diags config.status 1.6.4
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -13826,13 +14275,14 @@ do
     "scripts/ibrouters") CONFIG_FILES="$CONFIG_FILES scripts/ibrouters" ;;
     "scripts/iblinkinfo.pl") CONFIG_FILES="$CONFIG_FILES scripts/iblinkinfo.pl" ;;
     "scripts/ibqueryerrors.pl") CONFIG_FILES="$CONFIG_FILES scripts/ibqueryerrors.pl" ;;
+    "scripts/dump_lfts.sh") CONFIG_FILES="$CONFIG_FILES scripts/dump_lfts.sh" ;;
+    "scripts/dump_mfts.sh") CONFIG_FILES="$CONFIG_FILES scripts/dump_mfts.sh" ;;
     "doc/man/ibaddr.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibaddr.8" ;;
     "doc/man/check_lft_balance.8") CONFIG_FILES="$CONFIG_FILES doc/man/check_lft_balance.8" ;;
     "doc/man/ibcacheedit.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibcacheedit.8" ;;
     "doc/man/ibccconfig.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibccconfig.8" ;;
     "doc/man/ibccquery.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibccquery.8" ;;
-    "doc/man/dump_lfts.8") CONFIG_FILES="$CONFIG_FILES doc/man/dump_lfts.8" ;;
-    "doc/man/dump_mfts.8") CONFIG_FILES="$CONFIG_FILES doc/man/dump_mfts.8" ;;
+    "doc/man/dump_fts.8") CONFIG_FILES="$CONFIG_FILES doc/man/dump_fts.8" ;;
     "doc/man/ibhosts.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibhosts.8" ;;
     "doc/man/ibidsverify.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibidsverify.8" ;;
     "doc/man/iblinkinfo.8") CONFIG_FILES="$CONFIG_FILES doc/man/iblinkinfo.8" ;;
diff --git a/configure.in b/configure.ac
similarity index 91%
rename from configure.in
rename to configure.ac
index 61d7909..122a029 100644
--- a/configure.in
+++ b/configure.ac
@@ -1,11 +1,11 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
-AC_INIT(infiniband-diags, 1.6.1, linux-rdma at vger.kernel.org)
+AC_INIT(infiniband-diags, 1.6.4, linux-rdma at vger.kernel.org)
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(config)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([foreign])
 
 AC_SUBST(RELEASE, ${RELEASE:-unknown})
 AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
@@ -22,8 +22,12 @@ AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
 
 dnl Checks for programs
 AC_PROG_CC
+AM_PROG_CC_C_O
 AC_PROG_LIBTOOL
 
+AC_CHECK_PROG(have_dash, [dash], true, false)
+AM_CONDITIONAL(HAVE_DASH, test x$have_dash = xtrue)
+
 dnl Checks for libraries
 AC_CHECK_LIB(ibumad, umad_init, [],
 	AC_MSG_ERROR([umad_init() not found. diags require libibumad.]))
@@ -158,6 +162,15 @@ IBSCRIPTPATH_TMP2="`echo $IBSCRIPTPATH_TMP1 | sed 's/^NONE/$ac_default_prefix/'`
 IBSCRIPTPATH="${with_ibpath_override:-`eval echo $IBSCRIPTPATH_TMP2`}"
 AC_SUBST(IBSCRIPTPATH)
 
+dnl check for glib
+PKG_CHECK_MODULES([GLIB], [glib-2.0], ac_glib=yes, ac_glib=no)
+AM_CONDITIONAL([HAVE_GLIB], test "$ac_glib" = "yes")
+if test "$ac_glib" = "yes"; then
+   AC_DEFINE([HAVE_GLIB], 1, [Define to 1 to indicate GLIB support])
+else
+   AC_MSG_ERROR(glib not found; glib2 is required)
+fi
+
 dnl Begin libibnetdisc stuff
 ibnetdisc_api_version=`grep LIBVERSION $srcdir/libibnetdisc/libibnetdisc.ver | sed 's/LIBVERSION=//'`
 if test -z $ibnetdisc_api_version; then
@@ -171,6 +184,9 @@ dnl Generate doc/man/*.in files if possible
 DOC_DATE="`date +%Y-%m-%d`"
 AC_SUBST(BUILD_DATE)
 AC_CHECK_PROG(have_rst2man, rst2man, "yes")
+if test x$have_rst2man != xyes; then
+AC_CHECK_PROG(have_rst2man, rst2man.py, "yes")
+fi
 if test x$have_rst2man == xyes; then
 	doc/generate
 else
@@ -206,13 +222,14 @@ AC_CONFIG_FILES([\
 	scripts/ibrouters \
 	scripts/iblinkinfo.pl \
 	scripts/ibqueryerrors.pl \
+	scripts/dump_lfts.sh \
+	scripts/dump_mfts.sh \
 	doc/man/ibaddr.8 \
 	doc/man/check_lft_balance.8 \
 	doc/man/ibcacheedit.8 \
 	doc/man/ibccconfig.8 \
 	doc/man/ibccquery.8 \
-	doc/man/dump_lfts.8 \
-	doc/man/dump_mfts.8 \
+	doc/man/dump_fts.8 \
 	doc/man/ibhosts.8 \
 	doc/man/ibidsverify.8 \
 	doc/man/iblinkinfo.8 \
diff --git a/doc/generate b/doc/generate
index a91dd3d..816b66f 100755
--- a/doc/generate
+++ b/doc/generate
@@ -1,19 +1,34 @@
-#!/bin/bash
+#!/bin/sh
 
 docdir=`dirname $0`
 mode=$1
 
 cd $docdir
 
+rst2man=""
+
+rc=`which rst2man &> /dev/null`
+if [ "$?" == "0" ]; then
+	rst2man="rst2man"
+fi
+rc=`which rst2man.py &> /dev/null`
+if [ "$?" == "0" ]; then
+	rst2man="rst2man.py"
+fi
+
 if [ "$mode" == "" ]; then
 	if [ ! -d man ]; then
 		mkdir man
 	fi
+	if [ "$rst2man" == "" ]; then
+		echo "could not generate man pages; 'rst2man not found'"
+		exit 1
+	fi
 	for file in rst/*.rst; do
 		file=`basename $file`
 		target=`echo $file | sed -e 's/\(.*\).rst/\1/'`
 		echo "   creating man/$target ..."
-		rst2man rst/$file > man/$target
+		$rst2man rst/$file > man/$target
 	done
 elif [ "$mode" == "clean" ]; then
 	rm -f man/*
diff --git a/doc/man/check_lft_balance.8 b/doc/man/check_lft_balance.8
index 8e93a0b..af0580f 100644
--- a/doc/man/check_lft_balance.8
+++ b/doc/man/check_lft_balance.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH CHECK_LFT_BALANCE 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH check InfiniBand unicast forwarding tables balance
+.SH CHECK INFINIBAND UNICAST FORWARDING TABLES BALANCE
 .SS SYNOPSIS
 .sp
 check_lft_balance.sh [\-hRv]
@@ -43,18 +43,15 @@ unicast forwarding tables.  It analyzes the output of
 .INDENT 0.0
 .TP
 .B \fB\-h\fP
-.sp
 show help
 .TP
 .B \fB\-R\fP
-.sp
 Recalculate dump_lfts information, ie do not use the cached
 information.  This option is slower but should be used if the diag
 tools have not been used for some time or if there are other reasons to
 believe that the fabric has changed.
 .TP
 .B \fB\-v\fP
-.sp
 verbose output
 .UNINDENT
 .SS SEE ALSO
@@ -65,9 +62,7 @@ verbose output
 .INDENT 0.0
 .TP
 .B Albert Chu
-.
 < \fI\%chu11 at llnl.gov\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/check_lft_balance.8.in b/doc/man/check_lft_balance.8.in
index 5bf8ff8..3e84b13 100644
--- a/doc/man/check_lft_balance.8.in
+++ b/doc/man/check_lft_balance.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH CHECK_LFT_BALANCE 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH check InfiniBand unicast forwarding tables balance
+.SH CHECK INFINIBAND UNICAST FORWARDING TABLES BALANCE
 .SS SYNOPSIS
 .sp
 check_lft_balance.sh [\-hRv]
@@ -43,18 +43,15 @@ unicast forwarding tables.  It analyzes the output of
 .INDENT 0.0
 .TP
 .B \fB\-h\fP
-.sp
 show help
 .TP
 .B \fB\-R\fP
-.sp
 Recalculate dump_lfts information, ie do not use the cached
 information.  This option is slower but should be used if the diag
 tools have not been used for some time or if there are other reasons to
 believe that the fabric has changed.
 .TP
 .B \fB\-v\fP
-.sp
 verbose output
 .UNINDENT
 .SS SEE ALSO
@@ -65,9 +62,7 @@ verbose output
 .INDENT 0.0
 .TP
 .B Albert Chu
-.
 < \fI\%chu11 at llnl.gov\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/dump_lfts.8 b/doc/man/dump_fts.8
similarity index 68%
rename from doc/man/dump_lfts.8
rename to doc/man/dump_fts.8
index 31ea0fc..e495716 100644
--- a/doc/man/dump_lfts.8
+++ b/doc/man/dump_fts.8
@@ -1,8 +1,8 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
-.TH DUMP_LFTS.SH 8 "" "" "OpenIB Diagnostics"
+.TH DUMP_FTS 8 "" "" "OpenIB Diagnostics"
 .SH NAME
-DUMP_LFTS.SH \- dump InfiniBand unicast forwarding tables
+DUMP_FTS \- dump InfiniBand forwarding tables
 .
 .nr rst2man-indent-level 0
 .
@@ -32,21 +32,27 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 ..
 .SH SYNOPSIS
 .sp
-dump_lfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/dump\-file]
+dump_fts [options] [<startlid> [<endlid>]]
 .SH DESCRIPTION
 .sp
-dump_lfts.sh is a script which dumps the InfiniBand unciast forwarding
-tables (MFTs) in the switch nodes in the subnet.
+dump_fts is similar to ibroute but dumps tables for every switch found in an
+ibnetdiscover scan of the subnet.
 .sp
 The dump file format is compatible with loading into OpenSM using
 the \-R file \-U /path/to/dump\-file syntax.
 .SH OPTIONS
-.sp
-\fB\-D\fP
-dump forwarding tables using direct routed rather than LID routed SMPs
-.sp
-\fB\-h\fP
-show help
+.INDENT 0.0
+.TP
+.B \fB\-a, \-\-all\fP
+show all lids in range, even invalid entries
+.TP
+.B \fB\-n, \-\-no_dests\fP
+do not try to resolve destinations
+.TP
+.B \fB\-M, \-\-Multicast\fP
+show multicast forwarding tables
+In this case, the range parameters are specifying the mlid range.
+.UNINDENT
 .SS Port Selection flags
 .\" Define the common option -C
 .
@@ -67,10 +73,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -78,6 +82,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -89,21 +95,71 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
 .SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
 .\" Define the common option -z
 .
 .sp
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
-.\" Define the common option -t
-.
-.sp
-\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
 .SH FILES
 .\" Common text for the config file
 .
@@ -124,6 +180,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -131,8 +189,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -158,20 +220,16 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
-\fBdump_mfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
+\fBdump_lfts(8), dump_mfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
 .SH AUTHORS
 .INDENT 0.0
 .TP
-.B Sasha Khapyorsky
-.
-< \fI\%sashak at voltaire.com\fP >
-.TP
-.B Hal Rosenstock
-.
-< \fI\%halr at voltaire.com\fP >
+.B Ira Weiny
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/dump_lfts.8.in b/doc/man/dump_fts.8.in
similarity index 68%
rename from doc/man/dump_lfts.8.in
rename to doc/man/dump_fts.8.in
index a75a425..3a0db75 100644
--- a/doc/man/dump_lfts.8.in
+++ b/doc/man/dump_fts.8.in
@@ -1,8 +1,8 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
-.TH DUMP_LFTS.SH 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.TH DUMP_FTS 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
-DUMP_LFTS.SH \- dump InfiniBand unicast forwarding tables
+DUMP_FTS \- dump InfiniBand forwarding tables
 .
 .nr rst2man-indent-level 0
 .
@@ -32,21 +32,27 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 ..
 .SH SYNOPSIS
 .sp
-dump_lfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/dump\-file]
+dump_fts [options] [<startlid> [<endlid>]]
 .SH DESCRIPTION
 .sp
-dump_lfts.sh is a script which dumps the InfiniBand unciast forwarding
-tables (MFTs) in the switch nodes in the subnet.
+dump_fts is similar to ibroute but dumps tables for every switch found in an
+ibnetdiscover scan of the subnet.
 .sp
 The dump file format is compatible with loading into OpenSM using
 the \-R file \-U /path/to/dump\-file syntax.
 .SH OPTIONS
-.sp
-\fB\-D\fP
-dump forwarding tables using direct routed rather than LID routed SMPs
-.sp
-\fB\-h\fP
-show help
+.INDENT 0.0
+.TP
+.B \fB\-a, \-\-all\fP
+show all lids in range, even invalid entries
+.TP
+.B \fB\-n, \-\-no_dests\fP
+do not try to resolve destinations
+.TP
+.B \fB\-M, \-\-Multicast\fP
+show multicast forwarding tables
+In this case, the range parameters are specifying the mlid range.
+.UNINDENT
 .SS Port Selection flags
 .\" Define the common option -C
 .
@@ -67,10 +73,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -78,6 +82,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -89,21 +95,71 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
 .SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
 .\" Define the common option -z
 .
 .sp
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
-.\" Define the common option -t
-.
-.sp
-\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
 .SH FILES
 .\" Common text for the config file
 .
@@ -124,6 +180,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -131,8 +189,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -158,20 +220,16 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
-\fBdump_mfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
+\fBdump_lfts(8), dump_mfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
 .SH AUTHORS
 .INDENT 0.0
 .TP
-.B Sasha Khapyorsky
-.
-< \fI\%sashak at voltaire.com\fP >
-.TP
-.B Hal Rosenstock
-.
-< \fI\%halr at voltaire.com\fP >
+.B Ira Weiny
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/dump_mfts.8 b/doc/man/dump_mfts.8
deleted file mode 100644
index c594043..0000000
--- a/doc/man/dump_mfts.8
+++ /dev/null
@@ -1,170 +0,0 @@
-.\" Man page generated from reStructeredText.
-.
-.TH DUMP_MFTS.SH 8 "" "" "OpenIB Diagnostics"
-.SH NAME
-DUMP_MFTS.SH \- dump InfiniBand multicast forwarding tables
-.
-.nr rst2man-indent-level 0
-.
-.de1 rstReportMargin
-\\$1 \\n[an-margin]
-level \\n[rst2man-indent-level]
-level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
--
-\\n[rst2man-indent0]
-\\n[rst2man-indent1]
-\\n[rst2man-indent2]
-..
-.de1 INDENT
-.\" .rstReportMargin pre:
-. RS \\$1
-. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
-. nr rst2man-indent-level +1
-.\" .rstReportMargin post:
-..
-.de UNINDENT
-. RE
-.\" indent \\n[an-margin]
-.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
-.nr rst2man-indent-level -1
-.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
-.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
-..
-.SH SYNOPSIS
-.sp
-dump_mfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/file]
-.SH DESCRIPTION
-.sp
-dump_mfts.sh is a script which dumps the InfiniBand multicast
-forwarding tables (MFTs) in the switch nodes in the subnet.
-.SH OPTIONS
-.sp
-\fB\-D\fP
-dump forwarding tables using direct routed rather than LID routed SMPs
-.sp
-\fB\-h\fP
-show help
-.SS Port Selection flags
-.\" Define the common option -C
-.
-.sp
-\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
-.\" Define the common option -P
-.
-.sp
-\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
-.\" Explanation of local port selection
-.
-.SS Local port Selection
-.sp
-Multiple port/Multiple CA support: when no IB device or port is specified
-(see the "local umad parameters" below), the libibumad library
-selects the port to use by the following criteria:
-.INDENT 0.0
-.INDENT 3.5
-.INDENT 0.0
-.IP 1. 3
-.
-the first port that is ACTIVE.
-.IP 2. 3
-.
-if not found, the first port that is UP (physical link up).
-.UNINDENT
-.sp
-If a port and/or CA name is specified, the libibumad library attempts
-to fulfill the user request, and will fail if it is not possible.
-.sp
-For example:
-.sp
-.nf
-.ft C
-ibaddr                 # use the first port (criteria #1 above)
-ibaddr \-C mthca1       # pick the best port from "mthca1" only.
-ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
-ibaddr \-C mthca0 \-P 2  # use the specified port only.
-.ft P
-.fi
-.UNINDENT
-.UNINDENT
-.SS Configuration flags
-.\" Define the common option -z
-.
-.sp
-\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
-.INDENT 0.0
-.INDENT 3.5
-.sp
-Default: /usr/local/etc/infiniband-diags/ibdiag.conf
-.UNINDENT
-.UNINDENT
-.\" Define the common option -t
-.
-.sp
-\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
-.SH FILES
-.\" Common text for the config file
-.
-.SS CONFIG FILE
-.sp
-/usr/local/etc/infiniband-diags/ibdiag.conf
-.sp
-A global config file is provided to set some of the common options for all
-tools.  See supplied config file for details.
-.\" Common text to describe the node name map file.
-.
-.SS NODE NAME MAP FILE FORMAT
-.sp
-The node name map is used to specify user friendly names for nodes in the
-output.  GUIDs are used to perform the lookup.
-.sp
-This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
-for the file location for your installation.
-.sp
-\fBGenerically:\fP
-.sp
-.nf
-.ft C
-# comment
-<guid> "<name>"
-.ft P
-.fi
-.sp
-\fBExample:\fP
-.sp
-.nf
-.ft C
-# IB1
-# Line cards
-0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
-0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
-0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
-0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
-0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
-
-# Spines
-0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
-0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
-0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
-0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
-0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
-
-# GUID   Node Name
-0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
-0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
-0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
-0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
-.ft P
-.fi
-.SH SEE ALSO
-.sp
-\fBdump_lfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
-.SH AUTHOR
-.INDENT 0.0
-.TP
-.B Hal Rosenstock
-.
-< \fI\%halr at voltaire.com\fP >
-.UNINDENT
-.\" Generated by docutils manpage writer.
-.\" 
-.
diff --git a/doc/man/dump_mfts.8.in b/doc/man/dump_mfts.8.in
deleted file mode 100644
index 0e5f4b9..0000000
--- a/doc/man/dump_mfts.8.in
+++ /dev/null
@@ -1,170 +0,0 @@
-.\" Man page generated from reStructeredText.
-.
-.TH DUMP_MFTS.SH 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
-.SH NAME
-DUMP_MFTS.SH \- dump InfiniBand multicast forwarding tables
-.
-.nr rst2man-indent-level 0
-.
-.de1 rstReportMargin
-\\$1 \\n[an-margin]
-level \\n[rst2man-indent-level]
-level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
--
-\\n[rst2man-indent0]
-\\n[rst2man-indent1]
-\\n[rst2man-indent2]
-..
-.de1 INDENT
-.\" .rstReportMargin pre:
-. RS \\$1
-. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
-. nr rst2man-indent-level +1
-.\" .rstReportMargin post:
-..
-.de UNINDENT
-. RE
-.\" indent \\n[an-margin]
-.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
-.nr rst2man-indent-level -1
-.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
-.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
-..
-.SH SYNOPSIS
-.sp
-dump_mfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/file]
-.SH DESCRIPTION
-.sp
-dump_mfts.sh is a script which dumps the InfiniBand multicast
-forwarding tables (MFTs) in the switch nodes in the subnet.
-.SH OPTIONS
-.sp
-\fB\-D\fP
-dump forwarding tables using direct routed rather than LID routed SMPs
-.sp
-\fB\-h\fP
-show help
-.SS Port Selection flags
-.\" Define the common option -C
-.
-.sp
-\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
-.\" Define the common option -P
-.
-.sp
-\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
-.\" Explanation of local port selection
-.
-.SS Local port Selection
-.sp
-Multiple port/Multiple CA support: when no IB device or port is specified
-(see the "local umad parameters" below), the libibumad library
-selects the port to use by the following criteria:
-.INDENT 0.0
-.INDENT 3.5
-.INDENT 0.0
-.IP 1. 3
-.
-the first port that is ACTIVE.
-.IP 2. 3
-.
-if not found, the first port that is UP (physical link up).
-.UNINDENT
-.sp
-If a port and/or CA name is specified, the libibumad library attempts
-to fulfill the user request, and will fail if it is not possible.
-.sp
-For example:
-.sp
-.nf
-.ft C
-ibaddr                 # use the first port (criteria #1 above)
-ibaddr \-C mthca1       # pick the best port from "mthca1" only.
-ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
-ibaddr \-C mthca0 \-P 2  # use the specified port only.
-.ft P
-.fi
-.UNINDENT
-.UNINDENT
-.SS Configuration flags
-.\" Define the common option -z
-.
-.sp
-\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
-.INDENT 0.0
-.INDENT 3.5
-.sp
-Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
-.UNINDENT
-.UNINDENT
-.\" Define the common option -t
-.
-.sp
-\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
-.SH FILES
-.\" Common text for the config file
-.
-.SS CONFIG FILE
-.sp
- at IBDIAG_CONFIG_PATH@/ibdiag.conf
-.sp
-A global config file is provided to set some of the common options for all
-tools.  See supplied config file for details.
-.\" Common text to describe the node name map file.
-.
-.SS NODE NAME MAP FILE FORMAT
-.sp
-The node name map is used to specify user friendly names for nodes in the
-output.  GUIDs are used to perform the lookup.
-.sp
-This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
-for the file location for your installation.
-.sp
-\fBGenerically:\fP
-.sp
-.nf
-.ft C
-# comment
-<guid> "<name>"
-.ft P
-.fi
-.sp
-\fBExample:\fP
-.sp
-.nf
-.ft C
-# IB1
-# Line cards
-0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
-0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
-0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
-0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
-0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
-
-# Spines
-0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
-0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
-0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
-0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
-0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
-
-# GUID   Node Name
-0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
-0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
-0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
-0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
-.ft P
-.fi
-.SH SEE ALSO
-.sp
-\fBdump_lfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
-.SH AUTHOR
-.INDENT 0.0
-.TP
-.B Hal Rosenstock
-.
-< \fI\%halr at voltaire.com\fP >
-.UNINDENT
-.\" Generated by docutils manpage writer.
-.\" 
-.
diff --git a/doc/man/ibaddr.8 b/doc/man/ibaddr.8
index 6a4b7bc..0a2bafb 100644
--- a/doc/man/ibaddr.8
+++ b/doc/man/ibaddr.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBADDR 8 "" "" "OpenIB Diagnostics"
 .SH NAME
@@ -54,6 +54,8 @@ show lid range (in decimal) only
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -66,6 +68,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -80,7 +84,6 @@ Examples:
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -89,7 +92,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -101,7 +103,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -129,10 +130,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -140,6 +139,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,23 +152,27 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -y
 .
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
 .\" Define the common option -z
 .
 .sp
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -181,6 +186,8 @@ Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 A global config file is provided to set some of the common options for all
 tools.  See supplied config file for details.
 .SH EXAMPLES
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -192,6 +199,8 @@ ibaddr \-L 32            # show decimal lid range only
 ibaddr \-g 32            # show gid address only
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 \fBibroute (8), ibtracert (8)\fP
@@ -199,9 +208,7 @@ ibaddr \-g 32            # show gid address only
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibaddr.8.in b/doc/man/ibaddr.8.in
index efbd438..5458b17 100644
--- a/doc/man/ibaddr.8.in
+++ b/doc/man/ibaddr.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBADDR 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
@@ -54,6 +54,8 @@ show lid range (in decimal) only
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -66,6 +68,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -80,7 +84,6 @@ Examples:
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -89,7 +92,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -101,7 +103,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -129,10 +130,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -140,6 +139,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,23 +152,27 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -y
 .
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
 .\" Define the common option -z
 .
 .sp
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -181,6 +186,8 @@ Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 A global config file is provided to set some of the common options for all
 tools.  See supplied config file for details.
 .SH EXAMPLES
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -192,6 +199,8 @@ ibaddr \-L 32            # show decimal lid range only
 ibaddr \-g 32            # show gid address only
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 \fBibroute (8), ibtracert (8)\fP
@@ -199,9 +208,7 @@ ibaddr \-g 32            # show gid address only
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibcacheedit.8 b/doc/man/ibcacheedit.8
index bfed66c..7e3830a 100644
--- a/doc/man/ibcacheedit.8
+++ b/doc/man/ibcacheedit.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBCACHEEDIT 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH edit an ibnetdiscover cache
+.SH EDIT AN IBNETDISCOVER CACHE
 .SS SYNOPSIS
 .sp
 ibcacheedit [options] <orig.cache> <new.cache>
@@ -42,23 +42,19 @@ ibcacheedit allows users to edit an ibnetdiscover cache created through the
 .INDENT 0.0
 .TP
 .B \fB\-\-switchguid BEFOREGUID:AFTERGUID\fP
-.sp
 Specify a switchguid that should be changed.  The before and after guid
 should be separated by a colon.  On switches, port guids are identical
 to the switch guid, so port guids will be adjusted as well on switches.
 .TP
 .B \fB\-\-caguid BEFOREGUID:AFTERGUID\fP
-.sp
 Specify a caguid that should be changed.  The before and after guid
 should be separated by a colon.
 .TP
 .B \fB\-\-sysimgguid BEFOREGUID:AFTERGUID\fP
-.sp
 Specify a sysimgguid that should be changed.  The before and after guid
 should be spearated by a colon.
 .TP
 .B \fB\-\-portguid NODEGUID:BEFOREGUID:AFTERGUID\fP
-.sp
 Specify a portguid that should be changed.  The nodeguid of the port
 (e.g. switchguid or caguid) should be specified first, followed by a
 colon, the before port guid, another colon, then the after port guid.
@@ -78,9 +74,7 @@ guid will be adjusted as well on switches.
 .INDENT 0.0
 .TP
 .B Albert Chu
-.
 < \fI\%chu11 at llnl.gov\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibcacheedit.8.in b/doc/man/ibcacheedit.8.in
index 9b8cb42..73bff51 100644
--- a/doc/man/ibcacheedit.8.in
+++ b/doc/man/ibcacheedit.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBCACHEEDIT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH edit an ibnetdiscover cache
+.SH EDIT AN IBNETDISCOVER CACHE
 .SS SYNOPSIS
 .sp
 ibcacheedit [options] <orig.cache> <new.cache>
@@ -42,23 +42,19 @@ ibcacheedit allows users to edit an ibnetdiscover cache created through the
 .INDENT 0.0
 .TP
 .B \fB\-\-switchguid BEFOREGUID:AFTERGUID\fP
-.sp
 Specify a switchguid that should be changed.  The before and after guid
 should be separated by a colon.  On switches, port guids are identical
 to the switch guid, so port guids will be adjusted as well on switches.
 .TP
 .B \fB\-\-caguid BEFOREGUID:AFTERGUID\fP
-.sp
 Specify a caguid that should be changed.  The before and after guid
 should be separated by a colon.
 .TP
 .B \fB\-\-sysimgguid BEFOREGUID:AFTERGUID\fP
-.sp
 Specify a sysimgguid that should be changed.  The before and after guid
 should be spearated by a colon.
 .TP
 .B \fB\-\-portguid NODEGUID:BEFOREGUID:AFTERGUID\fP
-.sp
 Specify a portguid that should be changed.  The nodeguid of the port
 (e.g. switchguid or caguid) should be specified first, followed by a
 colon, the before port guid, another colon, then the after port guid.
@@ -78,9 +74,7 @@ guid will be adjusted as well on switches.
 .INDENT 0.0
 .TP
 .B Albert Chu
-.
 < \fI\%chu11 at llnl.gov\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibccconfig.8 b/doc/man/ibccconfig.8
index 6f95756..083e1bf 100644
--- a/doc/man/ibccconfig.8
+++ b/doc/man/ibccconfig.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBCCCONFIG 8 "" "" "OpenIB Diagnostics"
 .SH NAME
@@ -45,7 +45,6 @@ Misuse of this tool could result in a broken fabric.\fP
 .INDENT 0.0
 .TP
 .B Current supported operations and their parameters:
-.
 CongestionKeyInfo (CK) <lid|guid> <cckey> <cckeyprotectbit> <cckeyleaseperiod> <cckeyviolations>
 SwitchCongestionSetting (SS) <lid|guid> <controlmap> <victimmask> <creditmask> <threshold> <packetsize> <csthreshold> <csreturndelay> <markingrate>
 SwitchPortCongestionSetting (SP) <lid|guid> <portnum> <valid> <control_type> <threshold> <packet_size> <cong_parm_marking_rate>
@@ -61,7 +60,6 @@ Specify a congestion control (CC) key.  If none is specified, a key of 0 is used
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -70,7 +68,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -82,7 +79,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -123,10 +119,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -134,6 +128,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -145,13 +141,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -y
 .
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -161,11 +158,12 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
 .SH EXAMPLES
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -176,6 +174,8 @@ ibccconfig CongestionControlTable 1 63 0 0:0 0:1 ...                      # Conf
 ibccconfig CongestionControlTable 1 127 0 0:64 0:65 ...                   # Configure second block of Congestion Control Table
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -189,9 +189,7 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B Albert Chu
-.
 < \fI\%chu11 at llnl.gov\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibccconfig.8.in b/doc/man/ibccconfig.8.in
index 0df5fbf..51106a5 100644
--- a/doc/man/ibccconfig.8.in
+++ b/doc/man/ibccconfig.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBCCCONFIG 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
@@ -45,7 +45,6 @@ Misuse of this tool could result in a broken fabric.\fP
 .INDENT 0.0
 .TP
 .B Current supported operations and their parameters:
-.
 CongestionKeyInfo (CK) <lid|guid> <cckey> <cckeyprotectbit> <cckeyleaseperiod> <cckeyviolations>
 SwitchCongestionSetting (SS) <lid|guid> <controlmap> <victimmask> <creditmask> <threshold> <packetsize> <csthreshold> <csreturndelay> <markingrate>
 SwitchPortCongestionSetting (SP) <lid|guid> <portnum> <valid> <control_type> <threshold> <packet_size> <cong_parm_marking_rate>
@@ -61,7 +60,6 @@ Specify a congestion control (CC) key.  If none is specified, a key of 0 is used
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -70,7 +68,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -82,7 +79,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -123,10 +119,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -134,6 +128,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -145,13 +141,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -y
 .
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -161,11 +158,12 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
 .SH EXAMPLES
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -176,6 +174,8 @@ ibccconfig CongestionControlTable 1 63 0 0:0 0:1 ...                      # Conf
 ibccconfig CongestionControlTable 1 127 0 0:64 0:65 ...                   # Configure second block of Congestion Control Table
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -189,9 +189,7 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B Albert Chu
-.
 < \fI\%chu11 at llnl.gov\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibccquery.8 b/doc/man/ibccquery.8
index cfca977..f134ecd 100644
--- a/doc/man/ibccquery.8
+++ b/doc/man/ibccquery.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBCCQUERY 8 "" "" "OpenIB Diagnostics"
 .SH NAME
@@ -41,7 +41,6 @@ to congestion control.
 .INDENT 0.0
 .TP
 .B Current supported operations and their parameters:
-.
 CongestionInfo (CI) <addr>
 CongestionKeyInfo (CK) <addr>
 CongestionLog (CL) <addr>
@@ -60,7 +59,6 @@ Specify a congestion control (CC) key.  If none is specified, a key of 0 is used
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -69,7 +67,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -81,7 +78,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -122,10 +118,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -133,6 +127,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -144,13 +140,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -y
 .
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -160,7 +157,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -174,6 +170,8 @@ Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 A global config file is provided to set some of the common options for all
 tools.  See supplied config file for details.
 .SH EXAMPLES
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -182,13 +180,13 @@ ibccquery SwitchPortCongestionSetting 3 # Query all Switch Port Congestion Setti
 ibccquery SwitchPortCongestionSetting 3 1 # Query Switch Port Congestion Setting for port 1
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH AUTHOR
 .INDENT 0.0
 .TP
 .B Albert Chu
-.
 < \fI\%chu11 at llnl.gov\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibccquery.8.in b/doc/man/ibccquery.8.in
index a282c99..752c676 100644
--- a/doc/man/ibccquery.8.in
+++ b/doc/man/ibccquery.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBCCQUERY 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
@@ -41,7 +41,6 @@ to congestion control.
 .INDENT 0.0
 .TP
 .B Current supported operations and their parameters:
-.
 CongestionInfo (CI) <addr>
 CongestionKeyInfo (CK) <addr>
 CongestionLog (CL) <addr>
@@ -60,7 +59,6 @@ Specify a congestion control (CC) key.  If none is specified, a key of 0 is used
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -69,7 +67,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -81,7 +78,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -122,10 +118,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -133,6 +127,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -144,13 +140,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -y
 .
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -160,7 +157,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -174,6 +170,8 @@ Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 A global config file is provided to set some of the common options for all
 tools.  See supplied config file for details.
 .SH EXAMPLES
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -182,13 +180,13 @@ ibccquery SwitchPortCongestionSetting 3 # Query all Switch Port Congestion Setti
 ibccquery SwitchPortCongestionSetting 3 1 # Query Switch Port Congestion Setting for port 1
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH AUTHOR
 .INDENT 0.0
 .TP
 .B Albert Chu
-.
 < \fI\%chu11 at llnl.gov\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibclearcounters.8.in b/doc/man/ibclearcounters.8.in
deleted file mode 100644
index 106c643..0000000
--- a/doc/man/ibclearcounters.8.in
+++ /dev/null
@@ -1,101 +0,0 @@
-.\" Man page generated from reStructeredText.
-.
-.TH IBCLEARCOUNTERS 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
-.SH NAME
-IBCLEARCOUNTERS \- 
-.
-.nr rst2man-indent-level 0
-.
-.de1 rstReportMargin
-\\$1 \\n[an-margin]
-level \\n[rst2man-indent-level]
-level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
--
-\\n[rst2man-indent0]
-\\n[rst2man-indent1]
-\\n[rst2man-indent2]
-..
-.de1 INDENT
-.\" .rstReportMargin pre:
-. RS \\$1
-. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
-. nr rst2man-indent-level +1
-.\" .rstReportMargin post:
-..
-.de UNINDENT
-. RE
-.\" indent \\n[an-margin]
-.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
-.nr rst2man-indent-level -1
-.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
-.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
-..
-.SH clear port counters in IB subnet
-.SS SYNOPSIS
-.sp
-ibclearcounters [\-h] [<topology\-file> | \-C ca_name \-P ca_port \-t(imeout) timeout_ms]
-.SS DESCRIPTION
-.sp
-ibclearcounters is a script that clears the PMA port counters by either walking
-the IB subnet topology or using an already saved topology file.
-.SS OPTIONS
-.SS Port Selection flags
-.\" Define the common option -C
-.
-.sp
-\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
-.\" Define the common option -P
-.
-.sp
-\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
-.\" Explanation of local port selection
-.
-.SS Local port Selection
-.sp
-Multiple port/Multiple CA support: when no IB device or port is specified
-(see the "local umad parameters" below), the libibumad library
-selects the port to use by the following criteria:
-.INDENT 0.0
-.INDENT 3.5
-.INDENT 0.0
-.IP 1. 3
-.
-the first port that is ACTIVE.
-.IP 2. 3
-.
-if not found, the first port that is UP (physical link up).
-.UNINDENT
-.sp
-If a port and/or CA name is specified, the libibumad library attempts
-to fulfill the user request, and will fail if it is not possible.
-.sp
-For example:
-.sp
-.nf
-.ft C
-ibaddr                 # use the first port (criteria #1 above)
-ibaddr \-C mthca1       # pick the best port from "mthca1" only.
-ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
-ibaddr \-C mthca0 \-P 2  # use the specified port only.
-.ft P
-.fi
-.UNINDENT
-.UNINDENT
-.SS Configuration flags
-.\" Define the common option -t
-.
-.sp
-\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
-.SS SEE ALSO
-.sp
-\fBibnetdiscover(8), perfquery(8)\fP
-.SS AUTHOR
-.INDENT 0.0
-.TP
-.B Hal Rosenstock
-.
-< \fI\%halr at voltaire.com\fP >
-.UNINDENT
-.\" Generated by docutils manpage writer.
-.\" 
-.
diff --git a/doc/man/ibfindnodesusing.8 b/doc/man/ibfindnodesusing.8
index fe0850f..e9630a2 100644
--- a/doc/man/ibfindnodesusing.8
+++ b/doc/man/ibfindnodesusing.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBFINDNODESUSING 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH find a list of end nodes which are routed through the specified switch and port
+.SH FIND A LIST OF END NODES WHICH ARE ROUTED THROUGH THE SPECIFIED SWITCH AND PORT
 .SS SYNOPSIS
 .sp
 ibfindnodesusing.pl [options] <switch_guid|switch_name> <port>
@@ -43,11 +43,9 @@ switch port end; the script finds the remote end automatically.
 .INDENT 0.0
 .TP
 .B \fB\-h\fP
-.sp
 show help
 .TP
 .B \fB\-R\fP
-.sp
 Recalculate the ibnetdiscover information, ie do not use the cached
 information.  This option is slower but should be used if the diag
 tools have not been used for some time or if there are other reasons to
@@ -77,6 +75,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -84,8 +84,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -111,13 +115,13 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SS AUTHOR
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibfindnodesusing.8.in b/doc/man/ibfindnodesusing.8.in
index 23a3a5c..3e9a403 100644
--- a/doc/man/ibfindnodesusing.8.in
+++ b/doc/man/ibfindnodesusing.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBFINDNODESUSING 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH find a list of end nodes which are routed through the specified switch and port
+.SH FIND A LIST OF END NODES WHICH ARE ROUTED THROUGH THE SPECIFIED SWITCH AND PORT
 .SS SYNOPSIS
 .sp
 ibfindnodesusing.pl [options] <switch_guid|switch_name> <port>
@@ -43,11 +43,9 @@ switch port end; the script finds the remote end automatically.
 .INDENT 0.0
 .TP
 .B \fB\-h\fP
-.sp
 show help
 .TP
 .B \fB\-R\fP
-.sp
 Recalculate the ibnetdiscover information, ie do not use the cached
 information.  This option is slower but should be used if the diag
 tools have not been used for some time or if there are other reasons to
@@ -77,6 +75,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -84,8 +84,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -111,13 +115,13 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SS AUTHOR
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibhosts.8 b/doc/man/ibhosts.8
index 2e7d82e..ce64629 100644
--- a/doc/man/ibhosts.8
+++ b/doc/man/ibhosts.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBHOSTS 8 "" "" "OpenIB Diagnostics"
 .SH NAME
@@ -60,7 +60,6 @@ already saved topology file and extracts the CA nodes.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -75,10 +74,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -86,6 +83,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -97,6 +96,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -117,6 +118,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -124,8 +127,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,6 +158,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 ibnetdiscover(8)
@@ -161,9 +170,7 @@ ibnetdiscover, ibnetdiscover format
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibhosts.8.in b/doc/man/ibhosts.8.in
index ceadee3..40a46ac 100644
--- a/doc/man/ibhosts.8.in
+++ b/doc/man/ibhosts.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBHOSTS 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
@@ -60,7 +60,6 @@ already saved topology file and extracts the CA nodes.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -75,10 +74,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -86,6 +83,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -97,6 +96,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -117,6 +118,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -124,8 +127,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,6 +158,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 ibnetdiscover(8)
@@ -161,9 +170,7 @@ ibnetdiscover, ibnetdiscover format
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibidsverify.8 b/doc/man/ibidsverify.8
index ac1e596..4f4903b 100644
--- a/doc/man/ibidsverify.8
+++ b/doc/man/ibidsverify.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBIDSVERIFY 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH validate IB identifiers in subnet and report errors
+.SH VALIDATE IB IDENTIFIERS IN SUBNET AND REPORT ERRORS
 .SS SYNOPSIS
 .sp
 ibidsverify.pl [\-h] [\-R]
@@ -74,9 +74,7 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibidsverify.8.in b/doc/man/ibidsverify.8.in
index 3933e67..882bac7 100644
--- a/doc/man/ibidsverify.8.in
+++ b/doc/man/ibidsverify.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBIDSVERIFY 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH validate IB identifiers in subnet and report errors
+.SH VALIDATE IB IDENTIFIERS IN SUBNET AND REPORT ERRORS
 .SS SYNOPSIS
 .sp
 ibidsverify.pl [\-h] [\-R]
@@ -74,9 +74,7 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/iblinkinfo.8 b/doc/man/iblinkinfo.8
index ef371cb..9b92952 100644
--- a/doc/man/iblinkinfo.8
+++ b/doc/man/iblinkinfo.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBLINKINFO 8 "" "" "OpenIB Diagnostics"
 .SH NAME
@@ -67,6 +67,8 @@ The node to start a partial scan can be specified with the following addresses.
 .
 .sp
 \fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -79,6 +81,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBNote:\fP For switches results are printed for all ports not just switch port 0.
 .sp
@@ -151,10 +155,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -162,6 +164,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -173,6 +177,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -180,7 +186,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -189,7 +194,6 @@ Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -200,7 +204,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -213,7 +216,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -223,7 +225,6 @@ is specified then a value will be prompted for.
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -235,7 +236,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -243,8 +243,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .
 .sp
 \fB\-V, \-\-version\fP     show the version info.
-.sp
-\fB\-R\fP (This option is obsolete and does nothing)
 .SH EXIT STATUS
 .sp
 0 on success, \-1 on failure to scan the fabric, 1 if check mode is used and
@@ -269,6 +267,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -276,8 +276,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -303,13 +307,13 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH AUTHOR
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/iblinkinfo.8.in b/doc/man/iblinkinfo.8.in
index d5fd476..1621404 100644
--- a/doc/man/iblinkinfo.8.in
+++ b/doc/man/iblinkinfo.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBLINKINFO 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
@@ -67,6 +67,8 @@ The node to start a partial scan can be specified with the following addresses.
 .
 .sp
 \fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -79,6 +81,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBNote:\fP For switches results are printed for all ports not just switch port 0.
 .sp
@@ -151,10 +155,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -162,6 +164,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -173,6 +177,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -180,7 +186,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -189,7 +194,6 @@ Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -200,7 +204,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -213,7 +216,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -223,7 +225,6 @@ is specified then a value will be prompted for.
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -235,7 +236,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -243,8 +243,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .
 .sp
 \fB\-V, \-\-version\fP     show the version info.
-.sp
-\fB\-R\fP (This option is obsolete and does nothing)
 .SH EXIT STATUS
 .sp
 0 on success, \-1 on failure to scan the fabric, 1 if check mode is used and
@@ -269,6 +267,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -276,8 +276,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -303,13 +307,13 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH AUTHOR
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibnetdiscover.8 b/doc/man/ibnetdiscover.8
index 966638b..3cbb27d 100644
--- a/doc/man/ibnetdiscover.8
+++ b/doc/man/ibnetdiscover.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBNETDISCOVER 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -62,6 +62,9 @@ List of connected routers
 \fB\-s, \-\-show\fP
 Show progress information during discovery.
 .sp
+\fB\-f, \-\-full\fP
+Show full information (ports\(aq speed and width, vlcap)
+.sp
 \fB\-p, \-\-ports\fP
 Obtain a ports report which is a
 list of connected ports with relevant information (like LID, portnum,
@@ -74,7 +77,6 @@ Report max hops discovered.
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -134,10 +136,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -145,6 +145,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -156,6 +158,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -163,7 +167,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -172,7 +175,6 @@ Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -183,7 +185,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -196,7 +197,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -206,7 +206,6 @@ is specified then a value will be prompted for.
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -215,7 +214,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -227,7 +225,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -255,6 +252,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -262,8 +261,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -289,6 +292,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Common text to describe the Topology file.
 .
 .SS TOPOLOGY FILE FORMAT
@@ -315,6 +320,8 @@ The active link width and speed are then appended to the end of this
 output line.
 .sp
 An example of this is:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -372,6 +379,8 @@ Ca      2 "H\-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technolo
 [1](8f10403960559)     "S\-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 When grouping is used, IB nodes are organized into chassis which are
 numbered. Nodes which cannot be determined to be in a chassis are
@@ -381,13 +390,10 @@ connectivity lines.
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibnetdiscover.8.in b/doc/man/ibnetdiscover.8.in
index dbb7851..78e7e52 100644
--- a/doc/man/ibnetdiscover.8.in
+++ b/doc/man/ibnetdiscover.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBNETDISCOVER 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -62,6 +62,9 @@ List of connected routers
 \fB\-s, \-\-show\fP
 Show progress information during discovery.
 .sp
+\fB\-f, \-\-full\fP
+Show full information (ports\(aq speed and width, vlcap)
+.sp
 \fB\-p, \-\-ports\fP
 Obtain a ports report which is a
 list of connected ports with relevant information (like LID, portnum,
@@ -74,7 +77,6 @@ Report max hops discovered.
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -134,10 +136,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -145,6 +145,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -156,6 +158,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -163,7 +167,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -172,7 +175,6 @@ Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -183,7 +185,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -196,7 +197,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -206,7 +206,6 @@ is specified then a value will be prompted for.
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -215,7 +214,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -227,7 +225,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -255,6 +252,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -262,8 +261,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -289,6 +292,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Common text to describe the Topology file.
 .
 .SS TOPOLOGY FILE FORMAT
@@ -315,6 +320,8 @@ The active link width and speed are then appended to the end of this
 output line.
 .sp
 An example of this is:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -372,6 +379,8 @@ Ca      2 "H\-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technolo
 [1](8f10403960559)     "S\-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 When grouping is used, IB nodes are organized into chassis which are
 numbered. Nodes which cannot be determined to be in a chassis are
@@ -381,13 +390,10 @@ connectivity lines.
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibnodes.8 b/doc/man/ibnodes.8
index 4f3a65b..f414bbd 100644
--- a/doc/man/ibnodes.8
+++ b/doc/man/ibnodes.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBNODES 8 "" "" "OpenIB Diagnostics"
 .SH NAME
@@ -60,7 +60,6 @@ already saved topology file and extracts the IB nodes (CAs and switches).
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -75,10 +74,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -86,6 +83,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -97,6 +96,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -117,6 +118,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -124,8 +127,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,6 +158,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 ibnetdiscover(8)
@@ -161,9 +170,7 @@ ibnetdiscover, ibnetdiscover format
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibnodes.8.in b/doc/man/ibnodes.8.in
index 6f5521f..f19c990 100644
--- a/doc/man/ibnodes.8.in
+++ b/doc/man/ibnodes.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBNODES 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
@@ -60,7 +60,6 @@ already saved topology file and extracts the IB nodes (CAs and switches).
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -75,10 +74,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -86,6 +83,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -97,6 +96,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -117,6 +118,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -124,8 +127,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,6 +158,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 ibnetdiscover(8)
@@ -161,9 +170,7 @@ ibnetdiscover, ibnetdiscover format
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibping.8 b/doc/man/ibping.8
index ec02a52..c222ff6 100644
--- a/doc/man/ibping.8
+++ b/doc/man/ibping.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBPING 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -85,10 +85,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -96,6 +94,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -107,6 +107,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -114,7 +116,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -132,7 +133,6 @@ Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -141,7 +141,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -v
@@ -149,7 +148,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -170,9 +168,7 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibping.8.in b/doc/man/ibping.8.in
index ecb6176..a4aa95c 100644
--- a/doc/man/ibping.8.in
+++ b/doc/man/ibping.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBPING 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -85,10 +85,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -96,6 +94,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -107,6 +107,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -114,7 +116,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -132,7 +133,6 @@ Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -141,7 +141,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -v
@@ -149,7 +148,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -170,9 +168,7 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibportstate.8 b/doc/man/ibportstate.8
index bb55e0d..956d03f 100644
--- a/doc/man/ibportstate.8
+++ b/doc/man/ibportstate.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBPORTSTATE 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -47,8 +47,7 @@ also allows the link speed/width enabled on any IB port to be adjusted.
 .INDENT 7.0
 .TP
 .B Supported ops: enable, disable, reset, speed, espeed, fdr10, width, query,
-.
-down, arm, active, vls, mtu, lid, smlid, lmc,
+on, off, down, arm, active, vls, mtu, lid, smlid, lmc,
 mkey, mkeylease, mkeyprot
 (Default is query)
 .UNINDENT
@@ -56,6 +55,10 @@ mkey, mkeylease, mkeyprot
 \fBenable, disable, and reset\fP are only allowed on switch ports (An
 error is indicated if attempted on CA or router ports)
 .sp
+\fBoff\fP change the port state to disable.
+.sp
+\fBon\fP change the port state to enable(only when the current state is disable).
+.sp
 \fBspeed and width\fP are allowed on any port
 .sp
 \fBspeed\fP values are the legal values for PortInfo:LinkSpeedEnabled (An
@@ -100,6 +103,8 @@ is specified for the mkey, then ibportstate will prompt for a value.
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -112,6 +117,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -s
 .
 .sp
@@ -136,10 +143,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -147,6 +152,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -158,6 +165,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -165,7 +174,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -178,7 +186,6 @@ Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -192,7 +199,6 @@ is specified then a value will be prompted for.
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -201,7 +207,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -K
@@ -209,7 +214,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-K, \-\-show_keys\fP
-.sp
 show security keys (mkey, smkey, etc.) associated with the request.
 .UNINDENT
 .\" Define the common option -v
@@ -217,7 +221,6 @@ show security keys (mkey, smkey, etc.) associated with the request.
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -238,7 +241,6 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B ::
-.
 ibportstate 3 1 disable                  # by lid
 ibportstate \-G 0x2C9000100D051 1 enable  # by guid
 ibportstate \-D 0 1                       # (query) by direct route
@@ -251,9 +253,7 @@ ibportstate \-D 0 1 lid 0x1234 arm        # by direct route
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%hal.rosenstock at gmail.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibportstate.8.in b/doc/man/ibportstate.8.in
index e45c37a..aed6b7f 100644
--- a/doc/man/ibportstate.8.in
+++ b/doc/man/ibportstate.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBPORTSTATE 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -47,8 +47,7 @@ also allows the link speed/width enabled on any IB port to be adjusted.
 .INDENT 7.0
 .TP
 .B Supported ops: enable, disable, reset, speed, espeed, fdr10, width, query,
-.
-down, arm, active, vls, mtu, lid, smlid, lmc,
+on, off, down, arm, active, vls, mtu, lid, smlid, lmc,
 mkey, mkeylease, mkeyprot
 (Default is query)
 .UNINDENT
@@ -56,6 +55,10 @@ mkey, mkeylease, mkeyprot
 \fBenable, disable, and reset\fP are only allowed on switch ports (An
 error is indicated if attempted on CA or router ports)
 .sp
+\fBoff\fP change the port state to disable.
+.sp
+\fBon\fP change the port state to enable(only when the current state is disable).
+.sp
 \fBspeed and width\fP are allowed on any port
 .sp
 \fBspeed\fP values are the legal values for PortInfo:LinkSpeedEnabled (An
@@ -100,6 +103,8 @@ is specified for the mkey, then ibportstate will prompt for a value.
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -112,6 +117,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -s
 .
 .sp
@@ -136,10 +143,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -147,6 +152,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -158,6 +165,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -165,7 +174,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -178,7 +186,6 @@ Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -192,7 +199,6 @@ is specified then a value will be prompted for.
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -201,7 +207,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -K
@@ -209,7 +214,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-K, \-\-show_keys\fP
-.sp
 show security keys (mkey, smkey, etc.) associated with the request.
 .UNINDENT
 .\" Define the common option -v
@@ -217,7 +221,6 @@ show security keys (mkey, smkey, etc.) associated with the request.
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -238,7 +241,6 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B ::
-.
 ibportstate 3 1 disable                  # by lid
 ibportstate \-G 0x2C9000100D051 1 enable  # by guid
 ibportstate \-D 0 1                       # (query) by direct route
@@ -251,9 +253,7 @@ ibportstate \-D 0 1 lid 0x1234 arm        # by direct route
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%hal.rosenstock at gmail.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibqueryerrors.8 b/doc/man/ibqueryerrors.8
index a963449..67be6d6 100644
--- a/doc/man/ibqueryerrors.8
+++ b/doc/man/ibqueryerrors.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBQUERYERRORS 8 "" "" "OpenIB Diagnostics"
 .SH NAME
@@ -66,6 +66,9 @@ Specify an alternate threshold file.  The default is /usr/local/etc/infiniband-d
 .sp
 \fB\-\-ca\fP  print data for CA\(aqs only
 .sp
+\fB\-\-skip\-sl\fP  Use the default sl for queries. This is not recommended when
+using a QoS aware routing engine as it can cause a credit deadlock.
+.sp
 \fB\-\-router\fP  print data for routers only
 .sp
 \fB\-\-clear\-errors \-k\fP Clear error counters after read.
@@ -90,6 +93,8 @@ The node to start a partial scan can be specified with the following addresses.
 .
 .sp
 \fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -102,6 +107,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBNote:\fP For switches results are printed for all ports not just switch port 0.
 .sp
@@ -134,10 +141,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -145,6 +150,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -156,6 +163,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -163,7 +172,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -172,7 +180,6 @@ Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -183,7 +190,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -196,7 +202,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -206,7 +211,6 @@ is specified then a value will be prompted for.
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -215,7 +219,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -227,7 +230,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -253,6 +255,8 @@ Define threshold values for errors.  File format is simple "name=val".
 Comments begin with \(aq#\(aq
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -262,6 +266,8 @@ LinkErrorRecoveryCounter=10
 VL15Dropped=100
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Common text for the config file
 .
 .SS CONFIG FILE
@@ -281,6 +287,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -288,8 +296,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -315,13 +327,13 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH AUTHOR
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibqueryerrors.8.in b/doc/man/ibqueryerrors.8.in
index 31158aa..9a81ce0 100644
--- a/doc/man/ibqueryerrors.8.in
+++ b/doc/man/ibqueryerrors.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBQUERYERRORS 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
@@ -66,6 +66,9 @@ Specify an alternate threshold file.  The default is @IBDIAG_CONFIG_PATH@/error_
 .sp
 \fB\-\-ca\fP  print data for CA\(aqs only
 .sp
+\fB\-\-skip\-sl\fP  Use the default sl for queries. This is not recommended when
+using a QoS aware routing engine as it can cause a credit deadlock.
+.sp
 \fB\-\-router\fP  print data for routers only
 .sp
 \fB\-\-clear\-errors \-k\fP Clear error counters after read.
@@ -90,6 +93,8 @@ The node to start a partial scan can be specified with the following addresses.
 .
 .sp
 \fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -102,6 +107,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBNote:\fP For switches results are printed for all ports not just switch port 0.
 .sp
@@ -134,10 +141,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -145,6 +150,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -156,6 +163,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Configuration flags
 .\" Define the common option -z
 .
@@ -163,7 +172,6 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -172,7 +180,6 @@ Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -183,7 +190,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -196,7 +202,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -206,7 +211,6 @@ is specified then a value will be prompted for.
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -215,7 +219,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -227,7 +230,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -253,6 +255,8 @@ Define threshold values for errors.  File format is simple "name=val".
 Comments begin with \(aq#\(aq
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -262,6 +266,8 @@ LinkErrorRecoveryCounter=10
 VL15Dropped=100
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Common text for the config file
 .
 .SS CONFIG FILE
@@ -281,6 +287,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -288,8 +296,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -315,13 +327,13 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH AUTHOR
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibroute.8 b/doc/man/ibroute.8
index 3b59684..cb98008 100644
--- a/doc/man/ibroute.8
+++ b/doc/man/ibroute.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBROUTE 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand switch forwarding tables
+.SH QUERY INFINIBAND SWITCH FORWARDING TABLES
 .SS SYNOPSIS
 .sp
 ibroute [options] [<dest dr_path|lid|guid> [<startlid> [<endlid>]]]
@@ -44,15 +44,12 @@ The default range is all valid entries in the range 1...FDBTop.
 .INDENT 0.0
 .TP
 .B \fB\-a, \-\-all\fP
-.sp
 show all lids in range, even invalid entries
 .TP
 .B \fB\-n, \-\-no_dests\fP
-.sp
 do not try to resolve destinations
 .TP
 .B \fB\-M, \-\-Multicast\fP
-.sp
 show multicast forwarding tables
 In this case, the range parameters are specifying the mlid range.
 .UNINDENT
@@ -61,6 +58,8 @@ In this case, the range parameters are specifying the mlid range.
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -73,6 +72,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -105,10 +106,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -116,6 +115,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -127,13 +128,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -142,7 +144,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -154,7 +155,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -172,17 +172,24 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
 .\" Define the common option -z
 .
 .sp
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -195,13 +202,65 @@ Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .sp
 A global config file is provided to set some of the common options for all
 tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
 .SS EXAMPLES
 .sp
 Unicast examples
 .INDENT 0.0
 .TP
 .B ::
-.
 ibroute 4               # dump all lids with valid out ports of switch with lid 4
 ibroute \-a 4            # same, but dump all lids, even with invalid out ports
 ibroute \-n 4            # simple dump format \- no destination resolution
@@ -215,7 +274,6 @@ Multicast examples
 .INDENT 0.0
 .TP
 .B ::
-.
 ibroute \-M 4                # dump all non empty mlids of switch with lid 4
 ibroute \-M 4 0xc010 0xc020  # same, but with range
 ibroute \-M \-n 4             # simple dump format
@@ -227,9 +285,7 @@ ibtracert (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibroute.8.in b/doc/man/ibroute.8.in
index 53992cd..aa988ce 100644
--- a/doc/man/ibroute.8.in
+++ b/doc/man/ibroute.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBROUTE 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand switch forwarding tables
+.SH QUERY INFINIBAND SWITCH FORWARDING TABLES
 .SS SYNOPSIS
 .sp
 ibroute [options] [<dest dr_path|lid|guid> [<startlid> [<endlid>]]]
@@ -44,15 +44,12 @@ The default range is all valid entries in the range 1...FDBTop.
 .INDENT 0.0
 .TP
 .B \fB\-a, \-\-all\fP
-.sp
 show all lids in range, even invalid entries
 .TP
 .B \fB\-n, \-\-no_dests\fP
-.sp
 do not try to resolve destinations
 .TP
 .B \fB\-M, \-\-Multicast\fP
-.sp
 show multicast forwarding tables
 In this case, the range parameters are specifying the mlid range.
 .UNINDENT
@@ -61,6 +58,8 @@ In this case, the range parameters are specifying the mlid range.
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -73,6 +72,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -105,10 +106,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -116,6 +115,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -127,13 +128,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -142,7 +144,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -154,7 +155,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -172,17 +172,24 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
 .\" Define the common option -z
 .
 .sp
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -195,13 +202,65 @@ Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .sp
 A global config file is provided to set some of the common options for all
 tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
 .SS EXAMPLES
 .sp
 Unicast examples
 .INDENT 0.0
 .TP
 .B ::
-.
 ibroute 4               # dump all lids with valid out ports of switch with lid 4
 ibroute \-a 4            # same, but dump all lids, even with invalid out ports
 ibroute \-n 4            # simple dump format \- no destination resolution
@@ -215,7 +274,6 @@ Multicast examples
 .INDENT 0.0
 .TP
 .B ::
-.
 ibroute \-M 4                # dump all non empty mlids of switch with lid 4
 ibroute \-M 4 0xc010 0xc020  # same, but with range
 ibroute \-M \-n 4             # simple dump format
@@ -227,9 +285,7 @@ ibtracert (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibrouters.8 b/doc/man/ibrouters.8
index 1429834..10f000d 100644
--- a/doc/man/ibrouters.8
+++ b/doc/man/ibrouters.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBROUTERS 8 "" "" "OpenIB Diagnostics"
 .SH NAME
@@ -60,7 +60,6 @@ already saved topology file and extracts the router nodes.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -75,10 +74,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -86,6 +83,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -97,6 +96,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -117,6 +118,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -124,8 +127,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,6 +158,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 ibnetdiscover(8)
@@ -161,9 +170,7 @@ ibnetdiscover, ibnetdiscover format
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibrouters.8.in b/doc/man/ibrouters.8.in
index 3419cc4..f1b8d6e 100644
--- a/doc/man/ibrouters.8.in
+++ b/doc/man/ibrouters.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBROUTERS 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
@@ -60,7 +60,6 @@ already saved topology file and extracts the router nodes.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -75,10 +74,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -86,6 +83,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -97,6 +96,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -117,6 +118,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -124,8 +127,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,6 +158,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 ibnetdiscover(8)
@@ -161,9 +170,7 @@ ibnetdiscover, ibnetdiscover format
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibstat.8 b/doc/man/ibstat.8
index 98e6aa5..4018b7c 100644
--- a/doc/man/ibstat.8
+++ b/doc/man/ibstat.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBSTAT 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query basic status of InfiniBand device(s)
+.SH QUERY BASIC STATUS OF INFINIBAND DEVICE(S)
 .SS SYNOPSIS
 .sp
 ibstat [options] <ca_name> [portnum]
@@ -47,23 +47,18 @@ information than ibstatus.
 .INDENT 0.0
 .TP
 .B \fB\-l, \-\-list_of_cas\fP
-.sp
 list all IB devices
 .TP
 .B \fB\-s, \-\-short\fP
-.sp
 short output
 .TP
 .B \fB\-p, \-\-port_list\fP
-.sp
 show port list
 .TP
 .B \fBca_name\fP
-.sp
 InfiniBand device name
 .TP
 .B \fBportnum\fP
-.sp
 port number of InfiniBand device
 .UNINDENT
 .SS Debugging flags
@@ -72,7 +67,6 @@ port number of InfiniBand device
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -85,7 +79,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -100,7 +93,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -108,7 +100,6 @@ Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .INDENT 0.0
 .TP
 .B ::
-.
 ibstat            # display status of all ports on all IB devices
 ibstat \-l         # list all IB devices
 ibstat \-p         # show port guids
@@ -121,9 +112,7 @@ ibstatus (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibstat.8.in b/doc/man/ibstat.8.in
index c53173a..6fc7fb7 100644
--- a/doc/man/ibstat.8.in
+++ b/doc/man/ibstat.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBSTAT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query basic status of InfiniBand device(s)
+.SH QUERY BASIC STATUS OF INFINIBAND DEVICE(S)
 .SS SYNOPSIS
 .sp
 ibstat [options] <ca_name> [portnum]
@@ -47,23 +47,18 @@ information than ibstatus.
 .INDENT 0.0
 .TP
 .B \fB\-l, \-\-list_of_cas\fP
-.sp
 list all IB devices
 .TP
 .B \fB\-s, \-\-short\fP
-.sp
 short output
 .TP
 .B \fB\-p, \-\-port_list\fP
-.sp
 show port list
 .TP
 .B \fBca_name\fP
-.sp
 InfiniBand device name
 .TP
 .B \fBportnum\fP
-.sp
 port number of InfiniBand device
 .UNINDENT
 .SS Debugging flags
@@ -72,7 +67,6 @@ port number of InfiniBand device
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -85,7 +79,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -100,7 +93,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -108,7 +100,6 @@ Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .INDENT 0.0
 .TP
 .B ::
-.
 ibstat            # display status of all ports on all IB devices
 ibstat \-l         # list all IB devices
 ibstat \-p         # show port guids
@@ -121,9 +112,7 @@ ibstatus (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibstatus.8 b/doc/man/ibstatus.8
index c5aa3cb..dcfd269 100644
--- a/doc/man/ibstatus.8
+++ b/doc/man/ibstatus.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBSTATUS 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query basic status of InfiniBand device(s)
+.SH QUERY BASIC STATUS OF INFINIBAND DEVICE(S)
 .SS SYNOPSIS
 .sp
 ibstatus [\-h] [devname[:port]]...
@@ -47,18 +47,15 @@ physical state.
 .INDENT 0.0
 .TP
 .B \fBdevname\fP
-.sp
 InfiniBand device name
 .TP
 .B \fBportnum\fP
-.sp
 port number of InfiniBand device
 .UNINDENT
 .SS EXAMPLES
 .INDENT 0.0
 .TP
 .B ::
-.
 ibstatus                    # display status of all IB ports
 ibstatus mthca1             # status of mthca1 ports
 ibstatus mthca1:1 mthca0:2  # show status of specified ports
@@ -70,9 +67,7 @@ ibstatus mthca1:1 mthca0:2  # show status of specified ports
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibstatus.8.in b/doc/man/ibstatus.8.in
index 704f5dc..56f3937 100644
--- a/doc/man/ibstatus.8.in
+++ b/doc/man/ibstatus.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBSTATUS 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query basic status of InfiniBand device(s)
+.SH QUERY BASIC STATUS OF INFINIBAND DEVICE(S)
 .SS SYNOPSIS
 .sp
 ibstatus [\-h] [devname[:port]]...
@@ -47,18 +47,15 @@ physical state.
 .INDENT 0.0
 .TP
 .B \fBdevname\fP
-.sp
 InfiniBand device name
 .TP
 .B \fBportnum\fP
-.sp
 port number of InfiniBand device
 .UNINDENT
 .SS EXAMPLES
 .INDENT 0.0
 .TP
 .B ::
-.
 ibstatus                    # display status of all IB ports
 ibstatus mthca1             # status of mthca1 ports
 ibstatus mthca1:1 mthca0:2  # show status of specified ports
@@ -70,9 +67,7 @@ ibstatus mthca1:1 mthca0:2  # show status of specified ports
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibswitches.8 b/doc/man/ibswitches.8
index a2c458e..bc861c3 100644
--- a/doc/man/ibswitches.8
+++ b/doc/man/ibswitches.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBSWITCHES 8 "" "" "OpenIB Diagnostics"
 .SH NAME
@@ -60,7 +60,6 @@ already saved topology file and extracts the switch nodes.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -75,10 +74,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -86,6 +83,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -97,6 +96,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -117,6 +118,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -124,8 +127,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,6 +158,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 ibnetdiscover(8)
@@ -161,9 +170,7 @@ ibnetdiscover, ibnetdiscover format
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibswitches.8.in b/doc/man/ibswitches.8.in
index 3f6c7e5..58ce047 100644
--- a/doc/man/ibswitches.8.in
+++ b/doc/man/ibswitches.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBSWITCHES 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
 .SH NAME
@@ -60,7 +60,6 @@ already saved topology file and extracts the switch nodes.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -75,10 +74,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -86,6 +83,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -97,6 +96,8 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SH FILES
 .\" Common text for the config file
 .
@@ -117,6 +118,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -124,8 +127,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -151,6 +158,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SH SEE ALSO
 .sp
 ibnetdiscover(8)
@@ -161,9 +170,7 @@ ibnetdiscover, ibnetdiscover format
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibsysstat.8 b/doc/man/ibsysstat.8
index a21c082..a8f8962 100644
--- a/doc/man/ibsysstat.8
+++ b/doc/man/ibsysstat.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBSYSSTAT 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH system status on an InfiniBand address
+.SH SYSTEM STATUS ON AN INFINIBAND ADDRESS
 .SS SYNOPSIS
 .sp
 ibsysstat [options] <dest lid | guid> [<op>]
@@ -43,19 +43,23 @@ client/server. Default is to run as client.
 .sp
 Current supported operations:
 .INDENT 0.0
-.TP
-.B ::
-.
-ping \- verify connectivity to server (default)
-host \- obtain host information from server
-cpu  \- obtain cpu information from server
+.INDENT 3.5
+.sp
+.nf
+.ft C
+ping \e\- verify connectivity to server (default)
+host \e\- obtain host information from server
+cpu  \e\- obtain cpu information from server
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
 .TP
 .B \fB\-o, \-\-oui\fP
-.sp
 use specified OUI number to multiplex vendor mads
 .TP
 .B \fB\-S, \-\-Server\fP
-.sp
 start in server mode (do not return)
 .UNINDENT
 .SS Addressing Flags
@@ -91,10 +95,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -102,6 +104,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -113,13 +117,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -128,7 +133,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -140,7 +144,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -159,7 +162,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -176,9 +178,7 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibsysstat.8.in b/doc/man/ibsysstat.8.in
index 68f6f51..63dd8ce 100644
--- a/doc/man/ibsysstat.8.in
+++ b/doc/man/ibsysstat.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBSYSSTAT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH system status on an InfiniBand address
+.SH SYSTEM STATUS ON AN INFINIBAND ADDRESS
 .SS SYNOPSIS
 .sp
 ibsysstat [options] <dest lid | guid> [<op>]
@@ -43,19 +43,23 @@ client/server. Default is to run as client.
 .sp
 Current supported operations:
 .INDENT 0.0
-.TP
-.B ::
-.
-ping \- verify connectivity to server (default)
-host \- obtain host information from server
-cpu  \- obtain cpu information from server
+.INDENT 3.5
+.sp
+.nf
+.ft C
+ping \e\- verify connectivity to server (default)
+host \e\- obtain host information from server
+cpu  \e\- obtain cpu information from server
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
 .TP
 .B \fB\-o, \-\-oui\fP
-.sp
 use specified OUI number to multiplex vendor mads
 .TP
 .B \fB\-S, \-\-Server\fP
-.sp
 start in server mode (do not return)
 .UNINDENT
 .SS Addressing Flags
@@ -91,10 +95,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -102,6 +104,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -113,13 +117,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -128,7 +133,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -140,7 +144,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -159,7 +162,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -176,9 +178,7 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibtracert.8 b/doc/man/ibtracert.8
index 3bef111..804a6eb 100644
--- a/doc/man/ibtracert.8
+++ b/doc/man/ibtracert.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBTRACERT 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH trace InfiniBand path
+.SH TRACE INFINIBAND PATH
 .SS SYNOPSIS
 .sp
 ibtracert [options] [<lid|guid> [<startlid> [<endlid>]]]
@@ -45,12 +45,13 @@ and destination nodes.
 .INDENT 0.0
 .TP
 .B \fB\-n, \-\-no_info\fP
-.sp
 simple format; don\(aqt show additional information
 .TP
 .B \fB\-m\fP
-.sp
 show the multicast trace of the specified mlid
+.TP
+.B \fB\-f, \-\-force\fP
+force route to destination port
 .UNINDENT
 .SS Addressing Flags
 .\" Define the common option -G
@@ -85,10 +86,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -96,6 +95,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -107,13 +108,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -122,7 +124,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -134,7 +135,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -153,7 +153,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -162,7 +161,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -172,7 +170,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -196,6 +193,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -203,8 +202,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -230,13 +233,14 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SS EXAMPLES
 .sp
 Unicast examples
 .INDENT 0.0
 .TP
 .B ::
-.
 ibtracert 4 16                                  # show path between lids 4 and 16
 ibtracert \-n 4 16                               # same, but using simple output format
 ibtracert \-G 0x8f1040396522d 0x002c9000100d051  # use guid addresses
@@ -246,7 +250,6 @@ Multicast example
 .INDENT 0.0
 .TP
 .B ::
-.
 ibtracert \-m 0xc000 4 16    # show multicast path of mlid 0xc000 between lids 4 and 16
 .UNINDENT
 .SS SEE ALSO
@@ -256,13 +259,10 @@ ibroute (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 <\fI\%hal.rosenstock at gmail.com\fP>
 .TP
 .B Ira Weiny
-.
-<\fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/ibtracert.8.in b/doc/man/ibtracert.8.in
index 0b0ae59..6c936f7 100644
--- a/doc/man/ibtracert.8.in
+++ b/doc/man/ibtracert.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH IBTRACERT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH trace InfiniBand path
+.SH TRACE INFINIBAND PATH
 .SS SYNOPSIS
 .sp
 ibtracert [options] [<lid|guid> [<startlid> [<endlid>]]]
@@ -45,12 +45,13 @@ and destination nodes.
 .INDENT 0.0
 .TP
 .B \fB\-n, \-\-no_info\fP
-.sp
 simple format; don\(aqt show additional information
 .TP
 .B \fB\-m\fP
-.sp
 show the multicast trace of the specified mlid
+.TP
+.B \fB\-f, \-\-force\fP
+force route to destination port
 .UNINDENT
 .SS Addressing Flags
 .\" Define the common option -G
@@ -85,10 +86,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -96,6 +95,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -107,13 +108,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -122,7 +124,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -134,7 +135,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -153,7 +153,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -162,7 +161,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -172,7 +170,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -196,6 +193,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -203,8 +202,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -230,13 +233,14 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SS EXAMPLES
 .sp
 Unicast examples
 .INDENT 0.0
 .TP
 .B ::
-.
 ibtracert 4 16                                  # show path between lids 4 and 16
 ibtracert \-n 4 16                               # same, but using simple output format
 ibtracert \-G 0x8f1040396522d 0x002c9000100d051  # use guid addresses
@@ -246,7 +250,6 @@ Multicast example
 .INDENT 0.0
 .TP
 .B ::
-.
 ibtracert \-m 0xc000 4 16    # show multicast path of mlid 0xc000 between lids 4 and 16
 .UNINDENT
 .SS SEE ALSO
@@ -256,13 +259,10 @@ ibroute (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 <\fI\%hal.rosenstock at gmail.com\fP>
 .TP
 .B Ira Weiny
-.
-<\fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/infiniband-diags.8 b/doc/man/infiniband-diags.8
index e382db5..9e09db0 100644
--- a/doc/man/infiniband-diags.8
+++ b/doc/man/infiniband-diags.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH INFINIBAND-DIAGS 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH Diagnostics for InfiniBand Fabrics
+.SH DIAGNOSTICS FOR INFINIBAND FABRICS
 .SS DESCRIPTION
 .sp
 infiniband\-diags is a set of utilities designed to help configure, debug, and
@@ -61,6 +61,8 @@ The \-D and \-G option have two forms:
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -73,10 +75,14 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -D for Directed routes
 .
 .sp
 \fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -89,6 +95,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -125,10 +133,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -136,6 +142,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -147,13 +155,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -162,7 +171,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -174,7 +182,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -192,7 +199,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -203,7 +209,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -213,7 +218,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -239,6 +243,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -246,8 +252,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -273,6 +283,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Common text to describe the Topology file.
 .
 .SS TOPOLOGY FILE FORMAT
@@ -299,6 +311,8 @@ The active link width and speed are then appended to the end of this
 output line.
 .sp
 An example of this is:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -356,6 +370,8 @@ Ca      2 "H\-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technolo
 [1](8f10403960559)     "S\-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 When grouping is used, IB nodes are organized into chassis which are
 numbered. Nodes which cannot be determined to be in a chassis are
@@ -365,63 +381,54 @@ connectivity lines.
 .SS Basic fabric conectivity
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibnetdiscover, iblinkinfo
 .UNINDENT
 .UNINDENT
 .SS Node information
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibnodes, ibswitches, ibhosts, ibrouters
 .UNINDENT
 .UNINDENT
 .SS Port information
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibportstate, ibaddr
 .UNINDENT
 .UNINDENT
 .SS Switch Forwarding Table info
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibtracert, ibroute, dump_lfts, dump_mfts, check_lft_balance, ibfindnodesusing
 .UNINDENT
 .UNINDENT
 .SS Peformance counters
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibqueryerrors, perfquery
 .UNINDENT
 .UNINDENT
 .SS Local HCA info
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibstat, ibstatus
 .UNINDENT
 .UNINDENT
 .SS Connectivity check
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibping, ibsysstat
 .UNINDENT
 .UNINDENT
 .SS Low level query tools
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: smpquery, smpdump, saquery, sminfo
 .UNINDENT
 .UNINDENT
 .SS Fabric verification tools
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibidsverify
 .UNINDENT
 .UNINDENT
@@ -439,9 +446,7 @@ ibprintca, ibprintrt, ibprintswitch, set_nodedesc.sh
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-<\fI\%weiny2 at llnl.gov\fP>
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/infiniband-diags.8.in b/doc/man/infiniband-diags.8.in
index 80702ed..da5a775 100644
--- a/doc/man/infiniband-diags.8.in
+++ b/doc/man/infiniband-diags.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH INFINIBAND-DIAGS 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH Diagnostics for InfiniBand Fabrics
+.SH DIAGNOSTICS FOR INFINIBAND FABRICS
 .SS DESCRIPTION
 .sp
 infiniband\-diags is a set of utilities designed to help configure, debug, and
@@ -61,6 +61,8 @@ The \-D and \-G option have two forms:
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -73,10 +75,14 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -D for Directed routes
 .
 .sp
 \fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -89,6 +95,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -125,10 +133,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -136,6 +142,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -147,13 +155,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -162,7 +171,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -174,7 +182,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -192,7 +199,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -203,7 +209,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -213,7 +218,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -239,6 +243,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -246,8 +252,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -273,6 +283,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Common text to describe the Topology file.
 .
 .SS TOPOLOGY FILE FORMAT
@@ -299,6 +311,8 @@ The active link width and speed are then appended to the end of this
 output line.
 .sp
 An example of this is:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -356,6 +370,8 @@ Ca      2 "H\-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technolo
 [1](8f10403960559)     "S\-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 When grouping is used, IB nodes are organized into chassis which are
 numbered. Nodes which cannot be determined to be in a chassis are
@@ -365,63 +381,54 @@ connectivity lines.
 .SS Basic fabric conectivity
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibnetdiscover, iblinkinfo
 .UNINDENT
 .UNINDENT
 .SS Node information
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibnodes, ibswitches, ibhosts, ibrouters
 .UNINDENT
 .UNINDENT
 .SS Port information
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibportstate, ibaddr
 .UNINDENT
 .UNINDENT
 .SS Switch Forwarding Table info
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibtracert, ibroute, dump_lfts, dump_mfts, check_lft_balance, ibfindnodesusing
 .UNINDENT
 .UNINDENT
 .SS Peformance counters
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibqueryerrors, perfquery
 .UNINDENT
 .UNINDENT
 .SS Local HCA info
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibstat, ibstatus
 .UNINDENT
 .UNINDENT
 .SS Connectivity check
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibping, ibsysstat
 .UNINDENT
 .UNINDENT
 .SS Low level query tools
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: smpquery, smpdump, saquery, sminfo
 .UNINDENT
 .UNINDENT
 .SS Fabric verification tools
 .INDENT 0.0
 .INDENT 3.5
-.sp
 See: ibidsverify
 .UNINDENT
 .UNINDENT
@@ -439,9 +446,7 @@ ibprintca, ibprintrt, ibprintswitch, set_nodedesc.sh
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-<\fI\%weiny2 at llnl.gov\fP>
+< \fI\%ira.weiny at intel.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/perfquery.8 b/doc/man/perfquery.8
index b1a5701..f16adb1 100644
--- a/doc/man/perfquery.8
+++ b/doc/man/perfquery.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH PERFQUERY 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,10 +30,10 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand port counters on a single port
+.SH QUERY INFINIBAND PORT COUNTERS ON A SINGLE PORT
 .SS SYNOPSIS
 .sp
-perfquery [options] [<lid|guid> [[port] [reset_mask]]]
+perfquery [options] [<lid|guid> [[port(s)] [reset_mask]]]
 .SS DESCRIPTION
 .sp
 perfquery uses PerfMgt GMPs to obtain the PortCounters (basic performance and
@@ -48,109 +48,89 @@ components that represent Data (e.g. PortXmitData and PortRcvData) indicate
 octets divided by 4 rather than just octets.
 .sp
 Note: Inputting a port of 255 indicates an operation be performed on all ports.
+.sp
+Note: For PortCounters, ExtendedCounters, and resets, multiple ports can be
+specified by either a comma separated list or a port range.  See examples below.
 .SS OPTIONS
 .INDENT 0.0
 .TP
 .B \fB\-x, \-\-extended\fP
-.sp
 show extended port counters rather than (basic) port counters.
 Note that extended port counters attribute is optional.
 .TP
 .B \fB\-X, \-\-xmtsl\fP
-.sp
 show transmit data SL counter. This is an optional counter for QoS.
 .TP
 .B \fB\-S, \-\-rcvsl\fP
-.sp
 show receive data SL counter. This is an optional counter for QoS.
 .TP
 .B \fB\-D, \-\-xmtdisc\fP
-.sp
 show transmit discard details. This is an optional counter.
 .TP
 .B \fB\-E, \-\-rcverr\fP
-.sp
 show receive error details. This is an optional counter.
 .TP
 .B \fB\-D, \-\-xmtdisc\fP
-.sp
 show transmit discard details. This is an optional counter.
 .TP
 .B \fB\-T, \-\-extended_speeds\fP
-.sp
 show extended speeds port counters. This is an optional counter.
 .TP
 .B \fB\-\-oprcvcounters\fP
-.sp
 show Rcv Counters per Op code. This is an optional counter.
 .TP
 .B \fB\-\-flowctlcounters\fP
-.sp
 show flow control counters. This is an optional counter.
 .TP
 .B \fB\-\-vloppackets\fP
-.sp
 show packets received per Op code per VL. This is an optional counter.
 .TP
 .B \fB\-\-vlopdata\fP
-.sp
 show data received per Op code per VL. This is an optional counter.
 .TP
 .B \fB\-\-vlxmitflowctlerrors\fP
-.sp
 show flow control update errors per VL. This is an optional counter.
 .TP
 .B \fB\-\-vlxmitcounters\fP
-.sp
 show ticks waiting to transmit counters per VL. This is an optional counter.
 .TP
 .B \fB\-\-swportvlcong\fP
-.sp
 show sw port VL congestion. This is an optional counter.
 .TP
 .B \fB\-\-rcvcc\fP
-.sp
 show Rcv congestion control counters. This is an optional counter.
 .TP
 .B \fB\-\-slrcvfecn\fP
-.sp
 show SL Rcv FECN counters. This is an optional counter.
 .TP
 .B \fB\-\-slrcvbecn\fP
-.sp
 show SL Rcv BECN counters. This is an optional counter.
 .TP
 .B \fB\-\-xmitcc\fP
-.sp
 show Xmit congestion control counters. This is an optional counter.
 .TP
 .B \fB\-\-vlxmittimecc\fP
-.sp
 show VL Xmit Time congestion control counters. This is an optional counter.
 .TP
 .B \fB\-c, \-\-smplctl\fP
-.sp
 show port samples control.
 .TP
 .B \fB\-a, \-\-all_ports\fP
-.sp
-show aggregated counters for all ports of the destination lid or reset
-all counters for all ports.  If the destination lid does not support
+show aggregated counters for all ports of the destination lid, reset
+all counters for all ports, or if multiple ports are specified, aggregate
+the counters of the specified ports.  If the destination lid does not support
 the AllPortSelect flag, all ports will be iterated through to emulate
 AllPortSelect behavior.
 .TP
 .B \fB\-l, \-\-loop_ports\fP
-.sp
 If all ports are selected by the user (either through the \fB\-a\fP option
-or port 255) iterate through each port rather than doing than aggregate
-operation.
+or port 255) or multiple ports are specified iterate through each port rather
+than doing than aggregate operation.
 .TP
 .B \fB\-r, \-\-reset_after_read\fP
-.sp
 reset counters after read
 .TP
 .B \fB\-R, \-\-Reset_only\fP
-.sp
 only reset counters
 .UNINDENT
 .SS Addressing Flags
@@ -186,10 +166,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -197,6 +175,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -208,13 +188,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -223,7 +204,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -235,7 +215,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -253,7 +232,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -263,7 +241,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -278,9 +255,10 @@ A global config file is provided to set some of the common options for all
 tools.  See supplied config file for details.
 .SS EXAMPLES
 .INDENT 0.0
-.TP
-.B ::
-.
+.INDENT 3.5
+.sp
+.nf
+.ft C
 perfquery                # read local port performance counters
 perfquery 32 1           # read performance counters from lid 32, port 1
 perfquery \-x 32 1        # read extended performance counters from lid 32, port 1
@@ -292,14 +270,19 @@ perfquery \-x \-R 0x20 1   # reset extended performance counters of port 1 only
 perfquery \-R \-a 32       # reset performance counters of all ports
 perfquery \-R 32 2 0x0fff # reset only error counters of port 2
 perfquery \-R 32 2 0xf000 # reset only non\-error counters of port 2
+perfquery \-a 32 1\-10     # read performance counters from lid 32, port 1\-10, aggregate output
+perfquery \-l 32 1\-10     # read performance counters from lid 32, port 1\-10, output each port
+perfquery \-a 32 1,4,8    # read performance counters from lid 32, port 1, 4, and 8, aggregate output
+perfquery \-l 32 1,4,8    # read performance counters from lid 32, port 1, 4, and 8, output each port
+.ft P
+.fi
+.UNINDENT
 .UNINDENT
 .SS AUTHOR
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%hal.rosenstock at gmail.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/perfquery.8.in b/doc/man/perfquery.8.in
index 5fef288..d939902 100644
--- a/doc/man/perfquery.8.in
+++ b/doc/man/perfquery.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH PERFQUERY 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,10 +30,10 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand port counters on a single port
+.SH QUERY INFINIBAND PORT COUNTERS ON A SINGLE PORT
 .SS SYNOPSIS
 .sp
-perfquery [options] [<lid|guid> [[port] [reset_mask]]]
+perfquery [options] [<lid|guid> [[port(s)] [reset_mask]]]
 .SS DESCRIPTION
 .sp
 perfquery uses PerfMgt GMPs to obtain the PortCounters (basic performance and
@@ -48,109 +48,89 @@ components that represent Data (e.g. PortXmitData and PortRcvData) indicate
 octets divided by 4 rather than just octets.
 .sp
 Note: Inputting a port of 255 indicates an operation be performed on all ports.
+.sp
+Note: For PortCounters, ExtendedCounters, and resets, multiple ports can be
+specified by either a comma separated list or a port range.  See examples below.
 .SS OPTIONS
 .INDENT 0.0
 .TP
 .B \fB\-x, \-\-extended\fP
-.sp
 show extended port counters rather than (basic) port counters.
 Note that extended port counters attribute is optional.
 .TP
 .B \fB\-X, \-\-xmtsl\fP
-.sp
 show transmit data SL counter. This is an optional counter for QoS.
 .TP
 .B \fB\-S, \-\-rcvsl\fP
-.sp
 show receive data SL counter. This is an optional counter for QoS.
 .TP
 .B \fB\-D, \-\-xmtdisc\fP
-.sp
 show transmit discard details. This is an optional counter.
 .TP
 .B \fB\-E, \-\-rcverr\fP
-.sp
 show receive error details. This is an optional counter.
 .TP
 .B \fB\-D, \-\-xmtdisc\fP
-.sp
 show transmit discard details. This is an optional counter.
 .TP
 .B \fB\-T, \-\-extended_speeds\fP
-.sp
 show extended speeds port counters. This is an optional counter.
 .TP
 .B \fB\-\-oprcvcounters\fP
-.sp
 show Rcv Counters per Op code. This is an optional counter.
 .TP
 .B \fB\-\-flowctlcounters\fP
-.sp
 show flow control counters. This is an optional counter.
 .TP
 .B \fB\-\-vloppackets\fP
-.sp
 show packets received per Op code per VL. This is an optional counter.
 .TP
 .B \fB\-\-vlopdata\fP
-.sp
 show data received per Op code per VL. This is an optional counter.
 .TP
 .B \fB\-\-vlxmitflowctlerrors\fP
-.sp
 show flow control update errors per VL. This is an optional counter.
 .TP
 .B \fB\-\-vlxmitcounters\fP
-.sp
 show ticks waiting to transmit counters per VL. This is an optional counter.
 .TP
 .B \fB\-\-swportvlcong\fP
-.sp
 show sw port VL congestion. This is an optional counter.
 .TP
 .B \fB\-\-rcvcc\fP
-.sp
 show Rcv congestion control counters. This is an optional counter.
 .TP
 .B \fB\-\-slrcvfecn\fP
-.sp
 show SL Rcv FECN counters. This is an optional counter.
 .TP
 .B \fB\-\-slrcvbecn\fP
-.sp
 show SL Rcv BECN counters. This is an optional counter.
 .TP
 .B \fB\-\-xmitcc\fP
-.sp
 show Xmit congestion control counters. This is an optional counter.
 .TP
 .B \fB\-\-vlxmittimecc\fP
-.sp
 show VL Xmit Time congestion control counters. This is an optional counter.
 .TP
 .B \fB\-c, \-\-smplctl\fP
-.sp
 show port samples control.
 .TP
 .B \fB\-a, \-\-all_ports\fP
-.sp
-show aggregated counters for all ports of the destination lid or reset
-all counters for all ports.  If the destination lid does not support
+show aggregated counters for all ports of the destination lid, reset
+all counters for all ports, or if multiple ports are specified, aggregate
+the counters of the specified ports.  If the destination lid does not support
 the AllPortSelect flag, all ports will be iterated through to emulate
 AllPortSelect behavior.
 .TP
 .B \fB\-l, \-\-loop_ports\fP
-.sp
 If all ports are selected by the user (either through the \fB\-a\fP option
-or port 255) iterate through each port rather than doing than aggregate
-operation.
+or port 255) or multiple ports are specified iterate through each port rather
+than doing than aggregate operation.
 .TP
 .B \fB\-r, \-\-reset_after_read\fP
-.sp
 reset counters after read
 .TP
 .B \fB\-R, \-\-Reset_only\fP
-.sp
 only reset counters
 .UNINDENT
 .SS Addressing Flags
@@ -186,10 +166,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -197,6 +175,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -208,13 +188,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -223,7 +204,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -235,7 +215,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -253,7 +232,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -263,7 +241,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -278,9 +255,10 @@ A global config file is provided to set some of the common options for all
 tools.  See supplied config file for details.
 .SS EXAMPLES
 .INDENT 0.0
-.TP
-.B ::
-.
+.INDENT 3.5
+.sp
+.nf
+.ft C
 perfquery                # read local port performance counters
 perfquery 32 1           # read performance counters from lid 32, port 1
 perfquery \-x 32 1        # read extended performance counters from lid 32, port 1
@@ -292,14 +270,19 @@ perfquery \-x \-R 0x20 1   # reset extended performance counters of port 1 only
 perfquery \-R \-a 32       # reset performance counters of all ports
 perfquery \-R 32 2 0x0fff # reset only error counters of port 2
 perfquery \-R 32 2 0xf000 # reset only non\-error counters of port 2
+perfquery \-a 32 1\-10     # read performance counters from lid 32, port 1\-10, aggregate output
+perfquery \-l 32 1\-10     # read performance counters from lid 32, port 1\-10, output each port
+perfquery \-a 32 1,4,8    # read performance counters from lid 32, port 1, 4, and 8, aggregate output
+perfquery \-l 32 1,4,8    # read performance counters from lid 32, port 1, 4, and 8, output each port
+.ft P
+.fi
+.UNINDENT
 .UNINDENT
 .SS AUTHOR
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%hal.rosenstock at gmail.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/saquery.8 b/doc/man/saquery.8
index 50b2966..13aaf4f 100644
--- a/doc/man/saquery.8
+++ b/doc/man/saquery.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH SAQUERY 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand subnet administration attributes
+.SH QUERY INFINIBAND SUBNET ADMINISTRATION ATTRIBUTES
 .SS SYNOPSIS
 .sp
 saquery [options] [<name> | <lid> | <guid>]
@@ -41,79 +41,61 @@ saquery issues the selected SA query. Node records are queried by default.
 .INDENT 0.0
 .TP
 .B \fB\-p\fP
-.sp
 get PathRecord info
 .TP
 .B \fB\-N\fP
-.sp
 get NodeRecord info
 .TP
 .B \fB\-D, \-\-list\fP
-.sp
 get NodeDescriptions of CAs only
 .TP
 .B \fB\-S\fP
-.sp
 get ServiceRecord info
 .TP
 .B \fB\-I\fP
-.sp
 get InformInfoRecord (subscription) info
 .TP
 .B \fB\-L\fP
-.sp
 return the Lids of the name specified
 .TP
 .B \fB\-l\fP
-.sp
 return the unique Lid of the name specified
 .TP
 .B \fB\-G\fP
-.sp
 return the Guids of the name specified
 .TP
 .B \fB\-O\fP
-.sp
 return the name for the Lid specified
 .TP
 .B \fB\-U\fP
-.sp
 return the name for the Guid specified
 .TP
 .B \fB\-c\fP
-.sp
 get the SA\(aqs class port info
 .TP
 .B \fB\-s\fP
-.sp
 return the PortInfoRecords with isSM or isSMdisabled capability mask bit on
 .TP
 .B \fB\-g\fP
-.sp
 get multicast group info
 .TP
 .B \fB\-m\fP
-.sp
 get multicast member info.  If a group is specified, limit the output
 to the group specified and print one line containing only the GUID and
 node description for each entry. Example: saquery \-m 0xc000
 .TP
 .B \fB\-x\fP
-.sp
 get LinkRecord info
 .TP
 .B \fB\-\-src\-to\-dst <src:dst>\fP
-.sp
 get a PathRecord for <src:dst>
 where src and dst are either node names or LIDs
 .TP
 .B \fB\-\-sgid\-to\-dgid <sgid:dgid>\fP
-.sp
 get a PathRecord for \fBsgid\fP to \fBdgid\fP
 where both GIDs are in an IPv6 format acceptable to \fBinet_pton (3)\fP
 .TP
 .B \fB\-\-smkey <val>\fP
-.sp
 use SM_Key value for the query. Will be used only with "trusted"
 queries.  If non\-numeric value (like \(aqx\(aq) is specified then saquery
 will prompt for a value.
@@ -126,7 +108,6 @@ Default (when not specified here or in
 .INDENT 0.0
 .TP
 .B \fB\-K, \-\-show_keys\fP
-.sp
 show security keys (mkey, smkey, etc.) associated with the request.
 .UNINDENT
 .sp
@@ -150,7 +131,6 @@ show security keys (mkey, smkey, etc.) associated with the request.
 .INDENT 0.0
 .TP
 .B \fB\-\-pkey\fP P_Key (PathRecord, MCMemberRecord). If non\-numeric value (like \(aqx\(aq)
-.sp
 is specified then saquery will prompt for a value
 .UNINDENT
 .sp
@@ -166,7 +146,6 @@ is specified then saquery will prompt for a value
 .INDENT 0.0
 .TP
 .B \fB\-\-qkey\fP Q_Key (MCMemberRecord). If non\-numeric value (like \(aqx\(aq) is specified
-.sp
 then saquery will prompt for a value
 .UNINDENT
 .sp
@@ -182,11 +161,14 @@ then saquery will prompt for a value
 .sp
 \fB\-\-proxy_join\fP Proxy join (MCMemberRecord)
 .sp
+\fB\-\-service_id\fP ServiceID (PathRecord)
+.sp
 Supported query names (and aliases):
 .INDENT 0.0
-.TP
-.B ::
-.
+.INDENT 3.5
+.sp
+.nf
+.ft C
 ClassPortInfo (CPI)
 NodeRecord (NR) [lid]
 PortInfoRecord (PIR) [[lid]/[port]/[options]]
@@ -201,6 +183,11 @@ MCMemberRecord (MCMR)
 LFTRecord (LFTR) [[lid]/[block]]
 MFTRecord (MFTR) [[mlid]/[position]/[block]]
 GUIDInfoRecord (GIR) [[lid]/[block]]
+SwitchInfoRecord (SWIR) [lid]
+SMInfoRecord (SMIR) [lid]
+.ft P
+.fi
+.UNINDENT
 .UNINDENT
 .SS Port Selection flags
 .\" Define the common option -C
@@ -222,10 +209,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -233,6 +218,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -244,13 +231,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -259,7 +247,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -271,7 +258,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -289,7 +275,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -300,7 +285,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -310,7 +294,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -334,6 +317,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -341,8 +326,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -368,6 +357,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SS DEPENDENCIES
 .sp
 OpenSM (or other running SM/SA), libosmcomp, libibumad, libibmad
@@ -375,13 +366,10 @@ OpenSM (or other running SM/SA), libosmcomp, libibumad, libibmad
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .TP
 .B Hal Rosenstock
-.
-< \fI\%halr at voltaire.com\fP >
+< \fI\%halr at mellanox.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/saquery.8.in b/doc/man/saquery.8.in
index d7d3a5c..72465fc 100644
--- a/doc/man/saquery.8.in
+++ b/doc/man/saquery.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH SAQUERY 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand subnet administration attributes
+.SH QUERY INFINIBAND SUBNET ADMINISTRATION ATTRIBUTES
 .SS SYNOPSIS
 .sp
 saquery [options] [<name> | <lid> | <guid>]
@@ -41,79 +41,61 @@ saquery issues the selected SA query. Node records are queried by default.
 .INDENT 0.0
 .TP
 .B \fB\-p\fP
-.sp
 get PathRecord info
 .TP
 .B \fB\-N\fP
-.sp
 get NodeRecord info
 .TP
 .B \fB\-D, \-\-list\fP
-.sp
 get NodeDescriptions of CAs only
 .TP
 .B \fB\-S\fP
-.sp
 get ServiceRecord info
 .TP
 .B \fB\-I\fP
-.sp
 get InformInfoRecord (subscription) info
 .TP
 .B \fB\-L\fP
-.sp
 return the Lids of the name specified
 .TP
 .B \fB\-l\fP
-.sp
 return the unique Lid of the name specified
 .TP
 .B \fB\-G\fP
-.sp
 return the Guids of the name specified
 .TP
 .B \fB\-O\fP
-.sp
 return the name for the Lid specified
 .TP
 .B \fB\-U\fP
-.sp
 return the name for the Guid specified
 .TP
 .B \fB\-c\fP
-.sp
 get the SA\(aqs class port info
 .TP
 .B \fB\-s\fP
-.sp
 return the PortInfoRecords with isSM or isSMdisabled capability mask bit on
 .TP
 .B \fB\-g\fP
-.sp
 get multicast group info
 .TP
 .B \fB\-m\fP
-.sp
 get multicast member info.  If a group is specified, limit the output
 to the group specified and print one line containing only the GUID and
 node description for each entry. Example: saquery \-m 0xc000
 .TP
 .B \fB\-x\fP
-.sp
 get LinkRecord info
 .TP
 .B \fB\-\-src\-to\-dst <src:dst>\fP
-.sp
 get a PathRecord for <src:dst>
 where src and dst are either node names or LIDs
 .TP
 .B \fB\-\-sgid\-to\-dgid <sgid:dgid>\fP
-.sp
 get a PathRecord for \fBsgid\fP to \fBdgid\fP
 where both GIDs are in an IPv6 format acceptable to \fBinet_pton (3)\fP
 .TP
 .B \fB\-\-smkey <val>\fP
-.sp
 use SM_Key value for the query. Will be used only with "trusted"
 queries.  If non\-numeric value (like \(aqx\(aq) is specified then saquery
 will prompt for a value.
@@ -126,7 +108,6 @@ Default (when not specified here or in
 .INDENT 0.0
 .TP
 .B \fB\-K, \-\-show_keys\fP
-.sp
 show security keys (mkey, smkey, etc.) associated with the request.
 .UNINDENT
 .sp
@@ -150,7 +131,6 @@ show security keys (mkey, smkey, etc.) associated with the request.
 .INDENT 0.0
 .TP
 .B \fB\-\-pkey\fP P_Key (PathRecord, MCMemberRecord). If non\-numeric value (like \(aqx\(aq)
-.sp
 is specified then saquery will prompt for a value
 .UNINDENT
 .sp
@@ -166,7 +146,6 @@ is specified then saquery will prompt for a value
 .INDENT 0.0
 .TP
 .B \fB\-\-qkey\fP Q_Key (MCMemberRecord). If non\-numeric value (like \(aqx\(aq) is specified
-.sp
 then saquery will prompt for a value
 .UNINDENT
 .sp
@@ -182,11 +161,14 @@ then saquery will prompt for a value
 .sp
 \fB\-\-proxy_join\fP Proxy join (MCMemberRecord)
 .sp
+\fB\-\-service_id\fP ServiceID (PathRecord)
+.sp
 Supported query names (and aliases):
 .INDENT 0.0
-.TP
-.B ::
-.
+.INDENT 3.5
+.sp
+.nf
+.ft C
 ClassPortInfo (CPI)
 NodeRecord (NR) [lid]
 PortInfoRecord (PIR) [[lid]/[port]/[options]]
@@ -201,6 +183,11 @@ MCMemberRecord (MCMR)
 LFTRecord (LFTR) [[lid]/[block]]
 MFTRecord (MFTR) [[mlid]/[position]/[block]]
 GUIDInfoRecord (GIR) [[lid]/[block]]
+SwitchInfoRecord (SWIR) [lid]
+SMInfoRecord (SMIR) [lid]
+.ft P
+.fi
+.UNINDENT
 .UNINDENT
 .SS Port Selection flags
 .\" Define the common option -C
@@ -222,10 +209,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -233,6 +218,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -244,13 +231,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -259,7 +247,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -271,7 +258,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -289,7 +275,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-\-outstanding_smps, \-o <val>\fP
-.sp
 Specify the number of outstanding SMP\(aqs which should be issued during the scan
 .sp
 Default: 2
@@ -300,7 +285,6 @@ Default: 2
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -310,7 +294,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -334,6 +317,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -341,8 +326,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -368,6 +357,8 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SS DEPENDENCIES
 .sp
 OpenSM (or other running SM/SA), libosmcomp, libibumad, libibmad
@@ -375,13 +366,10 @@ OpenSM (or other running SM/SA), libosmcomp, libibumad, libibmad
 .INDENT 0.0
 .TP
 .B Ira Weiny
-.
-< \fI\%weiny2 at llnl.gov\fP >
+< \fI\%ira.weiny at intel.com\fP >
 .TP
 .B Hal Rosenstock
-.
-< \fI\%halr at voltaire.com\fP >
+< \fI\%halr at mellanox.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/sminfo.8 b/doc/man/sminfo.8
index 8b0fceb..9cf217a 100644
--- a/doc/man/sminfo.8
+++ b/doc/man/sminfo.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH SMINFO 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand SMInfo attribute
+.SH QUERY INFINIBAND SMINFO ATTRIBUTE
 .SS SYNOPSIS
 .sp
 sminfo [options] sm_lid | sm_dr_path [modifier]
@@ -46,7 +46,6 @@ dangerous, and may result in a malfunction of the target SM.
 .INDENT 0.0
 .TP
 .B \fB\-s, \-\-state <state>\fP set SM state
-.sp
 0 not active
 .sp
 1 discovering
@@ -64,6 +63,8 @@ dangerous, and may result in a malfunction of the target SM.
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -76,6 +77,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -104,10 +107,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -115,6 +116,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -126,13 +129,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -141,7 +145,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -153,7 +156,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -171,7 +173,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -181,7 +182,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -198,7 +198,6 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B ::
-.
 sminfo                  # local port\(aqs sminfo
 sminfo 32               # show sminfo of lid 32
 sminfo  \-G 0x8f1040023  # same but using guid address
@@ -210,9 +209,7 @@ smpdump (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/sminfo.8.in b/doc/man/sminfo.8.in
index 8bc9f48..8b33d27 100644
--- a/doc/man/sminfo.8.in
+++ b/doc/man/sminfo.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH SMINFO 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand SMInfo attribute
+.SH QUERY INFINIBAND SMINFO ATTRIBUTE
 .SS SYNOPSIS
 .sp
 sminfo [options] sm_lid | sm_dr_path [modifier]
@@ -46,7 +46,6 @@ dangerous, and may result in a malfunction of the target SM.
 .INDENT 0.0
 .TP
 .B \fB\-s, \-\-state <state>\fP set SM state
-.sp
 0 not active
 .sp
 1 discovering
@@ -64,6 +63,8 @@ dangerous, and may result in a malfunction of the target SM.
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -76,6 +77,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -104,10 +107,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -115,6 +116,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -126,13 +129,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -141,7 +145,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -153,7 +156,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -171,7 +173,6 @@ May be used several times (\-vv or \-v \-v \-v)
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -181,7 +182,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -198,7 +198,6 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B ::
-.
 sminfo                  # local port\(aqs sminfo
 sminfo 32               # show sminfo of lid 32
 sminfo  \-G 0x8f1040023  # same but using guid address
@@ -210,9 +209,7 @@ smpdump (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/smpdump.8 b/doc/man/smpdump.8
index 64efc79..61d165a 100644
--- a/doc/man/smpdump.8
+++ b/doc/man/smpdump.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH SMPDUMP 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH dump InfiniBand subnet management attributes
+.SH DUMP INFINIBAND SUBNET MANAGEMENT ATTRIBUTES
 .SS SYNOPSIS
 .sp
 smpdump [options] <dlid|dr_path> <attribute> [attribute_modifier]
@@ -42,19 +42,15 @@ specified SMA. The result is dumped in hex by default.
 .INDENT 0.0
 .TP
 .B \fBdlid|drpath\fP
-.sp
 LID or DR path to SMA
 .TP
 .B \fBattribute\fP
-.sp
 IBA attribute ID for SM attribute
 .TP
 .B \fBattribute_modifier\fP
-.sp
 IBA modifier for SM attribute
 .TP
 .B \fB\-s, \-\-string\fP
-.sp
 Print strings in packet if possible
 .UNINDENT
 .SS Addressing Flags
@@ -62,6 +58,8 @@ Print strings in packet if possible
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -74,6 +72,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -L
 .
 .sp
@@ -98,10 +98,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -109,6 +107,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -120,13 +120,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -135,7 +136,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -147,7 +147,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -166,7 +165,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -185,7 +183,6 @@ Direct Routed Examples
 .INDENT 0.0
 .TP
 .B ::
-.
 smpdump \-D 0,1,2,3,5 16 # NODE DESC
 smpdump \-D 0,1,2 0x15 2 # PORT INFO, port 2
 .UNINDENT
@@ -194,7 +191,6 @@ LID Routed Examples
 .INDENT 0.0
 .TP
 .B ::
-.
 smpdump 3 0x15 2        # PORT INFO, lid 3 port 2
 smpdump 0xa0 0x11       # NODE INFO, lid 0xa0
 .UNINDENT
@@ -205,9 +201,7 @@ smpquery (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/smpdump.8.in b/doc/man/smpdump.8.in
index cebf273..269402b 100644
--- a/doc/man/smpdump.8.in
+++ b/doc/man/smpdump.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH SMPDUMP 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH dump InfiniBand subnet management attributes
+.SH DUMP INFINIBAND SUBNET MANAGEMENT ATTRIBUTES
 .SS SYNOPSIS
 .sp
 smpdump [options] <dlid|dr_path> <attribute> [attribute_modifier]
@@ -42,19 +42,15 @@ specified SMA. The result is dumped in hex by default.
 .INDENT 0.0
 .TP
 .B \fBdlid|drpath\fP
-.sp
 LID or DR path to SMA
 .TP
 .B \fBattribute\fP
-.sp
 IBA attribute ID for SM attribute
 .TP
 .B \fBattribute_modifier\fP
-.sp
 IBA modifier for SM attribute
 .TP
 .B \fB\-s, \-\-string\fP
-.sp
 Print strings in packet if possible
 .UNINDENT
 .SS Addressing Flags
@@ -62,6 +58,8 @@ Print strings in packet if possible
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -74,6 +72,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -L
 .
 .sp
@@ -98,10 +98,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -109,6 +107,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -120,13 +120,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -135,7 +136,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -147,7 +147,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -166,7 +165,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -185,7 +183,6 @@ Direct Routed Examples
 .INDENT 0.0
 .TP
 .B ::
-.
 smpdump \-D 0,1,2,3,5 16 # NODE DESC
 smpdump \-D 0,1,2 0x15 2 # PORT INFO, port 2
 .UNINDENT
@@ -194,7 +191,6 @@ LID Routed Examples
 .INDENT 0.0
 .TP
 .B ::
-.
 smpdump 3 0x15 2        # PORT INFO, lid 3 port 2
 smpdump 0xa0 0x11       # NODE INFO, lid 0xa0
 .UNINDENT
@@ -205,9 +201,7 @@ smpquery (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%halr at voltaire.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/smpquery.8 b/doc/man/smpquery.8
index 72aa23e..ea5d7c9 100644
--- a/doc/man/smpquery.8
+++ b/doc/man/smpquery.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH SMPQUERY 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand subnet management attributes
+.SH QUERY INFINIBAND SUBNET MANAGEMENT ATTRIBUTES
 .SS SYNOPSIS
 .sp
 smpquery [options] <op> <dest dr_path|lid|guid> [op params]
@@ -45,7 +45,6 @@ Current supported operations and their parameters:
 .INDENT 0.0
 .TP
 .B ::
-.
 nodeinfo <addr>
 nodedesc <addr>
 portinfo <addr> [<portnum>]     # default port is zero
@@ -57,11 +56,9 @@ guids <addr>
 mlnxextportinfo <addr> [<portnum>]  # default port is zero
 .TP
 .B \fB\-c, \-\-combined\fP
-.sp
-Use Combined route address argument \fC<lid> <DR_Path>\fP
+Use Combined route address argument \fB<lid> <DR_Path>\fP
 .TP
 .B \fB\-x, \-\-extended\fP
-.sp
 Set SMSupportsExtendedSpeeds bit 31 in AttributeModifier
 (only impacts PortInfo queries).
 .UNINDENT
@@ -70,7 +67,6 @@ Set SMSupportsExtendedSpeeds bit 31 in AttributeModifier
 .INDENT 0.0
 .TP
 .B \fB\-K, \-\-show_keys\fP
-.sp
 show security keys (mkey, smkey, etc.) associated with the request.
 .UNINDENT
 .SS Addressing Flags
@@ -78,6 +74,8 @@ show security keys (mkey, smkey, etc.) associated with the request.
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -90,6 +88,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -122,10 +122,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -133,6 +131,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -144,13 +144,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -159,7 +160,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -171,7 +171,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -190,7 +189,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -199,7 +197,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -209,7 +206,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -233,6 +229,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -240,8 +238,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -267,11 +269,12 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SS EXAMPLES
 .INDENT 0.0
 .TP
 .B ::
-.
 smpquery portinfo 3 1                     # portinfo by lid, with port modifier
 smpquery \-G switchinfo 0x2C9000100D051 1  # switchinfo by guid
 smpquery \-D nodeinfo 0                    # nodeinfo by direct route
@@ -284,9 +287,7 @@ smpdump (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%hal at mellanox.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/smpquery.8.in b/doc/man/smpquery.8.in
index 53d1713..9015b83 100644
--- a/doc/man/smpquery.8.in
+++ b/doc/man/smpquery.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH SMPQUERY 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand subnet management attributes
+.SH QUERY INFINIBAND SUBNET MANAGEMENT ATTRIBUTES
 .SS SYNOPSIS
 .sp
 smpquery [options] <op> <dest dr_path|lid|guid> [op params]
@@ -45,7 +45,6 @@ Current supported operations and their parameters:
 .INDENT 0.0
 .TP
 .B ::
-.
 nodeinfo <addr>
 nodedesc <addr>
 portinfo <addr> [<portnum>]     # default port is zero
@@ -57,11 +56,9 @@ guids <addr>
 mlnxextportinfo <addr> [<portnum>]  # default port is zero
 .TP
 .B \fB\-c, \-\-combined\fP
-.sp
-Use Combined route address argument \fC<lid> <DR_Path>\fP
+Use Combined route address argument \fB<lid> <DR_Path>\fP
 .TP
 .B \fB\-x, \-\-extended\fP
-.sp
 Set SMSupportsExtendedSpeeds bit 31 in AttributeModifier
 (only impacts PortInfo queries).
 .UNINDENT
@@ -70,7 +67,6 @@ Set SMSupportsExtendedSpeeds bit 31 in AttributeModifier
 .INDENT 0.0
 .TP
 .B \fB\-K, \-\-show_keys\fP
-.sp
 show security keys (mkey, smkey, etc.) associated with the request.
 .UNINDENT
 .SS Addressing Flags
@@ -78,6 +74,8 @@ show security keys (mkey, smkey, etc.) associated with the request.
 .
 .sp
 \fB\-D, \-\-Direct\fP     The address specified is a directed route
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -90,6 +88,8 @@ Examples:
    port found through the automatic selection process.)
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .\" Define the common option -G
 .
 .sp
@@ -122,10 +122,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -133,6 +131,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -144,13 +144,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -159,7 +160,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -171,7 +171,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -190,7 +189,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 This file maps GUIDs to more user friendly names.  See FILES section.
 .UNINDENT
 .UNINDENT
@@ -199,7 +197,6 @@ This file maps GUIDs to more user friendly names.  See FILES section.
 .INDENT 0.0
 .TP
 .B \fB\-y, \-\-m_key <key>\fP
-.sp
 use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
 is specified then a value will be prompted for.
 .UNINDENT
@@ -209,7 +206,6 @@ is specified then a value will be prompted for.
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -233,6 +229,8 @@ This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
 for the file location for your installation.
 .sp
 \fBGenerically:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -240,8 +238,12 @@ for the file location for your installation.
 <guid> "<name>"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .sp
 \fBExample:\fP
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -267,11 +269,12 @@ for the file location for your installation.
 0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
 .ft P
 .fi
+.UNINDENT
+.UNINDENT
 .SS EXAMPLES
 .INDENT 0.0
 .TP
 .B ::
-.
 smpquery portinfo 3 1                     # portinfo by lid, with port modifier
 smpquery \-G switchinfo 0x2C9000100D051 1  # switchinfo by guid
 smpquery \-D nodeinfo 0                    # nodeinfo by direct route
@@ -284,9 +287,7 @@ smpdump (8)
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%hal at mellanox.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/vendstat.8 b/doc/man/vendstat.8
index a5e9a48..28e4a41 100644
--- a/doc/man/vendstat.8
+++ b/doc/man/vendstat.8
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH VENDSTAT 8 "" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand vendor specific functions
+.SH QUERY INFINIBAND VENDOR SPECIFIC FUNCTIONS
 .SS SYNOPSIS
 .sp
 vendstat [options] <lid|guid>
@@ -43,19 +43,15 @@ Mellanox InfiniSwitch\-III (IS3) and InfiniSwitch\-IV (IS4).
 .INDENT 0.0
 .TP
 .B \fB\-N\fP
-.sp
 show IS3 or IS4 general information.
 .TP
 .B \fB\-w\fP
-.sp
 show IS3 port xmit wait counters.
 .TP
 .B \fB\-i\fP
-.sp
 show IS4 counter group info.
 .TP
 .B \fB\-c <num,num>\fP
-.sp
 configure IS4 counter groups.
 .sp
 Configure IS4 counter groups 0 and 1. Such configuration is not
@@ -69,7 +65,6 @@ Group 0 counter config values:
 .B ::
 .INDENT 7.0
 .INDENT 3.5
-.sp
 0 \- PortXmitDataSL0\-7
 1 \- PortXmitDataSL8\-15
 2 \- PortRcvDataSL0\-7
@@ -81,17 +76,14 @@ Group 1 counter config values:
 .INDENT 0.0
 .TP
 .B ::
-.
 1 \- PortXmitDataSL8\-15
 2 \- PortRcvDataSL0\-7
 8 \- PortRcvDataSL8\-15
 .TP
 .B \fB\-R, \-\-Read <addr,mask>\fP
-.sp
 Read configuration space record at addr
 .TP
 .B \fB\-W, \-\-Write <addr,val,mask>\fP
-.sp
 Write configuration space record at addr
 .UNINDENT
 .SS Addressing Flags
@@ -127,10 +119,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -138,6 +128,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -149,13 +141,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -164,7 +157,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -176,7 +168,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -195,7 +186,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: /usr/local/etc/infiniband-diags/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -212,7 +202,6 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B ::
-.
 vendstat \-N 6           # read IS3 or IS4 general information
 vendstat \-w 6           # read IS3 port xmit wait counters
 vendstat \-i 6 12        # read IS4 port 12 counter group info
@@ -223,9 +212,7 @@ vendstat \-c 2,8 6 12    # configure IS4 port 12 counter groups for PortRcvDataS
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%hal.rosenstock at gmail.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/man/vendstat.8.in b/doc/man/vendstat.8.in
index ef5ed73..ebec171 100644
--- a/doc/man/vendstat.8.in
+++ b/doc/man/vendstat.8.in
@@ -1,4 +1,4 @@
-.\" Man page generated from reStructeredText.
+.\" Man page generated from reStructuredText.
 .
 .TH VENDSTAT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
 .SH NAME
@@ -30,7 +30,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.SH query InfiniBand vendor specific functions
+.SH QUERY INFINIBAND VENDOR SPECIFIC FUNCTIONS
 .SS SYNOPSIS
 .sp
 vendstat [options] <lid|guid>
@@ -43,19 +43,15 @@ Mellanox InfiniSwitch\-III (IS3) and InfiniSwitch\-IV (IS4).
 .INDENT 0.0
 .TP
 .B \fB\-N\fP
-.sp
 show IS3 or IS4 general information.
 .TP
 .B \fB\-w\fP
-.sp
 show IS3 port xmit wait counters.
 .TP
 .B \fB\-i\fP
-.sp
 show IS4 counter group info.
 .TP
 .B \fB\-c <num,num>\fP
-.sp
 configure IS4 counter groups.
 .sp
 Configure IS4 counter groups 0 and 1. Such configuration is not
@@ -69,7 +65,6 @@ Group 0 counter config values:
 .B ::
 .INDENT 7.0
 .INDENT 3.5
-.sp
 0 \- PortXmitDataSL0\-7
 1 \- PortXmitDataSL8\-15
 2 \- PortRcvDataSL0\-7
@@ -81,17 +76,14 @@ Group 1 counter config values:
 .INDENT 0.0
 .TP
 .B ::
-.
 1 \- PortXmitDataSL8\-15
 2 \- PortRcvDataSL0\-7
 8 \- PortRcvDataSL8\-15
 .TP
 .B \fB\-R, \-\-Read <addr,mask>\fP
-.sp
 Read configuration space record at addr
 .TP
 .B \fB\-W, \-\-Write <addr,val,mask>\fP
-.sp
 Write configuration space record at addr
 .UNINDENT
 .SS Addressing Flags
@@ -127,10 +119,8 @@ selects the port to use by the following criteria:
 .INDENT 3.5
 .INDENT 0.0
 .IP 1. 3
-.
 the first port that is ACTIVE.
 .IP 2. 3
-.
 if not found, the first port that is UP (physical link up).
 .UNINDENT
 .sp
@@ -138,6 +128,8 @@ If a port and/or CA name is specified, the libibumad library attempts
 to fulfill the user request, and will fail if it is not possible.
 .sp
 For example:
+.INDENT 0.0
+.INDENT 3.5
 .sp
 .nf
 .ft C
@@ -149,13 +141,14 @@ ibaddr \-C mthca0 \-P 2  # use the specified port only.
 .fi
 .UNINDENT
 .UNINDENT
+.UNINDENT
+.UNINDENT
 .SS Debugging flags
 .\" Define the common option -d
 .
 .INDENT 0.0
 .TP
 .B \-d
-.
 raise the IB debugging level.
 May be used several times (\-ddd or \-d \-d \-d).
 .UNINDENT
@@ -164,7 +157,6 @@ May be used several times (\-ddd or \-d \-d \-d).
 .INDENT 0.0
 .TP
 .B \-e
-.
 show send and receive errors (timeouts and others)
 .UNINDENT
 .\" Define the common option -h
@@ -176,7 +168,6 @@ show send and receive errors (timeouts and others)
 .INDENT 0.0
 .TP
 .B \fB\-v, \-\-verbose\fP
-.sp
 increase the application verbosity level.
 May be used several times (\-vv or \-v \-v \-v)
 .UNINDENT
@@ -195,7 +186,6 @@ May be used several times (\-vv or \-v \-v \-v)
 \fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
 .INDENT 0.0
 .INDENT 3.5
-.sp
 Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
 .UNINDENT
 .UNINDENT
@@ -212,7 +202,6 @@ tools.  See supplied config file for details.
 .INDENT 0.0
 .TP
 .B ::
-.
 vendstat \-N 6           # read IS3 or IS4 general information
 vendstat \-w 6           # read IS3 port xmit wait counters
 vendstat \-i 6 12        # read IS4 port 12 counter group info
@@ -223,9 +212,7 @@ vendstat \-c 2,8 6 12    # configure IS4 port 12 counter groups for PortRcvDataS
 .INDENT 0.0
 .TP
 .B Hal Rosenstock
-.
 < \fI\%hal.rosenstock at gmail.com\fP >
 .UNINDENT
 .\" Generated by docutils manpage writer.
-.\" 
 .
diff --git a/doc/rst/dump_fts.8.in.rst b/doc/rst/dump_fts.8.in.rst
new file mode 100644
index 0000000..9b2df51
--- /dev/null
+++ b/doc/rst/dump_fts.8.in.rst
@@ -0,0 +1,85 @@
+========
+DUMP_FTS
+========
+
+---------------------------------
+dump InfiniBand forwarding tables
+---------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+
+SYNOPSIS
+========
+
+dump_fts [options] [<startlid> [<endlid>]]
+
+
+DESCRIPTION
+===========
+
+dump_fts is similar to ibroute but dumps tables for every switch found in an
+ibnetdiscover scan of the subnet.
+
+The dump file format is compatible with loading into OpenSM using
+the -R file -U /path/to/dump-file syntax.
+
+OPTIONS
+=======
+
+**-a, --all**
+        show all lids in range, even invalid entries
+
+**-n, --no_dests**
+        do not try to resolve destinations
+
+**-M, --Multicast**
+        show multicast forwarding tables
+        In this case, the range parameters are specifying the mlid range.
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
+.. include:: common/opt_node_name_map.rst
+.. include:: common/opt_z-config.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+
+SEE ALSO
+========
+
+**dump_lfts(8), dump_mfts(8), ibroute(8), ibswitches(8), opensm(8)**
+
+
+AUTHORS
+=======
+
+Ira Weiny
+        < ira.weiny at intel.com >
diff --git a/doc/rst/dump_lfts.8.in.rst b/doc/rst/dump_lfts.8.in.rst
deleted file mode 100644
index 9b9ded2..0000000
--- a/doc/rst/dump_lfts.8.in.rst
+++ /dev/null
@@ -1,73 +0,0 @@
-============
-DUMP_LFTS.SH
-============
-
------------------------------------------
-dump InfiniBand unicast forwarding tables
------------------------------------------
-
-:Date: @BUILD_DATE@
-:Manual section: 8
-:Manual group: OpenIB Diagnostics
-
-
-
-SYNOPSIS
-========
-
-dump_lfts.sh [-h] [-D] [-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] [>/path/to/dump-file]
-
-
-DESCRIPTION
-===========
-
-dump_lfts.sh is a script which dumps the InfiniBand unciast forwarding
-tables (MFTs) in the switch nodes in the subnet.
-
-The dump file format is compatible with loading into OpenSM using
-the -R file -U /path/to/dump-file syntax.
-
-OPTIONS
-=======
-
-**-D**
-dump forwarding tables using direct routed rather than LID routed SMPs
-
-**-h**
-show help
-
-
-Port Selection flags
---------------------
-
-.. include:: common/opt_C.rst
-.. include:: common/opt_P.rst
-.. include:: common/sec_portselection.rst
-
-Configuration flags
--------------------
-
-.. include:: common/opt_z-config.rst
-.. include:: common/opt_t.rst
-
-FILES
-=====
-
-.. include:: common/sec_config-file.rst
-.. include:: common/sec_node-name-map.rst
-
-
-SEE ALSO
-========
-
-**dump_mfts(8), ibroute(8), ibswitches(8), opensm(8)**
-
-
-AUTHORS
-=======
-
-Sasha Khapyorsky
-        < sashak at voltaire.com >
-
-Hal Rosenstock
-        < halr at voltaire.com >
diff --git a/doc/rst/dump_mfts.8.in.rst b/doc/rst/dump_mfts.8.in.rst
deleted file mode 100644
index 551effc..0000000
--- a/doc/rst/dump_mfts.8.in.rst
+++ /dev/null
@@ -1,64 +0,0 @@
-============
-DUMP_MFTS.SH
-============
-
--------------------------------------------
-dump InfiniBand multicast forwarding tables
--------------------------------------------
-
-:Date: @BUILD_DATE@
-:Manual section: 8
-:Manual group: OpenIB Diagnostics
-
-
-SYNOPSIS
-========
-
-dump_mfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/file]
-
-DESCRIPTION
-===========
-
-dump_mfts.sh is a script which dumps the InfiniBand multicast
-forwarding tables (MFTs) in the switch nodes in the subnet.
-
-OPTIONS
-=======
-
-**-D**
-dump forwarding tables using direct routed rather than LID routed SMPs
-
-**-h**
-show help
-
-
-Port Selection flags
---------------------
-
-.. include:: common/opt_C.rst
-.. include:: common/opt_P.rst
-.. include:: common/sec_portselection.rst
-
-Configuration flags
--------------------
-
-.. include:: common/opt_z-config.rst
-.. include:: common/opt_t.rst
-
-FILES
-=====
-
-.. include:: common/sec_config-file.rst
-.. include:: common/sec_node-name-map.rst
-
-
-SEE ALSO
-========
-
-**dump_lfts(8), ibroute(8), ibswitches(8), opensm(8)**
-
-AUTHOR
-======
-
-Hal Rosenstock
-        < halr at voltaire.com >
diff --git a/doc/rst/ibaddr.8.in.rst b/doc/rst/ibaddr.8.in.rst
index 6713fcf..ac18bbf 100644
--- a/doc/rst/ibaddr.8.in.rst
+++ b/doc/rst/ibaddr.8.in.rst
@@ -69,6 +69,7 @@ Configuration flags
 -------------------
 
 .. include:: common/opt_y.rst
+.. include:: common/opt_t.rst
 .. include:: common/opt_z-config.rst
 
 FILES
diff --git a/doc/rst/ibclearcounters.8.in.rst b/doc/rst/ibclearcounters.8.in.rst
deleted file mode 100644
index 62bae25..0000000
--- a/doc/rst/ibclearcounters.8.in.rst
+++ /dev/null
@@ -1,51 +0,0 @@
-===============
-IBCLEARCOUNTERS
-===============
-
-:Date: @BUILD_DATE@
-:Manual section: 8
-:Manual group: Open IB Diagnostics
-
---------------------------------
-clear port counters in IB subnet
---------------------------------
-
-
-SYNOPSIS
-========
-
-ibclearcounters [\-h] [<topology-file> | \-C ca_name \-P ca_port \-t(imeout) timeout_ms]
-
-DESCRIPTION
-===========
-
-ibclearcounters is a script that clears the PMA port counters by either walking
-the IB subnet topology or using an already saved topology file.
-
-OPTIONS
-=======
-
-
-Port Selection flags
---------------------
-
-.. include:: common/opt_C.rst
-.. include:: common/opt_P.rst
-.. include:: common/sec_portselection.rst
-
-Configuration flags
--------------------
-
-.. include:: common/opt_t.rst
-
-
-SEE ALSO
-========
-
-**ibnetdiscover(8), perfquery(8)**
-
-AUTHOR
-======
-
-Hal Rosenstock
-        < halr at voltaire.com >
diff --git a/doc/rst/ibfindnodesusing.8.in.rst b/doc/rst/ibfindnodesusing.8.in.rst
index 6d19c36..573dea9 100644
--- a/doc/rst/ibfindnodesusing.8.in.rst
+++ b/doc/rst/ibfindnodesusing.8.in.rst
@@ -51,4 +51,4 @@ AUTHOR
 ======
 
 Ira Weiny
-        < weiny2 at llnl.gov >
+        < ira.weiny at intel.com >
diff --git a/doc/rst/iblinkinfo.8.in.rst b/doc/rst/iblinkinfo.8.in.rst
index 9e13d57..ee2aefb 100644
--- a/doc/rst/iblinkinfo.8.in.rst
+++ b/doc/rst/iblinkinfo.8.in.rst
@@ -109,8 +109,6 @@ Debugging flags
 .. include:: common/opt_v.rst
 .. include:: common/opt_V.rst
 
-**-R** (This option is obsolete and does nothing)
-
 EXIT STATUS
 ===========
 
@@ -129,4 +127,4 @@ AUTHOR
 ======
 
 Ira Weiny
-        < weiny2 at llnl.gov >
+        < ira.weiny at intel.com >
diff --git a/doc/rst/ibnetdiscover.8.in.rst b/doc/rst/ibnetdiscover.8.in.rst
index a5b92ca..61a5667 100644
--- a/doc/rst/ibnetdiscover.8.in.rst
+++ b/doc/rst/ibnetdiscover.8.in.rst
@@ -49,6 +49,9 @@ List of connected routers
 **-s, --show**
 Show progress information during discovery.
 
+**-f, --full**
+Show full information (ports' speed and width, vlcap)
+
 **-p, --ports**
 Obtain a ports report which is a
 list of connected ports with relevant information (like LID, portnum,
@@ -112,4 +115,4 @@ Hal Rosenstock
         < halr at voltaire.com >
 
 Ira Weiny
-        < weiny2 at llnl.gov >
+        < ira.weiny at intel.com >
diff --git a/doc/rst/ibportstate.8.in.rst b/doc/rst/ibportstate.8.in.rst
index c082638..750ee42 100644
--- a/doc/rst/ibportstate.8.in.rst
+++ b/doc/rst/ibportstate.8.in.rst
@@ -30,13 +30,17 @@ OPTIONS
 
 **<op>**
         Supported ops: enable, disable, reset, speed, espeed, fdr10, width, query,
-                        down, arm, active, vls, mtu, lid, smlid, lmc,
+                        on, off, down, arm, active, vls, mtu, lid, smlid, lmc,
                         mkey, mkeylease, mkeyprot
 			(Default is query)
 
         **enable, disable, and reset** are only allowed on switch ports (An
         error is indicated if attempted on CA or router ports)
 
+        **off** change the port state to disable.
+
+        **on** change the port state to enable(only when the current state is disable).
+
         **speed and width** are allowed on any port
 
         **speed** values are the legal values for PortInfo:LinkSpeedEnabled (An
diff --git a/doc/rst/ibqueryerrors.8.in.rst b/doc/rst/ibqueryerrors.8.in.rst
index 9a05e7b..df2901c 100644
--- a/doc/rst/ibqueryerrors.8.in.rst
+++ b/doc/rst/ibqueryerrors.8.in.rst
@@ -52,6 +52,9 @@ Specify an alternate threshold file.  The default is @IBDIAG_CONFIG_PATH@/error_
 
 **--ca**  print data for CA's only
 
+**--skip-sl**  Use the default sl for queries. This is not recommended when
+using a QoS aware routing engine as it can cause a credit deadlock.
+
 **--router**  print data for routers only
 
 **--clear-errors -k** Clear error counters after read.
@@ -153,4 +156,4 @@ AUTHOR
 ======
 
 Ira Weiny
-        < weiny2 at llnl.gov >
+        < ira.weiny at intel.com >
diff --git a/doc/rst/ibqueryerrors.8.in.rst.orig b/doc/rst/ibqueryerrors.8.in.rst.orig
deleted file mode 100644
index d71b205..0000000
--- a/doc/rst/ibqueryerrors.8.in.rst.orig
+++ /dev/null
@@ -1,153 +0,0 @@
-=============
-IBQUERYERRORS
-=============
-
----------------------------------
-query and report IB port counters
----------------------------------
-
-:Date: @BUILD_DATE@
-:Manual section: 8
-:Manual group: OpenIB Diagnostics
-
-
-SYNOPSIS
-========
-
-ibqueryerrors [options]
-
-DESCRIPTION
-===========
-
-The default behavior is to report the port error counters which exceed a
-threshold for each port in the fabric.  The default threshold is zero (0).
-Error fields can also be suppressed entirely.
-
-In addition to reporting errors on every port.  ibqueryerrors can report the
-port transmit and receive data as well as report full link information to the
-remote port if available.
-
-OPTIONS
-=======
-
-**-s, --suppress <err1,err2,...>**
-Suppress the errors listed in the comma separated list provided.
-
-**-c, --suppress-common**
-Suppress some of the common "side effect" counters.  These counters usually do
-not indicate an error condition and can be usually be safely ignored.
-
-**-r, --report-port**
-Report the port information.  This includes LID, port, external port (if
-applicable), link speed setting, remote GUID, remote port, remote external port
-(if applicable), and remote node description information.
-
-**--data**
-Include the optional transmit and receive data counters.
-
-**--threshold-file <filename>**
-Specify an alternate threshold file.  The default is @IBDIAG_CONFIG_PATH@/error_thresholds
-
-**--switch**  print data for switch's only
-
-**--ca**  print data for CA's only
-
-**--router**  print data for routers only
-
-**--clear-errors -k** Clear error counters after read.
-
-**--clear-counts -K** Clear data counters after read.
-
-**CAUTION** clearing data or error counters will occur regardless of if they
-are printed or not.  See **--counters** and **--data** for details on
-controling which counters are printed.
-
-**--details** include receive error and transmit discard details
-
-**--counters** print data counters only
-
-
-Partial Scan flags
-------------------
-
-The node to start a partial scan can be specified with the following addresses.
-
-.. include:: common/opt_G_with_param.rst
-.. include:: common/opt_D_with_param.rst
-
-**Note:** For switches results are printed for all ports not just switch port 0.
-
-**-S <port_guid>** same as "-G". (provided only for backward compatibility)
-
-
-Cache File flags
-----------------
-
-.. include:: common/opt_load-cache.rst
-
-
-Port Selection flags
---------------------
-
-.. include:: common/opt_C.rst
-.. include:: common/opt_P.rst
-.. include:: common/sec_portselection.rst
-
-Configuration flags
--------------------
-
-.. include:: common/opt_z-config.rst
-.. include:: common/opt_o-outstanding_smps.rst
-.. include:: common/opt_node_name_map.rst
-.. include:: common/opt_t.rst
-
-Debugging flags
----------------
-
-.. include:: common/opt_d.rst
-.. include:: common/opt_e.rst
-.. include:: common/opt_h.rst
-.. include:: common/opt_v.rst
-.. include:: common/opt_V.rst
-
-**-R**  (This option is obsolete and does nothing)
-
-EXIT STATUS
-===========
-
-**-1** if scan fails.
-
-**0** if scan succeeds without errors beyond thresholds
-
-**1** if errors are found beyond thresholds
-
-FILES
-=====
-
-ERROR THRESHOLD
----------------
-
- at IBDIAG_CONFIG_PATH@/error_thresholds
-
-Define threshold values for errors.  File format is simple "name=val".
-Comments begin with '#'
-
-**Example:**
-
-::
-
-	# Define thresholds for error counters
-	SymbolErrorCounter=10
-	LinkErrorRecoveryCounter=10
-	VL15Dropped=100
-
-
-.. include:: common/sec_config-file.rst
-.. include:: common/sec_node-name-map.rst
-
-
-AUTHOR
-======
-
-Ira Weiny
-        < weiny2 at llnl.gov >
diff --git a/doc/rst/ibroute.8.in.rst b/doc/rst/ibroute.8.in.rst
index c20136f..5870de6 100644
--- a/doc/rst/ibroute.8.in.rst
+++ b/doc/rst/ibroute.8.in.rst
@@ -68,6 +68,7 @@ Configuration flags
 
 .. include:: common/opt_t.rst
 .. include:: common/opt_y.rst
+.. include:: common/opt_node_name_map.rst
 .. include:: common/opt_z-config.rst
 
 FILES
@@ -75,6 +76,7 @@ FILES
 
 .. include:: common/sec_config-file.rst
 
+.. include:: common/sec_node-name-map.rst
 
 EXAMPLES
 ========
diff --git a/doc/rst/ibsysstat.8.in.rst b/doc/rst/ibsysstat.8.in.rst
index 5451f39..3a7b295 100644
--- a/doc/rst/ibsysstat.8.in.rst
+++ b/doc/rst/ibsysstat.8.in.rst
@@ -29,6 +29,7 @@ OPTIONS
 Current supported operations:
 
 ::
+
         ping \- verify connectivity to server (default)
         host \- obtain host information from server
         cpu  \- obtain cpu information from server
diff --git a/doc/rst/ibtracert.8.in.rst b/doc/rst/ibtracert.8.in.rst
index ab43af0..76fe568 100644
--- a/doc/rst/ibtracert.8.in.rst
+++ b/doc/rst/ibtracert.8.in.rst
@@ -34,6 +34,8 @@ OPTIONS
 **-m**
         show the multicast trace of the specified mlid
 
+**-f, --force**
+        force route to destination port
 
 
 Addressing Flags
@@ -105,4 +107,4 @@ Hal Rosenstock
         <hal.rosenstock at gmail.com>
 
 Ira Weiny
-        <weiny2 at llnl.gov >
+        < ira.weiny at intel.com >
diff --git a/doc/rst/infiniband-diags.8.in.rst b/doc/rst/infiniband-diags.8.in.rst
index e5231c4..7776a30 100644
--- a/doc/rst/infiniband-diags.8.in.rst
+++ b/doc/rst/infiniband-diags.8.in.rst
@@ -163,4 +163,4 @@ AUTHORS
 =======
 
 Ira Weiny
-        <weiny2 at llnl.gov>
+        < ira.weiny at intel.com >
diff --git a/doc/rst/perfquery.8.in.rst b/doc/rst/perfquery.8.in.rst
index 359c94e..5e3d709 100644
--- a/doc/rst/perfquery.8.in.rst
+++ b/doc/rst/perfquery.8.in.rst
@@ -14,7 +14,7 @@ query InfiniBand port counters on a single port
 SYNOPSIS
 ========
 
-perfquery [options] [<lid|guid> [[port] [reset_mask]]]
+perfquery [options] [<lid|guid> [[port(s)] [reset_mask]]]
 
 DESCRIPTION
 ===========
@@ -32,6 +32,9 @@ octets divided by 4 rather than just octets.
 
 Note: Inputting a port of 255 indicates an operation be performed on all ports.
 
+Note: For PortCounters, ExtendedCounters, and resets, multiple ports can be
+specified by either a comma separated list or a port range.  See examples below.
+
 
 OPTIONS
 =======
@@ -98,15 +101,16 @@ OPTIONS
 	show port samples control.
 
 **-a, --all_ports**
-	show aggregated counters for all ports of the destination lid or reset
-	all counters for all ports.  If the destination lid does not support
+	show aggregated counters for all ports of the destination lid, reset
+	all counters for all ports, or if multiple ports are specified, aggregate
+	the counters of the specified ports.  If the destination lid does not support
 	the AllPortSelect flag, all ports will be iterated through to emulate
 	AllPortSelect behavior.
 
 **-l, --loop_ports**
 	If all ports are selected by the user (either through the **-a** option
-	or port 255) iterate through each port rather than doing than aggregate
-	operation.
+	or port 255) or multiple ports are specified iterate through each port rather
+	than doing than aggregate operation.
 
 **-r, --reset_after_read**
 	reset counters after read
@@ -158,6 +162,7 @@ EXAMPLES
 ========
 
 ::
+
 	perfquery                # read local port performance counters
 	perfquery 32 1           # read performance counters from lid 32, port 1
 	perfquery -x 32 1        # read extended performance counters from lid 32, port 1
@@ -169,6 +174,10 @@ EXAMPLES
 	perfquery -R -a 32       # reset performance counters of all ports
 	perfquery -R 32 2 0x0fff # reset only error counters of port 2
 	perfquery -R 32 2 0xf000 # reset only non-error counters of port 2
+	perfquery -a 32 1-10     # read performance counters from lid 32, port 1-10, aggregate output
+	perfquery -l 32 1-10     # read performance counters from lid 32, port 1-10, output each port
+	perfquery -a 32 1,4,8    # read performance counters from lid 32, port 1, 4, and 8, aggregate output
+	perfquery -l 32 1,4,8    # read performance counters from lid 32, port 1, 4, and 8, output each port
 
 AUTHOR
 ======
diff --git a/doc/rst/saquery.8.in.rst b/doc/rst/saquery.8.in.rst
index 1a11965..0551917 100644
--- a/doc/rst/saquery.8.in.rst
+++ b/doc/rst/saquery.8.in.rst
@@ -135,9 +135,12 @@ OPTIONS
 
 **--proxy_join** Proxy join (MCMemberRecord)
 
+**--service_id** ServiceID (PathRecord)
+
 Supported query names (and aliases):
 
 ::
+
         ClassPortInfo (CPI)
         NodeRecord (NR) [lid]
         PortInfoRecord (PIR) [[lid]/[port]/[options]]
@@ -152,6 +155,8 @@ Supported query names (and aliases):
         LFTRecord (LFTR) [[lid]/[block]]
         MFTRecord (MFTR) [[mlid]/[position]/[block]]
         GUIDInfoRecord (GIR) [[lid]/[block]]
+        SwitchInfoRecord (SWIR) [lid]
+        SMInfoRecord (SMIR) [lid]
 
 
 
@@ -201,7 +206,7 @@ AUTHORS
 =======
 
 Ira Weiny
-        < weiny2 at llnl.gov >
+        < ira.weiny at intel.com >
 
 Hal Rosenstock
-        < halr at voltaire.com >
+        < halr at mellanox.com >
diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
index 7e6d5c1..ef3a46b 100644
--- a/include/ibdiag_common.h
+++ b/include/ibdiag_common.h
@@ -66,7 +66,7 @@ extern int show_keys;
 #define VERBOSE(fmt, ...) do { \
 	if (ibverbose) IBVERBOSE(fmt, ## __VA_ARGS__); \
 } while (0)
-#define IBERROR(fmt, ...) iberror(__FUNCTION__, fmt, ## __VA_ARGS__)
+#define IBEXIT(fmt, ...) ibexit(__FUNCTION__, fmt, ## __VA_ARGS__)
 
 #define NOT_DISPLAYED_STR "<not displayed>"
 
@@ -91,7 +91,7 @@ extern int ibdiag_process_opts(int argc, char *const argv[], void *context,
 			       const char *usage_args,
 			       const char *usage_examples[]);
 extern void ibdiag_show_usage();
-extern void iberror(const char *fn, char *msg, ...);
+extern void ibexit(const char *fn, char *msg, ...);
 
 /* convert counter values to a float with a unit specifier returned (using
  * binary prefix)
@@ -102,51 +102,6 @@ extern char *conv_cnt_human_readable(uint64_t val64, float *val, int data);
 
 int is_mlnx_ext_port_info_supported(uint32_t devid);
 
-/* define an SA query structure to be common
- * This is by no means optimal but it moves the saquery functionality out of
- * the saquery tool and provides it to other utilities.
- */
-struct bind_handle {
-	int fd, agent;
-	ib_portid_t dport;
-	struct ibmad_port *srcport;
-};
-typedef struct bind_handle * bind_handle_t;
-bind_handle_t sa_get_bind_handle(void);
-void sa_free_bind_handle(bind_handle_t h);
-
-struct sa_query_result {
-	uint32_t status;
-	unsigned result_cnt;
-	void *p_result_madw;
-};
-int sa_query(struct bind_handle *h, uint8_t method,
-	     uint16_t attr, uint32_t mod, uint64_t comp_mask, uint64_t sm_key,
-	     void *data, size_t datasz, struct sa_query_result *result);
-void sa_free_result_mad(struct sa_query_result *result);
-void *sa_get_query_rec(void *mad, unsigned i);
-void sa_report_err(int status);
-
-#define cl_hton8(x) (x)
-#define CHECK_AND_SET_VAL(val, size, comp_with, target, name, mask) \
-	if ((int##size##_t) val != (int##size##_t) comp_with) { \
-		target = cl_hton##size((uint##size##_t) val); \
-		comp_mask |= IB_##name##_COMPMASK_##mask; \
-	}
-
-#define CHECK_AND_SET_GID(val, target, name, mask) \
-	if (valid_gid(&(val))) { \
-		memcpy(&(target), &(val), sizeof(val)); \
-		comp_mask |= IB_##name##_COMPMASK_##mask; \
-	}
-
-#define CHECK_AND_SET_VAL_AND_SEL(val, target, name, mask, sel) \
-	if (val) { \
-		target = val; \
-		comp_mask |= IB_##name##_COMPMASK_##mask##sel; \
-		comp_mask |= IB_##name##_COMPMASK_##mask; \
-	}
-
 void get_max_msg(char *width_msg, char *speed_msg, int msg_size,
 		 ibnd_port_t * port);
 
@@ -161,4 +116,19 @@ int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
 int snprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
 		  const char *format, ...);
 void dump_portinfo(void *pi, int pisize, int tabs);
+
+/**
+ * Some common command line parsing
+ */
+typedef char *(op_fn_t) (ib_portid_t * dest, char **argv, int argc);
+
+typedef struct match_rec {
+	const char *name, *alias;
+	op_fn_t *fn;
+	unsigned opt_portnum;
+	char *ops_extra;
+} match_rec_t;
+
+op_fn_t *match_op(const match_rec_t match_tbl[], char *name);
+
 #endif				/* _IBDIAG_COMMON_H_ */
diff --git a/include/ibdiag_common.h b/include/ibdiag_sa.h
similarity index 50%
copy from include/ibdiag_common.h
copy to include/ibdiag_sa.h
index 7e6d5c1..368a829 100644
--- a/include/ibdiag_common.h
+++ b/include/ibdiag_sa.h
@@ -4,7 +4,7 @@
  * Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  * Copyright (c) 2009 HNR Consulting. All rights reserved.
- * Copyright (c) 2011 Lawrence Livermore National Security. All rights reserved.
+ * Copyright (c) 2012 Lawrence Livermore National Security. 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
@@ -36,97 +36,40 @@
  *
  */
 
-#ifndef _IBDIAG_COMMON_H_
-#define _IBDIAG_COMMON_H_
+#ifndef _IBDIAG_SA_H_
+#define _IBDIAG_SA_H_
 
-#include <stdarg.h>
 #include <infiniband/mad.h>
 #include <infiniband/iba/ib_types.h>
-#include <infiniband/ibnetdisc.h>
-
-extern int ibverbose;
-extern char *ibd_ca;
-extern int ibd_ca_port;
-extern enum MAD_DEST ibd_dest_type;
-extern ib_portid_t *ibd_sm_id;
-extern int ibd_timeout;
-extern uint32_t ibd_ibnetdisc_flags;
-extern uint64_t ibd_mkey;
-extern uint64_t ibd_sakey;
-extern int show_keys;
-
-/*========================================================*/
-/*                External interface                      */
-/*========================================================*/
-
-#undef DEBUG
-#define DEBUG(fmt, ...) do { \
-	if (ibdebug) IBDEBUG(fmt, ## __VA_ARGS__); \
-} while (0)
-#define VERBOSE(fmt, ...) do { \
-	if (ibverbose) IBVERBOSE(fmt, ## __VA_ARGS__); \
-} while (0)
-#define IBERROR(fmt, ...) iberror(__FUNCTION__, fmt, ## __VA_ARGS__)
-
-#define NOT_DISPLAYED_STR "<not displayed>"
-
-/* not all versions of ib_types.h will have this define */
-#ifndef IB_PM_PC_XMIT_WAIT_SUP
-#define IB_PM_PC_XMIT_WAIT_SUP (CL_HTON16(((uint16_t)1)<<12))
-#endif
-
-struct ibdiag_opt {
-	const char *name;
-	char letter;
-	unsigned has_arg;
-	const char *arg_tmpl;
-	const char *description;
-};
-
-extern int ibdiag_process_opts(int argc, char *const argv[], void *context,
-			       const char *exclude_common_str,
-			       const struct ibdiag_opt custom_opts[],
-			       int (*custom_handler) (void *cxt, int val,
-						      char *optarg),
-			       const char *usage_args,
-			       const char *usage_examples[]);
-extern void ibdiag_show_usage();
-extern void iberror(const char *fn, char *msg, ...);
-
-/* convert counter values to a float with a unit specifier returned (using
- * binary prefix)
- * "data" is a flag indicating this counter is a byte counter multiplied by 4
- * as per PortCounters[Extended]
- */
-extern char *conv_cnt_human_readable(uint64_t val64, float *val, int data);
-
-int is_mlnx_ext_port_info_supported(uint32_t devid);
 
 /* define an SA query structure to be common
  * This is by no means optimal but it moves the saquery functionality out of
  * the saquery tool and provides it to other utilities.
  */
-struct bind_handle {
+struct sa_handle {
 	int fd, agent;
 	ib_portid_t dport;
 	struct ibmad_port *srcport;
 };
-typedef struct bind_handle * bind_handle_t;
-bind_handle_t sa_get_bind_handle(void);
-void sa_free_bind_handle(bind_handle_t h);
 
 struct sa_query_result {
 	uint32_t status;
 	unsigned result_cnt;
 	void *p_result_madw;
 };
-int sa_query(struct bind_handle *h, uint8_t method,
+
+/* NOTE: umad_init must be called prior to sa_get_handle */
+struct sa_handle * sa_get_handle(void);
+void sa_free_handle(struct sa_handle * h);
+
+int sa_query(struct sa_handle *h, uint8_t method,
 	     uint16_t attr, uint32_t mod, uint64_t comp_mask, uint64_t sm_key,
 	     void *data, size_t datasz, struct sa_query_result *result);
 void sa_free_result_mad(struct sa_query_result *result);
 void *sa_get_query_rec(void *mad, unsigned i);
 void sa_report_err(int status);
 
+/* Macros for setting query values and ComponentMasks */
 #define cl_hton8(x) (x)
 #define CHECK_AND_SET_VAL(val, size, comp_with, target, name, mask) \
 	if ((int##size##_t) val != (int##size##_t) comp_with) { \
@@ -147,18 +90,4 @@ void sa_report_err(int status);
 		comp_mask |= IB_##name##_COMPMASK_##mask; \
 	}
 
-void get_max_msg(char *width_msg, char *speed_msg, int msg_size,
-		 ibnd_port_t * port);
-
-int resolve_sm_portid(char *ca_name, uint8_t portnum, ib_portid_t *sm_id);
-int resolve_self(char *ca_name, uint8_t ca_port, ib_portid_t *portid,
-                 int *port, ibmad_gid_t *gid);
-int resolve_portid_str(char *ca_name, uint8_t ca_port, ib_portid_t * portid,
-		       char *addr_str, enum MAD_DEST dest_type,
-		       ib_portid_t *sm_id, const struct ibmad_port *srcport);
-int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
-		   const char *format, va_list va_args);
-int snprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
-		  const char *format, ...);
-void dump_portinfo(void *pi, int pisize, int tabs);
-#endif				/* _IBDIAG_COMMON_H_ */
+#endif /* _IBDIAG_SA_H_ */
diff --git a/include/ibdiag_version.h b/include/ibdiag_version.h
index e65dfa4..b87381f 100644
--- a/include/ibdiag_version.h
+++ b/include/ibdiag_version.h
@@ -34,6 +34,6 @@
 #ifndef _IBDIAG_VERSION_H_
 #define _IBDIAG_VERSION_H_
 
-#define IBDIAG_VERSION "1.6.1"
+#define IBDIAG_VERSION "1.6.4"
 
 #endif	/* _IBDIAG_VERSION_H_ */
diff --git a/infiniband-diags.spec b/infiniband-diags.spec
index cff412a..1b3a13a 100644
--- a/infiniband-diags.spec
+++ b/infiniband-diags.spec
@@ -4,15 +4,15 @@
 
 Summary: OpenFabrics Alliance InfiniBand Diagnostic Tools
 Name: infiniband-diags
-Version: 1.6.1
+Version: 1.6.4
 Release: %rel%{?dist}
 License: GPLv2 or BSD
 Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Source: http://www.openfabrics.org/downloads/management/infiniband-diags-1.6.1.tar.gz
+Source: http://www.openfabrics.org/downloads/management/infiniband-diags-1.6.4.tar.gz
 Url: http://openfabrics.org/
-BuildRequires: libibmad-devel, opensm-devel, libibumad-devel
-Requires: libibmad, opensm-libs, libibumad
+BuildRequires: libibmad-devel, opensm-devel, libibumad-devel, glib2-devel
+Requires: libibmad, opensm-libs, libibumad, glib2
 Provides: perl(IBswcountlimits)
 Obsoletes: openib-diags
 
@@ -127,6 +127,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man8/ibccquery.8.gz
 %{_sbindir}/ibccconfig
 %{_mandir}/man8/ibccconfig.8.gz
+%{_sbindir}/dump_fts
+%{_mandir}/man8/dump_fts.8.gz
 
 # scripts here
 %{_sbindir}/ibhosts
diff --git a/infiniband-diags.spec.in b/infiniband-diags.spec.in
index d3fcd13..b3fe03a 100644
--- a/infiniband-diags.spec.in
+++ b/infiniband-diags.spec.in
@@ -11,8 +11,8 @@ Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Source: http://www.openfabrics.org/downloads/management/@TARBALL@
 Url: http://openfabrics.org/
-BuildRequires: libibmad-devel, opensm-devel, libibumad-devel
-Requires: libibmad, opensm-libs, libibumad
+BuildRequires: libibmad-devel, opensm-devel, libibumad-devel, glib2-devel
+Requires: libibmad, opensm-libs, libibumad, glib2
 Provides: perl(IBswcountlimits)
 Obsoletes: openib-diags
 
@@ -127,6 +127,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man8/ibccquery.8.gz
 %{_sbindir}/ibccconfig
 %{_mandir}/man8/ibccconfig.8.gz
+%{_sbindir}/dump_fts
+%{_mandir}/man8/dump_fts.8.gz
 
 # scripts here
 %{_sbindir}/ibhosts
diff --git a/libibnetdisc/Makefile.am b/libibnetdisc/Makefile.am
index fbf0e60..2cfcc33 100644
--- a/libibnetdisc/Makefile.am
+++ b/libibnetdisc/Makefile.am
@@ -24,10 +24,10 @@ endif
 
 libibnetdisc_la_SOURCES = src/ibnetdisc.c src/ibnetdisc_cache.c src/chassis.c \
 			  src/chassis.h src/internal.h src/query_smp.c
-libibnetdisc_la_CFLAGS = -Wall $(DBGFLAGS)
+libibnetdisc_la_CFLAGS = -Wall $(DBGFLAGS) $(GLIB_CFLAGS)
 libibnetdisc_la_LDFLAGS = -version-info $(ibnetdisc_api_version) \
 	-export-dynamic $(libibnetdisc_version_script) \
-	-libmad
+	-libmad $(GLIB_LIBS)
 libibnetdisc_la_DEPENDENCIES = $(srcdir)/src/libibnetdisc.map
 
 libibnetdiscincludedir = $(includedir)/infiniband
@@ -35,6 +35,7 @@ libibnetdiscincludedir = $(includedir)/infiniband
 test_testleaks_SOURCES = test/testleaks.c
 test_testleaks_CFLAGS = -Wall $(DBGFLAGS)
 test_testleaks_LDFLAGS = -libnetdisc
+test_testleaks_DEPENDENCIES = libibnetdisc.la
 
 libibnetdiscinclude_HEADERS = $(srcdir)/include/infiniband/ibnetdisc.h \
 				$(srcdir)/include/infiniband/ibnetdisc_osd.h
diff --git a/libibnetdisc/Makefile.in b/libibnetdisc/Makefile.in
index 43fce8a..a7ebf8e 100644
--- a/libibnetdisc/Makefile.in
+++ b/libibnetdisc/Makefile.in
@@ -48,7 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
 	$(top_srcdir)/config/ltoptions.m4 \
 	$(top_srcdir)/config/ltsugar.m4 \
 	$(top_srcdir)/config/ltversion.m4 \
-	$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.in
+	$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
@@ -142,6 +142,8 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GREP = @GREP@
 IBDIAG_CONFIG_PATH = @IBDIAG_CONFIG_PATH@
 IBSCRIPTPATH = @IBSCRIPTPATH@
@@ -175,6 +177,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 PERL_INSTALLDIR = @PERL_INSTALLDIR@
+PKG_CONFIG = @PKG_CONFIG@
 RANLIB = @RANLIB@
 RELEASE = @RELEASE@
 SED = @SED@
@@ -206,6 +209,7 @@ datarootdir = @datarootdir@
 docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
+have_dash = @have_dash@
 have_rst2man = @have_rst2man@
 host = @host@
 host_alias = @host_alias@
@@ -246,16 +250,17 @@ lib_LTLIBRARIES = libibnetdisc.la
 libibnetdisc_la_SOURCES = src/ibnetdisc.c src/ibnetdisc_cache.c src/chassis.c \
 			  src/chassis.h src/internal.h src/query_smp.c
 
-libibnetdisc_la_CFLAGS = -Wall $(DBGFLAGS)
+libibnetdisc_la_CFLAGS = -Wall $(DBGFLAGS) $(GLIB_CFLAGS)
 libibnetdisc_la_LDFLAGS = -version-info $(ibnetdisc_api_version) \
 	-export-dynamic $(libibnetdisc_version_script) \
-	-libmad
+	-libmad $(GLIB_LIBS)
 
 libibnetdisc_la_DEPENDENCIES = $(srcdir)/src/libibnetdisc.map
 libibnetdiscincludedir = $(includedir)/infiniband
 test_testleaks_SOURCES = test/testleaks.c
 test_testleaks_CFLAGS = -Wall $(DBGFLAGS)
 test_testleaks_LDFLAGS = -libnetdisc
+test_testleaks_DEPENDENCIES = libibnetdisc.la
 libibnetdiscinclude_HEADERS = $(srcdir)/include/infiniband/ibnetdisc.h \
 				$(srcdir)/include/infiniband/ibnetdisc_osd.h
 
diff --git a/libibnetdisc/include/infiniband/ibnetdisc.h b/libibnetdisc/include/infiniband/ibnetdisc.h
index 335ad83..acde1dc 100644
--- a/libibnetdisc/include/infiniband/ibnetdisc.h
+++ b/libibnetdisc/include/infiniband/ibnetdisc.h
@@ -58,6 +58,8 @@ typedef struct ibnd_node {
 	struct ibnd_node *next;	/* all node list in fabric */
 
 	ib_portid_t path_portid;	/* path from "from_node" */
+					/* NOTE: this is not valid on a fabric
+					 * read from a cache file */
 	uint16_t smalid;
 	uint8_t smalmc;
 
@@ -229,6 +231,9 @@ IBND_EXPORT ibnd_port_t *ibnd_find_port_guid(ibnd_fabric_t * fabric,
 					uint64_t guid);
 IBND_EXPORT ibnd_port_t *ibnd_find_port_dr(ibnd_fabric_t * fabric,
 					char *dr_str);
+IBND_EXPORT ibnd_port_t *ibnd_find_port_lid(ibnd_fabric_t * fabric,
+					    uint16_t lid);
+
 typedef void (*ibnd_iter_port_func_t) (ibnd_port_t * port, void *user_data);
 IBND_EXPORT void ibnd_iter_ports(ibnd_fabric_t * fabric,
 				ibnd_iter_port_func_t func, void *user_data);
diff --git a/libibnetdisc/libibnetdisc.ver b/libibnetdisc/libibnetdisc.ver
index c513f2a..59fca19 100644
--- a/libibnetdisc/libibnetdisc.ver
+++ b/libibnetdisc/libibnetdisc.ver
@@ -6,4 +6,4 @@
 # API_REV - advance on any added API
 # RUNNING_REV - advance any change to the vendor files
 # AGE - number of backward versions the API still supports
-LIBVERSION=7:0:2
+LIBVERSION=8:0:3
diff --git a/libibnetdisc/src/ibnetdisc.c b/libibnetdisc/src/ibnetdisc.c
index 3a7dd8f..121fe35 100644
--- a/libibnetdisc/src/ibnetdisc.c
+++ b/libibnetdisc/src/ibnetdisc.c
@@ -98,10 +98,10 @@ static int add_port_to_dpath(ib_dr_path_t * path, int nextport)
 static int retract_dpath(smp_engine_t * engine, ib_portid_t * portid)
 {
 	ibnd_scan_t *scan = engine->user_data;
-	ibnd_fabric_t *fabric = scan->fabric;
+	f_internal_t *f_int = scan->f_int;
 
 	if (scan->cfg->max_hops &&
-	    fabric->maxhops_discovered > scan->cfg->max_hops)
+	    f_int->fabric.maxhops_discovered > scan->cfg->max_hops)
 		return 0;
 
 	/* this may seem wrong but the only time we would retract the path is
@@ -109,7 +109,7 @@ static int retract_dpath(smp_engine_t * engine, ib_portid_t * portid)
 	 * from that to find the node it is connected to.  This counts as a
 	 * positive hop discovered
 	 */
-	fabric->maxhops_discovered++;
+	f_int->fabric.maxhops_discovered++;
 	portid->drpath.p[portid->drpath.cnt] = 0;
 	portid->drpath.cnt--;
 	return 1;
@@ -119,10 +119,10 @@ static int extend_dpath(smp_engine_t * engine, ib_portid_t * portid,
 			int nextport)
 {
 	ibnd_scan_t *scan = engine->user_data;
-	ibnd_fabric_t *fabric = scan->fabric;
+	f_internal_t *f_int = scan->f_int;
 
 	if (scan->cfg->max_hops &&
-	    fabric->maxhops_discovered > scan->cfg->max_hops)
+	    f_int->fabric.maxhops_discovered > scan->cfg->max_hops)
 		return 0;
 
 	if (portid->lid) {
@@ -144,8 +144,8 @@ static int extend_dpath(smp_engine_t * engine, ib_portid_t * portid,
 	}
 
 	if (((unsigned) portid->drpath.cnt - scan->initial_hops) >
-	    fabric->maxhops_discovered)
-		fabric->maxhops_discovered++;
+	    f_int->fabric.maxhops_discovered)
+		f_int->fabric.maxhops_discovered++;
 
 	return 1;
 }
@@ -213,7 +213,7 @@ static int is_mlnx_ext_port_info_supported(ibnd_port_t * port)
 int mlnx_ext_port_info_err(smp_engine_t * engine, ibnd_smp_t * smp,
 			   uint8_t * mad, void *cb_data)
 {
-	ibnd_fabric_t *fabric = ((ibnd_scan_t *) engine->user_data)->fabric;
+	f_internal_t *f_int = ((ibnd_scan_t *) engine->user_data)->f_int;
 	ibnd_node_t *node = cb_data;
 	ibnd_port_t *port;
 	uint8_t port_num, local_port;
@@ -232,12 +232,12 @@ int mlnx_ext_port_info_err(smp_engine_t * engine, ibnd_smp_t * smp,
 	if (port_num && mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F)
 	    == IB_PORT_PHYS_STATE_LINKUP
 	    && ((node->type == IB_NODE_SWITCH && port_num != local_port) ||
-		(node == fabric->from_node && port_num == fabric->from_portnum))) {
+		(node == f_int->fabric.from_node && port_num == f_int->fabric.from_portnum))) {
 		int rc = 0;
 		ib_portid_t path = smp->path;
 
 		if (node->type != IB_NODE_SWITCH &&
-		    node == fabric->from_node &&
+		    node == f_int->fabric.from_node &&
 		    path.drpath.cnt > 1)
 			rc = retract_dpath(engine, &path);
 		else {
@@ -260,7 +260,7 @@ int mlnx_ext_port_info_err(smp_engine_t * engine, ibnd_smp_t * smp,
 static int recv_mlnx_ext_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
 				   uint8_t * mad, void *cb_data)
 {
-	ibnd_fabric_t *fabric = ((ibnd_scan_t *) engine->user_data)->fabric;
+	f_internal_t *f_int = ((ibnd_scan_t *) engine->user_data)->f_int;
 	ibnd_node_t *node = cb_data;
 	ibnd_port_t *port;
 	uint8_t *ext_port_info = mad + IB_SMP_DATA_OFFS;
@@ -281,12 +281,12 @@ static int recv_mlnx_ext_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
 	if (port_num && mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F)
 	    == IB_PORT_PHYS_STATE_LINKUP
 	    && ((node->type == IB_NODE_SWITCH && port_num != local_port) ||
-		(node == fabric->from_node && port_num == fabric->from_portnum))) {
+		(node == f_int->fabric.from_node && port_num == f_int->fabric.from_portnum))) {
 		int rc = 0;
 		ib_portid_t path = smp->path;
 
 		if (node->type != IB_NODE_SWITCH &&
-		    node == fabric->from_node &&
+		    node == f_int->fabric.from_node &&
 		    path.drpath.cnt > 1)
 			rc = retract_dpath(engine, &path);
 		else {
@@ -319,7 +319,7 @@ static int recv_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
 			  uint8_t * mad, void *cb_data)
 {
 	ibnd_scan_t *scan = (ibnd_scan_t *)engine->user_data;
-	ibnd_fabric_t *fabric = scan->fabric;
+	f_internal_t *f_int = scan->f_int;
 	ibnd_node_t *node = cb_data;
 	ibnd_port_t *port;
 	uint8_t *port_info = mad + IB_SMP_DATA_OFFS;
@@ -359,7 +359,8 @@ static int recv_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
 		port->lmc = node->smalmc;
 	}
 
-	add_to_portguid_hash(port, fabric->portstbl);
+	add_to_portguid_hash(port, f_int->fabric.portstbl);
+	add_to_portlid_hash(port, f_int->lid2guid);
 
 	if ((scan->cfg->flags & IBND_CONFIG_MLX_EPI)
 	    && is_mlnx_ext_port_info_supported(port)) {
@@ -389,13 +390,13 @@ static int recv_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
 	if (port_num && mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F)
 	    == IB_PORT_PHYS_STATE_LINKUP
 	    && ((node->type == IB_NODE_SWITCH && port_num != local_port) ||
-		(node == fabric->from_node && port_num == fabric->from_portnum))) {
+		(node == f_int->fabric.from_node && port_num == f_int->fabric.from_portnum))) {
 
 		int rc = 0;
 		ib_portid_t path = smp->path;
 
 		if (node->type != IB_NODE_SWITCH &&
-		    node == fabric->from_node &&
+		    node == f_int->fabric.from_node &&
 		    path.drpath.cnt > 1)
 			rc = retract_dpath(engine, &path);
 		else {
@@ -441,7 +442,7 @@ static int query_port_info(smp_engine_t * engine, ib_portid_t * portid,
 static ibnd_node_t *create_node(smp_engine_t * engine, ib_portid_t * path,
 				uint8_t * node_info)
 {
-	ibnd_fabric_t *fabric = ((ibnd_scan_t *) engine->user_data)->fabric;
+	f_internal_t *f_int = ((ibnd_scan_t *) engine->user_data)->f_int;
 	ibnd_node_t *rc = calloc(1, sizeof(*rc));
 	if (!rc) {
 		IBND_ERROR("OOM: node creation failed\n");
@@ -463,13 +464,13 @@ static ibnd_node_t *create_node(smp_engine_t * engine, ib_portid_t * path,
 	rc->path_portid = *path;
 	memcpy(rc->info, node_info, sizeof(rc->info));
 
-	add_to_nodeguid_hash(rc, fabric->nodestbl);
+	add_to_nodeguid_hash(rc, f_int->fabric.nodestbl);
 
 	/* add this to the all nodes list */
-	rc->next = fabric->nodes;
-	fabric->nodes = rc;
+	rc->next = f_int->fabric.nodes;
+	f_int->fabric.nodes = rc;
 
-	add_to_type_list(rc, fabric);
+	add_to_type_list(rc, f_int);
 
 	return rc;
 }
@@ -505,7 +506,7 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp,
 			  uint8_t * mad, void *cb_data)
 {
 	ibnd_scan_t *scan = engine->user_data;
-	ibnd_fabric_t *fabric = scan->fabric;
+	f_internal_t *f_int = scan->f_int;
 	uint8_t *node_info = mad + IB_SMP_DATA_OFFS;
 	struct ni_cbdata *ni_cbdata = (struct ni_cbdata *)cb_data;
 	ibnd_node_t *rem_node = NULL;
@@ -523,7 +524,7 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp,
 		free(ni_cbdata);
 	}
 
-	node = ibnd_find_node_guid(fabric, node_guid);
+	node = ibnd_find_node_guid(&f_int->fabric, node_guid);
 	if (!node) {
 		node = create_node(engine, &smp->path, node_info);
 		if (!node)
@@ -550,8 +551,8 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp,
 			     node, port);
 
 	if (rem_node == NULL) {	/* this is the start node */
-		fabric->from_node = node;
-		fabric->from_portnum = port_num;
+		f_int->fabric.from_node = node;
+		f_int->fabric.from_portnum = port_num;
 	} else {
 		/* link ports... */
 		if (!rem_node->ports[rem_port_num]) {
@@ -628,8 +629,37 @@ void add_to_portguid_hash(ibnd_port_t * port, ibnd_port_t * hash[])
 	hash[hash_idx] = port;
 }
 
-void add_to_type_list(ibnd_node_t * node, ibnd_fabric_t * fabric)
+void create_lid2guid(f_internal_t *f_int)
 {
+	f_int->lid2guid = g_hash_table_new_full(g_direct_hash, g_direct_equal,
+				NULL, NULL);
+}
+
+void destroy_lid2guid(f_internal_t *f_int)
+{
+	if (f_int->lid2guid) {
+		g_hash_table_destroy(f_int->lid2guid);
+	}
+}
+
+void add_to_portlid_hash(ibnd_port_t * port, GHashTable *htable)
+{
+	uint16_t base_lid = port->base_lid;
+	uint16_t lid_mask = ((1 << port->lmc) -1);
+	uint16_t lid = 0;
+	/* 0 < valid lid <= 0xbfff */
+	if (base_lid > 0 && base_lid <= 0xbfff) {
+		/* We add the port for all lids
+		 * so it is easier to find any "random" lid specified */
+		for (lid = base_lid; lid <= (base_lid + lid_mask); lid++) {
+			g_hash_table_insert(htable, GINT_TO_POINTER(lid), port);
+		}
+	}
+}
+
+void add_to_type_list(ibnd_node_t * node, f_internal_t * f_int)
+{
+	ibnd_fabric_t *fabric = &f_int->fabric;
 	switch (node->type) {
 	case IB_NODE_CA:
 		node->type_next = fabric->ch_adapters;
@@ -664,12 +694,21 @@ static int set_config(struct ibnd_config *config, struct ibnd_config *cfg)
 	return (0);
 }
 
+f_internal_t *allocate_fabric_internal(void)
+{
+	f_internal_t *f = calloc(1, sizeof(*f));
+	if (f)
+		create_lid2guid(f);
+
+	return (f);
+}
+
 ibnd_fabric_t *ibnd_discover_fabric(char * ca_name, int ca_port,
 				    ib_portid_t * from,
 				    struct ibnd_config *cfg)
 {
 	struct ibnd_config config = { 0 };
-	ibnd_fabric_t *fabric = NULL;
+	f_internal_t *f_int = NULL;
 	ib_portid_t my_portid = { 0 };
 	smp_engine_t engine;
 	ibnd_scan_t scan;
@@ -685,21 +724,19 @@ ibnd_fabric_t *ibnd_discover_fabric(char * ca_name, int ca_port,
 		return NULL;
 	}
 
-	fabric = calloc(1, sizeof(*fabric));
-	if (!fabric) {
+	f_int = allocate_fabric_internal();
+	if (!f_int) {
 		IBND_ERROR("OOM: failed to calloc ibnd_fabric_t\n");
 		return NULL;
 	}
 
-	memset(fabric, 0, sizeof(*fabric));
-
 	memset(&scan.selfportid, 0, sizeof(scan.selfportid));
-	scan.fabric = fabric;
+	scan.f_int = f_int;
 	scan.cfg = &config;
 	scan.initial_hops = from->drpath.cnt;
 
 	if (smp_engine_init(&engine, ca_name, ca_port, &scan, &config)) {
-		free(fabric);
+		free(f_int);
 		return (NULL);
 	}
 
@@ -719,19 +756,19 @@ ibnd_fabric_t *ibnd_discover_fabric(char * ca_name, int ca_port,
 		if (process_mads(&engine) != 0)
 			goto error;
 
-	fabric->total_mads_used = engine.total_smps;
-	fabric->maxhops_discovered += scan.initial_hops;
+	f_int->fabric.total_mads_used = engine.total_smps;
+	f_int->fabric.maxhops_discovered += scan.initial_hops;
 
-	if (group_nodes(fabric))
+	if (group_nodes(&f_int->fabric))
 		goto error;
 
 	smp_engine_destroy(&engine);
 	mad_rpc_close_port(scan.ibmad_port);
-	return fabric;
+	return (ibnd_fabric_t *)f_int;
 error:
 	smp_engine_destroy(&engine);
 	mad_rpc_close_port(scan.ibmad_port);
-	ibnd_destroy_fabric(fabric);
+	ibnd_destroy_fabric(&f_int->fabric);
 	return NULL;
 }
 
@@ -768,6 +805,7 @@ void ibnd_destroy_fabric(ibnd_fabric_t * fabric)
 		destroy_node(node);
 		node = next;
 	}
+	destroy_lid2guid((f_internal_t *)fabric);
 	free(fabric);
 }
 
@@ -825,6 +863,18 @@ void ibnd_iter_nodes_type(ibnd_fabric_t * fabric, ibnd_iter_node_func_t func,
 		func(cur, user_data);
 }
 
+ibnd_port_t *ibnd_find_port_lid(ibnd_fabric_t * fabric,
+				uint16_t lid)
+{
+	ibnd_port_t *port;
+	f_internal_t *f = (f_internal_t *)fabric;
+
+	port = (ibnd_port_t *)g_hash_table_lookup(f->lid2guid,
+					GINT_TO_POINTER(lid));
+
+	return port;
+}
+
 ibnd_port_t *ibnd_find_port_guid(ibnd_fabric_t * fabric, uint64_t guid)
 {
 	int hash = HASHGUID(guid) % HTSZ;
diff --git a/libibnetdisc/src/ibnetdisc_cache.c b/libibnetdisc/src/ibnetdisc_cache.c
index 2690373..d4663bf 100644
--- a/libibnetdisc/src/ibnetdisc_cache.c
+++ b/libibnetdisc/src/ibnetdisc_cache.c
@@ -127,7 +127,7 @@ typedef struct ibnd_port_cache {
 } ibnd_port_cache_t;
 
 typedef struct ibnd_fabric_cache {
-	ibnd_fabric_t *fabric;
+	f_internal_t *f_int;
 	uint64_t from_node_guid;
 	ibnd_node_cache_t *nodes_cache;
 	ibnd_port_cache_t *ports_cache;
@@ -250,7 +250,7 @@ static int _load_header_info(int fd, ibnd_fabric_cache_t * fabric_cache,
 
 	offset += _unmarshall64(buf + offset, &fabric_cache->from_node_guid);
 	offset += _unmarshall32(buf + offset, &tmp32);
-	fabric_cache->fabric->maxhops_discovered = tmp32;
+	fabric_cache->f_int->fabric.maxhops_discovered = tmp32;
 
 	return 0;
 }
@@ -515,7 +515,7 @@ static int _fill_port(ibnd_fabric_cache_t * fabric_cache, ibnd_node_t * node,
 	/* achu: needed if user wishes to re-cache a loaded fabric.
 	 * Otherwise, mostly unnecessary to do this.
 	 */
-	add_to_portguid_hash(port_cache->port, fabric_cache->fabric->portstbl);
+	add_to_portguid_hash(port_cache->port, fabric_cache->f_int->fabric.portstbl);
 	return 0;
 }
 
@@ -535,13 +535,13 @@ static int _rebuild_nodes(ibnd_fabric_cache_t * fabric_cache)
 
 		/* Insert node into appropriate data structures */
 
-		node->next = fabric_cache->fabric->nodes;
-		fabric_cache->fabric->nodes = node;
+		node->next = fabric_cache->f_int->fabric.nodes;
+		fabric_cache->f_int->fabric.nodes = node;
 
 		add_to_nodeguid_hash(node_cache->node,
-				     fabric_cache->fabric->nodestbl);
+				     fabric_cache->f_int->fabric.nodestbl);
 
-		add_to_type_list(node_cache->node, fabric_cache->fabric);
+		add_to_type_list(node_cache->node, fabric_cache->f_int);
 
 		node_cache->node_stored_to_fabric++;
 
@@ -601,6 +601,7 @@ static int _rebuild_ports(ibnd_fabric_cache_t * fabric_cache)
 		} else
 			port->remoteport = NULL;
 
+		add_to_portlid_hash(port, fabric_cache->f_int->lid2guid);
 		port_cache = port_cache_next;
 	}
 
@@ -612,7 +613,7 @@ ibnd_fabric_t *ibnd_load_fabric(const char *file, unsigned int flags)
 	unsigned int node_count = 0;
 	unsigned int port_count = 0;
 	ibnd_fabric_cache_t *fabric_cache = NULL;
-	ibnd_fabric_t *fabric = NULL;
+	f_internal_t *f_int = NULL;
 	ibnd_node_cache_t *node_cache = NULL;
 	int fd = -1;
 	unsigned int i;
@@ -635,14 +636,13 @@ ibnd_fabric_t *ibnd_load_fabric(const char *file, unsigned int flags)
 	}
 	memset(fabric_cache, '\0', sizeof(ibnd_fabric_cache_t));
 
-	fabric = (ibnd_fabric_t *) malloc(sizeof(ibnd_fabric_t));
-	if (!fabric) {
+	f_int = allocate_fabric_internal();
+	if (!f_int) {
 		IBND_DEBUG("OOM: fabric\n");
 		goto cleanup;
 	}
-	memset(fabric, '\0', sizeof(ibnd_fabric_t));
 
-	fabric_cache->fabric = fabric;
+	fabric_cache->f_int = f_int;
 
 	if (_load_header_info(fd, fabric_cache, &node_count, &port_count) < 0)
 		goto cleanup;
@@ -663,7 +663,7 @@ ibnd_fabric_t *ibnd_load_fabric(const char *file, unsigned int flags)
 		IBND_DEBUG("Cache invalid: cannot find from node\n");
 		goto cleanup;
 	}
-	fabric->from_node = node_cache->node;
+	f_int->fabric.from_node = node_cache->node;
 
 	if (_rebuild_nodes(fabric_cache) < 0)
 		goto cleanup;
@@ -671,15 +671,15 @@ ibnd_fabric_t *ibnd_load_fabric(const char *file, unsigned int flags)
 	if (_rebuild_ports(fabric_cache) < 0)
 		goto cleanup;
 
-	if (group_nodes(fabric))
+	if (group_nodes(&f_int->fabric))
 		goto cleanup;
 
 	_destroy_ibnd_fabric_cache(fabric_cache);
 	close(fd);
-	return fabric;
+	return (ibnd_fabric_t *)&f_int->fabric;
 
 cleanup:
-	ibnd_destroy_fabric(fabric);
+	ibnd_destroy_fabric((ibnd_fabric_t *)f_int);
 	_destroy_ibnd_fabric_cache(fabric_cache);
 	close(fd);
 	return NULL;
diff --git a/libibnetdisc/src/internal.h b/libibnetdisc/src/internal.h
index 80918c4..1ccd29c 100644
--- a/libibnetdisc/src/internal.h
+++ b/libibnetdisc/src/internal.h
@@ -40,6 +40,7 @@
 
 #include <infiniband/ibnetdisc.h>
 #include <complib/cl_qmap.h>
+#include <glib.h>
 
 #define	IBND_DEBUG(fmt, ...) \
 	if (ibdebug) { \
@@ -57,9 +58,18 @@
 #define DEFAULT_TIMEOUT 1000
 #define DEFAULT_RETRIES 3
 
+typedef struct f_internal {
+	ibnd_fabric_t fabric;
+	GHashTable *lid2guid;
+} f_internal_t;
+f_internal_t *allocate_fabric_internal(void);
+void create_lid2guid(f_internal_t *f_int);
+void destroy_lid2guid(f_internal_t *f_int);
+void add_to_portlid_hash(ibnd_port_t * port, GHashTable *htable);
+
 typedef struct ibnd_scan {
 	ib_portid_t selfportid;
-	ibnd_fabric_t *fabric;
+	f_internal_t *f_int;
 	struct ibnd_config *cfg;
 	struct ibmad_port *ibmad_port;
 	unsigned initial_hops;
@@ -100,8 +110,9 @@ void smp_engine_destroy(smp_engine_t * engine);
 void add_to_nodeguid_hash(ibnd_node_t * node, ibnd_node_t * hash[]);
 
 void add_to_portguid_hash(ibnd_port_t * port, ibnd_port_t * hash[]);
+void add_to_portlid_hash(ibnd_port_t * port, GHashTable *htable);
 
-void add_to_type_list(ibnd_node_t * node, ibnd_fabric_t * fabric);
+void add_to_type_list(ibnd_node_t * node, f_internal_t * fabric);
 
 void destroy_node(ibnd_node_t * node);
 
diff --git a/libibnetdisc/src/libibnetdisc.map b/libibnetdisc/src/libibnetdisc.map
index 1c42e7b..f1b7229 100644
--- a/libibnetdisc/src/libibnetdisc.map
+++ b/libibnetdisc/src/libibnetdisc.map
@@ -16,6 +16,7 @@ IBNETDISC_1.0 {
 		ibnd_iter_nodes_type;
 		ibnd_find_port_guid;
 		ibnd_find_port_dr;
+		ibnd_find_port_lid;
 		ibnd_iter_ports;
 	local: *;
 };
diff --git a/man/dump_lfts.8 b/man/dump_lfts.8
new file mode 100644
index 0000000..a3d1fdd
--- /dev/null
+++ b/man/dump_lfts.8
@@ -0,0 +1,2 @@
+.\".TH DUMP_LFTS.SH 8  "Feb 03, 2013" "OpenIB" "OpenIB Programmer's Manual"
+.so man8/dump_fts.8
diff --git a/man/dump_mfts.8 b/man/dump_mfts.8
new file mode 100644
index 0000000..0566aa9
--- /dev/null
+++ b/man/dump_mfts.8
@@ -0,0 +1,2 @@
+.\".TH DUMP_MFTS.SH 8  "Feb 03, 2013" "OpenIB" "OpenIB Programmer's Manual"
+.so man8/dump_fts.8
diff --git a/scripts/check_lft_balance.pl b/scripts/check_lft_balance.pl
index d848cb5..cbe0690 100755
--- a/scripts/check_lft_balance.pl
+++ b/scripts/check_lft_balance.pl
@@ -290,10 +290,10 @@ sub output_switch_port_usage
 	if ($verbose || $is_unbalanced == 1) {
 		if ($is_unbalanced == 1) {
 			print "Unbalanced Switch Port Usage: ";
-			print "$switch_name, $switch_guid, $switch_lid\n";
+			print "$switch_name, $switch_guid\n";
 		} else {
 			print
-			  "Switch Port Usage: $switch_name, $switch_guid, $switch_lid\n";
+			  "Switch Port Usage: $switch_name, $switch_guid\n";
 		}
 		for $port (@output_ports) {
 			print "Port $port: $switch_port_count{$port}\n";
@@ -365,16 +365,20 @@ if (!open(FH, "< $dump_lft_file")) {
 foreach $lft_line (@lft_lines) {
 	chomp($lft_line);
 	if ($lft_line =~ /Unicast/) {
-		$lft_line =~ /Unicast lids .+ of switch Lid (.+) guid (.+) \((.+)\)/;
 		if (@host_ports) {
 			process_host_ports();
 		}
 		if (defined($switch_name)) {
 			output_switch_port_usage();
 		}
-		$switch_lid                            = $1;
-		$switch_guid                           = $2;
-		$switch_name                           = $3;
+		if ($lft_line =~ /Unicast lids .+ of switch DR path slid .+ guid (.+) \((.+)\)/) {
+			$switch_guid                           = $1;
+			$switch_name                           = $2;
+		}
+		if ($lft_line =~ /Unicast lids .+ of switch Lid .+ guid (.+) \((.+)\)/) {
+			$switch_guid                           = $1;
+			$switch_name                           = $2;
+		}
 		@switch_maybe_directly_connected_hosts = ();
 		%switch_port_count                     = ();
 		@host_ports                            = ();
diff --git a/scripts/dump_lfts.sh b/scripts/dump_lfts.sh
old mode 100755
new mode 100644
index 0bf334d..b91fb55
--- a/scripts/dump_lfts.sh
+++ b/scripts/dump_lfts.sh
@@ -1,72 +1,12 @@
-#!/bin/bash
+#!/bin/sh
 #
 # This simple script will collect outputs of ibroute for all switches
 # on the subnet and drop it on stdout. It can be used for LFTs dump
 # generation.
 #
 
-usage ()
-{
-	echo Usage: `basename $0` "[-h] [-D] [-C ca_name]" \
-	    "[-P ca_port] [-t(imeout) timeout_ms]"
-	exit 2
-}
-
-dump_by_lid ()
-{
-for sw_lid in `ibswitches $ca_info \
-		| sed -ne 's/^.* lid \([0-9a-f]*\) .*$/\1/p'` ; do
-	ibroute $ca_info $sw_lid
-done
-}
-
-dump_by_dr_path ()
-{
-for sw_dr in `ibnetdiscover $ca_info -s \
-	| sed -ne '/^DR path .* switch /s/^DR path .*; \([,|0-9]\+\) ->.*{\([0-9|a-f]\+\)}.*$/\2 \1/p' \
-	| sort -u \
-	| awk 'BEGIN {guid=0;} {if ($1 != guid) { guid=$1; print $2; }}'` ; do
-	ibroute $ca_info -D ${sw_dr}
-done
-}
-
-use_d=""
-ca_info=""
-
-while [ "$1" ]; do
-	case $1 in
-	-D)
-		use_d="-D"
-		;;
-	-h)
-		usage
-		;;
-	-P | -C | -t | -timeout)
-		case $2 in
-		-*)
-			usage
-			;;
-		esac
-		if [ x$2 = x ] ; then
-			usage
-		fi
-		ca_info="$ca_info $1 $2"
-		shift
-		;;
-	-*)
-		usage
-		;;
-	*)
-		usage
-		;;
-	esac
-	shift
-done
-
-if [ "$use_d" = "-D" ] ; then
-	dump_by_dr_path
-else
-	dump_by_lid
-fi
-
-exit
+/usr/local/sbin/dump_fts $@
+echo ""
+echo "*** WARNING ***: this command has been replaced by dump_fts"
+echo ""
+echo ""
diff --git a/scripts/dump_lfts.sh.in b/scripts/dump_lfts.sh.in
new file mode 100755
index 0000000..ac2c0fc
--- /dev/null
+++ b/scripts/dump_lfts.sh.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# This simple script will collect outputs of ibroute for all switches
+# on the subnet and drop it on stdout. It can be used for LFTs dump
+# generation.
+#
+
+ at IBSCRIPTPATH@/dump_fts $@
+echo ""
+echo "*** WARNING ***: this command has been replaced by dump_fts"
+echo ""
+echo ""
diff --git a/scripts/dump_mfts.sh b/scripts/dump_mfts.sh
old mode 100755
new mode 100644
index d6c2359..342b2ab
--- a/scripts/dump_mfts.sh
+++ b/scripts/dump_mfts.sh
@@ -1,72 +1,12 @@
-#!/bin/bash
+#!/bin/sh
 #
 # This simple script will collect outputs of ibroute for all switches
 # on the subnet and drop it on stdout. It can be used for MFTs dump
 # generation.
 #
 
-usage ()
-{
-	echo Usage: `basename $0` "[-h] [-D] [-C ca_name]" \
-	    "[-P ca_port] [-t(imeout) timeout_ms]"
-	exit 2
-}
-
-dump_by_lid ()
-{
-for sw_lid in `ibswitches $ca_info \
-		| sed -ne 's/^.* lid \([0-9a-f]*\) .*$/\1/p'` ; do
-	ibroute $ca_info -M $sw_lid
-done
-}
-
-dump_by_dr_path ()
-{
-for sw_dr in `ibnetdiscover $ca_info -s \
-	| sed -ne '/^DR path .* switch /s/^DR path .*; \([,|0-9]\+\) ->.*{\([0-9|a-f]\+\)}.*$/\2 \1/p' \
-	| sort -u \
-	| awk 'BEGIN {guid=0;} {if ($1 != guid) { guid=$1; print $2; }}'` ; do
-	ibroute $ca_info -M -D ${sw_dr}
-done
-}
-
-use_d=""
-ca_info=""
-
-while [ "$1" ]; do
-	case $1 in
-	-D)
-		use_d="-D"
-		;;
-	-h)
-		usage
-		;;
-	-P | -C | -t | -timeout)
-		case $2 in
-		-*)
-			usage
-			;;
-		esac
-		if [ x$2 = x ] ; then
-			usage
-		fi
-		ca_info="$ca_info $1 $2"
-		shift
-		;;
-	-*)
-		usage
-		;;
-	*)
-		usage
-		;;
-	esac
-	shift
-done
-
-if [ "$use_d" = "-D" ] ; then
-	dump_by_dr_path
-else
-	dump_by_lid
-fi
-
-exit
+/usr/local/sbin/dump_fts -M $@
+echo ""
+echo "*** WARNING ***: this command has been replaced by dump_fts -M"
+echo ""
+echo ""
diff --git a/scripts/dump_mfts.sh.in b/scripts/dump_mfts.sh.in
new file mode 100755
index 0000000..652b567
--- /dev/null
+++ b/scripts/dump_mfts.sh.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# This simple script will collect outputs of ibroute for all switches
+# on the subnet and drop it on stdout. It can be used for MFTs dump
+# generation.
+#
+
+ at IBSCRIPTPATH@/dump_fts -M $@
+echo ""
+echo "*** WARNING ***: this command has been replaced by dump_fts -M"
+echo ""
+echo ""
diff --git a/scripts/ibcheckerrors b/scripts/ibcheckerrors
index 942b8dd..db01e59 100644
--- a/scripts/ibcheckerrors
+++ b/scripts/ibcheckerrors
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-b] [-v] [-N | -nocolor]"\
 	    "[<topology-file> | -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibcheckerrors.in b/scripts/ibcheckerrors.in
index ca40a68..6ebbe7f 100644
--- a/scripts/ibcheckerrors.in
+++ b/scripts/ibcheckerrors.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-b] [-v] [-N | -nocolor]"\
 	    "[<topology-file> | -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibcheckerrs b/scripts/ibcheckerrs
index 2a2d911..38bd0d1 100644
--- a/scripts/ibcheckerrs
+++ b/scripts/ibcheckerrs
@@ -1,15 +1,15 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-b] [-v] [-G] [-T <threshold_file>]" \
 	    "[-s(how_thresholds)] [-N \| -nocolor] [-C ca_name] [-P ca_port]" \
 	    "[-t(imeout) timeout_ms] <lid|guid> [<port>]"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -21,7 +21,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
@@ -29,7 +29,7 @@ function red() {
 	echo -e "\\033[1;031m" $1 "\\033[0;39m"
 }
 
-function show_thresholds() {
+show_thresholds() {
 	echo "SymbolErrorCounter=$SymbolErrorCounter"
 	echo "LinkErrorRecoveryCounter=$LinkErrorRecoveryCounter"
 	echo "LinkDownedCounter=$LinkDownedCounter"
@@ -44,7 +44,7 @@ function show_thresholds() {
 	echo "VL15Dropped=$VL15Dropped"
 }
 
-function get_thresholds() {
+get_thresholds() {
 	. $1
 }
 
diff --git a/scripts/ibcheckerrs.in b/scripts/ibcheckerrs.in
index 4b34efc..1edd1eb 100644
--- a/scripts/ibcheckerrs.in
+++ b/scripts/ibcheckerrs.in
@@ -1,15 +1,15 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-b] [-v] [-G] [-T <threshold_file>]" \
 	    "[-s(how_thresholds)] [-N \| -nocolor] [-C ca_name] [-P ca_port]" \
 	    "[-t(imeout) timeout_ms] <lid|guid> [<port>]"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -21,7 +21,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
@@ -29,7 +29,7 @@ function red() {
 	echo -e "\\033[1;031m" $1 "\\033[0;39m"
 }
 
-function show_thresholds() {
+show_thresholds() {
 	echo "SymbolErrorCounter=$SymbolErrorCounter"
 	echo "LinkErrorRecoveryCounter=$LinkErrorRecoveryCounter"
 	echo "LinkDownedCounter=$LinkDownedCounter"
@@ -44,7 +44,7 @@ function show_thresholds() {
 	echo "VL15Dropped=$VL15Dropped"
 }
 
-function get_thresholds() {
+get_thresholds() {
 	. $1
 }
 
diff --git a/scripts/ibchecknet b/scripts/ibchecknet
index de1c59d..523c453 100644
--- a/scripts/ibchecknet
+++ b/scripts/ibchecknet
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor]" \
 	    "[<topology-file> | -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibchecknet.in b/scripts/ibchecknet.in
index 75bc45a..3fd4ae7 100644
--- a/scripts/ibchecknet.in
+++ b/scripts/ibchecknet.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor]" \
 	    "[<topology-file> | -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibchecknode b/scripts/ibchecknode
index e8c33d1..621a7d5 100644
--- a/scripts/ibchecknode
+++ b/scripts/ibchecknode
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor] [-G]" \
 	    "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid>"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -20,7 +20,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibchecknode.in b/scripts/ibchecknode.in
index eac8069..d70d5c8 100644
--- a/scripts/ibchecknode.in
+++ b/scripts/ibchecknode.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor] [-G]" \
 	    "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid>"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -20,7 +20,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibcheckport b/scripts/ibcheckport
index 0f4d7aa..0e92cce 100644
--- a/scripts/ibcheckport
+++ b/scripts/ibcheckport
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor] [-G]" \
 	   "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid> <port>"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -20,7 +20,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibcheckport.in b/scripts/ibcheckport.in
index 3c8588e..16a8c24 100644
--- a/scripts/ibcheckport.in
+++ b/scripts/ibcheckport.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor] [-G]" \
 	   "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid> <port>"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -20,7 +20,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibcheckportstate b/scripts/ibcheckportstate
index 7621c84..d156af3 100644
--- a/scripts/ibcheckportstate
+++ b/scripts/ibcheckportstate
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor] [-G]" \
 	   "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid> <port>"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -20,7 +20,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibcheckportstate.in b/scripts/ibcheckportstate.in
index eb5e304..c5fb948 100644
--- a/scripts/ibcheckportstate.in
+++ b/scripts/ibcheckportstate.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor] [-G]" \
 	   "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid> <port>"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -20,7 +20,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibcheckportwidth b/scripts/ibcheckportwidth
index c205e88..9e922c9 100644
--- a/scripts/ibcheckportwidth
+++ b/scripts/ibcheckportwidth
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor] [-G]" \
 	   "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid> <port>"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -20,7 +20,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibcheckportwidth.in b/scripts/ibcheckportwidth.in
index 0df7a11..9cfca11 100644
--- a/scripts/ibcheckportwidth.in
+++ b/scripts/ibcheckportwidth.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor] [-G]" \
 	   "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid> <port>"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -20,7 +20,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibcheckstate b/scripts/ibcheckstate
index 6e96b3b..ceec8f3 100644
--- a/scripts/ibcheckstate
+++ b/scripts/ibcheckstate
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor]" \
 	    "[<topology-file> | -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibcheckstate.in b/scripts/ibcheckstate.in
index 8f85f7b..ce89df5 100644
--- a/scripts/ibcheckstate.in
+++ b/scripts/ibcheckstate.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor]" \
 	    "[<topology-file> | -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibcheckwidth b/scripts/ibcheckwidth
index 084c242..89b39fa 100644
--- a/scripts/ibcheckwidth
+++ b/scripts/ibcheckwidth
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor]" \
 	    "[<topology-file> \| -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibcheckwidth.in b/scripts/ibcheckwidth.in
index bf917fb..c8a08ee 100644
--- a/scripts/ibcheckwidth.in
+++ b/scripts/ibcheckwidth.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor]" \
 	    "[<topology-file> \| -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibclearcounters b/scripts/ibclearcounters
index c0891b0..4f9577c 100644
--- a/scripts/ibclearcounters
+++ b/scripts/ibclearcounters
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file>" \
 	    "| -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibclearcounters.in b/scripts/ibclearcounters.in
index 318fa84..789e02e 100644
--- a/scripts/ibclearcounters.in
+++ b/scripts/ibclearcounters.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file>" \
 	    "| -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibclearerrors b/scripts/ibclearerrors
index 9a71ecf..e7530ed 100644
--- a/scripts/ibclearerrors
+++ b/scripts/ibclearerrors
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-N | -nocolor] [<topology-file>" \
 	    "| -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibclearerrors.in b/scripts/ibclearerrors.in
index 4329ae6..ff7a452 100644
--- a/scripts/ibclearerrors.in
+++ b/scripts/ibclearerrors.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-N | -nocolor] [<topology-file>" \
 	    "| -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibdatacounters b/scripts/ibdatacounters
index 4505f0d..db5af66 100644
--- a/scripts/ibdatacounters
+++ b/scripts/ibdatacounters
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-b] [-v] [-N | -nocolor]" \
 	    "[<topology-file> \| -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibdatacounters.in b/scripts/ibdatacounters.in
index d7bf185..6f0389e 100644
--- a/scripts/ibdatacounters.in
+++ b/scripts/ibdatacounters.in
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-b] [-v] [-N | -nocolor]" \
 	    "[<topology-file> \| -C ca_name -P ca_port -t(imeout) timeout_ms]"
 	exit -1
 }
 
-function user_abort() {
+user_abort() {
 	echo "Aborted"
 	exit 1
 }
diff --git a/scripts/ibdatacounts b/scripts/ibdatacounts
index d1ab302..6a6328b 100644
--- a/scripts/ibdatacounts
+++ b/scripts/ibdatacounts
@@ -1,15 +1,15 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-b] [-v] [-G] [-N | -nocolor]" \
 	    "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid>" \
 	    "[<port>]"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -21,7 +21,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibdatacounts.in b/scripts/ibdatacounts.in
index ed5f85d..ac5f8c4 100644
--- a/scripts/ibdatacounts.in
+++ b/scripts/ibdatacounts.in
@@ -1,15 +1,15 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [-b] [-v] [-G] [-N | -nocolor]" \
 	    "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid>" \
 	    "[<port>]"
 	exit -1
 }
 
-function green() {
+green() {
 	if [ "$bw" = "yes" ]; then
 		if [ "$verbose" = "yes" ]; then
 			echo $1
@@ -21,7 +21,7 @@ function green() {
 	fi
 }
 
-function red() {
+red() {
 	if [ "$bw" = "yes" ]; then
 		echo $1
 		return
diff --git a/scripts/ibhosts b/scripts/ibhosts
index c3aaba6..10b3f41 100644
--- a/scripts/ibhosts
+++ b/scripts/ibhosts
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
 	    "-P ca_port -t timeout_ms]"
 	exit -1
diff --git a/scripts/ibhosts.in b/scripts/ibhosts.in
index 20abdf3..fda0541 100644
--- a/scripts/ibhosts.in
+++ b/scripts/ibhosts.in
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
 	    "-P ca_port -t timeout_ms]"
 	exit -1
diff --git a/scripts/ibnodes b/scripts/ibnodes
index 5a0f653..341e643 100644
--- a/scripts/ibnodes
+++ b/scripts/ibnodes
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
diff --git a/scripts/ibnodes.in b/scripts/ibnodes.in
index 0726efc..5871da8 100644
--- a/scripts/ibnodes.in
+++ b/scripts/ibnodes.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
diff --git a/scripts/ibrouters b/scripts/ibrouters
index ae71157..054a998 100644
--- a/scripts/ibrouters
+++ b/scripts/ibrouters
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
 	    "-P ca_port -t timeout_ms]"
 	exit -1
diff --git a/scripts/ibrouters.in b/scripts/ibrouters.in
index 71f4c60..ae66ca4 100644
--- a/scripts/ibrouters.in
+++ b/scripts/ibrouters.in
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
 	    "-P ca_port -t timeout_ms]"
 	exit -1
diff --git a/scripts/ibstatus b/scripts/ibstatus
index 6f01be0..f7fbbc2 100755
--- a/scripts/ibstatus
+++ b/scripts/ibstatus
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # Usage ibstatus [devname[:port]]
 
diff --git a/scripts/ibswitches b/scripts/ibswitches
index 63931cf..179f555 100644
--- a/scripts/ibswitches
+++ b/scripts/ibswitches
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
 	    "-P ca_port -t timeout_ms]"
 	exit -1
diff --git a/scripts/ibswitches.in b/scripts/ibswitches.in
index 2a1bcae..0f3aa91 100644
--- a/scripts/ibswitches.in
+++ b/scripts/ibswitches.in
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
-function usage() {
+usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
 	    "-P ca_port -t timeout_ms]"
 	exit -1
diff --git a/scripts/set_nodedesc.sh b/scripts/set_nodedesc.sh
index 1f08a54..1e42ac8 100755
--- a/scripts/set_nodedesc.sh
+++ b/scripts/set_nodedesc.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 if [ -f /etc/sysconfig/network ]; then
 . /etc/sysconfig/network
diff --git a/src/ibroute.c b/src/dump_fts.c
similarity index 60%
copy from src/ibroute.c
copy to src/dump_fts.c
index 06549f5..0de61da 100644
--- a/src/ibroute.c
+++ b/src/dump_fts.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
  * Copyright (c) 2009-2011 Mellanox Technologies LTD.  All rights reserved.
+ * Copyright (c) 2013 Lawrence Livermore National Security.  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
@@ -43,47 +44,24 @@
 #include <inttypes.h>
 #include <getopt.h>
 #include <netinet/in.h>
+#include <assert.h>
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
 #include <complib/cl_nodenamemap.h>
 
+#include <infiniband/ibnetdisc.h>
+
 #include "ibdiag_common.h"
 
 struct ibmad_port *srcport;
 
-static int brief, dump_all, multicast;
-
-/*******************************************/
+unsigned startlid = 0, endlid = 0;
 
-char *check_switch(ib_portid_t * portid, unsigned int *nports, uint64_t * guid,
-		   uint8_t * sw, char *nd)
-{
-	uint8_t ni[IB_SMP_DATA_SIZE] = { 0 };
-	int type;
-
-	DEBUG("checking node type");
-	if (!smp_query_via(ni, portid, IB_ATTR_NODE_INFO, 0, 0, srcport)) {
-		xdump(stderr, "nodeinfo\n", ni, sizeof ni);
-		return "node info failed: valid addr?";
-	}
-
-	if (!smp_query_via(nd, portid, IB_ATTR_NODE_DESC, 0, 0, srcport))
-		return "node desc failed";
-
-	mad_decode_field(ni, IB_NODE_TYPE_F, &type);
-	if (type != IB_NODE_SWITCH)
-		return "not a switch";
-
-	DEBUG("Gathering information about switch");
-	mad_decode_field(ni, IB_NODE_NPORTS_F, nports);
-	mad_decode_field(ni, IB_NODE_GUID_F, guid);
-
-	if (!smp_query_via(sw, portid, IB_ATTR_SWITCH_INFO, 0, 0, srcport))
-		return "switch info failed: is a switch node?";
+static int brief, dump_all, multicast;
 
-	return 0;
-}
+static char *node_name_map_file = NULL;
+static nn_map_t *node_name_map = NULL;
 
 #define IB_MLIDS_IN_BLOCK	(IB_SMP_DATA_SIZE/2)
 
@@ -132,24 +110,26 @@ int dump_mlid(char *str, int strlen, unsigned mlid, unsigned nports,
 
 uint16_t mft[16][IB_MLIDS_IN_BLOCK] = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0}, { 0 }, { 0 } };
 
-char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
-			    unsigned endlid)
+void dump_multicast_tables(ibnd_node_t * node, unsigned startlid,
+			    unsigned endlid, struct ibmad_port * mad_port)
 {
+	ib_portid_t *portid = &node->path_portid;
 	char nd[IB_SMP_DATA_SIZE] = { 0 };
-	uint8_t sw[IB_SMP_DATA_SIZE] = { 0 };
 	char str[512];
 	char *s;
 	uint64_t nodeguid;
 	uint32_t mod;
 	unsigned block, i, j, e, nports, cap, chunks, startblock, lastblock,
 	    top;
+	char *mapnd = NULL;
 	int n = 0;
 
-	if ((s = check_switch(portid, &nports, &nodeguid, sw, nd)))
-		return s;
+	memcpy(nd, node->nodedesc, strlen(node->nodedesc));
+	nports = node->numports;
+	nodeguid = node->guid;
 
-	mad_decode_field(sw, IB_SW_MCAST_FDB_CAP_F, &cap);
-	mad_decode_field(sw, IB_SW_MCAST_FDB_TOP_F, &top);
+	mad_decode_field(node->switchinfo, IB_SW_MCAST_FDB_CAP_F, &cap);
+	mad_decode_field(node->switchinfo, IB_SW_MCAST_FDB_TOP_F, &top);
 
 	if (!endlid || endlid > IB_MIN_MCAST_LID + cap - 1)
 		endlid = IB_MIN_MCAST_LID + cap - 1;
@@ -174,9 +154,11 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
 		endlid = IB_MAX_MCAST_LID;
 	}
 
+	mapnd = remap_node_name(node_name_map, nodeguid, nd);
+
 	printf("Multicast mlids [0x%x-0x%x] of switch %s guid 0x%016" PRIx64
 	       " (%s):\n", startlid, endlid, portid2str(portid), nodeguid,
-	       clean_nodedesc(nd));
+	       mapnd);
 
 	if (brief)
 		printf(" MLid       Port Mask\n");
@@ -204,15 +186,23 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
 	lastblock = endlid / IB_MLIDS_IN_BLOCK;
 	for (block = startblock; block <= lastblock; block++) {
 		for (j = 0; j < chunks; j++) {
+			int status;
 			mod = (block - IB_MIN_MCAST_LID / IB_MLIDS_IN_BLOCK)
 			    | (j << 28);
 
 			DEBUG("reading block %x chunk %d mod %x", block, j,
 			      mod);
-			if (!smp_query_via
+			if (!smp_query_status_via
 			    (mft + j, portid, IB_ATTR_MULTICASTFORWTBL, mod, 0,
-			     srcport))
-				return "multicast forwarding table get failed";
+			     &status, mad_port)) {
+				fprintf(stderr, "SubnGet(MFT) failed on switch "
+						"'%s' %s Node GUID 0x%"PRIx64
+						" SMA LID %d; MAD status 0x%x "
+						"AM 0x%x\n",
+						mapnd, portid2str(portid),
+						node->guid, node->smalid,
+						status, mod);
+			}
 		}
 
 		i = block * IB_MLIDS_IN_BLOCK;
@@ -231,91 +221,106 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
 	}
 
 	printf("%d %smlids dumped \n", n, dump_all ? "" : "valid ");
-	return 0;
+
+	free(mapnd);
 }
 
-int dump_lid(char *str, int strlen, int lid, int valid)
+int dump_lid(char *str, int str_len, int lid, int valid,
+		ibnd_fabric_t *fabric,
+		int * last_port_lid, int * base_port_lid,
+		uint64_t * portguid)
 {
 	char nd[IB_SMP_DATA_SIZE] = { 0 };
-	uint8_t ni[IB_SMP_DATA_SIZE] = { 0 };
-	uint8_t pi[IB_SMP_DATA_SIZE] = { 0 };
-	ib_portid_t lidport = { 0 };
-	static int last_port_lid, base_port_lid;
-	char ntype[50], sguid[30], desc[64];
-	static uint64_t portguid;
+
+	ibnd_port_t *port = NULL;
+
+	char ntype[50], sguid[30];
+	uint64_t nodeguid;
 	int baselid, lmc, type;
+	char *mapnd = NULL;
+	int rc;
 
 	if (brief) {
 		str[0] = 0;
 		return 0;
 	}
 
-	if (lid <= last_port_lid) {
+	if (lid <= *last_port_lid) {
 		if (!valid)
-			return snprintf(str, strlen,
+			return snprintf(str, str_len,
 					": (path #%d - illegal port)",
-					lid - base_port_lid);
-		else if (!portguid)
-			return snprintf(str, strlen,
+					lid - *base_port_lid);
+		else if (!*portguid)
+			return snprintf(str, str_len,
 					": (path #%d out of %d)",
-					lid - base_port_lid + 1,
-					last_port_lid - base_port_lid + 1);
+					lid - *base_port_lid + 1,
+					*last_port_lid - *base_port_lid + 1);
 		else {
-			return snprintf(str, strlen,
+			return snprintf(str, str_len,
 					": (path #%d out of %d: portguid %s)",
-					lid - base_port_lid + 1,
-					last_port_lid - base_port_lid + 1,
+					lid - *base_port_lid + 1,
+					*last_port_lid - *base_port_lid + 1,
 					mad_dump_val(IB_NODE_PORT_GUID_F, sguid,
-						     sizeof sguid, &portguid));
+						     sizeof sguid, portguid));
 		}
 	}
 
 	if (!valid)
-		return snprintf(str, strlen, ": (illegal port)");
+		return snprintf(str, str_len, ": (illegal port)");
 
-	portguid = 0;
-	lidport.lid = lid;
+	*portguid = 0;
+
+	port = ibnd_find_port_lid(fabric, lid);
+	if (!port) {
+		return snprintf(str, str_len, ": (node info not available fabric scan)");
+	}
 
-	if (!smp_query_via(nd, &lidport, IB_ATTR_NODE_DESC, 0, 100, srcport) ||
-	    !smp_query_via(pi, &lidport, IB_ATTR_PORT_INFO, 0, 100, srcport) ||
-	    !smp_query_via(ni, &lidport, IB_ATTR_NODE_INFO, 0, 100, srcport))
-		return snprintf(str, strlen, ": (unknown node and type)");
+	nodeguid = port->node->guid;
+	*portguid = port->guid;
+	type = port->node->type;
 
-	mad_decode_field(ni, IB_NODE_PORT_GUID_F, &portguid);
-	mad_decode_field(ni, IB_NODE_TYPE_F, &type);
+	baselid = port->base_lid;
+	lmc = port->lmc;
 
-	mad_decode_field(pi, IB_PORT_LID_F, &baselid);
-	mad_decode_field(pi, IB_PORT_LMC_F, &lmc);
+	memcpy(nd, port->node->nodedesc, strlen(port->node->nodedesc));
 
 	if (lmc > 0) {
-		base_port_lid = baselid;
-		last_port_lid = baselid + (1 << lmc) - 1;
+		*base_port_lid = baselid;
+		*last_port_lid = baselid + (1 << lmc) - 1;
 	}
 
-	return snprintf(str, strlen, ": (%s portguid %s: %s)",
-			mad_dump_val(IB_NODE_TYPE_F, ntype, sizeof ntype,
-				     &type), mad_dump_val(IB_NODE_PORT_GUID_F,
-							  sguid, sizeof sguid,
-							  &portguid),
-			mad_dump_val(IB_NODE_DESC_F, desc, sizeof desc,
-				     clean_nodedesc(nd)));
+	mapnd = remap_node_name(node_name_map, nodeguid, nd);
+ 
+	rc = snprintf(str, str_len, ": (%s portguid %s: '%s')",
+		      mad_dump_val(IB_NODE_TYPE_F, ntype, sizeof ntype,
+				   &type), mad_dump_val(IB_NODE_PORT_GUID_F,
+							sguid, sizeof sguid,
+							portguid),
+		      mapnd);
+
+	free(mapnd);
+	return rc;
 }
 
-char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
+void dump_unicast_tables(ibnd_node_t * node, int startlid, int endlid,
+			struct ibmad_port *mad_port, ibnd_fabric_t *fabric)
 {
+	ib_portid_t * portid = &node->path_portid;
 	char lft[IB_SMP_DATA_SIZE] = { 0 };
 	char nd[IB_SMP_DATA_SIZE] = { 0 };
-	uint8_t sw[IB_SMP_DATA_SIZE] = { 0 };
-	char str[200], *s;
+	char str[200];
 	uint64_t nodeguid;
 	int block, i, e, top;
 	unsigned nports;
 	int n = 0, startblock, endblock;
+	char *mapnd = NULL;
+	int last_port_lid = 0, base_port_lid = 0;
+	uint64_t portguid = 0;
 
-	if ((s = check_switch(portid, &nports, &nodeguid, sw, nd)))
-		return s;
-
-	mad_decode_field(sw, IB_SW_LINEAR_FDB_TOP_F, &top);
+	mad_decode_field(node->switchinfo, IB_SW_LINEAR_FDB_TOP_F, &top);
+	nodeguid = node->guid;
+	nports = node->numports;
+	memcpy(nd, node->nodedesc, strlen(node->nodedesc));
 
 	if (!endlid || endlid > top)
 		endlid = top;
@@ -326,9 +331,11 @@ char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
 		endlid = IB_MAX_UCAST_LID;
 	}
 
+	mapnd = remap_node_name(node_name_map, nodeguid, nd);
+
 	printf("Unicast lids [0x%x-0x%x] of switch %s guid 0x%016" PRIx64
 	       " (%s):\n", startlid, endlid, portid2str(portid), nodeguid,
-	       clean_nodedesc(nd));
+	       mapnd);
 
 	DEBUG("Switch top is 0x%x\n", top);
 
@@ -336,11 +343,18 @@ char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
 	printf("       Port     Info \n");
 	startblock = startlid / IB_SMP_DATA_SIZE;
 	endblock = ALIGN(endlid, IB_SMP_DATA_SIZE) / IB_SMP_DATA_SIZE;
-	for (block = startblock; block <= endblock; block++) {
+	for (block = startblock; block < endblock; block++) {
+		int status;
 		DEBUG("reading block %d", block);
-		if (!smp_query_via(lft, portid, IB_ATTR_LINEARFORWTBL, block,
-				   0, srcport))
-			return "linear forwarding table get failed";
+		if (!smp_query_status_via(lft, portid, IB_ATTR_LINEARFORWTBL, block,
+				   0, &status, mad_port)) {
+			fprintf(stderr, "SubnGet(LFT) failed on switch "
+					"'%s' %s Node GUID 0x%"PRIx64
+					" SMA LID %d; MAD status 0x%x AM 0x%x\n",
+					mapnd, portid2str(portid),
+					node->guid, node->smalid,
+					status, block);
+		}
 		i = block * IB_SMP_DATA_SIZE;
 		e = i + IB_SMP_DATA_SIZE;
 		if (i < startlid)
@@ -354,14 +368,30 @@ char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
 
 			if (!valid && !dump_all)
 				continue;
-			dump_lid(str, sizeof str, i, valid);
+			dump_lid(str, sizeof str, i, valid, fabric,
+				&last_port_lid, &base_port_lid, &portguid);
 			printf("0x%04x %03u %s\n", i, outport & 0xff, str);
 			n++;
 		}
 	}
 
 	printf("%d %slids dumped \n", n, dump_all ? "" : "valid ");
-	return 0;
+	free(mapnd);
+}
+
+void dump_node(ibnd_node_t *node, struct ibmad_port *mad_port,
+		ibnd_fabric_t *fabric)
+{
+	if (multicast)
+		dump_multicast_tables(node, startlid, endlid, mad_port);
+	else
+		dump_unicast_tables(node, startlid, endlid,
+						mad_port, fabric);
+}
+
+void process_switch(ibnd_node_t * node, void *fabric)
+{
+	dump_node(node, srcport, (ibnd_fabric_t *)fabric);
 }
 
 static int process_opt(void *context, int ch, char *optarg)
@@ -376,6 +406,9 @@ static int process_opt(void *context, int ch, char *optarg)
 	case 'n':
 		brief++;
 		break;
+	case 1:
+		node_name_map_file = strdup(optarg);
+		break;
 	default:
 		return -1;
 	}
@@ -384,68 +417,73 @@ static int process_opt(void *context, int ch, char *optarg)
 
 int main(int argc, char **argv)
 {
+	int rc = 0;
 	int mgmt_classes[3] =
 	    { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS };
-	ib_portid_t portid = { 0 };
-	unsigned startlid = 0, endlid = 0;
-	char *err;
+
+	struct ibnd_config config = { 0 };
+	ibnd_fabric_t *fabric = NULL;
 
 	const struct ibdiag_opt opts[] = {
 		{"all", 'a', 0, NULL, "show all lids, even invalid entries"},
 		{"no_dests", 'n', 0, NULL,
 		 "do not try to resolve destinations"},
 		{"Multicast", 'M', 0, NULL, "show multicast forwarding tables"},
+		{"node-name-map", 1, 1, "<file>", "node name map file"},
 		{0}
 	};
 	char usage_args[] = "[<dest dr_path|lid|guid> [<startlid> [<endlid>]]]";
 	const char *usage_examples[] = {
 		" -- Unicast examples:",
-		"4\t# dump all lids with valid out ports of switch with lid 4",
-		"-a 4\t# same, but dump all lids, even with invalid out ports",
-		"-n 4\t# simple dump format - no destination resolving",
-		"4 10\t# dump lids starting from 10",
-		"4 0x10 0x20\t# dump lid range",
-		"-G 0x08f1040023\t# resolve switch by GUID",
-		"-D 0,1\t# resolve switch by direct path",
+		"-a\t# same, but dump all lids, even with invalid out ports",
+		"-n\t# simple dump format - no destination resolving",
+		"10\t# dump lids starting from 10",
+		"0x10 0x20\t# dump lid range",
 		" -- Multicast examples:",
-		"-M 4\t# dump all non empty mlids of switch with lid 4",
-		"-M 4 0xc010 0xc020\t# same, but with range",
-		"-M -n 4\t# simple dump format",
+		"-M\t# dump all non empty mlids of switch with lid 4",
+		"-M 0xc010 0xc020\t# same, but with range",
+		"-M -n\t# simple dump format",
 		NULL,
 	};
 
-	ibdiag_process_opts(argc, argv, NULL, "K", opts, process_opt,
+	ibdiag_process_opts(argc, argv, &config, "KGDLs", opts, process_opt,
 			    usage_args, usage_examples);
 
 	argc -= optind;
 	argv += optind;
 
-	if (!argc)
-		ibdiag_show_usage();
-
+	if (argc > 0)
+		startlid = strtoul(argv[0], 0, 0);
 	if (argc > 1)
-		startlid = strtoul(argv[1], 0, 0);
-	if (argc > 2)
-		endlid = strtoul(argv[2], 0, 0);
+		endlid = strtoul(argv[1], 0, 0);
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+
+	node_name_map = open_node_name_map(node_name_map_file);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
-	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
-			       ibd_dest_type, ibd_sm_id, srcport) < 0)
-		IBERROR("can't resolve destination port %s", argv[1]);
+	if (ibd_timeout) {
+		mad_rpc_set_timeout(srcport, ibd_timeout);
+		config.timeout_ms = ibd_timeout;
+	}
 
-	if (multicast)
-		err = dump_multicast_tables(&portid, startlid, endlid);
-	else
-		err = dump_unicast_tables(&portid, startlid, endlid);
+	config.flags = ibd_ibnetdisc_flags;
+	config.mkey = ibd_mkey;
+
+	if ((fabric = ibnd_discover_fabric(ibd_ca, ibd_ca_port, NULL,
+						&config)) != NULL) {
+		ibnd_iter_nodes_type(fabric, process_switch, IB_NODE_SWITCH, fabric);
+	} else {
+		fprintf(stderr, "Failed to discover fabric\n");
+		rc = -1;
+	}
 
-	if (err)
-		IBERROR("dump tables: %s", err);
+	ibnd_destroy_fabric(fabric);
 
 	mad_rpc_close_port(srcport);
-	exit(0);
+	close_node_name_map(node_name_map);
+	exit(rc);
 }
diff --git a/src/ibaddr.c b/src/ibaddr.c
index 9d208f5..5845b4e 100644
--- a/src/ibaddr.c
+++ b/src/ibaddr.c
@@ -147,21 +147,21 @@ int main(int argc, char **argv)
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, ibd_sm_id, srcport) < 0)
-			IBERROR("can't resolve destination port %s", argv[0]);
+			IBEXIT("can't resolve destination port %s", argv[0]);
 	} else {
 		if (resolve_self(ibd_ca, ibd_ca_port, &portid, &port, NULL) < 0)
-			IBERROR("can't resolve self port %s", argv[0]);
+			IBEXIT("can't resolve self port %s", argv[0]);
 	}
 
 	if (ib_resolve_addr(&portid, port, show_lid, show_gid) < 0)
-		IBERROR("can't resolve requested address");
+		IBEXIT("can't resolve requested address");
 
 	mad_rpc_close_port(srcport);
 	exit(0);
diff --git a/src/ibcacheedit.c b/src/ibcacheedit.c
index f302813..983c0ab 100644
--- a/src/ibcacheedit.c
+++ b/src/ibcacheedit.c
@@ -280,13 +280,13 @@ int main(int argc, char **argv)
 	new_cache_file = argv[1];
 
 	if (!orig_cache_file)
-		IBERROR("original cache file not specified");
+		IBEXIT("original cache file not specified");
 
 	if (!new_cache_file)
-		IBERROR("new cache file not specified");
+		IBEXIT("new cache file not specified");
 
 	if ((fabric = ibnd_load_fabric(orig_cache_file, 0)) == NULL)
-		IBERROR("loading original cached fabric failed");
+		IBEXIT("loading original cached fabric failed");
 
 	if (switchguid_flag) {
 		guids.before = switchguid_before;
@@ -298,7 +298,7 @@ int main(int argc, char **argv)
 				     &guids);
 
 		if (!guids.found)
-			IBERROR("switchguid = %" PRIx64 " not found",
+			IBEXIT("switchguid = %" PRIx64 " not found",
 				switchguid_before);
 	}
 
@@ -312,7 +312,7 @@ int main(int argc, char **argv)
 				     &guids);
 
 		if (!guids.found)
-			IBERROR("caguid = %" PRIx64 " not found",
+			IBEXIT("caguid = %" PRIx64 " not found",
 				caguid_before);
 	}
 
@@ -325,7 +325,7 @@ int main(int argc, char **argv)
 				&guids);
 
 		if (!guids.found)
-			IBERROR("sysimgguid = %" PRIx64 " not found",
+			IBEXIT("sysimgguid = %" PRIx64 " not found",
 				sysimgguid_before);
 	}
 
@@ -340,16 +340,16 @@ int main(int argc, char **argv)
 				&guids);
 
 		if (!guids.searchguid_found)
-			IBERROR("nodeguid = %" PRIx64 " not found",
+			IBEXIT("nodeguid = %" PRIx64 " not found",
 				portguid_nodeguid);
 
 		if (!guids.found)
-			IBERROR("portguid = %" PRIx64 " not found",
+			IBEXIT("portguid = %" PRIx64 " not found",
 				portguid_before);
 	}
 
 	if (ibnd_cache_fabric(fabric, new_cache_file, 0) < 0)
-		IBERROR("caching new cache data failed");
+		IBEXIT("caching new cache data failed");
 
 	ibnd_destroy_fabric(fabric);
 	exit(0);
diff --git a/src/ibccconfig.c b/src/ibccconfig.c
index 6dd6b0b..11dfc07 100644
--- a/src/ibccconfig.c
+++ b/src/ibccconfig.c
@@ -56,15 +56,6 @@
 
 struct ibmad_port *srcport;
 
-typedef char *(op_fn_t) (ib_portid_t * dest, char **argv, int argc);
-
-typedef struct match_rec {
-	const char *name, *alias;
-	op_fn_t *fn;
-	unsigned opt_portnum;
-	char *ops_extra;
-} match_rec_t;
-
 static op_fn_t congestion_key_info;
 static op_fn_t switch_congestion_setting;
 static op_fn_t switch_port_congestion_setting;
@@ -553,16 +544,6 @@ static char *congestion_control_table(ib_portid_t * dest, char **argv, int argc)
 	return NULL;
 }
 
-static op_fn_t *match_op(char *name)
-{
-	const match_rec_t *r;
-	for (r = match_tbl; r->name; r++)
-		if (!strcasecmp(r->name, name) ||
-		    (r->alias && !strcasecmp(r->alias, name)))
-			return r->fn;
-	return NULL;
-}
-
 static int process_opt(void *context, int ch, char *optarg)
 {
 	switch (ch) {
@@ -623,20 +604,20 @@ int main(int argc, char **argv)
 	if (argc < 2)
 		ibdiag_show_usage();
 
-	if (!(fn = match_op(argv[0])))
-		IBERROR("operation '%s' not supported", argv[0]);
+	if (!(fn = match_op(match_tbl, argv[0])))
+		IBEXIT("operation '%s' not supported", argv[0]);
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
-		IBERROR("can't resolve destination %s", argv[1]);
+		IBEXIT("can't resolve destination %s", argv[1]);
 	if ((err = fn(&portid, argv + 2, argc - 2)))
-		IBERROR("operation %s: %s", argv[0], err);
+		IBEXIT("operation %s: %s", argv[0], err);
 
 	mad_rpc_close_port(srcport);
 	exit(0);
diff --git a/src/ibccquery.c b/src/ibccquery.c
index 476436f..ac8bca2 100644
--- a/src/ibccquery.c
+++ b/src/ibccquery.c
@@ -53,14 +53,6 @@
 
 struct ibmad_port *srcport;
 
-typedef char *(op_fn_t) (ib_portid_t * dest, char **argv, int argc);
-
-typedef struct match_rec {
-	const char *name, *alias;
-	op_fn_t *fn;
-	unsigned opt_portnum;
-} match_rec_t;
-
 static op_fn_t class_port_info;
 static op_fn_t congestion_info;
 static op_fn_t congestion_key_info;
@@ -72,15 +64,15 @@ static op_fn_t congestion_control_table;
 static op_fn_t timestamp_dump;
 
 static const match_rec_t match_tbl[] = {
-	{"ClassPortInfo", "CP", class_port_info, 0},
-	{"CongestionInfo", "CI", congestion_info, 0},
-	{"CongestionKeyInfo", "CK", congestion_key_info, 0},
-	{"CongestionLog", "CL", congestion_log, 0},
-	{"SwitchCongestionSetting", "SS", switch_congestion_setting, 0},
-	{"SwitchPortCongestionSetting", "SP", switch_port_congestion_setting, 1},
-	{"CACongestionSetting", "CS", ca_congestion_setting, 0},
-	{"CongestionControlTable", "CT", congestion_control_table, 0},
-	{"Timestamp", "TI", timestamp_dump, 0},
+	{"ClassPortInfo", "CP", class_port_info, 0, ""},
+	{"CongestionInfo", "CI", congestion_info, 0, ""},
+	{"CongestionKeyInfo", "CK", congestion_key_info, 0, ""},
+	{"CongestionLog", "CL", congestion_log, 0, ""},
+	{"SwitchCongestionSetting", "SS", switch_congestion_setting, 0, ""},
+	{"SwitchPortCongestionSetting", "SP", switch_port_congestion_setting, 1, ""},
+	{"CACongestionSetting", "CS", ca_congestion_setting, 0, ""},
+	{"CongestionControlTable", "CT", congestion_control_table, 0, ""},
+	{"Timestamp", "TI", timestamp_dump, 0, ""},
 	{0}
 };
 
@@ -344,16 +336,6 @@ static char *timestamp_dump(ib_portid_t * dest, char **argv, int argc)
 	return NULL;
 }
 
-static op_fn_t *match_op(char *name)
-{
-	const match_rec_t *r;
-	for (r = match_tbl; r->name; r++)
-		if (!strcasecmp(r->name, name) ||
-		    (r->alias && !strcasecmp(r->alias, name)))
-			return r->fn;
-	return NULL;
-}
-
 static int process_opt(void *context, int ch, char *optarg)
 {
 	switch (ch) {
@@ -407,20 +389,20 @@ int main(int argc, char **argv)
 	if (argc < 2)
 		ibdiag_show_usage();
 
-	if (!(fn = match_op(argv[0])))
-		IBERROR("operation '%s' not supported", argv[0]);
+	if (!(fn = match_op(match_tbl, argv[0])))
+		IBEXIT("operation '%s' not supported", argv[0]);
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
-		IBERROR("can't resolve destination %s", argv[1]);
+		IBEXIT("can't resolve destination %s", argv[1]);
 	if ((err = fn(&portid, argv + 2, argc - 2)))
-		IBERROR("operation %s: %s", argv[0], err);
+		IBEXIT("operation %s: %s", argv[0], err);
 
 	mad_rpc_close_port(srcport);
 	exit(0);
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index ebe8797..8c749c7 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -254,7 +254,7 @@ static int process_opt(int ch, char *optarg)
 		val = strtol(optarg, &endp, 0);
 		if (errno || (endp && *endp != '\0') || val <= 0 ||
 		    val > INT_MAX)
-			IBERROR("Invalid timeout \"%s\".  Timeout requires a "
+			IBEXIT("Invalid timeout \"%s\".  Timeout requires a "
 				"positive integer value < %d.", optarg, INT_MAX);
 		else {
 			madrpc_set_timeout((int)val);
@@ -265,7 +265,7 @@ static int process_opt(int ch, char *optarg)
 		/* srcport is not required when resolving via IB_DEST_LID */
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &sm_portid, optarg,
 				IB_DEST_LID, 0, NULL) < 0)
-			IBERROR("cannot resolve SM destination port %s",
+			IBEXIT("cannot resolve SM destination port %s",
 				optarg);
 		ibd_sm_id = &sm_portid;
 		break;
@@ -279,7 +279,7 @@ static int process_opt(int ch, char *optarg)
 			errno = 0;
 			ibd_mkey = strtoull(getpass("M_Key: "), &endp, 0);
 			if (errno || *endp != '\0') {
-				IBERROR("Bad M_Key");
+				IBEXIT("Bad M_Key");
 			}
                 }
                 break;
@@ -409,7 +409,7 @@ int ibdiag_process_opts(int argc, char *const argv[], void *cxt,
 	return 0;
 }
 
-void iberror(const char *fn, char *msg, ...)
+void ibexit(const char *fn, char *msg, ...)
 {
 	char buf[512];
 	va_list va;
@@ -686,171 +686,6 @@ int resolve_portid_str(char *ca_name, uint8_t ca_port, ib_portid_t * portid,
 	return -1;
 }
 
-/* define a common SA query structure
- * This is by no means optimal but it moves the saquery functionality out of
- * the saquery tool and provides it to other utilities.
- */
-bind_handle_t sa_get_bind_handle(void)
-{
-	bind_handle_t handle;
-	handle = calloc(1, sizeof(*handle));
-	if (!handle)
-		IBPANIC("calloc failed");
-
-	resolve_sm_portid(ibd_ca, ibd_ca_port, &handle->dport);
-	if (!handle->dport.lid) {
-		IBWARN("No SM/SA found on port %s:%d",
-			ibd_ca ? "" : ibd_ca,
-			ibd_ca_port);
-		free(handle);
-		return (NULL);
-	}
-
-	handle->dport.qp = 1;
-	if (!handle->dport.qkey)
-		handle->dport.qkey = IB_DEFAULT_QP1_QKEY;
-
-	handle->fd = umad_open_port(ibd_ca, ibd_ca_port);
-	handle->agent = umad_register(handle->fd, IB_SA_CLASS, 2, 1, NULL);
-
-	return handle;
-}
-
-void sa_free_bind_handle(bind_handle_t h)
-{
-	umad_unregister(h->fd, h->agent);
-	umad_close_port(h->fd);
-	free(h);
-}
-
-int sa_query(bind_handle_t h, uint8_t method,
-		    uint16_t attr, uint32_t mod, uint64_t comp_mask,
-		    uint64_t sm_key, void *data, size_t datasz,
-		    struct sa_query_result *result)
-{
-	ib_rpc_t rpc;
-	void *umad, *mad;
-	int ret, offset, len = 256;
-
-	memset(&rpc, 0, sizeof(rpc));
-	rpc.mgtclass = IB_SA_CLASS;
-	rpc.method = method;
-	rpc.attr.id = attr;
-	rpc.attr.mod = mod;
-	rpc.mask = comp_mask;
-	rpc.datasz = datasz;
-	rpc.dataoffs = IB_SA_DATA_OFFS;
-
-	umad = calloc(1, len + umad_size());
-	if (!umad)
-		IBPANIC("cannot alloc mem for umad: %s\n", strerror(errno));
-
-	mad_build_pkt(umad, &rpc, &h->dport, NULL, data);
-
-	mad_set_field64(umad_get_mad(umad), 0, IB_SA_MKEY_F, sm_key);
-
-	if (ibdebug > 1)
-		xdump(stdout, "SA Request:\n", umad_get_mad(umad), len);
-
-	ret = umad_send(h->fd, h->agent, umad, len, ibd_timeout, 0);
-	if (ret < 0) {
-		IBWARN("umad_send failed: attr %u: %s\n",
-			attr, strerror(errno));
-		free(umad);
-		return (-ret);
-	}
-
-recv_mad:
-	ret = umad_recv(h->fd, umad, &len, ibd_timeout);
-	if (ret < 0) {
-		if (errno == ENOSPC) {
-			umad = realloc(umad, umad_size() + len);
-			goto recv_mad;
-		}
-		IBWARN("umad_recv failed: attr 0x%x: %s\n", attr,
-			strerror(errno));
-		free(umad);
-		return (-ret);
-	}
-
-	if ((ret = umad_status(umad)))
-		return ret;
-
-	mad = umad_get_mad(umad);
-
-	if (ibdebug > 1)
-		xdump(stdout, "SA Response:\n", mad, len);
-
-	method = (uint8_t) mad_get_field(mad, 0, IB_MAD_METHOD_F);
-	offset = mad_get_field(mad, 0, IB_SA_ATTROFFS_F);
-	result->status = mad_get_field(mad, 0, IB_MAD_STATUS_F);
-	result->p_result_madw = mad;
-	if (result->status != IB_SA_MAD_STATUS_SUCCESS)
-		result->result_cnt = 0;
-	else if (method != IB_MAD_METHOD_GET_TABLE)
-		result->result_cnt = 1;
-	else if (!offset)
-		result->result_cnt = 0;
-	else
-		result->result_cnt = (len - IB_SA_DATA_OFFS) / (offset << 3);
-
-	return 0;
-}
-
-void sa_free_result_mad(struct sa_query_result *result)
-{
-	if (result->p_result_madw) {
-		free((uint8_t *) result->p_result_madw - umad_size());
-		result->p_result_madw = NULL;
-	}
-}
-
-void *sa_get_query_rec(void *mad, unsigned i)
-{
-	int offset = mad_get_field(mad, 0, IB_SA_ATTROFFS_F);
-	return (uint8_t *) mad + IB_SA_DATA_OFFS + i * (offset << 3);
-}
-
-static const char *ib_sa_error_str[] = {
-	"SA_NO_ERROR",
-	"SA_ERR_NO_RESOURCES",
-	"SA_ERR_REQ_INVALID",
-	"SA_ERR_NO_RECORDS",
-	"SA_ERR_TOO_MANY_RECORDS",
-	"SA_ERR_REQ_INVALID_GID",
-	"SA_ERR_REQ_INSUFFICIENT_COMPONENTS",
-	"SA_ERR_REQ_DENIED",
-	"SA_ERR_STATUS_PRIO_SUGGESTED",
-	"SA_ERR_UNKNOWN"
-};
-
-#define ARR_SIZE(a) (sizeof(a)/sizeof((a)[0]))
-#define SA_ERR_UNKNOWN (ARR_SIZE(ib_sa_error_str) - 1)
-
-static inline const char *ib_sa_err_str(IN uint8_t status)
-{
-	if (status > SA_ERR_UNKNOWN)
-		status = SA_ERR_UNKNOWN;
-	return (ib_sa_error_str[status]);
-}
-
-void sa_report_err(int status)
-{
-	int st = status & 0xff;
-	char sm_err_str[64] = { 0 };
-	char sa_err_str[64] = { 0 };
-
-	if (st)
-		sprintf(sm_err_str, " SM(%s)", ib_get_err_str(st));
-
-	st = status >> 8;
-	if (st)
-		sprintf(sa_err_str, " SA(%s)", ib_sa_err_str((uint8_t) st));
-
-	fprintf(stderr, "ERROR: Query result returned 0x%04x, %s%s\n",
-		status, sm_err_str, sa_err_str);
-}
-
 static unsigned int get_max(unsigned int num)
 {
 	unsigned r = 0;		// r will be lg(num)
@@ -1016,3 +851,13 @@ void dump_portinfo(void *pi, int pisize, int tabs)
 		printf("%s\n", buf);
 	}
 }
+
+op_fn_t *match_op(const match_rec_t match_tbl[], char *name)
+{
+	const match_rec_t *r;
+	for (r = match_tbl; r->name; r++)
+		if (!strcasecmp(r->name, name) ||
+		    (r->alias && !strcasecmp(r->alias, name)))
+			return r->fn;
+	return NULL;
+}
diff --git a/src/ibdiag_sa.c b/src/ibdiag_sa.c
new file mode 100644
index 0000000..018a428
--- /dev/null
+++ b/src/ibdiag_sa.c
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2006-2007 The Regents of the University of California.
+ * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2009 HNR Consulting. All rights reserved.
+ * Copyright (c) 2011 Lawrence Livermore National Security. 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.
+ *
+ */
+
+
+#include <errno.h>
+#include <infiniband/umad.h>
+
+#include "ibdiag_common.h"
+#include "ibdiag_sa.h"
+
+/* define a common SA query structure
+ * This is by no means optimal but it moves the saquery functionality out of
+ * the saquery tool and provides it to other utilities.
+ */
+
+struct sa_handle * sa_get_handle(void)
+{
+	struct sa_handle * handle;
+	handle = calloc(1, sizeof(*handle));
+	if (!handle)
+		IBPANIC("calloc failed");
+
+	resolve_sm_portid(ibd_ca, ibd_ca_port, &handle->dport);
+	if (!handle->dport.lid) {
+		IBWARN("No SM/SA found on port %s:%d",
+			ibd_ca ? "" : ibd_ca,
+			ibd_ca_port);
+		free(handle);
+		return (NULL);
+	}
+
+	handle->dport.qp = 1;
+	if (!handle->dport.qkey)
+		handle->dport.qkey = IB_DEFAULT_QP1_QKEY;
+
+	handle->fd = umad_open_port(ibd_ca, ibd_ca_port);
+	handle->agent = umad_register(handle->fd, IB_SA_CLASS, 2, 1, NULL);
+
+	return handle;
+}
+
+void sa_free_handle(struct sa_handle * h)
+{
+	umad_unregister(h->fd, h->agent);
+	umad_close_port(h->fd);
+	free(h);
+}
+
+int sa_query(struct sa_handle * h, uint8_t method,
+		    uint16_t attr, uint32_t mod, uint64_t comp_mask,
+		    uint64_t sm_key, void *data, size_t datasz,
+		    struct sa_query_result *result)
+{
+	ib_rpc_t rpc;
+	void *umad, *mad;
+	int ret, offset, len = 256;
+
+	memset(&rpc, 0, sizeof(rpc));
+	rpc.mgtclass = IB_SA_CLASS;
+	rpc.method = method;
+	rpc.attr.id = attr;
+	rpc.attr.mod = mod;
+	rpc.mask = comp_mask;
+	rpc.datasz = datasz;
+	rpc.dataoffs = IB_SA_DATA_OFFS;
+
+	umad = calloc(1, len + umad_size());
+	if (!umad)
+		IBPANIC("cannot alloc mem for umad: %s\n", strerror(errno));
+
+	mad_build_pkt(umad, &rpc, &h->dport, NULL, data);
+
+	mad_set_field64(umad_get_mad(umad), 0, IB_SA_MKEY_F, sm_key);
+
+	if (ibdebug > 1)
+		xdump(stdout, "SA Request:\n", umad_get_mad(umad), len);
+
+	ret = umad_send(h->fd, h->agent, umad, len, ibd_timeout, 0);
+	if (ret < 0) {
+		IBWARN("umad_send failed: attr 0x%x: %s\n",
+			attr, strerror(errno));
+		free(umad);
+		return (-ret);
+	}
+
+recv_mad:
+	ret = umad_recv(h->fd, umad, &len, ibd_timeout);
+	if (ret < 0) {
+		if (errno == ENOSPC) {
+			umad = realloc(umad, umad_size() + len);
+			goto recv_mad;
+		}
+		IBWARN("umad_recv failed: attr 0x%x: %s\n", attr,
+			strerror(errno));
+		free(umad);
+		return (-ret);
+	}
+
+	if ((ret = umad_status(umad)))
+		return ret;
+
+	mad = umad_get_mad(umad);
+
+	if (ibdebug > 1)
+		xdump(stdout, "SA Response:\n", mad, len);
+
+	method = (uint8_t) mad_get_field(mad, 0, IB_MAD_METHOD_F);
+	offset = mad_get_field(mad, 0, IB_SA_ATTROFFS_F);
+	result->status = mad_get_field(mad, 0, IB_MAD_STATUS_F);
+	result->p_result_madw = mad;
+	if (result->status != IB_SA_MAD_STATUS_SUCCESS)
+		result->result_cnt = 0;
+	else if (method != IB_MAD_METHOD_GET_TABLE)
+		result->result_cnt = 1;
+	else if (!offset)
+		result->result_cnt = 0;
+	else
+		result->result_cnt = (len - IB_SA_DATA_OFFS) / (offset << 3);
+
+	return 0;
+}
+
+void sa_free_result_mad(struct sa_query_result *result)
+{
+	if (result->p_result_madw) {
+		free((uint8_t *) result->p_result_madw - umad_size());
+		result->p_result_madw = NULL;
+	}
+}
+
+void *sa_get_query_rec(void *mad, unsigned i)
+{
+	int offset = mad_get_field(mad, 0, IB_SA_ATTROFFS_F);
+	return (uint8_t *) mad + IB_SA_DATA_OFFS + i * (offset << 3);
+}
+
+static const char *ib_sa_error_str[] = {
+	"SA_NO_ERROR",
+	"SA_ERR_NO_RESOURCES",
+	"SA_ERR_REQ_INVALID",
+	"SA_ERR_NO_RECORDS",
+	"SA_ERR_TOO_MANY_RECORDS",
+	"SA_ERR_REQ_INVALID_GID",
+	"SA_ERR_REQ_INSUFFICIENT_COMPONENTS",
+	"SA_ERR_REQ_DENIED",
+	"SA_ERR_STATUS_PRIO_SUGGESTED",
+	"SA_ERR_UNKNOWN"
+};
+
+#define ARR_SIZE(a) (sizeof(a)/sizeof((a)[0]))
+#define SA_ERR_UNKNOWN (ARR_SIZE(ib_sa_error_str) - 1)
+
+static inline const char *ib_sa_err_str(IN uint8_t status)
+{
+	if (status > SA_ERR_UNKNOWN)
+		status = SA_ERR_UNKNOWN;
+	return (ib_sa_error_str[status]);
+}
+
+static const char *ib_mad_inv_field_str[] = {
+	"MAD No invalid fields",
+	"MAD Bad version",
+	"MAD Method specified is not supported",
+	"MAD Method/Attribute combination is not supported",
+	"MAD Reserved",
+	"MAD Reserved",
+	"MAD Reserved",
+	"MAD Invalid value in Attribute field(s) or Attribute Modifier"
+	"MAD UNKNOWN ERROR"
+};
+#define MAD_ERR_UNKNOWN (ARR_SIZE(ib_mad_inv_field_str) - 1)
+
+static inline const char *ib_mad_inv_field_err_str(IN uint8_t f)
+{
+	if (f > MAD_ERR_UNKNOWN)
+		f = MAD_ERR_UNKNOWN;
+	return (ib_mad_inv_field_str[f]);
+}
+
+void sa_report_err(int status)
+{
+	int st = status & 0xff;
+	char mad_err_str[64] = { 0 };
+	char sa_err_str[64] = { 0 };
+
+	if (st)
+		sprintf(mad_err_str, " (%s; %s; %s)",
+			(st & 0x1) ? "BUSY" : "",
+			(st & 0x2) ? "Redirection Required" : "",
+			ib_mad_inv_field_err_str(st>>2));
+
+
+	st = status >> 8;
+	if (st)
+		sprintf(sa_err_str, " SA(%s)", ib_sa_err_str((uint8_t) st));
+
+	fprintf(stderr, "ERROR: Query result returned 0x%04x, %s%s\n",
+		status, mad_err_str, sa_err_str);
+}
diff --git a/src/iblinkinfo.c b/src/iblinkinfo.c
index 5a4cfe5..92ff3c6 100644
--- a/src/iblinkinfo.c
+++ b/src/iblinkinfo.c
@@ -629,8 +629,6 @@ int main(int argc, char **argv)
 		 "Output only switches"},
 		{"cas-only", 7, 0, NULL,
 		 "Output only CAs"},
-		{"GNDN", 'R', 0, NULL,
-		 "(This option is obsolete and does nothing)"},
 		{0}
 	};
 	char usage_args[] = "";
@@ -683,11 +681,11 @@ int main(int argc, char **argv)
 
 	if (diff_cache_file &&
 	    !(diff_fabric = ibnd_load_fabric(diff_cache_file, 0)))
-		IBERROR("loading cached fabric for diff failed\n");
+		IBEXIT("loading cached fabric for diff failed\n");
 
 	if (filterdownports_cache_file &&
 	    !(filterdownports_fabric = ibnd_load_fabric(filterdownports_cache_file, 0)))
-		IBERROR("loading cached fabric for filterdownports failed\n");
+		IBEXIT("loading cached fabric for filterdownports failed\n");
 
 	if (load_cache_file) {
 		if ((fabric = ibnd_load_fabric(load_cache_file, 0)) == NULL) {
diff --git a/src/ibnetdiscover.c b/src/ibnetdiscover.c
index b9fb243..0ad5e31 100644
--- a/src/ibnetdiscover.c
+++ b/src/ibnetdiscover.c
@@ -361,6 +361,8 @@ void out_switch_port(ibnd_port_t * port, int group, char *out_prefix)
 					IB_PORT_LINK_WIDTH_ACTIVE_F);
 	uint32_t ispeed = mad_get_field(port->info, 0,
 					IB_PORT_LINK_SPEED_ACTIVE_F);
+	uint32_t vlcap = mad_get_field(port->info, 0,
+				       IB_PORT_VL_CAP_F);
 	uint32_t fdr10 = mad_get_field(port->ext_info, 0,
 				       IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F);
 	uint32_t cap_mask, espeed;
@@ -408,7 +410,7 @@ void out_switch_port(ibnd_port_t * port, int group, char *out_prefix)
 			dump_linkspeedext_compat(espeed, ispeed, fdr10));
 
 	if (full_info)
-		fprintf(f, " s=%d w=%d", ispeed, iwidth);
+		fprintf(f, " s=%d w=%d v=%d", ispeed, iwidth, vlcap);
 
 	if (ibnd_is_xsigo_tca(port->remoteport->guid))
 		fprintf(f, " slot %d", port->portnum);
@@ -427,6 +429,8 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
 					IB_PORT_LINK_WIDTH_ACTIVE_F);
 	uint32_t ispeed = mad_get_field(port->info, 0,
 					IB_PORT_LINK_SPEED_ACTIVE_F);
+	uint32_t vlcap = mad_get_field(port->info, 0,
+				       IB_PORT_VL_CAP_F);
 	uint32_t fdr10 = mad_get_field(port->ext_info, 0,
 				       IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F);
 	uint32_t cap_mask, espeed;
@@ -464,7 +468,7 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
 			dump_linkspeedext_compat(espeed, ispeed, fdr10));
 
 	if (full_info)
-		fprintf(f, " s=%d w=%d", ispeed, iwidth);
+		fprintf(f, " s=%d w=%d v=%d", ispeed, iwidth, vlcap);
 	fprintf(f, "\n");
 
 	free(rem_nodename);
@@ -1063,7 +1067,7 @@ int main(int argc, char **argv)
 	ibnd_fabric_t *diff_fabric = NULL;
 
 	const struct ibdiag_opt opts[] = {
-		{"full", 'f', 0, NULL, "show full information (ports' speed and width)"},
+		{"full", 'f', 0, NULL, "show full information (ports' speed and width, vlcap)"},
 		{"show", 's', 0, NULL, "show more information"},
 		{"list", 'l', 0, NULL, "list of connected nodes"},
 		{"grouping", 'g', 0, NULL, "show grouping"},
@@ -1103,7 +1107,7 @@ int main(int argc, char **argv)
 	config.flags = ibd_ibnetdisc_flags;
 
 	if (argc && !(f = fopen(argv[0], "w")))
-		IBERROR("can't open file %s for writing", argv[0]);
+		IBEXIT("can't open file %s for writing", argv[0]);
 
 	config.mkey = ibd_mkey;
 
@@ -1111,15 +1115,15 @@ int main(int argc, char **argv)
 
 	if (diff_cache_file &&
 	    !(diff_fabric = ibnd_load_fabric(diff_cache_file, 0)))
-		IBERROR("loading cached fabric for diff failed\n");
+		IBEXIT("loading cached fabric for diff failed\n");
 
 	if (load_cache_file) {
 		if ((fabric = ibnd_load_fabric(load_cache_file, 0)) == NULL)
-			IBERROR("loading cached fabric failed\n");
+			IBEXIT("loading cached fabric failed\n");
 	} else {
 		if ((fabric =
 		     ibnd_discover_fabric(ibd_ca, ibd_ca_port, NULL, &config)) == NULL)
-			IBERROR("discover failed\n");
+			IBEXIT("discover failed\n");
 	}
 
 	if (ports_report)
@@ -1133,7 +1137,7 @@ int main(int argc, char **argv)
 
 	if (cache_file)
 		if (ibnd_cache_fabric(fabric, cache_file, 0) < 0)
-			IBERROR("caching ibnetdiscover data failed\n");
+			IBEXIT("caching ibnetdiscover data failed\n");
 
 	ibnd_destroy_fabric(fabric);
 	if (diff_fabric)
diff --git a/src/ibping.c b/src/ibping.c
index beea26d..b697158 100644
--- a/src/ibping.c
+++ b/src/ibping.c
@@ -213,27 +213,27 @@ int main(int argc, char **argv)
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 1);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	if (server) {
 		if (mad_register_server_via(ping_class, 0, 0, oui, srcport) < 0)
-			IBERROR("can't serve class %d on this port",
+			IBEXIT("can't serve class %d on this port",
 				ping_class);
 
 		get_host_and_domain(host_and_domain, sizeof host_and_domain);
 
 		if ((err = ibping_serv()))
-			IBERROR("ibping to %s: %s", portid2str(&portid), err);
+			IBEXIT("ibping to %s: %s", portid2str(&portid), err);
 		exit(0);
 	}
 
 	if (mad_register_client_via(ping_class, 0, srcport) < 0)
-		IBERROR("can't register ping class %d on this port",
+		IBEXIT("can't register ping class %d on this port",
 			ping_class);
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
-		IBERROR("can't resolve destination port %s", argv[0]);
+		IBEXIT("can't resolve destination port %s", argv[0]);
 
 	signal(SIGINT, report);
 	signal(SIGTERM, report);
diff --git a/src/ibportstate.c b/src/ibportstate.c
index 1d8dc81..bf3c00c 100644
--- a/src/ibportstate.c
+++ b/src/ibportstate.c
@@ -68,6 +68,8 @@ enum port_ops {
 	MKEY,
 	MKEYLEASE,
 	MKEYPROT,
+	ON,
+	OFF
 };
 
 struct ibmad_port *srcport;
@@ -108,6 +110,8 @@ struct {
 	{"mkey", &mkey, 0},	/* MKEY */
 	{"mkeylease", &mkeylease, 0},	/* MKEY LEASE */
 	{"mkeyprot", &mkeyprot, 0},	/* MKEY PROTECT BITS */
+	{"on", NULL, 0},	/* ON */
+	{"off", NULL, 0},	/* OFF */
 };
 
 #define NPORT_ARGS (sizeof(port_args) / sizeof(port_args[0]))
@@ -122,7 +126,7 @@ static int get_node_info(ib_portid_t * dest, uint8_t * data)
 	int node_type;
 
 	if (!smp_query_via(data, dest, IB_ATTR_NODE_INFO, 0, 0, srcport))
-		IBERROR("smp query nodeinfo failed");
+		IBEXIT("smp query nodeinfo failed");
 
 	node_type = mad_get_field(data, 0, IB_NODE_TYPE_F);
 	if (node_type == IB_NODE_SWITCH)	/* Switch NodeType ? */
@@ -140,13 +144,13 @@ static int get_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
 
 	if (is_switch) {
 		if (!smp_query_via(smp, dest, IB_ATTR_PORT_INFO, 0, 0, srcport))
-			IBERROR("smp query port 0 portinfo failed");
+			IBEXIT("smp query port 0 portinfo failed");
 		info = smp;
 	} else
 		info = data;
 
 	if (!smp_query_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
-		IBERROR("smp query portinfo failed");
+		IBEXIT("smp query portinfo failed");
 	cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
 	return (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS));
 }
@@ -236,8 +240,13 @@ static void show_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
 static void set_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
 			  int espeed_cap, int is_switch)
 {
-	if (!smp_set_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
-		IBERROR("smp set portinfo failed");
+	unsigned mod;
+
+	mod = portnum;
+	if (espeed_cap)
+		mod |= 1<<31;
+	if (!smp_set_via(data, dest, IB_ATTR_PORT_INFO, mod, 0, srcport))
+		IBEXIT("smp set portinfo failed");
 
 	printf("\nAfter PortInfo set:\n");
 	show_port_info(dest, data, portnum, espeed_cap, is_switch);
@@ -247,7 +256,7 @@ static void get_ext_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
 {
 	if (!smp_query_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO,
 			   portnum, 0, srcport))
-		IBERROR("smp query ext portinfo failed");
+		IBEXIT("smp query ext portinfo failed");
 }
 
 static void show_ext_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
@@ -264,7 +273,7 @@ static void set_ext_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
 {
 	if (!smp_set_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO,
 			 portnum, 0, srcport))
-		IBERROR("smp set ext portinfo failed");
+		IBEXIT("smp set ext portinfo failed");
 
 	printf("\nAfter ExtendedPortInfo set:\n");
 	show_ext_port_info(dest, data, portnum);
@@ -379,7 +388,7 @@ int main(int argc, char **argv)
 	uint64_t val;
 	char *endp;
 	char usage_args[] = "<dest dr_path|lid|guid> <portnum> [<op>]\n"
-	    "\nSupported ops: enable, disable, reset, speed, espeed, fdr10,\n"
+	    "\nSupported ops: enable, disable, on, off, reset, speed, espeed, fdr10,\n"
 	    "\twidth, query, down, arm, active, vls, mtu, lid, smlid, lmc,\n"
 	    "\tmkey, mkeylease, mkeyprot\n";
 	const char *usage_examples[] = {
@@ -404,13 +413,13 @@ int main(int argc, char **argv)
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
-		IBERROR("can't resolve destination port %s", argv[0]);
+		IBEXIT("can't resolve destination port %s", argv[0]);
 
 	if (argc > 1)
 		portnum = strtol(argv[1], 0, 0);
@@ -424,7 +433,7 @@ int main(int argc, char **argv)
 			port_args[j].set = 1;
 			if (!port_args[j].val) {
 				if (port_op >= 0)
-					IBERROR("%s only one of: ",
+					IBEXIT("%s only one of: ",
 						"query, enable, disable, "
 						"reset, down, arm, active, "
 						"can be specified",
@@ -433,46 +442,46 @@ int main(int argc, char **argv)
 				break;
 			}
 			if (++i >= argc)
-				IBERROR("%s requires an additional parameter",
+				IBEXIT("%s requires an additional parameter",
 					port_args[j].name);
 			val = strtoull(argv[i], 0, 0);
 			switch (j) {
 			case SPEED:
 				if (val < 0 || val > 15)
-					IBERROR("invalid speed value %ld", val);
+					IBEXIT("invalid speed value %ld", val);
 				break;
 			case ESPEED:
 				if (val < 0 || val > 31)
-					IBERROR("invalid extended speed value %ld", val);
+					IBEXIT("invalid extended speed value %ld", val);
 				break;
 			case FDR10SPEED:
 				if (val < 0 || val > 1)
-					IBERROR("invalid fdr10 speed value %ld", val);
+					IBEXIT("invalid fdr10 speed value %ld", val);
 				break;
 			case WIDTH:
 				if (val < 0 || (val > 15 && val != 255))
-					IBERROR("invalid width value %ld", val);
+					IBEXIT("invalid width value %ld", val);
 				break;
 			case VLS:
 				if (val <= 0 || val > 5)
-					IBERROR("invalid vls value %ld", val);
+					IBEXIT("invalid vls value %ld", val);
 				break;
 			case MTU:
 				if (val <= 0 || val > 5)
-					IBERROR("invalid mtu value %ld", val);
+					IBEXIT("invalid mtu value %ld", val);
 				break;
 			case LID:
 				if (val <= 0 || val >= 0xC000)
-					IBERROR("invalid lid value 0x%lx", val);
+					IBEXIT("invalid lid value 0x%lx", val);
 				break;
 			case SMLID:
 				if (val <= 0 || val >= 0xC000)
-					IBERROR("invalid smlid value 0x%lx",
+					IBEXIT("invalid smlid value 0x%lx",
 						val);
 				break;
 			case LMC:
 				if (val < 0 || val > 7)
-					IBERROR("invalid lmc value %ld", val);
+					IBEXIT("invalid lmc value %ld", val);
 				break;
 			case MKEY:
 				errno = 0;
@@ -482,25 +491,25 @@ int main(int argc, char **argv)
 					val = strtoull(getpass("New M_Key: "),
 						       &endp, 0);
 					if (errno || *endp != '\0') {
-						IBERROR("Bad new M_Key\n");
+						IBEXIT("Bad new M_Key\n");
 					}
 				}
 				/* All 64-bit values are legal */
 				break;
 			case MKEYLEASE:
 				if (val < 0 || val > 0xFFFF)
-					IBERROR("invalid mkey lease time %ld", val);
+					IBEXIT("invalid mkey lease time %ld", val);
 				break;
 			case MKEYPROT:
 				if (val < 0 || val > 3)
-					IBERROR("invalid mkey protection bit setting %ld", val);
+					IBEXIT("invalid mkey protection bit setting %ld", val);
 			}
 			*port_args[j].val = val;
 			changed = 1;
 			break;
 		}
 		if (j == NPORT_ARGS)
-			IBERROR("invalid operation: %s", argv[i]);
+			IBEXIT("invalid operation: %s", argv[i]);
 	}
 	if (port_op < 0)
 		port_op = QUERY;
@@ -510,7 +519,7 @@ int main(int argc, char **argv)
 
 	if ((port_args[MKEY].set || port_args[MKEYLEASE].set ||
 	     port_args[MKEYPROT].set) && is_switch && portnum != 0)
-		IBERROR("Can't set M_Key fields on switch port != 0");
+		IBEXIT("Can't set M_Key fields on switch port != 0");
 
 	if (port_op != QUERY || changed)
 		printf("Initial %s PortInfo:\n", is_switch ? "Switch" : "CA");
@@ -529,6 +538,8 @@ int main(int argc, char **argv)
 		 * the SMA command will fail due to an invalid LID.
 		 * Set it to something unlikely but valid.
 		 */
+		physstate = mad_get_field(data, 0, IB_PORT_PHYS_STATE_F);
+
 		val = mad_get_field(data, 0, IB_PORT_LID_F);
 		if (!port_args[LID].set && (!val || val == 0xFFFF))
 			mad_set_field(data, 0, IB_PORT_LID_F, 0x1234);
@@ -539,11 +550,18 @@ int main(int argc, char **argv)
 		mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 0);	/* NOP */
 
 		switch (port_op) {
+		case ON:
+			/* Enable only if state is Disable */
+			if(physstate != 3) {
+				printf("Port is already in enable state\n");
+				goto close_port;
+			}
 		case ENABLE:
 		case RESET:
 			/* Polling */
 			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 2);
 			break;
+		case OFF:
 		case DISABLE:
 			printf("Disable may be irreversible\n");
 			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 3);
@@ -643,7 +661,7 @@ int main(int argc, char **argv)
 			/* Set DrSLID to local lid */
 			if (resolve_self(ibd_ca, ibd_ca_port, &selfportid,
 						&selfport, 0) < 0)
-				IBERROR("could not resolve self");
+				IBEXIT("could not resolve self");
 			peerportid.drpath.drslid = (uint16_t) selfportid.lid;
 			peerportid.drpath.drdlid = 0xffff;
 
@@ -727,6 +745,7 @@ int main(int argc, char **argv)
 		}
 	}
 
+close_port:
 	mad_rpc_close_port(srcport);
 	exit(0);
 }
diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
index 076327c..9d9ec45 100644
--- a/src/ibqueryerrors.c
+++ b/src/ibqueryerrors.c
@@ -55,11 +55,14 @@
 #include <infiniband/mad.h>
 
 #include "ibdiag_common.h"
+#include "ibdiag_sa.h"
 
 struct ibmad_port *ibmad_port;
 static char *node_name_map_file = NULL;
 static nn_map_t *node_name_map = NULL;
 static char *load_cache_file = NULL;
+static uint16_t lid2sl_table[sizeof(uint8_t) * 1024 * 48] = { 0 };
+static int obtain_sl = 1;
 
 int data_counters = 0;
 int data_counters_only = 0;
@@ -78,6 +81,8 @@ unsigned clear_errors = 0, clear_counts = 0, details = 0;
 #define PRINT_ROUTER 0x4
 #define PRINT_ALL 0xFF		/* all nodes default flag */
 
+#define DEFAULT_HALF_WORLD_PR_TIMEOUT (3000)
+
 struct {
 	int nodes_checked;
 	int bad_nodes;
@@ -93,6 +98,13 @@ static char *threshold_file = DEF_THRES_FILE;
 uint8_t thresholds[1204] = { 0 };
 char * threshold_str = "";
 
+static unsigned valid_gid(ib_gid_t * gid)
+{
+	ib_gid_t zero_gid;
+	memset(&zero_gid, 0, sizeof zero_gid);
+	return memcmp(&zero_gid, gid, sizeof(*gid));
+}
+
 static void set_thres(char *name, uint32_t val)
 {
 	int f;
@@ -298,6 +310,55 @@ static int print_summary(void)
 	return (summary.bad_ports);
 }
 
+static void insert_lid2sl_table(struct sa_query_result *r)
+{
+    unsigned int i;
+    for (i = 0; i < r->result_cnt; i++) {
+	    ib_path_rec_t *p_pr = (ib_path_rec_t *)sa_get_query_rec(r->p_result_madw, i);
+	    lid2sl_table[cl_ntoh16(p_pr->dlid)] = ib_path_rec_sl(p_pr);
+    }
+}
+
+static int path_record_query(ib_gid_t sgid,uint64_t dguid)
+{
+     ib_path_rec_t pr;
+     ib_net64_t comp_mask = 0;
+     uint8_t reversible = 0;
+     struct sa_handle * h;
+
+     h = sa_get_handle();
+     ibd_timeout = DEFAULT_HALF_WORLD_PR_TIMEOUT;
+     memset(&pr, 0, sizeof(pr));
+
+     CHECK_AND_SET_GID(sgid, pr.sgid, PR, SGID);
+     if(dguid) {
+	     mad_encode_field(sgid.raw, IB_GID_GUID_F, &dguid);
+	     CHECK_AND_SET_GID(sgid, pr.dgid, PR, DGID);
+     }
+
+     CHECK_AND_SET_VAL(1, 8, -1, pr.num_path, PR, NUMBPATH);/*to get only one PathRecord for each source and destination pair*/
+     CHECK_AND_SET_VAL(1, 8, -1, reversible, PR, REVERSIBLE);/*for a reversible path*/
+     pr.num_path |= reversible << 7;
+     struct sa_query_result result;
+     int ret = sa_query(h, IB_MAD_METHOD_GET_TABLE,
+                        (uint16_t)IB_SA_ATTR_PATHRECORD,0,cl_ntoh64(comp_mask),ibd_sakey,
+                        &pr, sizeof(pr), &result);
+     if (ret) {
+             fprintf(stderr, "Query SA failed: %s; sa call path_query failed\n", strerror(ret));
+             return ret;
+     }
+     if (result.status != IB_SA_MAD_STATUS_SUCCESS) {
+             sa_report_err(result.status);
+             ret = EIO;
+             goto Exit;
+     }
+
+     insert_lid2sl_table(&result);
+Exit:
+     sa_free_result_mad(&result);
+     return ret;
+}
+
 static int query_and_dump(char *buf, size_t size, ib_portid_t * portid,
 			  ibnd_node_t * node, char *node_name, int portnum,
 			  const char *attr_name, uint16_t attr_id,
@@ -447,6 +508,8 @@ static int query_cap_mask(ib_portid_t * portid, char *node_name, int portnum,
 	uint8_t pc[1024] = { 0 };
 	uint16_t rc_cap_mask;
 
+	portid->sl = lid2sl_table[portid->lid];
+
 	/* PerfMgt ClassPortInfo is a required attribute */
 	if (!pma_query_via(pc, portid, portnum, ibd_timeout, CLASS_PORT_INFO,
 			   ibmad_port)) {
@@ -474,6 +537,8 @@ static int print_data_cnts(ib_portid_t * portid, uint16_t cap_mask,
 
 	memset(pc, 0, 1024);
 
+	portid->sl = lid2sl_table[portid->lid];
+
 	if (cap_mask & (IB_PM_EXT_WIDTH_SUPPORTED | IB_PM_EXT_WIDTH_NOIETF_SUP)) {
 		if (!pma_query_via(pc, portid, portnum, ibd_timeout,
 				   IB_GSI_PORT_COUNTERS_EXT, ibmad_port)) {
@@ -543,6 +608,8 @@ static int print_errors(ib_portid_t * portid, uint16_t cap_mask,
 	memset(pc, 0, 1024);
 	memset(pce, 0, 1024);
 
+	portid->sl = lid2sl_table[portid->lid];
+
 	if (!pma_query_via(pc, portid, portnum, ibd_timeout,
 			   IB_GSI_PORT_COUNTERS, ibmad_port)) {
 		IBWARN("IB_GSI_PORT_COUNTERS query failed on %s, %s port %d",
@@ -822,6 +889,9 @@ static int process_opt(void *context, int ch, char *optarg)
 	case 9:
 		data_counters_only = 1;
 		break;
+	case 10:
+		obtain_sl = 0;
+		break;
 	case 'G':
 	case 'S':
 		port_guid_str = optarg;
@@ -856,8 +926,11 @@ int main(int argc, char **argv)
 	struct ibnd_config config = { 0 };
 	int resolved = -1;
 	ib_portid_t portid = { 0 };
+	ib_portid_t self_portid = { 0 };
 	int rc = 0;
 	ibnd_fabric_t *fabric = NULL;
+	ib_gid_t self_gid;
+	int port = 0;
 
 	int mgmt_classes[4] = { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS,
 		IB_PERFORMANCE_CLASS
@@ -875,6 +948,7 @@ int main(int argc, char **argv)
 		 "Same as \"-G\" for backward compatibility"},
 		{"Direct", 'D', 1, "<dr_path>",
 		 "report the node containing the port specified by <dr_path>"},
+		{"skip-sl", 10, 0, NULL,"don't obtain SL to all destinations"},
 		{"report-port", 'r', 0, NULL,
 		 "report port link information"},
 		{"threshold-file", 8, 1, NULL,
@@ -912,7 +986,7 @@ int main(int argc, char **argv)
 
 	ibmad_port = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 4);
 	if (!ibmad_port)
-		IBERROR("Failed to open port; %s:%d\n", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open port; %s:%d\n", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(ibmad_port, ibd_mkey);
 
@@ -931,6 +1005,11 @@ int main(int argc, char **argv)
 		exit(-1);
 	}
 
+	if (resolve_self(ibd_ca, ibd_ca_port, &self_portid, &port, &self_gid.raw) < 0) {
+		IBEXIT("can't resolve self port %s", argv[0]);
+		goto close_port;
+	}
+
 	/* limit the scan the fabric around the target */
 	if (dr_path) {
 		if ((resolved =
@@ -945,6 +1024,8 @@ int main(int argc, char **argv)
 					       ibmad_port)) < 0)
 			IBWARN("Failed to resolve %s; attempting full scan",
 			       port_guid_str);
+		if(obtain_sl)
+			lid2sl_table[portid.lid] = portid.sl;
 	}
 
 	if (load_cache_file) {
@@ -994,11 +1075,18 @@ int main(int argc, char **argv)
 
 		port = ibnd_find_port_guid(fabric, port_guid);
 		if (port) {
+			if(obtain_sl)
+				if(path_record_query(self_gid,port->guid))
+					goto destroy_fabric;
 			print_node(port->node, NULL);
 		} else
 			fprintf(stderr, "Failed to find node: %s\n", dr_path);
-	} else
+	} else {
+		if(obtain_sl)
+			if(path_record_query(self_gid,0))
+				goto destroy_fabric;
 		ibnd_iter_nodes(fabric, print_node, NULL);
+	}
 
 	rc = print_summary();
 	if (rc)
diff --git a/src/ibroute.c b/src/ibroute.c
index 06549f5..8e4544e 100644
--- a/src/ibroute.c
+++ b/src/ibroute.c
@@ -54,6 +54,9 @@ struct ibmad_port *srcport;
 
 static int brief, dump_all, multicast;
 
+static char *node_name_map_file = NULL;
+static nn_map_t *node_name_map = NULL;
+
 /*******************************************/
 
 char *check_switch(ib_portid_t * portid, unsigned int *nports, uint64_t * guid,
@@ -143,6 +146,7 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
 	uint32_t mod;
 	unsigned block, i, j, e, nports, cap, chunks, startblock, lastblock,
 	    top;
+	char *mapnd = NULL;
 	int n = 0;
 
 	if ((s = check_switch(portid, &nports, &nodeguid, sw, nd)))
@@ -174,9 +178,11 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
 		endlid = IB_MAX_MCAST_LID;
 	}
 
+	mapnd = remap_node_name(node_name_map, nodeguid, nd);
+
 	printf("Multicast mlids [0x%x-0x%x] of switch %s guid 0x%016" PRIx64
 	       " (%s):\n", startlid, endlid, portid2str(portid), nodeguid,
-	       clean_nodedesc(nd));
+	       mapnd);
 
 	if (brief)
 		printf(" MLid       Port Mask\n");
@@ -204,15 +210,20 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
 	lastblock = endlid / IB_MLIDS_IN_BLOCK;
 	for (block = startblock; block <= lastblock; block++) {
 		for (j = 0; j < chunks; j++) {
+			int status;
 			mod = (block - IB_MIN_MCAST_LID / IB_MLIDS_IN_BLOCK)
 			    | (j << 28);
 
 			DEBUG("reading block %x chunk %d mod %x", block, j,
 			      mod);
-			if (!smp_query_via
+			if (!smp_query_status_via
 			    (mft + j, portid, IB_ATTR_MULTICASTFORWTBL, mod, 0,
-			     srcport))
-				return "multicast forwarding table get failed";
+			     &status, srcport)) {
+				fprintf(stderr, "SubnGet() failed"
+						"; MAD status 0x%x AM 0x%x\n",
+						status, mod);
+				return NULL;
+			}
 		}
 
 		i = block * IB_MLIDS_IN_BLOCK;
@@ -231,6 +242,8 @@ char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
 	}
 
 	printf("%d %smlids dumped \n", n, dump_all ? "" : "valid ");
+
+	free(mapnd);
 	return 0;
 }
 
@@ -241,9 +254,12 @@ int dump_lid(char *str, int strlen, int lid, int valid)
 	uint8_t pi[IB_SMP_DATA_SIZE] = { 0 };
 	ib_portid_t lidport = { 0 };
 	static int last_port_lid, base_port_lid;
-	char ntype[50], sguid[30], desc[64];
+	char ntype[50], sguid[30];
 	static uint64_t portguid;
+	uint64_t nodeguid;
 	int baselid, lmc, type;
+	char *mapnd = NULL;
+	int rc;
 
 	if (brief) {
 		str[0] = 0;
@@ -281,6 +297,7 @@ int dump_lid(char *str, int strlen, int lid, int valid)
 	    !smp_query_via(ni, &lidport, IB_ATTR_NODE_INFO, 0, 100, srcport))
 		return snprintf(str, strlen, ": (unknown node and type)");
 
+	mad_decode_field(ni, IB_NODE_GUID_F, &nodeguid);
 	mad_decode_field(ni, IB_NODE_PORT_GUID_F, &portguid);
 	mad_decode_field(ni, IB_NODE_TYPE_F, &type);
 
@@ -292,13 +309,17 @@ int dump_lid(char *str, int strlen, int lid, int valid)
 		last_port_lid = baselid + (1 << lmc) - 1;
 	}
 
-	return snprintf(str, strlen, ": (%s portguid %s: %s)",
-			mad_dump_val(IB_NODE_TYPE_F, ntype, sizeof ntype,
-				     &type), mad_dump_val(IB_NODE_PORT_GUID_F,
-							  sguid, sizeof sguid,
-							  &portguid),
-			mad_dump_val(IB_NODE_DESC_F, desc, sizeof desc,
-				     clean_nodedesc(nd)));
+	mapnd = remap_node_name(node_name_map, nodeguid, nd);
+ 
+	rc = snprintf(str, strlen, ": (%s portguid %s: '%s')",
+		      mad_dump_val(IB_NODE_TYPE_F, ntype, sizeof ntype,
+				   &type), mad_dump_val(IB_NODE_PORT_GUID_F,
+							sguid, sizeof sguid,
+							&portguid),
+		      mapnd);
+
+	free(mapnd);
+	return rc;
 }
 
 char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
@@ -311,6 +332,7 @@ char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
 	int block, i, e, top;
 	unsigned nports;
 	int n = 0, startblock, endblock;
+	char *mapnd = NULL;
 
 	if ((s = check_switch(portid, &nports, &nodeguid, sw, nd)))
 		return s;
@@ -326,9 +348,11 @@ char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
 		endlid = IB_MAX_UCAST_LID;
 	}
 
+	mapnd = remap_node_name(node_name_map, nodeguid, nd);
+
 	printf("Unicast lids [0x%x-0x%x] of switch %s guid 0x%016" PRIx64
 	       " (%s):\n", startlid, endlid, portid2str(portid), nodeguid,
-	       clean_nodedesc(nd));
+	       mapnd);
 
 	DEBUG("Switch top is 0x%x\n", top);
 
@@ -336,11 +360,16 @@ char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
 	printf("       Port     Info \n");
 	startblock = startlid / IB_SMP_DATA_SIZE;
 	endblock = ALIGN(endlid, IB_SMP_DATA_SIZE) / IB_SMP_DATA_SIZE;
-	for (block = startblock; block <= endblock; block++) {
+	for (block = startblock; block < endblock; block++) {
+		int status;
 		DEBUG("reading block %d", block);
-		if (!smp_query_via(lft, portid, IB_ATTR_LINEARFORWTBL, block,
-				   0, srcport))
-			return "linear forwarding table get failed";
+		if (!smp_query_status_via(lft, portid, IB_ATTR_LINEARFORWTBL, block,
+				   0, &status, srcport)) {
+			fprintf(stderr, "SubnGet() failed"
+					"; MAD status 0x%x AM 0x%x\n",
+					status, block);
+			return NULL;
+		}
 		i = block * IB_SMP_DATA_SIZE;
 		e = i + IB_SMP_DATA_SIZE;
 		if (i < startlid)
@@ -361,6 +390,7 @@ char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
 	}
 
 	printf("%d %slids dumped \n", n, dump_all ? "" : "valid ");
+	free(mapnd);
 	return 0;
 }
 
@@ -376,6 +406,9 @@ static int process_opt(void *context, int ch, char *optarg)
 	case 'n':
 		brief++;
 		break;
+	case 1:
+		node_name_map_file = strdup(optarg);
+		break;
 	default:
 		return -1;
 	}
@@ -395,6 +428,7 @@ int main(int argc, char **argv)
 		{"no_dests", 'n', 0, NULL,
 		 "do not try to resolve destinations"},
 		{"Multicast", 'M', 0, NULL, "show multicast forwarding tables"},
+		{"node-name-map", 1, 1, "<file>", "node name map file"},
 		{0}
 	};
 	char usage_args[] = "[<dest dr_path|lid|guid> [<startlid> [<endlid>]]]";
@@ -428,15 +462,17 @@ int main(int argc, char **argv)
 	if (argc > 2)
 		endlid = strtoul(argv[2], 0, 0);
 
+	node_name_map = open_node_name_map(node_name_map_file);
+
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
-		IBERROR("can't resolve destination port %s", argv[1]);
+		IBEXIT("can't resolve destination port %s", argv[0]);
 
 	if (multicast)
 		err = dump_multicast_tables(&portid, startlid, endlid);
@@ -444,8 +480,9 @@ int main(int argc, char **argv)
 		err = dump_unicast_tables(&portid, startlid, endlid);
 
 	if (err)
-		IBERROR("dump tables: %s", err);
+		IBEXIT("dump tables: %s", err);
 
 	mad_rpc_close_port(srcport);
+	close_node_name_map(node_name_map);
 	exit(0);
 }
diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c
index 39b75c2..46fd6e7 100644
--- a/src/ibsendtrap.c
+++ b/src/ibsendtrap.c
@@ -131,10 +131,10 @@ static int send_trap(const char *name,
 	ib_mad_notice_attr_t notice;
 
 	if (resolve_self(ibd_ca, ibd_ca_port, &selfportid, &selfport, NULL))
-		IBERROR("can't resolve self");
+		IBEXIT("can't resolve self");
 
 	if (resolve_sm_portid(ibd_ca, ibd_ca_port, &sm_port))
-		IBERROR("can't resolve SM destination port");
+		IBEXIT("can't resolve SM destination port");
 
 	memset(&trap_rpc, 0, sizeof(trap_rpc));
 	trap_rpc.mgtclass = IB_SMI_CLASS;
@@ -207,7 +207,7 @@ int main(int argc, char **argv)
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 2);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
diff --git a/src/ibstat.c b/src/ibstat.c
index 665bb0a..37f2361 100644
--- a/src/ibstat.c
+++ b/src/ibstat.c
@@ -314,7 +314,8 @@ int main(int argc, char *argv[])
 		if (i >= n)
 			IBPANIC("'%s' IB device can't be found", argv[0]);
 
-		strncpy(names[i], argv[0], sizeof names[i]);
+		strncpy(names[0], argv[0], sizeof(names[0])-1);
+		names[0][sizeof(names[0])-1] = '\0';
 		n = 1;
 	}
 
@@ -324,16 +325,10 @@ int main(int argc, char *argv[])
 		return 0;
 	}
 
-	if (!list_only && argc) {
-		if (ca_stat(argv[0], dev_port, short_format) < 0)
-			IBPANIC("stat of IB device '%s' failed", argv[0]);
-		return 0;
-	}
-
 	for (i = 0; i < n; i++) {
 		if (list_only)
 			printf("%s\n", names[i]);
-		else if (ca_stat(names[i], -1, short_format) < 0)
+		else if (ca_stat(names[i], dev_port, short_format) < 0)
 			IBPANIC("stat of IB device '%s' failed", names[i]);
 	}
 
diff --git a/src/ibsysstat.c b/src/ibsysstat.c
index d798fe2..ec3b86b 100644
--- a/src/ibsysstat.c
+++ b/src/ibsysstat.c
@@ -63,6 +63,7 @@ typedef struct cpu_info {
 
 static cpu_info cpus[MAX_CPUS];
 static int host_ncpu;
+static int server = 0, oui = IB_OPENIB_OUI;
 
 static int server_respond(void *umad, int size)
 {
@@ -222,7 +223,7 @@ static char *ibsystat(ib_portid_t * portid, int attr)
 	rpc.method = IB_MAD_METHOD_GET;
 	rpc.attr.id = attr;
 	rpc.attr.mod = 0;
-	rpc.oui = IB_OPENIB_OUI;
+	rpc.oui = oui;
 	rpc.timeout = 0;
 	rpc.datasz = IB_VENDOR_RANGE2_DATA_SIZE;
 	rpc.dataoffs = IB_VENDOR_RANGE2_DATA_OFFS;
@@ -270,8 +271,10 @@ int build_cpuinfo(void)
 	while (fgets(line, sizeof(line) - 1, f)) {
 		if (!strncmp(line, "processor\t", 10)) {
 			ncpu++;
-			if (ncpu > MAX_CPUS)
+			if (ncpu > MAX_CPUS) {
+				fclose(f);
 				return MAX_CPUS;
+			}
 			continue;
 		}
 
@@ -293,8 +296,6 @@ int build_cpuinfo(void)
 	return ncpu;
 }
 
-static int server = 0, oui = IB_OPENIB_OUI;
-
 static int process_opt(void *context, int ch, char *optarg)
 {
 	switch (ch) {
@@ -340,30 +341,30 @@ int main(int argc, char **argv)
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	if (server) {
 		if (mad_register_server_via(sysstat_class, 1, 0, oui, srcport) <
 		    0)
-			IBERROR("can't serve class %d", sysstat_class);
+			IBEXIT("can't serve class %d", sysstat_class);
 
 		host_ncpu = build_cpuinfo();
 
 		if ((err = ibsystat_serv()))
-			IBERROR("ibssystat to %s: %s", portid2str(&portid),
+			IBEXIT("ibssystat to %s: %s", portid2str(&portid),
 				err);
 		exit(0);
 	}
 
 	if (mad_register_client_via(sysstat_class, 1, srcport) < 0)
-		IBERROR("can't register to sysstat class %d", sysstat_class);
+		IBEXIT("can't register to sysstat class %d", sysstat_class);
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
-		IBERROR("can't resolve destination port %s", argv[0]);
+		IBEXIT("can't resolve destination port %s", argv[0]);
 
 	if ((err = ibsystat(&portid, attr)))
-		IBERROR("ibsystat to %s: %s", portid2str(&portid), err);
+		IBEXIT("ibsystat to %s: %s", portid2str(&portid), err);
 
 	mad_rpc_close_port(srcport);
 	exit(0);
diff --git a/src/ibtracert.c b/src/ibtracert.c
index 5800e40..d32968b 100644
--- a/src/ibtracert.c
+++ b/src/ibtracert.c
@@ -250,6 +250,13 @@ static int find_route(ib_portid_t * from, ib_portid_t * to, int dump)
 	int maxhops = MAXHOPS;
 	int portnum, outport;
 
+	memset(&fromnode,0,sizeof(Node));
+	memset(&tonode,0,sizeof(Node));
+	memset(&nextnode,0,sizeof(Node));
+	memset(&fromport,0,sizeof(Port));
+	memset(&toport,0,sizeof(Port));
+	memset(&nextport,0,sizeof(Port));
+
 	DEBUG("from %s", portid2str(from));
 
 	if (get_node(&fromnode, &fromport, from) < 0 ||
@@ -502,10 +509,10 @@ static Node *find_mcpath(ib_portid_t * from, int mlid)
 	DEBUG("from %s", portid2str(from));
 
 	if (!(node = calloc(1, sizeof(Node))))
-		IBERROR("out of memory");
+		IBEXIT("out of memory");
 
 	if (!(port = calloc(1, sizeof(Port))))
-		IBERROR("out of memory");
+		IBEXIT("out of memory");
 
 	if (get_node(node, port, from) < 0) {
 		IBWARN("can't reach node %s", portid2str(from));
@@ -568,12 +575,13 @@ static Node *find_mcpath(ib_portid_t * from, int mlid)
 						path->drpath.cnt--;
 				} else {
 					if (!(port = calloc(1, sizeof(Port))))
-						IBERROR("out of memory");
+						IBEXIT("out of memory");
 
 					if (get_port(port, i, path) < 0) {
 						IBWARN
 						    ("can't reach node %s port %d",
 						     portid2str(path), i);
+						free(port);
 						return 0;
 					}
 
@@ -585,15 +593,17 @@ static Node *find_mcpath(ib_portid_t * from, int mlid)
 					link_port(port, node);
 #endif
 
-					if (extend_dpath(&path->drpath, i) < 0)
+					if (extend_dpath(&path->drpath, i) < 0) {
+						free(port);
 						return 0;
+					}
 				}
 
 				if (!(remotenode = calloc(1, sizeof(Node))))
-					IBERROR("out of memory");
+					IBEXIT("out of memory");
 
 				if (!(remoteport = calloc(1, sizeof(Port))))
-					IBERROR("out of memory");
+					IBEXIT("out of memory");
 
 				if (get_node(remotenode, remoteport, path) < 0) {
 					IBWARN
@@ -772,7 +782,7 @@ int main(int argc, char **argv)
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
@@ -780,18 +790,18 @@ int main(int argc, char **argv)
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &src_portid, argv[0],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
-		IBERROR("can't resolve source port %s", argv[0]);
+		IBEXIT("can't resolve source port %s", argv[0]);
 
 	if (resolve_portid_str(ibd_ca, ibd_ca_port, &dest_portid, argv[1],
 			       ibd_dest_type, ibd_sm_id, srcport) < 0)
-		IBERROR("can't resolve destination port %s", argv[1]);
+		IBEXIT("can't resolve destination port %s", argv[1]);
 
 	if (ibd_dest_type == IB_DEST_DRPATH) {
 		if (resolve_lid(&src_portid, NULL) < 0)
-			IBERROR("cannot resolve lid for port \'%s\'",
+			IBEXIT("cannot resolve lid for port \'%s\'",
 				portid2str(&src_portid));
 		if (resolve_lid(&dest_portid, NULL) < 0)
-			IBERROR("cannot resolve lid for port \'%s\'",
+			IBEXIT("cannot resolve lid for port \'%s\'",
 				portid2str(&dest_portid));
 	}
 
@@ -803,14 +813,14 @@ int main(int argc, char **argv)
 	if (ibd_dest_type != IB_DEST_DRPATH) {
 		/* first find a direct path to the src port */
 		if (find_route(&my_portid, &src_portid, 0) < 0)
-			IBERROR("can't find a route to the src port");
+			IBEXIT("can't find a route to the src port");
 
 		src_portid = my_portid;
 	}
 
 	if (!multicast) {
 		if (find_route(&src_portid, &dest_portid, dumplevel) < 0)
-			IBERROR("can't find a route from src to dest");
+			IBEXIT("can't find a route from src to dest");
 		exit(0);
 	} else {
 		if (mlid < 0xc000)
@@ -818,10 +828,10 @@ int main(int argc, char **argv)
 	}
 
 	if (!(target_portguid = find_target_portguid(&dest_portid)))
-		IBERROR("can't reach target lid %d", dest_portid.lid);
+		IBEXIT("can't reach target lid %d", dest_portid.lid);
 
 	if (!(endnode = find_mcpath(&src_portid, mlid)))
-		IBERROR("can't find a multicast route from src to dest");
+		IBEXIT("can't find a multicast route from src to dest");
 
 	/* dump multicast path */
 	dump_mcpath(endnode, dumplevel);
diff --git a/src/perfquery.c b/src/perfquery.c
index 32dd98f..112d92c 100644
--- a/src/perfquery.c
+++ b/src/perfquery.c
@@ -94,6 +94,7 @@ struct perf_count perf_count =
 struct perf_count_ext perf_count_ext = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
 #define ALL_PORTS 0xFF
+#define MAX_PORTS 255
 
 /* Notes: IB semantics is to cap counters if count has exceeded limits.
  * Therefore we must check for overflows and cap the counters if necessary.
@@ -303,7 +304,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 		memset(pc, 0, sizeof(pc));
 		if (!pma_query_via(pc, portid, port, timeout,
 				   IB_GSI_PORT_COUNTERS, srcport))
-			IBERROR("perfquery");
+			IBEXIT("perfquery");
 		if (!(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)) {
 			/* if PortCounters:PortXmitWait not supported clear this counter */
 			VERBOSE("PortXmitWait not indicated"
@@ -332,7 +333,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 		memset(pc, 0, sizeof(pc));
 		if (!pma_query_via(pc, portid, port, timeout,
 				   IB_GSI_PORT_COUNTERS_EXT, srcport))
-			IBERROR("perfextquery");
+			IBEXIT("perfextquery");
 		if (aggregate)
 			aggregate_perfcounters_ext(cap_mask);
 		else
@@ -359,11 +360,11 @@ static void reset_counters(int extended, int timeout, int mask,
 	if (extended != 1) {
 		if (!performance_reset_via(pc, portid, port, mask, timeout,
 					   IB_GSI_PORT_COUNTERS, srcport))
-			IBERROR("perf reset");
+			IBEXIT("perf reset");
 	} else {
 		if (!performance_reset_via(pc, portid, port, mask, timeout,
 					   IB_GSI_PORT_COUNTERS_EXT, srcport))
-			IBERROR("perf ext reset");
+			IBEXIT("perf ext reset");
 	}
 }
 
@@ -371,6 +372,8 @@ static int reset, reset_only, all_ports, loop_ports, port, extended, xmt_sl,
     rcv_sl, xmt_disc, rcv_err, extended_speeds, smpl_ctl, oprcvcounters, flowctlcounters,
     vloppackets, vlopdata, vlxmitflowctlerrors, vlxmitcounters, swportvlcong,
     rcvcc, slrcvfecn, slrcvbecn, xmitcc, vlxmittimecc;
+static int ports[MAX_PORTS];
+static int ports_count;
 
 static void common_func(ib_portid_t * portid, int port_num, int mask,
 			unsigned query, unsigned reset,
@@ -383,7 +386,7 @@ static void common_func(ib_portid_t * portid, int port_num, int mask,
 		memset(pc, 0, sizeof(pc));
 		if (!pma_query_via(pc, portid, port_num, ibd_timeout, attr,
 				   srcport))
-			IBERROR("cannot query %s", name);
+			IBEXIT("cannot query %s", name);
 
 		dump_func(buf, sizeof(buf), pc, sizeof(pc));
 
@@ -394,7 +397,7 @@ static void common_func(ib_portid_t * portid, int port_num, int mask,
 	memset(pc, 0, sizeof(pc));
 	if (reset && !performance_reset_via(pc, portid, port, mask, ibd_timeout,
 					    attr, srcport))
-		IBERROR("cannot reset %s", name);
+		IBEXIT("cannot reset %s", name);
 }
 
 static void xmt_sl_query(ib_portid_t * portid, int port, int mask)
@@ -474,7 +477,7 @@ static void extended_speeds_query(ib_portid_t * portid, int port, uint64_t ext_m
 
 	if ((reset_only || reset) &&
 	    !ext_speeds_reset_via(pc, portid, port, ext_mask, ibd_timeout, srcport))
-		IBERROR("cannot reset PortExtendedSpeedsCounters");
+		IBEXIT("cannot reset PortExtendedSpeedsCounters");
 }
 
 static void oprcvcounters_query(ib_portid_t * portid, int port, int mask)
@@ -563,12 +566,12 @@ static void vlxmittimecc_query(ib_portid_t * portid, int port, int mask)
 
 void dump_portsamples_control(ib_portid_t * portid, int port)
 {
-	char buf[1024];
+	char buf[1280];
 
 	memset(pc, 0, sizeof(pc));
 	if (!pma_query_via(pc, portid, port, ibd_timeout,
 			   IB_GSI_PORT_SAMPLES_CONTROL, srcport))
-		IBERROR("sampctlquery");
+		IBEXIT("sampctlquery");
 
 	mad_dump_portsamples_control(buf, sizeof buf, pc, sizeof pc);
 	printf("# PortSamplesControl: %s port %d\n%s", portid2str(portid),
@@ -656,7 +659,7 @@ static int process_opt(void *context, int ch, char *optarg)
 
 int main(int argc, char **argv)
 {
-	int mgmt_classes[2] = { IB_SA_CLASS, IB_PERFORMANCE_CLASS };
+	int mgmt_classes[3] = { IB_SMI_CLASS, IB_SA_CLASS, IB_PERFORMANCE_CLASS };
 	ib_portid_t portid = { 0 };
 	int mask = 0xffff;
 	uint64_t ext_mask = 0xffffffffffffffffULL;
@@ -666,6 +669,7 @@ int main(int argc, char **argv)
 	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
 	int start_port = 1;
 	int enhancedport0;
+	char *tmpstr;
 	int i;
 
 	const struct ibdiag_opt opts[] = {
@@ -694,7 +698,7 @@ int main(int argc, char **argv)
 		{"Reset_only", 'R', 0, NULL, "only reset counters"},
 		{0}
 	};
-	char usage_args[] = " [<lid|guid> [[port] [reset_mask]]]";
+	char usage_args[] = " [<lid|guid> [[port(s)] [reset_mask]]]";
 	const char *usage_examples[] = {
 		"\t\t# read local port's performance counters",
 		"32 1\t\t# read performance counters from lid 32, port 1",
@@ -707,6 +711,10 @@ int main(int argc, char **argv)
 		"-R -a 32\t# reset performance counters of all ports",
 		"-R 32 2 0x0fff\t# reset only error counters of port 2",
 		"-R 32 2 0xf000\t# reset only non-error counters of port 2",
+		"-a 32 1-10\t# read performance counters from lid 32, port 1-10, aggregate output",
+		"-l 32 1-10\t# read performance counters from lid 32, port 1-10, output each port",
+		"-a 32 1,4,8\t# read performance counters from lid 32, port 1, 4, and 8, aggregate output",
+		"-l 32 1,4,8\t# read performance counters from lid 32, port 1, 4, and 8, output each port",
 		NULL,
 	};
 
@@ -716,39 +724,66 @@ int main(int argc, char **argv)
 	argc -= optind;
 	argv += optind;
 
-	if (argc > 1)
-		port = strtoul(argv[1], 0, 0);
+	if (argc > 1) {
+		if (strchr(argv[1], ',')) {
+			tmpstr = strtok(argv[1], ",");
+			while (tmpstr) {
+				ports[ports_count++] = strtoul(tmpstr, 0, 0);
+				tmpstr = strtok(NULL, ",");
+			}
+			port = ports[0];
+		}
+		else if ((tmpstr = strchr(argv[1], '-'))) {
+			int pmin, pmax;
+
+			*tmpstr = '\0';
+			tmpstr++;
+
+			pmin = strtoul(argv[1], 0, 0);
+			pmax = strtoul(tmpstr, 0, 0);
+
+			if (pmin >= pmax)
+				IBEXIT("max port must be greater than min port in range");
+
+			while (pmin <= pmax)
+				ports[ports_count++] = pmin++;
+
+			port = ports[0];
+		}
+		else
+			port = strtoul(argv[1], 0, 0);
+	}
 	if (argc > 2) {
 		ext_mask = strtoull(argv[2], 0, 0);
 		mask = ext_mask;
 	}
 
-	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 2);
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, ibd_sm_id, srcport) < 0)
-			IBERROR("can't resolve destination port %s", argv[0]);
+			IBEXIT("can't resolve destination port %s", argv[0]);
 	} else {
 		if (resolve_self(ibd_ca, ibd_ca_port, &portid, &port, 0) < 0)
-			IBERROR("can't resolve self port %s", argv[0]);
+			IBEXIT("can't resolve self port %s", argv[0]);
 	}
 
 	/* PerfMgt ClassPortInfo is a required attribute */
 	memset(pc, 0, sizeof(pc));
 	if (!pma_query_via(pc, &portid, port, ibd_timeout, CLASS_PORT_INFO,
 			   srcport))
-		IBERROR("classportinfo query");
+		IBEXIT("classportinfo query");
 	/* ClassPortInfo should be supported as part of libibmad */
 	memcpy(&cap_mask, pc + 2, sizeof(cap_mask));	/* CapabilityMask */
 	if (!(cap_mask & IB_PM_ALL_PORT_SELECT)) {	/* bit 8 is AllPortSelect */
 		if (!all_ports && port == ALL_PORTS)
-			IBERROR("AllPortSelect not supported");
-		if (all_ports)
+			IBEXIT("AllPortSelect not supported");
+		if (all_ports && port == ALL_PORTS)
 			all_ports_loop = 1;
 	}
 
@@ -846,16 +881,16 @@ int main(int argc, char **argv)
 	if (all_ports_loop || (loop_ports && (all_ports || port == ALL_PORTS))) {
 		if (smp_query_via(data, &portid, IB_ATTR_NODE_INFO, 0, 0,
 				  srcport) < 0)
-			IBERROR("smp query nodeinfo failed");
+			IBEXIT("smp query nodeinfo failed");
 		node_type = mad_get_field(data, 0, IB_NODE_TYPE_F);
 		mad_decode_field(data, IB_NODE_NPORTS_F, &num_ports);
 		if (!num_ports)
-			IBERROR("smp query nodeinfo: num ports invalid");
+			IBEXIT("smp query nodeinfo: num ports invalid");
 
 		if (node_type == IB_NODE_SWITCH) {
 			if (smp_query_via(data, &portid, IB_ATTR_SWITCH_INFO,
 					  0, 0, srcport) < 0)
-				IBERROR("smp query nodeinfo failed");
+				IBEXIT("smp query nodeinfo failed");
 			enhancedport0 =
 			    mad_get_field(data, 0, IB_SW_ENHANCED_PORT0_F);
 			if (enhancedport0)
@@ -882,6 +917,19 @@ int main(int argc, char **argv)
 				output_aggregate_perfcounters_ext(&portid,
 								  cap_mask);
 		}
+	} else if (ports_count > 1) {
+		for (i = 0; i < ports_count; i++)
+			dump_perfcounters(extended, ibd_timeout, cap_mask,
+					  &portid, ports[i],
+					  (all_ports && !loop_ports));
+		if (all_ports && !loop_ports) {
+			if (extended != 1)
+				output_aggregate_perfcounters(&portid,
+							      cap_mask);
+			else
+				output_aggregate_perfcounters_ext(&portid,
+								  cap_mask);
+		}
 	} else
 		dump_perfcounters(extended, ibd_timeout, cap_mask, &portid,
 				  port, 0);
@@ -896,6 +944,9 @@ do_reset:
 	if (all_ports_loop || (loop_ports && (all_ports || port == ALL_PORTS))) {
 		for (i = start_port; i <= num_ports; i++)
 			reset_counters(extended, ibd_timeout, mask, &portid, i);
+	} else if (ports_count > 1) {
+		for (i = 0; i < ports_count; i++)
+			reset_counters(extended, ibd_timeout, mask, &portid, ports[i]);
 	} else
 		reset_counters(extended, ibd_timeout, mask, &portid, port);
 
diff --git a/src/saquery.c b/src/saquery.c
index 4ff2f65..837d8ae 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -1,8 +1,8 @@
 /*
  * Copyright (c) 2006,2007 The Regents of the University of California.
  * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2002-2013 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 1996-2013 Intel Corporation. All rights reserved.
  * Copyright (c) 2009 HNR Consulting. All rights reserved.
  *
  * Produced at Lawrence Livermore National Laboratory.
@@ -58,8 +58,17 @@
 #include <complib/cl_nodenamemap.h>
 
 #include "ibdiag_common.h"
+#include "ibdiag_sa.h"
+
+#ifndef IB_PR_COMPMASK_SERVICEID
+#define IB_PR_COMPMASK_SERVICEID (IB_PR_COMPMASK_SERVICEID_MSB | \
+				  IB_PR_COMPMASK_SERVICEID_LSB)
+#endif
+
+#define UMAD_SA_CAP_MASK2_IS_MCAST_TOP_SUP (1 << 3)
 
 struct query_params {
+	uint64_t service_id;
 	ib_gid_t sgid, dgid, gid, mgid;
 	uint16_t slid, dlid, mlid;
 	uint32_t flow_label;
@@ -73,13 +82,14 @@ struct query_params {
 	uint8_t scope;
 	uint8_t join_state;
 	int proxy_join;
+	ib_class_port_info_t cpi;
 };
 
 struct query_cmd {
 	const char *name, *alias;
 	uint16_t query_type;
 	const char *usage;
-	int (*handler) (const struct query_cmd * q, bind_handle_t h,
+	int (*handler) (const struct query_cmd * q, struct sa_handle * h,
 			struct query_params * p, int argc, char *argv[]);
 };
 
@@ -130,7 +140,7 @@ static void print_node_desc(ib_node_record_t * node_record)
 	}
 }
 
-static void dump_node_record(void *data)
+static void dump_node_record(void *data, struct query_params *p)
 {
 	ib_node_record_t *nr = data;
 	ib_node_info_t *ni = &nr->node_info;
@@ -139,7 +149,7 @@ static void dump_node_record(void *data)
 				       (char *)nr->node_desc.description);
 
 	printf("NodeRecord dump:\n"
-	       "\t\tlid.....................0x%X\n"
+	       "\t\tlid.....................%u\n"
 	       "\t\treserved................0x%X\n"
 	       "\t\tbase_version............0x%X\n"
 	       "\t\tclass_version...........0x%X\n"
@@ -194,10 +204,10 @@ static void print_node_record(ib_node_record_t * node_record)
 		break;
 	}
 
-	dump_node_record(node_record);
+	dump_node_record(node_record, 0);
 }
 
-static void dump_path_record(void *data)
+static void dump_path_record(void *data, struct query_params *p)
 {
 	char gid_str[INET6_ADDRSTRLEN];
 	char gid_str2[INET6_ADDRSTRLEN];
@@ -231,11 +241,10 @@ static void dump_path_record(void *data)
 	       p_pr->resv2[3], p_pr->resv2[4], p_pr->resv2[5]);
 }
 
-static void dump_class_port_info(void *data)
+static void dump_class_port_info(ib_class_port_info_t *cpi)
 {
 	char gid_str[INET6_ADDRSTRLEN];
 	char gid_str2[INET6_ADDRSTRLEN];
-	ib_class_port_info_t *cpi = data;
 
 	printf("SA ClassPortInfo:\n"
 	       "\t\tBase version.............%d\n"
@@ -267,7 +276,7 @@ static void dump_class_port_info(void *data)
 	       cl_ntoh32(cpi->trap_qkey));
 }
 
-static void dump_portinfo_record(void *data)
+static void dump_portinfo_record(void *data, struct query_params *p)
 {
 	ib_portinfo_record_t *p_pir = data;
 	const ib_port_info_t *const p_pi = &p_pir->port_info;
@@ -283,13 +292,13 @@ static void dump_portinfo_record(void *data)
 	       cl_ntoh32(p_pi->capability_mask));
 }
 
-static void dump_one_portinfo_record(void *data)
+static void dump_one_portinfo_record(void *data, struct query_params *p)
 {
 	ib_portinfo_record_t *pir = data;
 	ib_port_info_t *pi = &pir->port_info;
 
 	printf("PortInfoRecord dump:\n"
-	       "\tRID:\n"
+	       "\tRID\n"
 	       "\t\tEndPortLid..............%u\n"
 	       "\t\tPortNum.................%u\n"
 	       "\t\tOptions.................0x%x\n"
@@ -298,7 +307,7 @@ static void dump_one_portinfo_record(void *data)
 	dump_portinfo(pi, sizeof(*pi), 2);
 }
 
-static void dump_one_mcmember_record(void *data)
+static void dump_one_mcmember_record(void *data, struct query_params *p)
 {
 	char mgid[INET6_ADDRSTRLEN], gid[INET6_ADDRSTRLEN];
 	ib_member_rec_t *mr = data;
@@ -329,7 +338,7 @@ static void dump_one_mcmember_record(void *data)
 	       flow, hop, scope, join, mr->proxy_join);
 }
 
-static void dump_multicast_group_record(void *data)
+static void dump_multicast_group_record(void *data, struct query_params *p)
 {
 	char gid_str[INET6_ADDRSTRLEN];
 	ib_member_rec_t *p_mcmr = data;
@@ -348,7 +357,8 @@ static void dump_multicast_group_record(void *data)
 }
 
 static void dump_multicast_member_record(ib_member_rec_t *p_mcmr,
-					 struct sa_query_result *nr_result)
+					 struct sa_query_result *nr_result,
+					 struct query_params *params)
 {
 	char gid_str[INET6_ADDRSTRLEN];
 	char gid_str2[INET6_ADDRSTRLEN];
@@ -364,6 +374,8 @@ static void dump_multicast_member_record(ib_member_rec_t *p_mcmr,
 		ib_node_record_t *nr = sa_get_query_rec(nr_result->p_result_madw, i);
 		if (nr->node_info.port_guid ==
 		    p_mcmr->port_gid.unicast.interface_id) {
+			if(node_name != NULL)
+				free(node_name);
 			node_name = remap_node_name(node_name_map,
 						nr->node_info.node_guid,
 						(char *)nr->node_desc.description);
@@ -394,7 +406,7 @@ static void dump_multicast_member_record(ib_member_rec_t *p_mcmr,
 	free(node_name);
 }
 
-static void dump_service_record(void *data)
+static void dump_service_record(void *data, struct query_params *p)
 {
 	char gid[INET6_ADDRSTRLEN];
 	char buf_service_key[35];
@@ -480,7 +492,68 @@ static void dump_service_record(void *data)
 	       cl_ntoh64(p_sr->service_data64[1]));
 }
 
-static void dump_inform_info_record(void *data)
+static void dump_sm_info_record(void *data, struct query_params *p)
+{
+	ib_sminfo_record_t *p_smr = data;
+	const ib_sm_info_t *const p_smi = &p_smr->sm_info;
+	uint8_t priority, state;
+	priority = ib_sminfo_get_priority(p_smi);
+	state = ib_sminfo_get_state(p_smi);
+
+	printf("SMInfoRecord dump:\n"
+	       "\t\tRID\n"
+	       "\t\tLID...................%u\n"
+	       "\t\tSMInfo dump:\n"
+	       "\t\tGUID..................0x%016" PRIx64 "\n"
+	       "\t\tSM_Key................0x%016" PRIx64 "\n"
+	       "\t\tActCount..............%u\n"
+	       "\t\tPriority..............%u\n"
+	       "\t\tSMState...............%u\n",
+	       cl_ntoh16(p_smr->lid),
+	       cl_ntoh64(p_smr->sm_info.guid),
+	       cl_ntoh64(p_smr->sm_info.sm_key),
+	       cl_ntoh32(p_smr->sm_info.act_count),
+	       priority, state);
+}
+
+static void dump_switch_info_record(void *data, struct query_params *p)
+{
+	ib_switch_info_record_t *p_sir = data;
+	uint32_t sa_cap_mask2 = ib_class_cap_mask2(&p->cpi);
+
+	printf("SwitchInfoRecord dump:\n"
+		"\t\tRID\n"
+		"\t\tLID.....................................%u\n"
+		"\t\tSwitchInfo dump:\n"
+		"\t\tLinearFDBCap............................0x%X\n"
+		"\t\tRandomFDBCap............................0x%X\n"
+		"\t\tMulticastFDBCap.........................0x%X\n"
+		"\t\tLinearFDBTop............................0x%X\n"
+		"\t\tDefaultPort.............................%u\n"
+		"\t\tDefaultMulticastPrimaryPort.............%u\n"
+		"\t\tDefaultMulticastNotPrimaryPort..........%u\n"
+		"\t\tLifeTimeValue/PortStateChange/OpSL2VL...0x%X\n"
+		"\t\tLIDsPerPort.............................0x%X\n"
+		"\t\tPartitionEnforcementCap.................0x%X\n"
+		"\t\tflags...................................0x%X\n",
+		cl_ntoh16(p_sir->lid),
+		cl_ntoh16(p_sir->switch_info.lin_cap),
+		cl_ntoh16(p_sir->switch_info.rand_cap),
+		cl_ntoh16(p_sir->switch_info.mcast_cap),
+		cl_ntoh16(p_sir->switch_info.lin_top),
+		p_sir->switch_info.def_port,
+		p_sir->switch_info.def_mcast_pri_port,
+		p_sir->switch_info.def_mcast_not_port,
+		p_sir->switch_info.life_state,
+		cl_ntoh16(p_sir->switch_info.lids_per_port),
+		cl_ntoh16(p_sir->switch_info.enforce_cap),
+		p_sir->switch_info.flags);
+	if (sa_cap_mask2 & UMAD_SA_CAP_MASK2_IS_MCAST_TOP_SUP)
+		printf("\t\tMulticastFDBTop.........................0x%X\n",
+		       cl_ntoh16(p_sir->switch_info.mcast_top));
+}
+
+static void dump_inform_info_record(void *data, struct query_params *p)
 {
 	char gid_str[INET6_ADDRSTRLEN];
 	char gid_str2[INET6_ADDRSTRLEN];
@@ -566,7 +639,7 @@ static void dump_inform_info_record(void *data)
 	}
 }
 
-static void dump_one_link_record(void *data)
+static void dump_one_link_record(void *data, struct query_params *p)
 {
 	ib_link_record_t *lr = data;
 	printf("LinkRecord dump:\n"
@@ -578,7 +651,7 @@ static void dump_one_link_record(void *data)
 	       lr->to_port_num, cl_ntoh16(lr->to_lid));
 }
 
-static void dump_one_slvl_record(void *data)
+static void dump_one_slvl_record(void *data, struct query_params *p)
 {
 	ib_slvl_table_record_t *slvl = data;
 	ib_slvl_table_t *t = &slvl->slvl_tbl;
@@ -600,7 +673,7 @@ static void dump_one_slvl_record(void *data)
 	       ib_slvl_table_get(t, 14), ib_slvl_table_get(t, 15));
 }
 
-static void dump_one_vlarb_record(void *data)
+static void dump_one_vlarb_record(void *data, struct query_params *p)
 {
 	ib_vl_arb_table_record_t *vlarb = data;
 	ib_vl_arb_element_t *e = vlarb->vl_arb_tbl.vl_entry;
@@ -627,7 +700,7 @@ static void dump_one_vlarb_record(void *data)
 		       e[i + 15].weight);
 }
 
-static void dump_one_pkey_tbl_record(void *data)
+static void dump_one_pkey_tbl_record(void *data, struct query_params *params)
 {
 	ib_pkey_table_record_t *pktr = data;
 	ib_net16_t *p = pktr->pkey_tbl.pkey_entry;
@@ -648,7 +721,7 @@ static void dump_one_pkey_tbl_record(void *data)
 	printf("\n");
 }
 
-static void dump_one_lft_record(void *data)
+static void dump_one_lft_record(void *data, struct query_params *p)
 {
 	ib_lft_record_t *lftr = data;
 	unsigned block = cl_ntoh16(lftr->block_num);
@@ -662,7 +735,7 @@ static void dump_one_lft_record(void *data)
 	printf("\n");
 }
 
-static void dump_one_guidinfo_record(void *data)
+static void dump_one_guidinfo_record(void *data, struct query_params *p)
 {
 	ib_guidinfo_record_t *gir = data;
 	printf("GUIDInfo Record dump:\n"
@@ -687,7 +760,7 @@ static void dump_one_guidinfo_record(void *data)
 	       cl_ntoh64(gir->guid_info.guid[7]));
 }
 
-static void dump_one_mft_record(void *data)
+static void dump_one_mft_record(void *data, struct query_params *p)
 {
 	ib_mft_record_t *mftr = data;
 	unsigned position = cl_ntoh16(mftr->position_block_num) >> 12;
@@ -709,19 +782,21 @@ static void dump_one_mft_record(void *data)
 	printf("\n");
 }
 
-static void dump_results(struct sa_query_result *r, void (*dump_func) (void *))
+static void dump_results(struct sa_query_result *r,
+			 void (*dump_func) (void *, struct query_params *),
+			 struct query_params *p)
 {
 	unsigned i;
 	for (i = 0; i < r->result_cnt; i++) {
 		void *data = sa_get_query_rec(r->p_result_madw, i);
-		dump_func(data);
+		dump_func(data, p);
 	}
 }
 
 /**
  * Get any record(s)
  */
-static int get_any_records(bind_handle_t h,
+static int get_any_records(struct sa_handle * h,
 			   uint16_t attr_id, uint32_t attr_mod,
 			   ib_net64_t comp_mask, void *attr,
 			   size_t attr_size,
@@ -742,11 +817,13 @@ static int get_any_records(bind_handle_t h,
 	return ret;
 }
 
-static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
+static int get_and_dump_any_records(struct sa_handle * h, uint16_t attr_id,
 				    uint32_t attr_mod, ib_net64_t comp_mask,
 				    void *attr,
 				    size_t attr_size,
-				    void (*dump_func) (void *))
+				    void (*dump_func) (void *,
+				    		       struct query_params *),
+				    struct query_params *p)
 {
 	struct sa_query_result result;
 	int ret = get_any_records(h, attr_id, attr_mod, comp_mask, attr,
@@ -754,7 +831,7 @@ static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
 	if (ret)
 		return ret;
 
-	dump_results(&result, dump_func);
+	dump_results(&result, dump_func, p);
 	sa_free_result_mad(&result);
 	return 0;
 }
@@ -762,21 +839,23 @@ static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
 /**
  * Get all the records available for requested query type.
  */
-static int get_all_records(bind_handle_t h, uint16_t attr_id,
+static int get_all_records(struct sa_handle * h, uint16_t attr_id,
 			   struct sa_query_result *result)
 {
 	return get_any_records(h, attr_id, 0, 0, NULL, 0, result);
 }
 
-static int get_and_dump_all_records(bind_handle_t h, uint16_t attr_id,
-				    void (*dump_func) (void *))
+static int get_and_dump_all_records(struct sa_handle * h, uint16_t attr_id,
+				    void (*dump_func) (void *,
+						       struct query_params *p),
+				    struct query_params *p)
 {
 	struct sa_query_result result;
 	int ret = get_all_records(h, attr_id, &result);
 	if (ret)
 		return ret;
 
-	dump_results(&result, dump_func);
+	dump_results(&result, dump_func, p);
 	sa_free_result_mad(&result);
 	return ret;
 }
@@ -784,10 +863,9 @@ static int get_and_dump_all_records(bind_handle_t h, uint16_t attr_id,
 /**
  * return the lid from the node descriptor (name) supplied
  */
-static int get_lid_from_name(bind_handle_t h, const char *name, uint16_t * lid)
+static int get_lid_from_name(struct sa_handle * h, const char *name, uint16_t * lid)
 {
 	ib_node_record_t *node_record = NULL;
-	ib_node_info_t *p_ni = NULL;
 	unsigned i;
 	int ret;
 	struct sa_query_result result;
@@ -799,7 +877,6 @@ static int get_lid_from_name(bind_handle_t h, const char *name, uint16_t * lid)
 	ret = ENONET;
 	for (i = 0; i < result.result_cnt; i++) {
 		node_record = sa_get_query_rec(result.p_result_madw, i);
-		p_ni = &(node_record->node_info);
 		if (name
 		    && strncmp(name, (char *)node_record->node_desc.description,
 			       sizeof(node_record->node_desc.description)) ==
@@ -813,7 +890,7 @@ static int get_lid_from_name(bind_handle_t h, const char *name, uint16_t * lid)
 	return ret;
 }
 
-static uint16_t get_lid(bind_handle_t h, const char *name)
+static uint16_t get_lid(struct sa_handle * h, const char *name)
 {
 	int rc = 0;
 	uint16_t rc_lid = 0;
@@ -840,7 +917,17 @@ static uint16_t get_lid(bind_handle_t h, const char *name)
 	return rc_lid;
 }
 
-static int parse_lid_and_ports(bind_handle_t h,
+static int parse_iir_subscriber_gid(char *str, ib_inform_info_record_t *ir)
+{
+       int rc = inet_pton(AF_INET6,str,&(ir->subscriber_gid.raw));
+       if(rc < 1){
+          fprintf(stderr, "Invalid SubscriberGID specified: \"%s\"\n",str);
+          exit(EINVAL);
+       }
+       return rc;
+}
+
+static int parse_lid_and_ports(struct sa_handle * h,
 			       char *str, int *lid, int *port1, int *port2)
 {
 	char *p, *e;
@@ -883,7 +970,7 @@ static int parse_lid_and_ports(bind_handle_t h,
 /*
  * Get the portinfo records available with IsSM or IsSMdisabled CapabilityMask bit on.
  */
-static int get_issm_records(bind_handle_t h, ib_net32_t capability_mask,
+static int get_issm_records(struct sa_handle * h, ib_net32_t capability_mask,
 			    struct sa_query_result *result)
 {
 	ib_portinfo_record_t attr;
@@ -895,7 +982,7 @@ static int get_issm_records(bind_handle_t h, ib_net32_t capability_mask,
 			       IB_PIR_COMPMASK_CAPMASK, &attr, sizeof(attr), result);
 }
 
-static int print_node_records(bind_handle_t h)
+static int print_node_records(struct sa_handle * h, struct query_params *p)
 {
 	unsigned i;
 	int ret;
@@ -923,10 +1010,22 @@ static int print_node_records(bind_handle_t h)
 			if (requested_guid == cl_ntoh64(p_ni->port_guid))
 				print_node_record(node_record);
 		} else {
+			ib_node_info_t *p_ni = &(node_record->node_info);
+			ib_node_desc_t *p_nd = &(node_record->node_desc);
+			char *name;
+
+			name = remap_node_name (node_name_map,
+						cl_ntoh64(p_ni->node_guid),
+						(char *)p_nd->description);
+
 			if (!requested_name ||
 			    (strncmp(requested_name,
 				     (char *)node_record->node_desc.description,
 				     sizeof(node_record->
+					    node_desc.description)) == 0) ||
+			    (strncmp(requested_name,
+				     name,
+				     sizeof(node_record->
 					    node_desc.description)) == 0)) {
 				print_node_record(node_record);
 				if (node_print_desc == UNIQUE_LID_ONLY) {
@@ -934,33 +1033,15 @@ static int print_node_records(bind_handle_t h)
 					exit(0);
 				}
 			}
-		}
-	}
-	sa_free_result_mad(&result);
-	return ret;
-}
 
-static int get_print_class_port_info(bind_handle_t h)
-{
-	struct sa_query_result result;
-	int ret = sa_query(h, IB_MAD_METHOD_GET, CLASS_PORT_INFO, 0, 0,
-			   ibd_sakey, NULL, 0, &result);
-	if (ret) {
-		fprintf(stderr, "ERROR: Query SA failed: %s\n", strerror(ret));
-		return ret;
-	}
-	if (result.status != IB_SA_MAD_STATUS_SUCCESS) {
-		sa_report_err(result.status);
-		ret = EIO;
-		goto Exit;
+			free(name);
+		}
 	}
-	dump_results(&result, dump_class_port_info);
-Exit:
 	sa_free_result_mad(&result);
 	return ret;
 }
 
-static int query_path_records(const struct query_cmd *q, bind_handle_t h,
+static int query_path_records(const struct query_cmd *q, struct sa_handle * h,
 			      struct query_params *p, int argc, char *argv[])
 {
 	ib_path_rec_t pr;
@@ -970,6 +1051,7 @@ static int query_path_records(const struct query_cmd *q, bind_handle_t h,
 	uint8_t reversible = 0;
 
 	memset(&pr, 0, sizeof(pr));
+	CHECK_AND_SET_VAL(p->service_id, 64, 0, pr.service_id, PR, SERVICEID);
 	CHECK_AND_SET_GID(p->sgid, pr.sgid, PR, SGID);
 	CHECK_AND_SET_GID(p->dgid, pr.dgid, PR, DGID);
 	CHECK_AND_SET_VAL(p->slid, 16, 0, pr.slid, PR, SLID);
@@ -991,10 +1073,10 @@ static int query_path_records(const struct query_cmd *q, bind_handle_t h,
 				  SELEC);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_PATHRECORD, 0, comp_mask,
-					&pr, sizeof(pr), dump_path_record);
+					&pr, sizeof(pr), dump_path_record, p);
 }
 
-static int print_issm_records(bind_handle_t h)
+static int print_issm_records(struct sa_handle * h, struct query_params *p)
 {
 	struct sa_query_result result;
 	int ret = 0;
@@ -1005,7 +1087,7 @@ static int print_issm_records(bind_handle_t h)
 		return (ret);
 
 	printf("IsSM ports\n");
-	dump_results(&result, dump_portinfo_record);
+	dump_results(&result, dump_portinfo_record, p);
 	sa_free_result_mad(&result);
 
 	/* Now, get IsSMdisabled records */
@@ -1014,13 +1096,14 @@ static int print_issm_records(bind_handle_t h)
 		return (ret);
 
 	printf("\nIsSMdisabled ports\n");
-	dump_results(&result, dump_portinfo_record);
+	dump_results(&result, dump_portinfo_record, p);
 	sa_free_result_mad(&result);
 
 	return (ret);
 }
 
-static int print_multicast_member_records(bind_handle_t h)
+static int print_multicast_member_records(struct sa_handle * h,
+					struct query_params *params)
 {
 	struct sa_query_result mc_group_result;
 	struct sa_query_result nr_result;
@@ -1039,7 +1122,7 @@ static int print_multicast_member_records(bind_handle_t h)
 		ib_member_rec_t *rec = (ib_member_rec_t *)
 				sa_get_query_rec(mc_group_result.p_result_madw,
 					      i);
-		dump_multicast_member_record(rec, &nr_result);
+		dump_multicast_member_record(rec, &nr_result, params);
 	}
 
 	sa_free_result_mad(&nr_result);
@@ -1050,19 +1133,21 @@ return_mc:
 	return ret;
 }
 
-static int print_multicast_group_records(bind_handle_t h)
+static int print_multicast_group_records(struct sa_handle * h,
+					 struct query_params *p)
 {
 	return get_and_dump_all_records(h, IB_SA_ATTR_MCRECORD,
-					dump_multicast_group_record);
+					dump_multicast_group_record, p);
 }
 
-static int query_class_port_info(const struct query_cmd *q, bind_handle_t h,
+static int query_class_port_info(const struct query_cmd *q, struct sa_handle * h,
 				 struct query_params *p, int argc, char *argv[])
 {
-	return get_print_class_port_info(h);
+	dump_class_port_info(&p->cpi);
+	return (0);
 }
 
-static int query_node_records(const struct query_cmd *q, bind_handle_t h,
+static int query_node_records(const struct query_cmd *q, struct sa_handle * h,
 			      struct query_params *p, int argc, char *argv[])
 {
 	ib_node_record_t nr;
@@ -1076,11 +1161,11 @@ static int query_node_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(lid, 16, 0, nr.lid, NR, LID);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_NODERECORD, 0, comp_mask,
-					&nr, sizeof(nr), dump_node_record);
+					&nr, sizeof(nr), dump_node_record, p);
 }
 
 static int query_portinfo_records(const struct query_cmd *q,
-				  bind_handle_t h, struct query_params *p,
+				  struct sa_handle * h, struct query_params *p,
 				  int argc, char *argv[])
 {
 	ib_portinfo_record_t pir;
@@ -1097,11 +1182,11 @@ static int query_portinfo_records(const struct query_cmd *q,
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_PORTINFORECORD, 0,
 					comp_mask, &pir, sizeof(pir),
-					dump_one_portinfo_record);
+					dump_one_portinfo_record, p);
 }
 
 static int query_mcmember_records(const struct query_cmd *q,
-				  bind_handle_t h, struct query_params *p,
+				  struct sa_handle * h, struct query_params *p,
 				  int argc, char *argv[])
 {
 	ib_member_rec_t mr;
@@ -1129,25 +1214,75 @@ static int query_mcmember_records(const struct query_cmd *q,
 	CHECK_AND_SET_VAL(p->proxy_join, 8, -1, mr.proxy_join, MCR, PROXY);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_MCRECORD, 0, comp_mask,
-					&mr, sizeof(mr), dump_one_mcmember_record);
+					&mr, sizeof(mr), dump_one_mcmember_record, p);
 }
 
-static int query_service_records(const struct query_cmd *q, bind_handle_t h,
+static int query_service_records(const struct query_cmd *q, struct sa_handle * h,
 				 struct query_params *p, int argc, char *argv[])
 {
 	return get_and_dump_all_records(h, IB_SA_ATTR_SERVICERECORD,
-					dump_service_record);
+					dump_service_record, p);
 }
 
-static int query_informinfo_records(const struct query_cmd *q,
-				    bind_handle_t h, struct query_params *p,
+static int query_sm_info_records(const struct query_cmd *q,
+				 struct sa_handle * h, struct query_params *p,
+				 int argc, char *argv[])
+{
+	ib_sminfo_record_t smir;
+	ib_net64_t comp_mask = 0;
+	int lid = 0;
+
+	if (argc > 0)
+		parse_lid_and_ports(h, argv[0], &lid, NULL, NULL);
+
+	memset(&smir, 0, sizeof(smir));
+	CHECK_AND_SET_VAL(lid, 16, 0, smir.lid, SMIR, LID);
+
+	return get_and_dump_any_records(h, IB_SA_ATTR_SMINFORECORD, 0,
+					comp_mask, &smir, sizeof(smir),
+					dump_sm_info_record, p);
+}
+
+static int query_switchinfo_records(const struct query_cmd *q,
+				struct sa_handle * h, struct query_params *p,
+				int argc, char *argv[])
+{
+	ib_switch_info_record_t swir;
+	ib_net64_t comp_mask = 0;
+	int lid = 0;
+
+	if (argc > 0)
+		parse_lid_and_ports(h, argv[0], &lid, NULL, NULL);
+
+	memset(&swir, 0, sizeof(swir));
+	CHECK_AND_SET_VAL(lid, 16, 0, swir.lid, SWIR, LID);
+
+	return get_and_dump_any_records(h, IB_SA_ATTR_SWITCHINFORECORD, 0,
+					comp_mask, &swir, sizeof(swir),
+					dump_switch_info_record, p);
+}
+
+static int query_inform_info_records(const struct query_cmd *q,
+				    struct sa_handle * h, struct query_params *p,
 				    int argc, char *argv[])
 {
-	return get_and_dump_all_records(h, IB_SA_ATTR_INFORMINFORECORD,
-					dump_inform_info_record);
+       int rc = 0;
+       ib_inform_info_record_t ir;
+       ib_net64_t comp_mask = 0;
+       memset(&ir, 0, sizeof(ir));
+
+       if (argc > 0) {
+           comp_mask = IB_IIR_COMPMASK_SUBSCRIBERGID;
+           if((rc = parse_iir_subscriber_gid(argv[0], &ir)) < 1)
+                 return rc;
+       }
+
+       return get_and_dump_any_records(h, IB_SA_ATTR_INFORMINFORECORD, 0, comp_mask,
+				       &ir, sizeof(ir), dump_inform_info_record, p);
+
 }
 
-static int query_link_records(const struct query_cmd *q, bind_handle_t h,
+static int query_link_records(const struct query_cmd *q, struct sa_handle * h,
 			      struct query_params *p, int argc, char *argv[])
 {
 	ib_link_record_t lr;
@@ -1167,10 +1302,10 @@ static int query_link_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(to_port, 8, -1, lr.to_port_num, LR, TO_PORT);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_LINKRECORD, 0, comp_mask,
-					&lr, sizeof(lr), dump_one_link_record);
+					&lr, sizeof(lr), dump_one_link_record, p);
 }
 
-static int query_sl2vl_records(const struct query_cmd *q, bind_handle_t h,
+static int query_sl2vl_records(const struct query_cmd *q, struct sa_handle * h,
 			       struct query_params *p, int argc, char *argv[])
 {
 	ib_slvl_table_record_t slvl;
@@ -1187,10 +1322,10 @@ static int query_sl2vl_records(const struct query_cmd *q, bind_handle_t h,
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_SL2VLTABLERECORD, 0,
 					comp_mask, &slvl, sizeof(slvl),
-					dump_one_slvl_record);
+					dump_one_slvl_record, p);
 }
 
-static int query_vlarb_records(const struct query_cmd *q, bind_handle_t h,
+static int query_vlarb_records(const struct query_cmd *q, struct sa_handle * h,
 			       struct query_params *p, int argc, char *argv[])
 {
 	ib_vl_arb_table_record_t vlarb;
@@ -1207,11 +1342,11 @@ static int query_vlarb_records(const struct query_cmd *q, bind_handle_t h,
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_VLARBTABLERECORD, 0,
 					comp_mask, &vlarb, sizeof(vlarb),
-					dump_one_vlarb_record);
+					dump_one_vlarb_record, p);
 }
 
 static int query_pkey_tbl_records(const struct query_cmd *q,
-				  bind_handle_t h, struct query_params *p,
+				  struct sa_handle * h, struct query_params *p,
 				  int argc, char *argv[])
 {
 	ib_pkey_table_record_t pktr;
@@ -1228,10 +1363,10 @@ static int query_pkey_tbl_records(const struct query_cmd *q,
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_PKEYTABLERECORD, 0,
 					comp_mask, &pktr, sizeof(pktr),
-					dump_one_pkey_tbl_record);
+					dump_one_pkey_tbl_record, p);
 }
 
-static int query_lft_records(const struct query_cmd *q, bind_handle_t h,
+static int query_lft_records(const struct query_cmd *q, struct sa_handle * h,
 			     struct query_params *p, int argc, char *argv[])
 {
 	ib_lft_record_t lftr;
@@ -1246,10 +1381,10 @@ static int query_lft_records(const struct query_cmd *q, bind_handle_t h,
 	CHECK_AND_SET_VAL(block, 16, -1, lftr.block_num, LFTR, BLOCK);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_LFTRECORD, 0, comp_mask,
-					&lftr, sizeof(lftr), dump_one_lft_record);
+					&lftr, sizeof(lftr), dump_one_lft_record, p);
 }
 
-static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
+static int query_guidinfo_records(const struct query_cmd *q, struct sa_handle * h,
 				  struct query_params *p, int argc, char *argv[])
 {
 	ib_guidinfo_record_t gir;
@@ -1265,10 +1400,10 @@ static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_GUIDINFORECORD, 0,
 					comp_mask, &gir, sizeof(gir),
-					dump_one_guidinfo_record);
+					dump_one_guidinfo_record, p);
 }
 
-static int query_mft_records(const struct query_cmd *q, bind_handle_t h,
+static int query_mft_records(const struct query_cmd *q, struct sa_handle * h,
 			     struct query_params *p, int argc, char *argv[])
 {
 	ib_mft_record_t mftr;
@@ -1287,7 +1422,30 @@ static int query_mft_records(const struct query_cmd *q, bind_handle_t h,
 	mftr.position_block_num |= cl_hton16(pos << 12);
 
 	return get_and_dump_any_records(h, IB_SA_ATTR_MFTRECORD, 0, comp_mask,
-					&mftr, sizeof(mftr), dump_one_mft_record);
+					&mftr, sizeof(mftr), dump_one_mft_record, p);
+}
+
+static int query_sa_cpi(struct sa_handle *h, struct query_params *query_params)
+{
+	ib_class_port_info_t *cpi;
+	struct sa_query_result result;
+	int ret = sa_query(h, IB_MAD_METHOD_GET, CLASS_PORT_INFO, 0, 0,
+		       ibd_sakey, NULL, 0, &result);
+	if (ret) {
+		fprintf(stderr, "ERROR: Query SA failed: %s\n", strerror(ret));
+		return ret;
+	}
+
+	if (result.status != IB_SA_MAD_STATUS_SUCCESS) {
+		sa_report_err(result.status);
+		ret = EIO;
+		goto Exit;
+	}
+	cpi = sa_get_query_rec(result.p_result_madw, 0);
+	memcpy(&query_params->cpi, cpi, sizeof(query_params->cpi));
+Exit:
+	sa_free_result_mad(&result);
+	return (0);
 }
 
 static const struct query_cmd query_cmds[] = {
@@ -1304,7 +1462,7 @@ static const struct query_cmd query_cmds[] = {
 	{"VLArbitrationTableRecord", "VLAR", IB_SA_ATTR_VLARBTABLERECORD,
 	 "[[lid]/[port]/[block]]", query_vlarb_records},
 	{"InformInfoRecord", "IIR", IB_SA_ATTR_INFORMINFORECORD,
-	 NULL, query_informinfo_records},
+	 "[subscriber_gid]", query_inform_info_records},
 	{"LinkRecord", "LR", IB_SA_ATTR_LINKRECORD,
 	 "[[from_lid]/[from_port]] [[to_lid]/[to_port]]", query_link_records},
 	{"ServiceRecord", "SR", IB_SA_ATTR_SERVICERECORD,
@@ -1319,6 +1477,10 @@ static const struct query_cmd query_cmds[] = {
 	 "[[mlid]/[position]/[block]]", query_mft_records},
 	{"GUIDInfoRecord", "GIR", IB_SA_ATTR_GUIDINFORECORD,
 	 "[[lid]/[block]]", query_guidinfo_records},
+	{"SwitchInfoRecord", "SWIR", IB_SA_ATTR_SWITCHINFORECORD,
+	 "[lid]", query_switchinfo_records},
+	{"SMInfoRecord", "SMIR", IB_SA_ATTR_SMINFORECORD,
+	 "[lid]", query_sm_info_records},
 	{0}
 };
 
@@ -1528,6 +1690,9 @@ static int process_opt(void *context, int ch, char *optarg)
 	case 'X':
 		p->proxy_join = strtoul(optarg, NULL, 0);
 		break;
+	case 22:
+		p->service_id = strtoull(optarg, NULL, 0);
+		break;
 	default:
 		return -1;
 	}
@@ -1536,8 +1701,9 @@ static int process_opt(void *context, int ch, char *optarg)
 
 int main(int argc, char **argv)
 {
+	int sa_cpi_required = 0;
 	char usage_args[1024];
-	bind_handle_t h;
+	struct sa_handle * h;
 	struct query_params params;
 	const struct query_cmd *q;
 	int status;
@@ -1610,6 +1776,7 @@ int main(int argc, char **argv)
 		{"scope", 21, 1, NULL, "Scope (MCMemberRecord)"},
 		{"join_state", 'J', 1, NULL, "Join state (MCMemberRecord)"},
 		{"proxy_join", 'X', 1, NULL, "Proxy join (MCMemberRecord)"},
+		{"service_id", 22, 1, NULL, "ServiceID (PathRecord)"},
 		{0}
 	};
 
@@ -1687,7 +1854,10 @@ int main(int argc, char **argv)
 		ibdiag_show_usage();
 	}
 
-	h = sa_get_bind_handle();
+	if (umad_init())
+		IBEXIT("Failed to initialized umad library");
+
+	h = sa_get_handle();
 	if (!h)
 		IBPANIC("Failed to bind to the SA");
 
@@ -1698,21 +1868,31 @@ int main(int argc, char **argv)
 	if (dst_lid && *dst_lid)
 		params.dlid = get_lid(h, dst_lid);
 
+	if (command == SAQUERY_CMD_CLASS_PORT_INFO ||
+	    query_type == IB_SA_ATTR_SWITCHINFORECORD)
+		sa_cpi_required = 1;
+
+	if (sa_cpi_required && (status = query_sa_cpi(h, &params)) != 0) {
+		fprintf(stderr, "Failed to query SA:ClassPortInfo\n");
+		goto error;
+	}
+
 	switch (command) {
 	case SAQUERY_CMD_NODE_RECORD:
-		status = print_node_records(h);
+		status = print_node_records(h, &params);
 		break;
 	case SAQUERY_CMD_CLASS_PORT_INFO:
-		status = get_print_class_port_info(h);
+		dump_class_port_info(&params.cpi);
+		status = 0;
 		break;
 	case SAQUERY_CMD_ISSM:
-		status = print_issm_records(h);
+		status = print_issm_records(h, &params);
 		break;
 	case SAQUERY_CMD_MCGROUPS:
-		status = print_multicast_group_records(h);
+		status = print_multicast_group_records(h, &params);
 		break;
 	case SAQUERY_CMD_MCMEMBERS:
-		status = print_multicast_member_records(h);
+		status = print_multicast_member_records(h, &params);
 		break;
 	default:
 		if ((!q && !(q = find_query_by_type(query_type)))
@@ -1725,9 +1905,11 @@ int main(int argc, char **argv)
 		break;
 	}
 
+error:
 	if (src_lid)
 		free(src_lid);
-	sa_free_bind_handle(h);
+	sa_free_handle(h);
+	umad_done();
 	close_node_name_map(node_name_map);
 	return (status);
 }
diff --git a/src/sminfo.c b/src/sminfo.c
index 2471a08..894d9fc 100644
--- a/src/sminfo.c
+++ b/src/sminfo.c
@@ -120,17 +120,17 @@ int main(int argc, char **argv)
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, 0, srcport) < 0)
-			IBERROR("can't resolve destination port %s", argv[0]);
+			IBEXIT("can't resolve destination port %s", argv[0]);
 	} else {
 		if (resolve_sm_portid(ibd_ca, ibd_ca_port, &portid) < 0)
-			IBERROR("can't resolve sm port %s", argv[0]);
+			IBEXIT("can't resolve sm port %s", argv[0]);
 	}
 
 	mad_encode_field(sminfo, IB_SMINFO_GUID_F, &guid);
@@ -142,10 +142,10 @@ int main(int argc, char **argv)
 	if (mod) {
 		if (!(p = smp_set_via(sminfo, &portid, IB_ATTR_SMINFO, mod,
 				      ibd_timeout, srcport)))
-			IBERROR("query");
+			IBEXIT("query");
 	} else if (!(p = smp_query_via(sminfo, &portid, IB_ATTR_SMINFO, 0,
 				       ibd_timeout, srcport)))
-		IBERROR("query");
+		IBEXIT("query");
 
 	mad_decode_field(sminfo, IB_SMINFO_GUID_F, &guid);
 	mad_decode_field(sminfo, IB_SMINFO_ACT_F, &act);
diff --git a/src/smpquery.c b/src/smpquery.c
index 66354e0..e2d509a 100644
--- a/src/smpquery.c
+++ b/src/smpquery.c
@@ -54,27 +54,19 @@
 
 struct ibmad_port *srcport;
 
-typedef char *(op_fn_t) (ib_portid_t * dest, char **argv, int argc);
-
-typedef struct match_rec {
-	const char *name, *alias;
-	op_fn_t *fn;
-	unsigned opt_portnum;
-} match_rec_t;
-
 static op_fn_t node_desc, node_info, port_info, switch_info, pkey_table,
     sl2vl_table, vlarb_table, guid_info, mlnx_ext_port_info;
 
 static const match_rec_t match_tbl[] = {
-	{"NodeInfo", "NI", node_info},
-	{"NodeDesc", "ND", node_desc},
-	{"PortInfo", "PI", port_info, 1},
-	{"SwitchInfo", "SI", switch_info},
-	{"PKeyTable", "PKeys", pkey_table, 1},
-	{"SL2VLTable", "SL2VL", sl2vl_table, 1},
-	{"VLArbitration", "VLArb", vlarb_table, 1},
-	{"GUIDInfo", "GI", guid_info},
-	{"MlnxExtPortInfo", "MEPI", mlnx_ext_port_info, 1},
+	{"NodeInfo", "NI", node_info, 0, ""},
+	{"NodeDesc", "ND", node_desc, 0, ""},
+	{"PortInfo", "PI", port_info, 1, ""},
+	{"SwitchInfo", "SI", switch_info, 0, ""},
+	{"PKeyTable", "PKeys", pkey_table, 1, ""},
+	{"SL2VLTable", "SL2VL", sl2vl_table, 1, ""},
+	{"VLArbitration", "VLArb", vlarb_table, 1, ""},
+	{"GUIDInfo", "GI", guid_info, 0, ""},
+	{"MlnxExtPortInfo", "MEPI", mlnx_ext_port_info, 1, ""},
 	{0}
 };
 
@@ -396,16 +388,6 @@ static char *guid_info(ib_portid_t * dest, char **argv, int argc)
 	return 0;
 }
 
-static op_fn_t *match_op(char *name)
-{
-	const match_rec_t *r;
-	for (r = match_tbl; r->name; r++)
-		if (!strcasecmp(r->name, name) ||
-		    (r->alias && !strcasecmp(r->alias, name)))
-			return r->fn;
-	return NULL;
-}
-
 static int process_opt(void *context, int ch, char *optarg)
 {
 	switch (ch) {
@@ -470,12 +452,12 @@ int main(int argc, char **argv)
 	if (argc < 2)
 		ibdiag_show_usage();
 
-	if (!(fn = match_op(argv[0])))
-		IBERROR("operation '%s' not supported", argv[0]);
+	if (!(fn = match_op(match_tbl, argv[0])))
+		IBEXIT("operation '%s' not supported", argv[0]);
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	smp_mkey_set(srcport, ibd_mkey);
 
@@ -484,9 +466,9 @@ int main(int argc, char **argv)
 	if (ibd_dest_type != IB_DEST_DRSLID) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
 				       ibd_dest_type, ibd_sm_id, srcport) < 0)
-			IBERROR("can't resolve destination port %s", argv[1]);
+			IBEXIT("can't resolve destination port %s", argv[1]);
 		if ((err = fn(&portid, argv + 2, argc - 2)))
-			IBERROR("operation %s: %s", argv[0], err);
+			IBEXIT("operation %s: %s", argv[0], err);
 	} else {
 		char concat[64];
 
@@ -494,9 +476,9 @@ int main(int argc, char **argv)
 		snprintf(concat, sizeof(concat), "%s %s", argv[1], argv[2]);
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, concat,
 				       ibd_dest_type, ibd_sm_id, srcport) < 0)
-			IBERROR("can't resolve destination port %s", concat);
+			IBEXIT("can't resolve destination port %s", concat);
 		if ((err = fn(&portid, argv + 3, argc - 3)))
-			IBERROR("operation %s: %s", argv[0], err);
+			IBEXIT("operation %s: %s", argv[0], err);
 	}
 	close_node_name_map(node_name_map);
 	mad_rpc_close_port(srcport);
diff --git a/src/vendstat.c b/src/vendstat.c
index 8535792..f28ff02 100644
--- a/src/vendstat.c
+++ b/src/vendstat.c
@@ -87,6 +87,7 @@ typedef struct {
 	uint32_t ext_major;
 	uint32_t ext_minor;
 	uint32_t ext_sub_minor;
+	uint32_t reserved[4];
 } is4_fw_ext_info_t;
 
 typedef struct {
@@ -171,7 +172,7 @@ static int do_vendor(ib_portid_t *portid, struct ibmad_port *srcport,
 	call.mod = attr_mod;
 
 	if (!ib_vendor_call_via(data, portid, &call, srcport))
-		IBERROR("vendstat: method %u, attribute %u", method, attr_id);
+		IBEXIT("vendstat: method %u, attribute %u", method, attr_id);
 
 	return 0;
 }
@@ -193,7 +194,7 @@ static void do_config_space_records(ib_portid_t *portid, unsigned set,
 		      set ? IB_MAD_METHOD_SET : IB_MAD_METHOD_GET,
 		      IB_MLX_IS3_CONFIG_SPACE_ACCESS, 2 << 22 | records << 16,
 		      cs))
-		IBERROR("cannot %s config space records", set ? "set" : "get");
+		IBEXIT("cannot %s config space records", set ? "set" : "get");
 
 	for (i = 0; i < records; i++) {
 		printf("Config space record at 0x%x: 0x%x\n",
@@ -212,7 +213,7 @@ static void counter_groups_info(ib_portid_t * portid, int port)
 	memset(&buf, 0, sizeof(buf));
 	if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET,
 		      IB_MLX_IS4_COUNTER_GROUP_INFO, port, buf))
-		IBERROR("counter group info query");
+		IBEXIT("counter group info query");
 
 	cg_info = (is4_counter_group_info_t *) & buf;
 	num_cg = cg_info->num_of_counter_groups;
@@ -250,14 +251,14 @@ static void config_counter_groups(ib_portid_t * portid, int port)
 
 	if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_SET,
 		      IB_MLX_IS4_CONFIG_COUNTER_GROUP, port, buf))
-		IBERROR("config counter group set");
+		IBEXIT("config counter group set");
 
 	/* get config counter groups */
 	memset(&buf, 0, sizeof(buf));
 
 	if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET,
 		      IB_MLX_IS4_CONFIG_COUNTER_GROUP, port, buf))
-		IBERROR("config counter group query");
+		IBEXIT("config counter group query");
 }
 
 static int general_info, xmit_wait, counter_group_info, config_counter_group;
@@ -324,6 +325,7 @@ int main(int argc, char **argv)
 	uint32_t fw_ver_major = 0;
 	uint32_t fw_ver_minor = 0;
 	uint32_t fw_ver_sub_minor = 0;
+	uint8_t sw_ver_major = 0, sw_ver_minor = 0, sw_ver_sub_minor = 0;
 	is3_general_info_t *gi_is3;
 	is4_general_info_t *gi_is4;
 	const struct ibdiag_opt opts[] = {
@@ -357,15 +359,15 @@ int main(int argc, char **argv)
 
 	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 2);
 	if (!srcport)
-		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	if (argc) {
 		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
 				       ibd_dest_type, ibd_sm_id, srcport) < 0)
-			IBERROR("can't resolve destination port %s", argv[0]);
+			IBEXIT("can't resolve destination port %s", argv[0]);
 	} else {
 		if (resolve_self(ibd_ca, ibd_ca_port, &portid, &port, 0) < 0)
-			IBERROR("can't resolve self port %s", argv[0]);
+			IBEXIT("can't resolve self port %s", argv[0]);
 	}
 
 	if (counter_group_info) {
@@ -393,7 +395,7 @@ int main(int argc, char **argv)
 	/* Only General Info and Port Xmit Wait Counters */
 	/* queries are currently supported */
 	if (!general_info && !xmit_wait)
-		IBERROR("at least one of -N and -w must be specified");
+		IBEXIT("at least one of -N and -w must be specified");
 
 	/* Would need a list of these and it might not be complete */
 	/* so for right now, punt on this */
@@ -402,23 +404,29 @@ int main(int argc, char **argv)
 	memset(&buf, 0, sizeof(buf));
 	if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET,
 		      CLASS_PORT_INFO, 0, buf))
-		IBERROR("classportinfo query");
+		IBEXIT("classportinfo query");
 
 	memset(&buf, 0, sizeof(buf));
 	gi_is3 = (is3_general_info_t *) &buf;
 	if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET,
 		      IB_MLX_IS3_GENERAL_INFO, 0, gi_is3))
-		IBERROR("generalinfo query");
+		IBEXIT("generalinfo query");
 
 	if (is_ext_fw_info_supported(ntohs(gi_is3->hw_info.device_id))) {
 		gi_is4 = (is4_general_info_t *) &buf;
 		fw_ver_major = ntohl(gi_is4->ext_fw_info.ext_major);
 		fw_ver_minor = ntohl(gi_is4->ext_fw_info.ext_minor);
 		fw_ver_sub_minor = ntohl(gi_is4->ext_fw_info.ext_sub_minor);
+		sw_ver_major = gi_is4->sw_info.major;
+		sw_ver_minor = gi_is4->sw_info.minor;
+		sw_ver_sub_minor = gi_is4->sw_info.sub_minor;
 	} else {
 		fw_ver_major = gi_is3->fw_info.major;
 		fw_ver_minor = gi_is3->fw_info.minor;
 		fw_ver_sub_minor = gi_is3->fw_info.sub_minor;
+		sw_ver_major = gi_is3->sw_info.major;
+		sw_ver_minor = gi_is3->sw_info.minor;
+		sw_ver_sub_minor = gi_is3->sw_info.sub_minor;
 	}
 
 	if (general_info) {
@@ -435,8 +443,8 @@ int main(int argc, char **argv)
 		printf("fw_psid:     '%s'\n", gi_is3->fw_info.psid);
 		printf("fw_ini_ver:  %d\n",
 		       ntohl(gi_is3->fw_info.ini_file_version));
-		printf("sw_version:  %02d.%02d.%02d\n", gi_is3->sw_info.major,
-		       gi_is3->sw_info.minor, gi_is3->sw_info.sub_minor);
+		printf("sw_version:  %02d.%02d.%02d\n", sw_ver_major,
+		       sw_ver_minor, sw_ver_sub_minor);
 	}
 
 	if (xmit_wait) {
@@ -444,7 +452,7 @@ int main(int argc, char **argv)
 		unsigned i;
 
 		if (ntohs(gi_is3->hw_info.device_id) != IS3_DEVICE_ID)
-			IBERROR("Unsupported device ID 0x%x",
+			IBEXIT("Unsupported device ID 0x%x",
 				ntohs(gi_is3->hw_info.device_id));
 
 		memset(&buf, 0, sizeof(buf));
@@ -456,7 +464,7 @@ int main(int argc, char **argv)
 		if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS,
 			      IB_MAD_METHOD_GET, IB_MLX_IS3_CONFIG_SPACE_ACCESS,
 			      2 << 22 | 16 << 16, cs))
-			IBERROR("vendstat");
+			IBEXIT("vendstat");
 
 		for (i = 0; i < 16; i++)
 			if (cs->record[i].data)	/* PortXmitWait is 32 bit counter */
@@ -472,7 +480,7 @@ int main(int argc, char **argv)
 		if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS,
 			      IB_MAD_METHOD_GET, IB_MLX_IS3_CONFIG_SPACE_ACCESS,
 			      2 << 22 | 8 << 16, cs))
-			IBERROR("vendstat");
+			IBEXIT("vendstat");
 
 		for (i = 0; i < 8; i++)
 			if (cs->record[i].data)	/* PortXmitWait is 32 bit counter */

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



More information about the Pkg-ofed-commits mailing list