summaryrefslogtreecommitdiffstats
path: root/scripts/trex-cfg
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-02-27 20:41:53 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-02-27 20:41:53 +0200
commita7fbd337035d5a5b1ca59ae290d995232a3adc22 (patch)
tree463284124bc69ea3a4ac9173a930940f1ba23e00 /scripts/trex-cfg
parentd812110d34d0188ad1a1e6258d49d48a13e6e5ef (diff)
dpdk_setup_ports: change return code to 32 in case of Mellanox NICs.
Add info on packages for compiling .ko file. Change-Id: Ic958a339ad6af696764cb76d95d72776afc8b304 Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/trex-cfg')
-rwxr-xr-xscripts/trex-cfg33
1 files changed, 23 insertions, 10 deletions
diff --git a/scripts/trex-cfg b/scripts/trex-cfg
index 02d50eb6..aaaa2a32 100755
--- a/scripts/trex-cfg
+++ b/scripts/trex-cfg
@@ -1,4 +1,10 @@
#! /bin/bash
+
+# exit code is Important should be
+# -1 : don't continue
+# 0 : no errors - no need to load mlx share object
+# 32 : no errors - mlx share object should be loaded (returned by dpdk_setup_ports.py)
+
SYS=`uname -r`
if [ -f /etc/debian_version ]; then
OS=debian
@@ -12,7 +18,7 @@ fi
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} != 'x86_64' ]; then
echo "ERROR, only 64bit operating systems are supported, please reinstall x86 64 bit OS"
- exit 1
+ exit -1
fi
@@ -44,7 +50,7 @@ if ! lsmod | grep -q igb_uio ; then
modprobe uio
if [ $? -ne 0 ]; then
echo "Failed inserting uio module, please check if it is installed"
- exit 1
+ exit -1
fi
km=ko/$SYS/igb_uio.ko
if [ ! -e $km ]; then
@@ -56,14 +62,21 @@ if ! lsmod | grep -q igb_uio ; then
make install &&
cd -
} &> /dev/null || {
- echo Automatic compilation failed.
+ echo -e "Automatic compilation failed.\n"
echo "You can try compiling yourself, using the following commands:"
- echo "\$cd ko/src "
- echo "\$make "
- echo "\$make install "
- echo "\$cd - "
- echo "Then try to run TRex again"
- exit 1
+ echo " \$cd ko/src "
+ echo " \$make "
+ echo " \$make install "
+ echo -e " \$cd - \n"
+ echo -e "Then, try to run TRex again.\n"
+ echo 'Note: you might need additional Linux packages for that:'
+ echo ' * yum based (Fedora, CentOS, RedHat):'
+ echo ' sudo yum install kernel-devel-`uname -r`'
+ echo ' sudo yum group install "Development tools"'
+ echo ' * apt based (Ubuntu):'
+ echo ' sudo apt install linux-headers-`uname -r`'
+ echo ' sudo apt install build-essential'
+ exit -1
}
echo Success.
fi
@@ -71,7 +84,7 @@ if ! lsmod | grep -q igb_uio ; then
insmod $km
if [ $? -ne 0 ]; then
echo "Failed inserting igb_uio module"
- exit 1
+ exit -1
fi
fi
fi