Add the DPDK l2fwd performance test cases.
[csit.git] / dpdk-tests / dpdk_scripts / install_dpdk.sh
1 #!/bin/bash
2
3 DPDK_VERSION=16.07
4 DPDK_DIR=dpdk-${DPDK_VERSION}
5 DPDK_PACKAGE=${DPDK_DIR}.tar.xz
6
7 ROOTDIR=/tmp/openvpp-testing
8 PWDDIR=$(pwd)
9
10 #download the DPDK package
11 #compile and install the DPDK
12 cd ${ROOTDIR}
13 wget -q "fast.dpdk.org/rel/${DPDK_PACKAGE}" || exit 1
14 tar xJf ${DPDK_PACKAGE}
15 cd ./${DPDK_DIR}
16 make install T=x86_64-native-linuxapp-gcc -j || exit 1
17 cd ${PWDDIR}
18
19 #compile the l3fwd
20 export RTE_SDK=${ROOTDIR}/${DPDK_DIR}/
21 export RTE_TARGET=x86_64-native-linuxapp-gcc
22 cd ${RTE_SDK}/examples/l3fwd
23 make -j || exit 1
24 cd ${PWDDIR}
25
26 #check and setup the hugepages
27 SYS_HUGEPAGE=$(cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages)
28 if [ ${SYS_HUGEPAGE} -lt 4096 ]; then
29     MOUNT=$(mount | grep /mnt/huge)
30     while [ "${MOUNT}" != "" ]
31     do
32         sudo umount /mnt/huge
33         sleep 1
34         MOUNT=$(mount | grep /mnt/huge)
35     done
36
37     echo 2048 | sudo tee /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
38     echo 2048 | sudo tee /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
39
40     sudo mkdir -p /mnt/huge
41     sudo mount -t hugetlbfs nodev /mnt/huge/
42     test $? -eq 0 || exit 1
43 fi
44
45 #check and set the max map count
46 SYS_MAP=$(cat /proc/sys/vm/max_map_count)
47 if [ ${SYS_MAP} -lt 200000 ]; then
48     echo 200000 | sudo tee /proc/sys/vm/max_map_count
49 fi