/usr/sbin/dump_lfts is in infiniband-diags 1.6.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | #!/bin/bash
#
# 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
|