diff options
author | Fangyin Hu <fangyinx.hu@intel.com> | 2016-11-25 03:52:22 -0800 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2017-01-11 13:21:52 +0000 |
commit | b633f4ebf7878ae968e27b71da69b6cde0265904 (patch) | |
tree | c7b8949f4fe5e56ae15e177afd0b2051266ba881 /dpdk-tests/dpdk_scripts/install_dpdk.sh | |
parent | 6858eef6792e7fae60c7fe2587721e2873bd5fc3 (diff) |
Add the DPDK l2fwd performance test cases.
Change-Id: I996847a4871ed994cd9b5edb459fb079ff39c86d
Signed-off-by: Fangyin Hu <fangyinx.hu@intel.com>
Diffstat (limited to 'dpdk-tests/dpdk_scripts/install_dpdk.sh')
-rwxr-xr-x | dpdk-tests/dpdk_scripts/install_dpdk.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/dpdk-tests/dpdk_scripts/install_dpdk.sh b/dpdk-tests/dpdk_scripts/install_dpdk.sh new file mode 100755 index 0000000000..99fa957d59 --- /dev/null +++ b/dpdk-tests/dpdk_scripts/install_dpdk.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +DPDK_VERSION=16.07 +DPDK_DIR=dpdk-${DPDK_VERSION} +DPDK_PACKAGE=${DPDK_DIR}.tar.xz + +ROOTDIR=/tmp/openvpp-testing +PWDDIR=$(pwd) + +#download the DPDK package +#compile and install the DPDK +cd ${ROOTDIR} +wget -q "fast.dpdk.org/rel/${DPDK_PACKAGE}" || exit 1 +tar xJf ${DPDK_PACKAGE} +cd ./${DPDK_DIR} +make install T=x86_64-native-linuxapp-gcc -j || exit 1 +cd ${PWDDIR} + +#compile the l3fwd +export RTE_SDK=${ROOTDIR}/${DPDK_DIR}/ +export RTE_TARGET=x86_64-native-linuxapp-gcc +cd ${RTE_SDK}/examples/l3fwd +make -j || exit 1 +cd ${PWDDIR} + +#check and setup the hugepages +SYS_HUGEPAGE=$(cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages) +if [ ${SYS_HUGEPAGE} -lt 4096 ]; then + MOUNT=$(mount | grep /mnt/huge) + while [ "${MOUNT}" != "" ] + do + sudo umount /mnt/huge + sleep 1 + MOUNT=$(mount | grep /mnt/huge) + done + + echo 2048 | sudo tee /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages + echo 2048 | sudo tee /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages + + sudo mkdir -p /mnt/huge + sudo mount -t hugetlbfs nodev /mnt/huge/ + test $? -eq 0 || exit 1 +fi + +#check and set the max map count +SYS_MAP=$(cat /proc/sys/vm/max_map_count) +if [ ${SYS_MAP} -lt 200000 ]; then + echo 200000 | sudo tee /proc/sys/vm/max_map_count +fi |