6 DPDK_VERSION=dpdk-17.02
7 DPDK_DIR=${DPDK_VERSION}
8 DPDK_PACKAGE=${DPDK_DIR}.tar.xz
9 ROOTDIR=/tmp/openvpp-testing
12 # Download the DPDK package
14 wget "fast.dpdk.org/rel/${DPDK_PACKAGE}" || \
15 { echo "Failed to download $DPDK_PACKAGE"; exit 1; }
16 tar xJvf ${DPDK_PACKAGE} || \
17 { echo "Failed to extract $DPDK_PACKAGE"; exit 1; }
21 make install T=x86_64-native-linuxapp-gcc -j || \
22 { echo "Failed to compile $DPDK_VERSION"; exit 1; }
26 export RTE_SDK=${ROOTDIR}/${DPDK_DIR}/
27 export RTE_TARGET=x86_64-native-linuxapp-gcc
28 cd ${RTE_SDK}/examples/l3fwd
30 { echo "Failed to compile l3fwd"; exit 1; }
33 # Check and setup the hugepages
34 SYS_HUGEPAGE=$(cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages)
35 echo " SYS_HUGEPAGE = ${SYS_HUGEPAGE}"
36 if [ ${SYS_HUGEPAGE} -lt 4096 ]; then
37 echo " It is not enough, should be at least 4096"
38 MOUNT=$(mount | grep /mnt/huge)
39 while [ "${MOUNT}" != "" ]
43 MOUNT=$(mount | grep /mnt/huge)
46 echo 2048 | sudo tee /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
47 echo 2048 | sudo tee /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
49 echo " Mounting hugepages"
50 sudo mkdir -p /mnt/huge
51 sudo mount -t hugetlbfs nodev /mnt/huge/ || \
52 { echo "Failed to mount hugepages"; exit 1; }
55 # Check and set the max map count
56 SYS_MAP=$(cat /proc/sys/vm/max_map_count)
58 if [ ${SYS_MAP} -lt 200000 ]; then
59 echo 200000 | sudo tee /proc/sys/vm/max_map_count