summaryrefslogtreecommitdiffstats
path: root/scripts/trex-cfg
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-03-05 23:30:13 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-03-05 23:39:30 +0200
commitc118763130d9901bf5271d2a8fc0bfac4be88b95 (patch)
tree08af67bf034bd87aed00ee53cf280e1643b0832d /scripts/trex-cfg
parent90c88873e54d100a944761f69a998085cae3f14b (diff)
Deal with loaded Kernel modules in Python:
Try loading igb_uio if it's avaiable, next try vfio-pci if it's available. Last effort is compiling igb_uio. Change-Id: I99d1d6c969f795d58a403587d6d0c395548ba3f7 Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/trex-cfg')
-rwxr-xr-xscripts/trex-cfg48
1 files changed, 0 insertions, 48 deletions
diff --git a/scripts/trex-cfg b/scripts/trex-cfg
index 5945a074..5d87b562 100755
--- a/scripts/trex-cfg
+++ b/scripts/trex-cfg
@@ -43,54 +43,6 @@ for file in /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepag
fi
done
-PATH=$PATH:/sbin:/usr/sbin
-
-VFIO_PCI_KO=`find /lib/modules/$(uname -r) -type f -name vfio-pci.ko`
-if [ $VFIO_PCI_KO ] && grep "iommu=pt" /proc/cmdline | grep -q "intel_iommu=on" ; then
- modprobe vfio-pci
-elif ! lsmod | grep -q igb_uio ; then
- echo "Loading kernel drivers for the first time"
- modprobe uio
- if [ $? -ne 0 ]; then
- echo "Failed inserting uio module, please check if it is installed"
- exit -1
- fi
- km=ko/$SYS/igb_uio.ko
- if [ ! -e $km ]; then
- echo "ERROR: We don't have precompiled igb_uio.ko module for your kernel version"
- echo Will try compiling automatically.
- {
- cd ko/src &&
- make &&
- make install &&
- cd -
- } &> /dev/null || {
- 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 -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
- if [ -e $km ]; then
- insmod $km
- if [ $? -ne 0 ]; then
- echo "Failed inserting igb_uio module"
- exit -1
- fi
- fi
-fi
# try to bind the ports from the configuration file (new DPDK)
PARENT_ARGS="$0 $@"