[ofa-general] [PATCH] infiniband-diags/dump_mfts.sh: fix -D format parsing

Sasha Khapyorsky sashak at voltaire.com
Sun Jan 25 02:07:55 PST 2009


The fixes are similar to those were done in dump_lfts.sh, plus all
previous adoption and fixes.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 infiniband-diags/scripts/dump_mfts.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/infiniband-diags/scripts/dump_mfts.sh b/infiniband-diags/scripts/dump_mfts.sh
index 39fc5fb..cdadba2 100755
--- a/infiniband-diags/scripts/dump_mfts.sh
+++ b/infiniband-diags/scripts/dump_mfts.sh
@@ -22,10 +22,10 @@ done
 
 dump_by_dr_path ()
 {
-for sw_dr in `ibnetdiscover $ca_info -v \
-		| sed -ne '/^DR path .* switch /s/^DR path \[\(.*\)\].*$/\1/p' \
-		| sed -e 's/\]\[/,/g' \
-		| sort -u` ; do
+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
 }
-- 
1.6.0.4.766.g6fc4a




More information about the general mailing list