summaryrefslogtreecommitdiffstats
path: root/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script
blob: f18ed608b65a562ff764725183271c37f1cd3904 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

if [ $DIB_DEV_IMAGE != "loopvm" ]; then
    exit 0
fi

DPDK=dpdk-18.02
DPDK_UNTAR=dpdk-18.02

# pick up the kernel version for the target image
kernel_version=`ls -t /lib/modules | awk 'NR==1 {print}'`

mkdir dpdk
wget http://fast.dpdk.org/rel/$DPDK.tar.xz
tar xfJ $DPDK.tar.xz
cd $DPDK_UNTAR

export RTE_KERNELDIR=/lib/modules/$kernel_version/build
export ARCH=x86
make -j4 install T=x86_64-native-linuxapp-gcc

cp x86_64-native-linuxapp-gcc/app/testpmd ../dpdk
cp x86_64-native-linuxapp-gcc/kmod/igb_uio.ko ../dpdk
echo "set promisc all off" > /dpdk/testpmd_cmd.txt

cd ..
rm -f $DPDK.tar.xz
rm -rf $DPDK_UNTAR