CSIT-687: Directory structure reorganization
[csit.git] / tests / tldk / tldk_scripts / install_tldk.sh
1 #!/bin/bash
2
3 set -x
4
5 DPDK_VERSION=16.11.1
6
7 ROOTDIR=/tmp/TLDK-testing
8 PWDDIR=$(pwd)
9 DPDK_DIR=dpdk
10 DPDK_PACKAGE=${DPDK_DIR}"-"${DPDK_VERSION}.tar.xz
11
12 # compile and install the DPDK
13 cd ${ROOTDIR}
14 sudo tar xvf ${DPDK_PACKAGE}
15 sudo mv dpdk-stable-${DPDK_VERSION} dpdk
16 echo $PWD
17 echo ${DPDK_PACKAGE}
18 cd ./${DPDK_DIR}
19 sudo sed -i 's/^CONFIG_RTE_LIBRTE_PMD_PCAP=n/CONFIG_RTE_LIBRTE_PMD_PCAP=y/g' ./config/common_base
20 sudo make install T=x86_64-native-linuxapp-gcc
21 cd ${PWDDIR}
22
23 # compile the TLDK
24 export RTE_SDK=${ROOTDIR}/${DPDK_DIR}/
25 export RTE_TARGET=x86_64-native-linuxapp-gcc
26 cd ${ROOTDIR}/tldk
27 make all
28 cd ${PWDDIR}
29
30 sudo killall -9 l4fwd 2>/dev/null
31
32 sleep 5
33
34 pid=`pgrep l4fwd`
35 if [ "$pid" != "" ]; then
36     echo "terminate the l4fwd failed!"
37     exit 1
38 fi
39
40 # check and setup the hugepages
41 SYS_HUGEPAGE=$(cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages)
42 if [ ${SYS_HUGEPAGE} -lt 1024 ]; then
43     MOUNT=$(mount | grep /mnt/huge)
44     while [ "${MOUNT}" != "" ]
45     do
46         sudo umount /mnt/huge
47         sleep 1
48         MOUNT=$(mount | grep /mnt/huge)
49     done
50
51     echo 1024 | sudo tee /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
52     echo 1024 | sudo tee /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
53
54     sudo mkdir -p /mnt/huge
55     sudo mount -t hugetlbfs nodev /mnt/huge/
56     test $? -eq 0 || exit 1
57 fi

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.