blob: 7f9d01918c0773221f4e70b04ca1c2143ffe635d [file] [log] [blame]
Chetan Gaonker2d6473f2017-07-11 20:20:42 +00001#!/bin/bash
2
3#Get system info
4name=`uname -n`
5
6#Export env variables to inherit
7export MY_DIR=$(pwd)
8export DPDK_TAG=v16.11
9export OVS_TAG=branch-2.7
10
11#Clone repo and build DPDK
12git clone http://dpdk.org/git/dpdk -b $DPDK_TAG $MY_DIR/dpdk
13cd $MY_DIR/dpdk
14export RTE_SDK=$(pwd)
15export RTE_TARGET=x86_64-native-linuxapp-gcc
16make -j4 install T=$RTE_TARGET
17
18#Set for kernel mod
19sudo apt-get install libpcap-dev
20sudo apt-get install linux-headers-`uname -r`
21
22#Hugepage allocation
23sudo -E sysctl -w vm.nr_hugepages=1024
24sudo -E umount /dev/hugepages
25sudo -E mkdir -p /dev/hugepages
26sudo -E mount -t hugetlbfs -o pagesize=2048k none /dev/hugepages
27
28#Traffic generator powered by DPDK
29wget http://fast.dpdk.org/rel/dpdk-16.11.1.tar.xz
30wget http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-dpdk-pktgen-3.1.2.tar.gz
31tar -xf dpdk-16.11.1.tar.xz
32tar -xf pktgen-dpdk-pktgen-3.1.2.tar.gz
33
34#Export env vars and make
35export RTE_SDK=/home/ubuntu/dpdk-stable-16.11.1
36export PKTGEN=/home/ubuntu/pktgen-dpdk-pktgen-3.1.2
37export PKTGEN=/home/ubuntu/pktgen-dpdk-pktgen-3.1.2
38export RTE_TARGET=x86_64-native-linuxapp-gcc
39cd $RTE_SDK
40make install T=x86_64-native-linuxapp-gcc
41cd $PKTGEN
42make
43
44#Loads the UIO support module
45if lsmod | grep "uio" &> /dev/null ; then
46echo "uio module is loaded"
47else
48modprobe uio
49fi
50
51#Loading the the igb-uio.ko module
52if lsmod | grep "igb_uio" &> /dev/null ; then
53echo "igb_uio module is loaded"
54else
55insmod /dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
56fi
57
58iface=`python $RTE_SDK/tools/dpdk-devbind.py -s | awk '/ens4/ {print $1}'`
59python $RTE_SDK/tools/dpdk-devbind.py -b igb_uio $iface
60
61# RUN Pktgen
62# -c COREMASK (0x3ff) (1111111111) 10 cores used with first core used for pktgen,
63# -n Memory channels, -socket memory for each cpu, -m for memory allocation
64# -P Promiscuous mode for all ports
65./app/x86_64-native-linuxapp-gcc/pktgen -c 0x3ff -n 2 --proc-type auto --socket-mem 4096 -- -T -P -m "[2-5:6-9].0"