2017-04-21 10:43:26 +00:00
|
|
|
# F-Stack Quick Start Guide
|
|
|
|
|
|
|
|
F-Stack is an open source high performance network framework based on DPDK.
|
|
|
|
|
|
|
|
|
|
|
|
## System Requirements
|
|
|
|
|
|
|
|
See Intel DPDK [linux_gsg](http://dpdk.org/doc/guides/linux_gsg/index.html)
|
|
|
|
|
2018-05-28 09:11:06 +00:00
|
|
|
## clone F-Stack
|
2017-04-21 10:43:26 +00:00
|
|
|
|
|
|
|
mkdir /data/f-stack
|
|
|
|
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
|
|
|
|
|
|
|
|
## Compile DPDK
|
|
|
|
|
|
|
|
Read DPDK Quick Started Guide or run the command below
|
|
|
|
|
2021-02-05 08:42:07 +00:00
|
|
|
cd /data/f-stack/dpdk
|
|
|
|
meson build
|
|
|
|
ninja -C build
|
|
|
|
ninja -C build install
|
2017-04-21 10:43:26 +00:00
|
|
|
|
|
|
|
## Set hugepage
|
|
|
|
|
|
|
|
For a single-node system, the command to use is as follows (assuming that 1024 pages are required):
|
|
|
|
|
|
|
|
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
|
|
|
|
|
|
|
|
On a NUMA machine, pages should be allocated explicitly on separate nodes:
|
|
|
|
|
|
|
|
echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
|
|
|
|
echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
|
|
|
|
|
|
|
|
Once the hugepage memory is reserved, to make the memory available for DPDK use, perform the following steps:
|
|
|
|
|
|
|
|
mkdir /mnt/huge
|
|
|
|
mount -t hugetlbfs nodev /mnt/huge
|
|
|
|
|
|
|
|
The mount point can be made permanent across reboots, by adding the following line to the `/etc/fstab` file:
|
|
|
|
|
|
|
|
nodev /mnt/huge hugetlbfs defaults 0 0
|
|
|
|
|
|
|
|
## offload NIC
|
|
|
|
|
2018-05-28 09:11:06 +00:00
|
|
|
modprobe uio
|
|
|
|
insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
|
2019-06-26 10:37:55 +00:00
|
|
|
insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/rte_kni.ko carrier=on
|
2018-05-28 09:11:06 +00:00
|
|
|
python dpdk-devbind.py --status
|
|
|
|
ifconfig eth0 down
|
|
|
|
python dpdk-devbind.py --bind=igb_uio eth0 # assuming that use 10GE NIC and eth0
|
2017-04-21 10:43:26 +00:00
|
|
|
|
|
|
|
## Compile lib
|
|
|
|
|
2021-02-05 08:42:07 +00:00
|
|
|
# Upgrade pkg-config while version < 0.28
|
|
|
|
cd /data/
|
|
|
|
wget https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
|
|
|
|
tar xzvf pkg-config-0.29.2.tar.gz
|
|
|
|
cd pkg-config-0.29.2
|
|
|
|
./configure --with-internal-glib
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
mv /usr/bin/pkg-config /usr/bin/pkg-config.bak
|
|
|
|
ln -s /usr/local/bin/pkg-config /usr/bin/pkg-config
|
|
|
|
|
2018-05-28 09:11:06 +00:00
|
|
|
export FF_PATH=/data/f-stack
|
2021-02-05 08:42:07 +00:00
|
|
|
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib/pkgconfig
|
|
|
|
cd /data/f-stack
|
2018-05-28 09:11:06 +00:00
|
|
|
cd lib
|
|
|
|
make
|
2017-04-21 10:43:26 +00:00
|
|
|
|
|
|
|
### Compile Nginx
|
|
|
|
|
|
|
|
cd ../
|
2019-10-31 08:35:06 +00:00
|
|
|
cd app/nginx-1.16.1
|
2017-04-21 10:43:26 +00:00
|
|
|
./configure --prefix=/usr/local/nginx_fstack --with-ff_module
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
cd ../../
|
2017-08-23 08:54:32 +00:00
|
|
|
/usr/local/nginx_fstack/sbin/nginx
|
2017-04-21 10:43:26 +00:00
|
|
|
|
|
|
|
### Compile Redis
|
|
|
|
|
2019-11-23 03:08:39 +00:00
|
|
|
cd app/redis-5.0.5/
|
2017-04-21 10:43:26 +00:00
|
|
|
make
|
2018-05-28 09:11:06 +00:00
|
|
|
# run with start.sh
|
|
|
|
./start.sh -b ./redis-server -o /path/to/redis.conf
|
|
|
|
# or run like this:
|
2019-03-12 09:03:59 +00:00
|
|
|
#./redis-server --conf config.ini --proc-type=primary --proc-id=0 /path/to/redis.conf
|
2017-04-21 10:43:26 +00:00
|
|
|
|