1# F-Stack Quick Start Guide
2
3  F-Stack is an open source high performance network framework based on DPDK.
4
5
6## System Requirements
7
8See Intel DPDK [linux_gsg](http://dpdk.org/doc/guides/linux_gsg/index.html)
9
10## clone F-Stack
11
12	mkdir /data/f-stack
13	git clone https://github.com/F-Stack/f-stack.git /data/f-stack
14
15## Compile DPDK
16
17Read DPDK Quick Started Guide or run the command below
18
19	cd /data/f-stack/dpdk
20	meson build
21	ninja -C build
22	ninja -C build install
23
24## Set hugepage
25
26For a single-node system, the command to use is as follows (assuming that 1024 pages are required):
27
28	echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
29
30On a NUMA machine, pages should be allocated explicitly on separate nodes:
31
32	echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
33	echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
34
35Once the hugepage memory is reserved, to make the memory available for DPDK use, perform the following steps:
36
37	mkdir /mnt/huge
38	mount -t hugetlbfs nodev /mnt/huge
39
40The mount point can be made permanent across reboots, by adding the following line to the `/etc/fstab` file:
41
42	nodev /mnt/huge hugetlbfs defaults 0 0
43
44## offload NIC
45
46    modprobe uio
47    insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
48    insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/rte_kni.ko carrier=on
49    python dpdk-devbind.py --status
50    ifconfig eth0 down
51    python dpdk-devbind.py --bind=igb_uio eth0 # assuming that use 10GE NIC and eth0
52
53## Compile  lib
54
55    # Upgrade pkg-config while version < 0.28
56    cd /data/
57    wget https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
58    tar xzvf pkg-config-0.29.2.tar.gz
59    cd pkg-config-0.29.2
60    ./configure --with-internal-glib
61    make
62    make install
63    mv /usr/bin/pkg-config /usr/bin/pkg-config.bak
64    ln -s /usr/local/bin/pkg-config /usr/bin/pkg-config
65
66    export FF_PATH=/data/f-stack
67    export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib/pkgconfig
68    cd /data/f-stack
69    cd lib
70    make
71
72### Compile Nginx
73
74	cd ../
75	cd app/nginx-1.16.1
76	./configure --prefix=/usr/local/nginx_fstack --with-ff_module
77	make
78	make install
79	cd ../../
80	/usr/local/nginx_fstack/sbin/nginx
81
82### Compile Redis
83
84	cd app/redis-5.0.5/
85	make
86	# run with start.sh
87	./start.sh -b ./redis-server -o /path/to/redis.conf
88	# or run like this:
89	#./redis-server --conf config.ini --proc-type=primary --proc-id=0 /path/to/redis.conf
90
91