# exit code is Important should be
# -1 : don't continue
# 0 : no errors - no need to load mlx share object
-# 1 : no errors - mlx share object should be loaded
+# 32 : no errors - mlx share object should be loaded
+MLX_EXIT_CODE = 32
class ConfigCreator(object):
if only_check_all_mlx:
if Mellanox_cnt >0:
- exit(1);
+ exit(MLX_EXIT_CODE);
else:
exit(0);
sys.exit(-1)
if Mellanox_cnt:
- return 1
+ return MLX_EXIT_CODE
else:
return 0
#! /bin/bash
export LD_LIBRARY_PATH=`pwd`
-#Add dummy lib in case we don't find it, e.g. there is no OFED installed
-if ldd _t-rex-64 | grep "libibverbs.so" | grep -q "not found"; then
-export LD_LIBRARY_PATH=$PWD:$PWD/dumy_libs
+EXTRA_INPUT_ARGS=""
+
+./trex-cfg $INPUT_ARGS
+RESULT=$?
+
+if [ $RESULT -eq 255 ]; then
+ echo "ERROR encountered while configuring trex system"
+ exit $RESULT
fi
-
-/usr/bin/gdb --args ./_t-rex-64-debug $@
+if [ $RESULT -eq 32 ]; then
+ EXTRA_INPUT_ARGS="--mlx5-so"
+fi
+
+
+/usr/bin/gdb --args ./_t-rex-64-debug $@ $EXTRA_INPUT_ARGS
#! /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
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
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
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
insmod $km
if [ $? -ne 0 ]; then
echo "Failed inserting igb_uio module"
- exit 1
+ exit -1
fi
fi
fi