Skip to content

Commit 76c5926

Browse files
author
logwang
committed
DPDK: upgrade to 17.11.2 LTS.
Changes: 1. This version is downloaded from https://fast.dpdk.org/rel/dpdk-17.11.2.tar.xz. 2. Adapt the new interface `rte_ring_dequeue_burst`. 3. Change the type of `port_id` from uint8_t to uint16_t. 4. Just link libdpdk.a instead of the other libaries. 5. Install libnuma-dev first. 6. Update the documents.
1 parent 2e160f1 commit 76c5926

File tree

2,251 files changed

+561228
-99375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,251 files changed

+561228
-99375
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,16 @@ Currently, besides authorized DNS server of DNSPod, there are various products i
3333
# clone F-Stack
3434
mkdir /data/f-stack
3535
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
36-
36+
37+
# install libnuma-dev
38+
yum install numactl-devel # on Centos
39+
#sudo apt-get install libnuma-dev # on Ubuntu
40+
3741
cd f-stack
3842
# compile DPDK
39-
cd dpdk/tools
43+
cd dpdk/usertools
4044
./dpdk-setup.sh # compile with x86_64-native-linuxapp-gcc
41-
45+
4246
# Set hugepage
4347
# single-node system
4448
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

app/micro_thread/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ endif
2929

3030
DEBUG= -g
3131
BINARY = libmt.a
32-
FF_LIBS+= -L${FF_PATH}/lib -L${FF_DPDK}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
33-
FF_LIBS+= -Wl,--whole-archive -lrte_pmd_vmxnet3_uio -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_pmd_e1000 -lrte_pmd_ring
34-
FF_LIBS+= -Wl,--whole-archive -lrte_hash -lrte_kvargs -Wl,-lrte_mbuf -lethdev -lrte_eal -Wl,-lrte_mempool
35-
FF_LIBS+= -lrte_ring -lrte_cmdline -lrte_cfgfile -lrte_kni -lrte_timer -Wl,-lrte_pmd_virtio
36-
FF_LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -pthread
32+
FF_LIBS+= -L${FF_PATH}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
33+
FF_LIBS+= -L${FF_DPDK}/lib -Wl,--whole-archive,-ldpdk,--no-whole-archive
34+
FF_LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -lpthread -lnuma
3735

3836
# Comment the following line if you are not using the gnu c compiler
3937
#C_ARGS = -Wall -g -fPIC -D_DEBUG

app/nginx-1.11.10/auto/make

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ if [ ! $FF_DPDK ]; then
2828
echo "FF_DPDK environment variable not defined, default:$FF_DPDK"
2929
fi
3030

31-
CORE_LIBS="$CORE_LIBS -L$FF_PATH/lib -L$FF_DPDK/lib -Wl,--whole-archive,-lfstack,--no-whole-archive"
32-
CORE_LIBS="$CORE_LIBS -g -Wl,--no-as-needed -fvisibility=default -pthread -lm -lrt"
33-
CORE_LIBS="$CORE_LIBS -Wl,--whole-archive -lrte_pmd_vmxnet3_uio -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_pmd_e1000 -lrte_pmd_ring"
34-
CORE_LIBS="$CORE_LIBS -Wl,--whole-archive -lrte_hash -lrte_kvargs -Wl,-lrte_mbuf -lethdev -lrte_eal -Wl,-lrte_mempool"
35-
CORE_LIBS="$CORE_LIBS -lrte_ring -lrte_cmdline -lrte_cfgfile -lrte_kni -lrte_timer -Wl,-lrte_pmd_virtio"
36-
CORE_LIBS="$CORE_LIBS -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto"
31+
CORE_LIBS="$CORE_LIBS -L$FF_PATH/lib -Wl,--whole-archive,-lfstack,--no-whole-archive"
32+
CORE_LIBS="$CORE_LIBS -L$FF_DPDK/lib -Wl,--whole-archive,-ldpdk,--no-whole-archive"
33+
CORE_LIBS="$CORE_LIBS -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -lpthread -lnuma"
3734

3835
cat << END > $NGX_MAKEFILE
3936

app/redis-3.2.8/src/Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ifeq ($(FF_PATH),)
1616
$(error variable FF_PATH is not set)
1717
endif
1818
ifeq ($(FF_DPDK),)
19-
$(error variable FF_DPDK is not set)
19+
FF_DPDK= $(FF_PATH)/dpdk/x86_64-native-linuxapp-gcc
2020
endif
2121

2222
release_hdr := $(shell sh -c './mkreleasehdr.sh')
@@ -119,12 +119,9 @@ endif
119119
FINAL_CFLAGS+= -DHAVE_FF_KQUEUE
120120
FINAL_CFLAGS+= -I$(FF_PATH)/lib
121121

122-
FINAL_LIBS+= -L$(FF_PATH)/lib -L$(FF_DPDK)/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
123-
FINAL_LIBS+= -g -Wl,--no-as-needed -fvisibility=default -pthread -lm -lrt
124-
FINAL_LIBS+= -Wl,--whole-archive -lrte_pmd_vmxnet3_uio -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_pmd_e1000 -lrte_pmd_ring
125-
FINAL_LIBS+= -Wl,--whole-archive -lrte_hash -lrte_kvargs -Wl,-lrte_mbuf -lethdev -lrte_eal -Wl,-lrte_mempool
126-
FINAL_LIBS+= -lrte_ring -lrte_cmdline -lrte_cfgfile -lrte_kni -lrte_timer -Wl,-lrte_pmd_virtio
127-
FINAL_LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lm -lcrypto
122+
FINAL_LIBS+= -L${FF_PATH}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
123+
FINAL_LIBS+= -L${FF_DPDK}/lib -Wl,--whole-archive,-ldpdk,--no-whole-archive
124+
FINAL_LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -lpthread -lnuma
128125

129126
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
130127
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)

doc/F-Stack_Development_Guide.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# F-Stack Development Guide
22

3-
With the rapid development of NIC, the poor performance of data packets processing with Linux kernel has become the bottleneck. However the rapid development of the Internet needs high performance of network processing, kernel bypass has caught more and more attention. There are various similar technologies appear, such as DPDK, NETMAP and PF_RING. The main idea of kernel bypass is that Linux is only used to deal with control flow, all data streams are processed in user space. Therefore kernel bypass can avoid performance bottlenecks caused by kernel packet copy, thread scheduling, system calls and interrupt. Further more, kernel bypass can achieve higher performance with multi optimizing methods. Within various techniques, DPDK has been widely used because of its more thorough isolation from kernel scheduling and active community support.
3+
With the rapid development of Network Interface Cards the poor performance of data packet processing with the Linux kernel has become the bottleneck in modern network systems. Yet, the increasing demands of the Internet's growth demand a higher performant network processing solution. Kernel bypass has emerged to catch more and more attention. There are various similar technologies such as: DPDK, NETMAP and PF_RING. The main idea of kernel bypass is that Linux is only used to deal with control flow; all data streams are processed in user space. Therefore, kernel bypass can avoid performance bottlenecks caused by kernel packet copying, thread scheduling, system calls, and interrupts. Furthermore, kernel bypass can achieve higher performance with multi-optimizing methods. Within various techniques, DPDK has been widely used because of it's more thorough isolation from kernel scheduling and active community support.
44

5-
F-Stack is an open source network framework with high performance based on DPDK. With follow characteristics
5+
F-Stack is an open source high performant network framework based on DPDK with the following characteristics:
66

7-
1. Ultra high network performance which can achieve network card under full load, 10 million concurrent, five million RPS, 1 million CPS.
8-
2. Transplant FreeBSD 11.01 user space stack, provides a complete stack function, cut a great amount of irrelevant features. Therefore greatly enhance the performance.
9-
3. Support Nginx, Redis and other mature applications, service can easily use F-Stack
10-
4. With Multi-process architecture, easy to extend
11-
5. Provide micro thread interface. Various applications with long time consuming can easily use F-Stack to get high performance without processing complex asynchronous logic.
12-
6. Provide Epoll/kqueue interface that allow many kinds of applications easily use F-Stack
7+
1. Ultra high network performance which the network card can achieve under full load: 10 million concurrent connections, 5 million RPS, 1 million CPS.
8+
2. Transplant FreeBSD 11.01 user space stack, which provides a complete stack function, and cut a great amount of irrelevant features. This greatly enhances network performance.
9+
3. Support Nginx, Redis, and other mature applications. Services can easily use F-Stack.
10+
4. Easy to extend with multi-process architecture.
11+
5. Provides micro thread interface. Various applications with stateful applications can easily use F-Stack to get high performance without processing complex asynchronous logic.
12+
6. Provide an Epoll/Kqueue interface that allow many kinds of applications to easily use F-Stack.
1313

1414
## Structure of F-Stack code
1515

doc/F-Stack_Quick_Start_Guide.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@
77

88
See Intel DPDK [linux_gsg](http://dpdk.org/doc/guides/linux_gsg/index.html)
99

10-
## clone F-Stack
10+
## Clone F-Stack
1111

1212
mkdir /data/f-stack
1313
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
1414

15+
## Install libnuma-dev
16+
17+
# on Centos
18+
yum install numactl-devel
19+
# on Ubuntu
20+
sudo apt-get install libnuma-dev
21+
1522
## Compile DPDK
1623

1724
Read DPDK Quick Started Guide or run the command below
@@ -43,20 +50,20 @@ The mount point can be made permanent across reboots, by adding the following li
4350

4451
## offload NIC
4552

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
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
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
5259

5360
## Compile lib
5461

55-
export FF_PATH=/data/f-stack
56-
export FF_DPDK=/data/f-stack/dpdk/x86_64-native-linuxapp-gcc
57-
cd ../../
58-
cd lib
59-
make
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
6067

6168
### Compile Nginx
6269

doc/Launch_F-Stack_on_AWS_EC2_in_one_minute.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
If you have a Redhat7.3 EC2 instance,and then execute the following cmds, you will get the F-Stack server in one minute
44

55
sudo -i
6-
yum install -y git gcc openssl-devel kernel-devel-$(uname -r) bc
7-
6+
yum install -y git gcc openssl-devel kernel-devel-$(uname -r) bc numactl-devel
7+
88
mkdir /data/f-stack
99
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
1010

@@ -17,7 +17,7 @@
1717
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
1818
mkdir /mnt/huge
1919
mount -t hugetlbfs nodev /mnt/huge
20-
20+
2121
# close ASLR; it is necessary in multiple process
2222
echo 0 > /proc/sys/kernel/randomize_va_space
2323

@@ -40,7 +40,7 @@
4040
#export mybc=`ifconfig eth0 | grep "Bcast" | awk -F ' ' '{print $3}' | awk -F ':' '{print $2}'`
4141
#export myhw=`ifconfig eth0 | grep "HWaddr" | awk -F ' ' '{print $5}'`
4242
#export mygw=`route -n | grep 0.0.0.0 | grep eth0 | grep UG | awk -F ' ' '{print $2}'
43-
43+
4444
sed "s/addr=192.168.1.2/addr=${myaddr}/" -i /data/f-stack/config.ini
4545
sed "s/netmask=255.255.255.0/netmask=${mymask}/" -i /data/f-stack/config.ini
4646
sed "s/broadcast=192.168.1.255/broadcast=${mybc}/" -i /data/f-stack/config.ini
@@ -53,7 +53,6 @@
5353
sed "s/#tcp_port=80/tcp_port=80/" -i /data/f-stack/config.ini
5454
sed "s/#vlanstrip=1/vlanstrip=1/" -i /data/f-stack/config.ini
5555

56-
5756
# Compile F-Stack lib
5857
export FF_PATH=/data/f-stack
5958
export FF_DPDK=/data/f-stack/dpdk/build
@@ -68,7 +67,7 @@
6867

6968
# offload NIC(if there is only one NIC,the follow commands must run in a script)
7069
ifconfig eth0 down
71-
python /data/f-stack/dpdk/tools/dpdk-devbind.py --bind=igb_uio eth0
70+
python /data/f-stack/dpdk/usertools/dpdk-devbind.py --bind=igb_uio eth0
7271

7372
# copy config.ini to $NGX_PREFIX/conf/f-stack.conf
7473
cp /data/f-stack/config.ini /usr/local/nginx_fstack/conf/f-stack.conf

dpdk/.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.c diff=cpp
2+
*.h diff=cpp
3+
*.py diff=python

dpdk/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
doc/guides/nics/overview_table.txt
2+
doc/guides/cryptodevs/overview_feature_table.txt
3+
doc/guides/cryptodevs/overview_cipher_table.txt
4+
doc/guides/cryptodevs/overview_auth_table.txt
5+
doc/guides/cryptodevs/overview_aead_table.txt
6+
cscope.out.po
7+
cscope.out.in
8+
cscope.out
9+
cscope.files
10+
GTAGS
11+
GPATH
12+
GRTAGS
13+
tags
14+
TAGS

dpdk/GNUmakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ export RTE_SDK
4141
#
4242

4343
ROOTDIRS-y := buildtools lib drivers app
44+
ROOTDIRS- := test
4445

4546
include $(RTE_SDK)/mk/rte.sdkroot.mk

0 commit comments

Comments
 (0)