Commit Graph

1200 Commits

Author SHA1 Message Date
sarosh 9582dbb778 fix cmsg for sendmsg 2023-06-12 15:04:29 +05:00
Jiajie Chen 15450d6666 Fix netmask in nginx conf
Reported by @JisonRWang in #754.
2023-05-31 14:56:59 +08:00
fengbojiang cbcadd4435 update doc of syscall. 2023-05-18 11:19:40 +08:00
fengbojiang d5d872badf Update syscall's REAMDME. 2023-05-12 16:26:57 +08:00
fengbojiang 52c04c6c7f Update url of LD_PRELOAD. 2023-05-04 16:19:04 +08:00
johnjiang 4c623d4a5f
Update README.md
Modify url.
2023-05-03 23:51:30 +08:00
fengbojiang 419e3b16fe Merge branch 'preload_syscall' into dev 2023-05-03 23:25:53 +08:00
fengbojiang 3e1a3d8082 Add README.md。 2023-05-03 23:23:09 +08:00
fengbojiang 6c13a60c87 Add adapter/README.md. 2023-05-03 17:16:01 +08:00
fengbojiang 8d38554a6f Add LICENSE. 2023-05-03 17:09:29 +08:00
fengbojiang f52469fde1 move /app/micro_thread to adapter/micro_thread. 2023-05-03 17:06:40 +08:00
fengbojiang 8f5f1dfbb0 Move adapter diretcory's all file to adapter/syscall. 2023-05-03 17:04:14 +08:00
fengbojiang b64f360ebc 1. Add main_stack_epoll_kernel.c for helloworld_stack_epoll_kernel that support f-stack and kernel stack at the same time.
2. move all main_stack*.c to adapter directory.
2023-05-03 16:59:40 +08:00
fengbojiang 94d26c8a13 modify IOV_MAX to 16. 2023-05-03 12:02:19 +08:00
fengbojiang edeb90e0b5 fix an issue that close sockfd while Nginx exiting. 2023-04-28 14:48:18 +08:00
fengbojiang 3d3266071c Use ff_global_cfg.dpdk.pkt_tx_delay to delay ff_handle_each_context to
improve the performance of nginx.
2023-04-28 12:26:11 +08:00
fengbojiang 1b25a84cc6 Fix waring. 2023-04-27 20:47:43 +08:00
fengbojiang 85173ced83 try reduce the number of call ff_linux_epoll_wait(). 2023-04-27 20:41:54 +08:00
fengbojiang 8ae79cd438 support mutli ff_so_zones. 2023-04-27 18:34:44 +08:00
fengbojiang 3240dd0dad Add FF_MULTI_SC macro definition to support some special application scenarios, let the child process worker inherit the specified sc.
Like Nginx with reuseport.
  Parent process socket/bind/listen multi sockets, and use them in different child process worker.

  All child process workers must be forked by the same process, scilicet:
    support master fork child1, [child1 fork child2], chilid2 fork worker1/worker2/worker3...
    But not support master fork worker1, worker fork worker2, worker2 fork worker3...

2. modify some log.
2023-04-27 17:24:32 +08:00
fengbojiang f98fd1a615 Don't free the memory malloc with rte_malloc in more socket API to
improve proformance, such as ff_hook_writev(), ff_hook_ioctl(), ff_hook_setsockopt(), etc.

But there are some others socket API not support this now, such as
ff_hook_recvmsg(), ff_hook_readv(), ff_hook_sendmsg, because it not be
used now, and do it is relatively troublesome, So If you need call them
very frequently, maybe you should support it, and can see
ff_hook_writev().

Now it will cause memory lead, need to fix it later.
2023-04-26 15:29:15 +08:00
fengbojiang a791578c8a Fix the issue that memory leak in ff_hook_ioctl and ff_hook_getsockopt. 2023-04-25 15:01:22 +08:00
fengbojiang 77d7051991 Nginx can basic work with libff_syscall.so without any code modify now.
1. Add FF_KERNEL_EVENT argument, default disable. If enable FF_KERNEL_EVENT, epoll_create/epoll_clt/epoll_wait always call f-stack and system API at the same time. Use for some scenarios similar to Nginx. And F-Stack's kern.maxfiles value shoudn't > 65536.
2. Fix the issue that abs_timeout possibly is negative numbers.
3. If timeout < 0, such as -1, ff_hook_epoll_wait will run loop always until return some events.
3. Add some log.
2023-04-25 11:59:10 +08:00
fengbojiang ac0321e70e Add refcoount in sc for fork and detach. 2023-04-23 11:32:33 +08:00
fengbojiang dd7dc378ef opt code. 2023-04-23 10:51:56 +08:00
fengbojiang cf587718c2 set cpu affinity in main_stack_thread_socket.c. 2023-04-19 13:54:10 +08:00
fengbojiang 3cd0ab86b6 1. Reduce the number of locks with dirty read first, and then try to lock sc and real read. QPS:360k -> 380k.
2. memory alignment. QPS:380k -> 400k.
2023-04-14 14:37:15 +08:00
fengbojiang 4af5a643fb 1. Fixed some issue that sem_timewait and sem_post.
2. Modify timeout of epoll_wait/kevent from 100us to 100ms by default.
3. set cpu affinity in main_stack_epoll_thread socket.
2023-04-13 19:27:57 +08:00
fengbojiang d3fabc9cef some opt. 2023-04-13 19:05:46 +08:00
fengbojiang e45925dd79 Don't free the memory malloc with rte_malloc in most commonly used socket API, to improve proformance.
The performance of single instance from 200,000 QPS improve to 260,000QPS.
NOTE:May cause memory leak.
2023-04-12 18:57:59 +08:00
fengbojiang dfb462caa7 Save the event num kevent or epoll_wait returned, Use for burst process event in one F-Stack loop to improve performance.
The performance of single instance improve from 4500 QPS to 200, 000
QPS.
2023-04-12 18:55:27 +08:00
fengbojiang f85c52e341 Don't sleep while no event triggerd in demo. 2023-04-12 17:49:16 +08:00
fengbojiang 2471d2560c Modify some log. 2023-04-12 17:48:39 +08:00
fengbojiang 739ea21764 Add some log. 2023-04-12 12:03:34 +08:00
fengbojiang 03b606ff9b Support timeout is NULL or 0 in libffsyscall.so.
And support it in main_stack.c.
2023-04-12 12:00:53 +08:00
fengbojiang e58d683b24 burst copy in ff_hook_epoll_wait. 2023-04-12 10:15:22 +08:00
fengbojiang 1d09ad5003 Fixed some issue that check the return value of sem_timedwait. 2023-04-11 17:51:34 +08:00
fengbojiang 8766cedde1 Add timeout in kevent. 2023-04-08 09:29:50 +08:00
fengbojiang f27d862f85 1. Add kevent demo, need link libff_syscall.so, not LD_PRELOAD.
2. Fix some issues.
2023-04-07 20:39:31 +08:00
fengbojiang e8ed03b521 Modify FF_SOCKET_THREAD disable by default. 2023-04-07 13:44:41 +08:00
johnjiang 30907c8c55
Merge pull request #751 from wenchengji159357/dev
Dev
2023-04-07 12:35:56 +08:00
fengbojiang 88318c48c4 Fix lock issue. 2023-04-07 12:00:02 +08:00
fengbojiang c0677726be Add main_stack_epoll_pipeline, and must disable FF_THREAD_SOCKET before build adapter. 2023-04-07 11:27:34 +08:00
fengbojiang 5a01e6f99b Optimize some code of main_stack_epoll. 2023-04-07 11:26:30 +08:00
fengbojiang baceb8fd64 1. Add FF_PROC_ID environment variable to fix the issue that secondary APP's process get sc
from the first ff_so_zone.
2. SIGINT can destructor sc.
2023-04-07 10:43:37 +08:00
fengbojiang 7492bfbcb6 Add helloworld_stack_epoll for demo. 2023-04-06 21:53:02 +08:00
fengbojiang 799c39d5f0 Fix the issue that not detach sc while destructor in exit. 2023-04-06 21:48:57 +08:00
fengbojiang 0efc8b3374 Fixed some issue in multi instances. 2023-04-06 19:09:55 +08:00
fengbojiang edcac626c5 Optimize some code. 2023-04-06 18:23:35 +08:00
fengbojiang fe7e360eca Add FF_THREAD_SOCKET in Makefile, Whether to use thread-level socket,
default enable.
2023-04-06 18:02:47 +08:00