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## Install libnuma-dev
16
17	# on Centos
18	yum install numactl-devel
19	# on Ubuntu
20	sudo apt-get install libnuma-dev
21
22## Compile DPDK
23
24Read DPDK Quick Started Guide or run the command below
25
26	cd /data/f-stack/dpdk/tools
27	./dpdk-setup.sh
28
29Compile with x86_64-native-linuxapp-gcc
30
31## Set hugepage
32
33For a single-node system, the command to use is as follows (assuming that 1024 pages are required):
34
35	echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
36
37On a NUMA machine, pages should be allocated explicitly on separate nodes:
38
39	echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
40	echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
41
42Once the hugepage memory is reserved, to make the memory available for DPDK use, perform the following steps:
43
44	mkdir /mnt/huge
45	mount -t hugetlbfs nodev /mnt/huge
46
47The mount point can be made permanent across reboots, by adding the following line to the `/etc/fstab` file:
48
49	nodev /mnt/huge hugetlbfs defaults 0 0
50
51## offload NIC
52
53	modprobe uio
54	insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
55	insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/rte_kni.ko
56	python dpdk-devbind.py --status
57	ifconfig eth0 down
58	python dpdk-devbind.py --bind=igb_uio eth0 # assuming that use 10GE NIC and eth0
59
60## Compile  lib
61
62	export FF_PATH=/data/f-stack
63	export FF_DPDK=/data/f-stack/dpdk/x86_64-native-linuxapp-gcc
64	cd ../../
65	cd lib
66	make
67
68### Compile Nginx
69
70	cd ../
71	cd app/nginx-1.11.10
72	./configure --prefix=/usr/local/nginx_fstack --with-ff_module
73	make
74	make install
75	cd ../../
76	/usr/local/nginx_fstack/sbin/nginx
77
78### Compile Redis
79
80	cd app/redis-3.2.8/
81	make
82	make install
83
84