Skip to content

Commit bfad7ee

Browse files
committed
Merge branch 'dev'
2 parents eeb2979 + 7616399 commit bfad7ee

File tree

3,831 files changed

+353922
-124193
lines changed

Some content is hidden

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

3,831 files changed

+353922
-124193
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- master
8+
- dev
9+
10+
jobs:
11+
build-ubuntu:
12+
runs-on: ubuntu-latest
13+
container:
14+
image: shanakaprageeth/ubuntu24-dpdk:latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
- name: Install dependencies
19+
run: |
20+
apt-get -qq update
21+
apt-get -qq install -y libssl-dev ninja-build
22+
# using pre-built dpdk inside the container
23+
cp -r /root/dpdk/build dpdk/build
24+
cd dpdk
25+
ninja -C build install
26+
- name: Compile f-stack
27+
run: |
28+
cd lib/
29+
make
30+
- name: Archive production artifacts
31+
if: github.ref_name == 'master' || github.ref_name == 'dev'
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: build_output
35+
path: |
36+
dpdk/build
37+
lib

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ BSD 3-Clause, Copyright (c) 2009, Ben Hoyt.All rights reserved.
4040
6.Nginx
4141

4242
BSD 2-Clause, Copyright (C) 2002-2021 Igor Sysoev
43-
Copyright (C) 2011-2023 Nginx, Inc.
43+
Copyright (C) 2011-2025 Nginx, Inc.
4444
All rights reserved.
4545

4646
7.Redis

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
[![Build Status](https://travis-ci.org/F-Stack/f-stack.svg?branch=master)](https://travis-ci.org/F-Stack/f-stack)
2-
1+
![Build Status](https://github.com/F-Stack/f-stack/actions/workflows/ci.yml/badge.svg?branch=dev)
32
# F-Stack
43
![](F-Stack.png)
54

@@ -38,7 +37,6 @@ Currently, besides authorized DNS server of DNSPod, there are various products i
3837
yum install numactl-devel # on Centos
3938
#sudo apt-get install libnuma-dev # on Ubuntu
4039

41-
pip3 install pyelftools --upgrade
4240
# Install python and modules for running DPDK python scripts
4341
pip3 install pyelftools --upgrade # RedHat/Centos
4442
sudo apt install python # On ubuntu
@@ -50,9 +48,8 @@ Currently, besides authorized DNS server of DNSPod, there are various products i
5048
cd f-stack
5149
# Compile DPDK
5250
cd dpdk/
53-
# re-enable kni now, to remove kni later
54-
# disable crypto/openssl for Redhat/Centos 7.x.
55-
meson -Denable_kmods=true -Ddisable_libs=flow_classify -Ddisable_drivers=crypto/openssl build
51+
# igb_uio is about 5% more efficient than vfio-pci, so continue using it.
52+
meson -Denable_kmods=true build
5653
ninja -C build
5754
ninja -C build install
5855

@@ -75,7 +72,6 @@ Currently, besides authorized DNS server of DNSPod, there are various products i
7572
# For Linux:
7673
modprobe uio
7774
insmod /data/f-stack/dpdk/build/kernel/linux/igb_uio/igb_uio.ko
78-
insmod /data/f-stack/dpdk/build/kernel/linux/kni/rte_kni.ko carrier=on # carrier=on is necessary, otherwise need to be up `veth0` via `echo 1 > /sys/class/net/veth0/carrier`
7975
python dpdk-devbind.py --status
8076
ifconfig eth0 down
8177
python dpdk-devbind.py --bind=igb_uio eth0 # assuming that use 10GE NIC and eth0
@@ -149,7 +145,6 @@ for more details, see [nginx guide](https://github.com/F-Stack/f-stack/blob/mast
149145
sleep 10
150146
ifconfig veth0 <ipaddr> netmask <netmask>  broadcast <broadcast> hw ether <mac addr>
151147
route add -net 0.0.0.0 gw <gateway> dev veth0
152-
echo 1 > /sys/class/net/veth0/carrier # if `carrier=on` not set while `insmod rte_kni.ko`
153148
# route add -net ... # other route rules
154149

155150
## Nginx Testing Result
@@ -174,20 +169,31 @@ All of these test cases use CPUs' physical cores.
174169

175170

176171
CPS (Connection:close, Small data packet) test result
172+
177173
![](CPS.png)
178174

179175
CPS_Reuseport (Connection:close, Small data packet) test result, This test case runs in a different test environment
176+
180177
![](CPS_Reuseport.png)
181178

182179
RPS (Connection:Keep-Alive, Small data packet) test data
180+
183181
![](RPS.png)
184182

185183
Bandwidth (Connection:Keep-Alive, 3.7k bytes data packet) test data
184+
186185
![](Bandwidth.png)
187186

188187
## Licenses
188+
189189
See [LICENSE](LICENSE)
190190

191+
## Wiki
192+
193+
See [wiki page](https://github.com/F-Stack/f-stack/wiki).
194+
195+
And more info see [deepwiki of F-Stack](https://deepwiki.com/F-Stack/f-stack), [powered by devin](https://devin.ai/).
196+
191197
## Join us
192198

193199
Tencent Cloud F-Stack team developed F-Stack which is a general network framework based on DPDK and provides ultra high network performance. We are here looking for more and more talented people with great passion on technology to join us. You would have the chance to work with brightest minds on this planet and help Tencent cloud and F-stack continuously evolve. Send us your resume or refer your friend to us if you are interested in joining us.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24
1+
1.25

adapter/syscall/Makefile

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TOPDIR=..
1+
TOPDIR=../..
22

33
ifeq ($(FF_PATH),)
44
FF_PATH=${TOPDIR}
@@ -17,10 +17,24 @@ endif
1717
# If disable it, one socket can use in all threads.
1818
#FF_THREAD_SOCKET=1
1919

20+
# Epoll polling mode, now only support freebsd socket, not support FF_KERNEL_EVENT.
21+
# If disable it, epoll use sem_wait.
22+
#FF_PRELOAD_POLLING_MODE=1
23+
2024
# If enable FF_KERNEL_EVENT, epoll_create/epoll_clt/epoll_wait always call f-stack and system API at the same time.
2125
# Use for some scenarios similar to Nginx.
2226
#FF_KERNEL_EVENT=1
2327

28+
# If enable FF_USE_THREAD_STRUCT_HANDLE, every ff_so_context has one struct thread handle in fstack, fork will be supported
29+
# like linux kernel.
30+
#FF_USE_THREAD_STRUCT_HANDLE=1
31+
32+
# If FF_PRELOAD_SUPPORT_SELECT is enabled, we can use select in LD_PRELOAD mode.
33+
# However, we need to set the value of FF_KERNEL_MAX_FD_SELECT based on our requirements to ensure file descriptors
34+
# (FDs) for the user-space protocol stack can be covered by the select interface.
35+
#FF_PRELOAD_SUPPORT_SELECT=1
36+
#FF_KERNEL_MAX_FD_SELECT=128
37+
2438
PKGCONF ?= pkg-config
2539

2640
ifndef DEBUG
@@ -41,6 +55,18 @@ ifdef FF_MULTI_SC
4155
CFLAGS+= -DFF_MULTI_SC
4256
endif
4357

58+
ifdef FF_PRELOAD_POLLING_MODE
59+
CFLAGS+= -DFF_PRELOAD_POLLING_MODE
60+
endif
61+
62+
ifdef FF_USE_THREAD_STRUCT_HANDLE
63+
CFLAGS+= -DFF_USE_THREAD_STRUCT_HANDLE
64+
endif
65+
66+
ifdef FF_PRELOAD_SUPPORT_SELECT
67+
CFLAGS+= -DFF_PRELOAD_SUPPORT_SELECT -DFF_KERNEL_MAX_FD_SELECT=$(FF_KERNEL_MAX_FD_SELECT) -DFF_USE_THREAD_STRUCT_HANDLE
68+
endif
69+
4470
CFLAGS += -fPIC -Wall -Werror $(shell $(PKGCONF) --cflags libdpdk)
4571

4672
INCLUDES= -I. -I${FF_PATH}/lib

adapter/syscall/ff_adapter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
int ff_adapter_init();
1111
//int __attribute__((constructor)) ff_adapter_init(int argc, char * const argv[]);
1212

13+
int ff_adapter_child_process_init(void);
14+
1315
void alarm_event_sem();
1416

1517
/*-

adapter/syscall/ff_declare_syscalls.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ FF_SYSCALL_DECL(int, epoll_create, (int));
2828
FF_SYSCALL_DECL(int, epoll_ctl, (int, int, int, struct epoll_event *));
2929
FF_SYSCALL_DECL(int, epoll_wait, (int, struct epoll_event *, int, int));
3030
FF_SYSCALL_DECL(pid_t, fork, (void));
31+
FF_SYSCALL_DECL(int, select, (int , fd_set *, fd_set *, fd_set *, struct timeval *));
3132
#undef FF_SYSCALL_DECL

0 commit comments

Comments
 (0)