[PATCH infiniband-diags] scripts: Add mkey support into ibhosts, ibswitches, and ibrouters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Hal Rosenstock <hal@xxxxxxxxxxxx>
---
diff --git a/scripts/ibhosts.in b/scripts/ibhosts.in
index fda0541..c37260c 100644
--- a/scripts/ibhosts.in
+++ b/scripts/ibhosts.in
@@ -3,19 +3,32 @@
 IBPATH=${IBPATH:-@IBSCRIPTPATH@}
 
 usage() {
-	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
-	    "-P ca_port -t timeout_ms]"
+	echo Usage: `basename $0` "[-h] [<topology-file> | -y mkey" \
+	    "-C ca_name -P ca_port -t timeout_ms]"
 	exit -1
 }
 
 topofile=""
 ca_info=""
+mkey="0"
 
 while [ "$1" ]; do
 	case $1 in
 	-h | --help)
 		usage
 		;;
+	-y | --m_key)
+		case $2 in
+		-*)
+			usage
+			;;
+		esac
+		if [ x$2 = x ] ; then
+			usage
+		fi
+		shift
+		mkey="$1"
+		;;
 	-P | --Port | -C | --Ca | -t | --timeout)
 		case $2 in
 		-*)
@@ -44,7 +57,7 @@ done
 if [ "$topofile" ]; then
 	netcmd="cat $topofile"
 else
-	netcmd="$IBPATH/ibnetdiscover $ca_info"
+	netcmd="$IBPATH/ibnetdiscover -y $mkey $ca_info"
 fi
 
 text="`eval $netcmd`"
diff --git a/scripts/ibrouters.in b/scripts/ibrouters.in
index ae66ca4..b3e5a1d 100644
--- a/scripts/ibrouters.in
+++ b/scripts/ibrouters.in
@@ -3,19 +3,32 @@
 IBPATH=${IBPATH:-@IBSCRIPTPATH@}
 
 usage() {
-	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
-	    "-P ca_port -t timeout_ms]"
+	echo Usage: `basename $0` "[-h] [<topology-file> | -y mkey" \
+	    "-C ca_name -P ca_port -t timeout_ms]"
 	exit -1
 }
 
 topofile=""
 ca_info=""
+mkey="0"
 
 while [ "$1" ]; do
 	case $1 in
 	-h | --help)
 		usage
 		;;
+	-y | --m_key)
+		case $2 in
+		-*)
+			usage
+			;;
+		esac
+		if [ x$2 = x ] ; then
+			usage
+		fi
+		shift
+		mkey="$1"
+		;;
 	-P | --Port | -C | --Ca | -t | --timeout)
 		case $2 in
 		-*)
@@ -44,7 +57,7 @@ done
 if [ "$topofile" ]; then
 	netcmd="cat $topofile"
 else
-	netcmd="$IBPATH/ibnetdiscover $ca_info"
+	netcmd="$IBPATH/ibnetdiscover -y $mkey $ca_info"
 fi
 
 text="`eval $netcmd`"
diff --git a/scripts/ibswitches.in b/scripts/ibswitches.in
index 0f3aa91..743f1db 100644
--- a/scripts/ibswitches.in
+++ b/scripts/ibswitches.in
@@ -3,19 +3,32 @@
 IBPATH=${IBPATH:-@IBSCRIPTPATH@}
 
 usage() {
-	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
-	    "-P ca_port -t timeout_ms]"
+	echo Usage: `basename $0` "[-h] [<topology-file> | -y mkey" \
+	    "-C ca_name -P ca_port -t timeout_ms]"
 	exit -1
 }
 
 topofile=""
 ca_info=""
+mkey="0"
 
 while [ "$1" ]; do
 	case $1 in
 	-h | --help)
 		usage
 		;;
+	-y | --m_key)
+		case $2 in
+		-*)
+			usage
+			;;
+		esac
+		if [ x$2 = x ] ; then
+			usage
+		fi
+		shift
+		mkey="$1"
+		;;
 	-P | --Port | -C | --Ca | -t | --timeout)
 		case $2 in
 		-*)
@@ -44,7 +57,7 @@ done
 if [ "$topofile" ]; then
 	netcmd="cat $topofile"
 else
-	netcmd="$IBPATH/ibnetdiscover $ca_info"
+	netcmd="$IBPATH/ibnetdiscover -y $mkey $ca_info"
 fi
 
 text="`eval $netcmd`"
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux