119 lines
3.2 KiB
Diff
119 lines
3.2 KiB
Diff
diff -up powerpc-utils-1.3.8/man/hcnmgr.8.me powerpc-utils-1.3.8/man/hcnmgr.8
|
|
--- powerpc-utils-1.3.8/man/hcnmgr.8.me 2020-10-01 13:09:19.969454947 +0200
|
|
+++ powerpc-utils-1.3.8/man/hcnmgr.8 2020-10-01 13:09:29.969148204 +0200
|
|
@@ -0,0 +1,35 @@
|
|
+.TH hcnmgr "01 October 2020" "Linux" "Linux on Power Service Tools"
|
|
+.RS
|
|
+hcnmgr contains a set of commands to support migratable SR_IOV logical port.
|
|
+The new commands configure/query/remove network devices. New commands should
|
|
+be called from the HMC, rather than directly from linux LPAR
|
|
+.PP
|
|
+Usage: hcncfgdrc DRC_INDEX=<drc_index> [STAKE_TOKEN=NULL] [\fB-d\fP]
|
|
+Configure a device to hybrid network HCN
|
|
+.PP
|
|
+Usage: hcnrmhcn HCN_ID=<hcnid>
|
|
+Remove a hybrid network HCN given an HCN ID
|
|
+.PP
|
|
+Usage: hcnrmdev DRC_INDEX=<drc_index> HCN_ID=<hcnid>
|
|
+Unconfigure device from HCN
|
|
+.PP
|
|
+Usage: hcnqrydev DRC_INDEX=<drc_index> HCN_ID=<hcnid>
|
|
+Query a device given a DRC_INDEX or HCN ID
|
|
+.PP
|
|
+Usage: hcnversion
|
|
+get the current version of the HCN support
|
|
+.PP
|
|
+Optional arguments.
|
|
+.RS
|
|
+.TP
|
|
+.B
|
|
+\fB-s\fP
|
|
+scan device-tree and configure HCN
|
|
+.TP
|
|
+.B
|
|
+\fB-V\fP
|
|
+Display version information and exit
|
|
+.TP
|
|
+.B
|
|
+\fB-h\fP
|
|
+Display this help information and exit
|
|
diff -up powerpc-utils-1.3.8/scripts/hcnmgr.me powerpc-utils-1.3.8/scripts/hcnmgr
|
|
--- powerpc-utils-1.3.8/scripts/hcnmgr.me 2020-10-01 13:03:10.839439027 +0200
|
|
+++ powerpc-utils-1.3.8/scripts/hcnmgr 2020-10-01 13:06:18.479509944 +0200
|
|
@@ -1,4 +1,4 @@
|
|
-#! /bin/bash
|
|
+#!/usr/bin/bash
|
|
|
|
# Copyright (c) 2020 International Business Machines
|
|
#
|
|
@@ -562,34 +562,7 @@ scanhcn() {
|
|
# Main
|
|
#
|
|
|
|
-#All echo messages goes into $LOG_FILE
|
|
-exec &> >(tee -a $LOG_FILE)
|
|
-
|
|
-#Start debug log $LOG_FILE with date and time
|
|
-NOW=$(date +"%m-%d-%Y %T")
|
|
-echo "=======================$NOW============================"
|
|
-
|
|
-#Validate this tool is running on powerpc platform
|
|
-. "$PSERIES_PLATFORM"
|
|
-if [ "$platform" != "$PLATFORM_PSERIES_LPAR" ]; then
|
|
- err $E_EPERM
|
|
-fi
|
|
-
|
|
-#Validate NMCLI packages is install to manage networking
|
|
-if ! nmcli --version >/dev/null 2>&1; then
|
|
- err $E_ENETUNREACH
|
|
-fi
|
|
-
|
|
-#Validate bonding module is loaded
|
|
-if ! lsmod | grep -q bonding; then
|
|
- hcnlog DEBUG "HCNMGR: Bonding module not loaded, load module ..."
|
|
- if ! modprobe bonding; then
|
|
- err $E_NOMODULE
|
|
- fi
|
|
-fi
|
|
-
|
|
HCNCMD=$(basename "$0")
|
|
-hcnlog DEBUG "$HCNCMD enter"
|
|
|
|
#getops for help and version
|
|
while getopts "sVhd:" arg; do
|
|
@@ -616,6 +589,34 @@ while getopts "sVhd:" arg; do
|
|
esac
|
|
done
|
|
|
|
+#All echo messages goes into $LOG_FILE
|
|
+exec &> >(tee -a $LOG_FILE)
|
|
+
|
|
+hcnlog DEBUG "$HCNCMD enter"
|
|
+
|
|
+#Start debug log $LOG_FILE with date and time
|
|
+NOW=$(date +"%m-%d-%Y %T")
|
|
+echo "=======================$NOW============================"
|
|
+
|
|
+#Validate this tool is running on powerpc platform
|
|
+. "$PSERIES_PLATFORM"
|
|
+if [ "$platform" != "$PLATFORM_PSERIES_LPAR" ]; then
|
|
+ err $E_EPERM
|
|
+fi
|
|
+
|
|
+#Validate NMCLI packages is install to manage networking
|
|
+if ! nmcli --version >/dev/null 2>&1; then
|
|
+ err $E_ENETUNREACH
|
|
+fi
|
|
+
|
|
+#Validate bonding module is loaded
|
|
+if ! lsmod | grep -q bonding; then
|
|
+ hcnlog DEBUG "HCNMGR: Bonding module not loaded, load module ..."
|
|
+ if ! modprobe bonding; then
|
|
+ err $E_NOMODULE
|
|
+ fi
|
|
+fi
|
|
+
|
|
#Log this scripts command line to syslog
|
|
hcnlog INFO "$HCNCMD $*"
|
|
|