<br><br>
<div class="gmail_quote">On Thu, Sep 10, 2009 at 7:56 AM, Doron Shoham <span dir="ltr"><<a href="mailto:dorons@voltaire.com" target="_blank">dorons@voltaire.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">ibcheckroutes validates route between all hosts in the fabric.<br>This script finds all leaf switches (switches that are connected to HCAs)<br>
and runs ibtracert between them.<br>When using various routing algorithms (e.g. up-down),<br>if fabric topology is not suitable there will be no<br>routes between some nodes.<br>It reports when the route exists between source and destination LIDs.<br>
<br>Signed-off-by: Doron Shoham <<a href="mailto:dorons@voltaire.com" target="_blank">dorons@voltaire.com</a>><br>---<br> infiniband-diags/Makefile.am              |    4 +-<br> infiniband-diags/<a href="http://configure.in/" target="_blank">configure.in</a>             |    1 +<br>
 infiniband-diags/man/ibcheckroutes.8      |   39 +++++++++++<br> infiniband-diags/scripts/<a href="http://ibcheckroutes.in/" target="_blank">ibcheckroutes.in</a> |  101 +++++++++++++++++++++++++++++<br> 4 files changed, 143 insertions(+), 2 deletions(-)<br>
 create mode 100644 infiniband-diags/man/ibcheckroutes.8<br> create mode 100755 infiniband-diags/scripts/<a href="http://ibcheckroutes.in/" target="_blank">ibcheckroutes.in</a><br><br>diff --git a/infiniband-diags/Makefile.am b/infiniband-diags/Makefile.am<br>
index 1cdb60e..57363c4 100644<br>--- a/infiniband-diags/Makefile.am<br>+++ b/infiniband-diags/Makefile.am<br>@@ -33,7 +33,7 @@ sbin_SCRIPTS = scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode \<br>              scripts/iblinkinfo.pl scripts/ibprintswitch.pl \<br>
              scripts/ibprintca.pl scripts/ibprintrt.pl \<br>              scripts/ibfindnodesusing.pl scripts/ibidsverify.pl \<br>-              scripts/check_lft_balance.pl<br>+              scripts/check_lft_balance.pl scripts/ibcheckroutes<br>
<br> noinst_LIBRARIES = libcommon.a<br><br>@@ -76,7 +76,7 @@ man_MANS = man/ibaddr.8 man/ibcheckerrors.8 man/ibcheckerrs.8 \<br>       man/ibprintswitch.8 man/ibprintca.8 man/ibfindnodesusing.8 \<br>       man/ibdatacounts.8 man/ibdatacounters.8 \<br>
       man/ibrouters.8 man/ibprintrt.8 man/ibidsverify.8 \<br>-       man/check_lft_balance.8<br>+       man/check_lft_balance.8 man/ibcheckroutes.8<br><br> BUILT_SOURCES = ibdiag_version<br> ibdiag_version:<br>diff --git a/infiniband-diags/<a href="http://configure.in/" target="_blank">configure.in</a> b/infiniband-diags/<a href="http://configure.in/" target="_blank">configure.in</a><br>
index 3ef35cc..aa178c5 100644<br>--- a/infiniband-diags/<a href="http://configure.in/" target="_blank">configure.in</a><br>+++ b/infiniband-diags/<a href="http://configure.in/" target="_blank">configure.in</a><br>@@ -158,6 +158,7 @@ AC_CONFIG_FILES([\<br>
       scripts/ibcheckportwidth \<br>       scripts/ibcheckstate \<br>       scripts/ibcheckwidth \<br>+       scripts/ibcheckroutes \<br>       scripts/ibclearcounters \<br>       scripts/ibclearerrors \<br>       scripts/ibdatacounts \<br>
diff --git a/infiniband-diags/man/ibcheckroutes.8 b/infiniband-diags/man/ibcheckroutes.8<br>new file mode 100644<br>index 0000000..a6a073f<br>--- /dev/null<br>+++ b/infiniband-diags/man/ibcheckroutes.8<br>@@ -0,0 +1,39 @@<br>
+.TH IBCHECKPORT 8 "September 10, 2009" "OpenIB" "OpenIB Diagnostics"<br>+<br>+.SH NAME<br>+ibcheckroutes \- validates routes between all hosts in fabric<br>+<br>+.SH SYNOPSIS<br>+.B ibcheckroutes<br>
+[\-h] [\-N] [\-b] [\-e] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms]<br>+<br>+.SH DESCRIPTION<br>+.PP<br>+ibcheckroutes is a script which uses a full topology file that was created by ibnetdiscover,<br>+scans the network to validate routes between all hosts in the fabric.<br>
</blockquote>
<div> </div>
<div>Based on what has been discussed, this really isn't the case. It only validates routes between leaf switches (at least currently).</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">+<br>+.SH OPTIONS<br>+.PP<br>+\-h  Show help.<br>+.PP<br>+\-N  Use mono rather than color mode.<br>+.PP<br>
+\-b  Suppress output.<br>+.PP<br>+\-e  Show errors only.<br>+.PP<br>+\-C <ca_name>    Use the specified ca_name.<br>+.PP<br>+\-P <ca_port>    Use the specified ca_port.<br>+.PP<br>+\-t <timeout_ms> Override the default timeout for the solicited mads.<br>
+<br>+.SH SEE ALSO<br>+.BR ibnetdiscover(8),<br>+.BR ibtracert(8),<br>+.BR ibroute(8)<br></blockquote>
<div> </div>
<div>Is ibroute used ?</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">+<br>+.SH AUTHOR<br>+.TP<br>+Doron Shoham<br>+.RI < <a href="mailto:dorons@voltaire.com" target="_blank">dorons@voltaire.com</a> ><br>
diff --git a/infiniband-diags/scripts/<a href="http://ibcheckroutes.in/" target="_blank">ibcheckroutes.in</a> b/infiniband-diags/scripts/<a href="http://ibcheckroutes.in/" target="_blank">ibcheckroutes.in</a><br>new file mode 100755<br>
index 0000000..eb3ad30<br>--- /dev/null<br>+++ b/infiniband-diags/scripts/<a href="http://ibcheckroutes.in/" target="_blank">ibcheckroutes.in</a><br>@@ -0,0 +1,101 @@<br>+#!/bin/sh<br>+<br>+IBPATH=${IBPATH:-@IBSCRIPTPATH@}<br>
+<br>+function usage() {<br>+       echo Usage: `basename $0` "[-h] [-N] [-b] [-e] [-C ca_name] [-P ca_port] [-t(imeout) timeout_ms]"<br>+       echo -e "   validate routes between all hosts in fabric"<br>
+       echo -e " -h   - Show help"<br>+       echo -e " -N   - Use mono rather than color mode"<br>+       echo -e " -b   - Suppress output"<br>+       echo -e " -e   - Show errors only"<br>
+       echo -e " -C   - Use the specified ca_name"<br>+       echo -e " -P   - Use the specified ca_port"<br>+       echo -e " -t   - Override the default timeout for the solicited"<br></blockquote>

<div> </div>
<div>add " mads" to the end of this</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">+       exit -1<br>+}<br>+<br>+function user_abort() {<br>+       echo "Aborted"<br>+       exit 1<br>
+}<br>+<br>+function green() {<br>+       if [ "$bw" = "yes" ]; then<br>+               printf "${res_col}[OK]\n" $1<br>+               return<br>+       fi<br>+       printf "\033[1;032m${res_col}[OK]\033[0;39m\n" $1<br>
+}<br>+<br>+function red() {<br>+       if [ "$bw" = "yes" ]; then<br>+               printf "${res_col}[FAILED]\n" "$1"<br>+               return<br>+       fi<br>+       printf "\033[31m${res_col}[FAILED]\033[0m\n" "$1"<br>
+}<br>+<br>+trap user_abort SIGINT SIGTERM<br>+<br>+bw=""<br>+brief=0<br>+error=0<br>+ca_info=""<br>+st=0<br>+topofile=/tmp/net<br>+res_col="%-20.20s"<br>+<br>+function get_opts() {<br>+       while getopts P:C:t:beNh o; do<br>
+               case "$o" in<br>+               h)<br>+                       usage<br>+                       ;;<br>+               N)<br>+                       bw="yes"<br>+                       ;;<br>
+               b)<br>+                       brief=1<br>+                       ;;<br>+               e)<br>+                       error=1<br>+                       ;;<br>+               P | C | t | timeout)<br>+                       ca_info="$ca_info -$o $OPTARG"<br>
+                       ;;<br>+               *)<br>+                       usage<br>+                       ;;<br>+               esac<br>+       done<br>+}<br>+<br>+get_opts $*<br>+<br>+$IBPATH/ibnetdiscover $ca_info > $topofile<br>
</blockquote>
<div> </div>
<div>How about allowing an already saved ibnetdiscover file to be used as well as a "fresh" ibnetdiscover output ?</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">+<br>+# find all leaf switches LIDs<br>+LIDS=($(awk  '/# lid /{a[$(NF-1)]=$(NF-1)} END{for(v in a) print v}' $topofile))<br>
+N=${#LIDS[@]}<br>+<br>+if [ $N -lt 2 ]; then<br>+       echo "Fabric contains only one switch"</blockquote>
<div> </div>
<div>one leaf switch ?</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">+       exit 0<br>+fi<br>+<br>+# check routes between all switches in fabric<br></blockquote>
<div> </div>
<div>all leaf switches ?</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">+[ $brief -eq 0 ] && echo -e "Checking route between:\nSource lid --> Destination lid"<br>
+for((s=0; s<N-1; s++)); do<br>+       for ((d=s+1; d<N; d++)); do<br>+               $IBPATH/ibtracert $ca_info ${LIDS[$s]} ${LIDS[$d]} > /dev/null<br></blockquote>
<div> </div>
<div>Is LMC > 0 handled ?</div>
<div> </div>
<div>-- Hal</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">+               if [ $? -eq 0 ]; then<br>+                       [ $brief -eq 0 ] && [ $error -eq 0 ] && green "${LIDS[$s]}-->${LIDS[$d]}"<br>
+               else<br>+                       [ $brief -eq 0 ] && red "${LIDS[$s]}-->${LIDS[$d]}"<br>+                       st=1<br>+               fi<br>+       done<br>+done<br>+<br>+exit $st<br>
--<br>1.5.4<br><br>_______________________________________________<br>general mailing list<br><a href="mailto:general@lists.openfabrics.org" target="_blank">general@lists.openfabrics.org</a><br><a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general" target="_blank">http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general</a><br>
<br>To unsubscribe, please visit <a href="http://openib.org/mailman/listinfo/openib-general" target="_blank">http://openib.org/mailman/listinfo/openib-general</a><br></blockquote></div><br>