-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetupDpdk.sh
executable file
·62 lines (44 loc) · 1.78 KB
/
setupDpdk.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#sudo bash ../utils/vm-kernel-upgrade.sh
#require rebooting
#sudo bash ../utils/vm-setup.sh
DPDK_HOME=~/tools/dpdk-stable-17.08.1
# add -DHG_MON=1 if you want dpdk to print memzone info.
CFLAGS="-g3 -Wno-error=maybe-uninitialized -fPIC"
sudo apt-get -y install build-essential ca-certificates curl \
libnuma-dev libpcap-dev xz-utils
# This is used when you want to monitor dpdk hugepage usage during runtime.
build_dpdk_hugepage_mon () {
if [ ! -d "dpdk-stable-17.08.1" ]; then
curl -sSf https://fast.dpdk.org/rel/dpdk-17.08.1.tar.xz | tar -xJv
elif [ ! -d "dpdk-stable-17.08.1/.git" ]; then
sudo rm -rf dpdk-stable-17.08.1/
git clone [email protected]:YangZhou1997/dpdk-stable-17.08.1.git
else
echo "Rebuild dpdk!"
fi
}
# This is used when you normally want to rebuild dpdk in case that you made some modification.
build_dpdk_normal () {
if [ ! -d "dpdk-stable-17.08.1" ]; then
curl -sSf https://fast.dpdk.org/rel/dpdk-17.08.1.tar.xz | tar -xJv
else
echo "Just build!"
fi
}
cd ~/tools
# build_dpdk_hugepage_mon
build_dpdk_normal
cp ~/utils/dpdk/common_linuxapp-17.08 $DPDK_HOME/config/common_linuxapp
cd $DPDK_HOME
make clean
make config T=x86_64-native-linuxapp-gcc EXTRA_CFLAGS="${CFLAGS}"
make -j16 EXTRA_CFLAGS="${CFLAGS}"
sudo make install
sudo insmod $DPDK_HOME/build/kmod/igb_uio.ko
sudo $DPDK_HOME/usertools/dpdk-devbind.py --force -b igb_uio 0000:02:00.0 0000:02:00.1 0000:02:00.2 0000:02:00.3
bash ~/NetBricks/setupDpdkCopy.sh
# hugepages setup on numa node
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
echo "please rebuild NetBricks to make dpdk changes valid"