It is highly possible that ibnetdiscover finds the same switches at
different paths. In this case the current version of the script will
dump LFTs multiple times for the same switches. This patch fixes this
bug - all discovered paths are sorted and unified by switch GUIDs.

Signed-off-by: Sasha Khapyorsky <[EMAIL PROTECTED]>
---
 infiniband-diags/scripts/dump_lfts.sh |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/infiniband-diags/scripts/dump_lfts.sh 
b/infiniband-diags/scripts/dump_lfts.sh
index 81984af..ebca705 100755
--- a/infiniband-diags/scripts/dump_lfts.sh
+++ b/infiniband-diags/scripts/dump_lfts.sh
@@ -23,8 +23,9 @@ done
 dump_by_dr_path ()
 {
 for sw_dr in `ibnetdiscover $ca_info -v \
-       | sed -ne '/^DR path .* switch /s/^DR path \([,|0-9]\+\) ->.*$/\1/p' \
-       | sort -u` ; do
+       | 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
 }
-- 
1.5.3.4.206.g58ba4

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to