Commit Graph

49 Commits (e793248e6a38fe8deb4894c98cfede416d0a2050)

Author SHA1 Message Date
chenwei 46de49a1b5 Nginx: fixbug, hijack `getpeername` and `getsockname`. 2018-05-27 12:29:26 +08:00
logwang 76c59264b6 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.
2018-05-15 17:49:22 +08:00
chenwei 57cbfd9c19 Nginx: fixbug, support `NGX_PROCESS_HELPER` .e.g cache, refer to #142 2018-05-04 17:02:02 +08:00
chenwei 702a9cad2d Nginx: fixbug, hijack `__recv_chk`.
Nginx maybe call `__recv_chk` with https because of _FORTIFY_SOURCE.
Refer to #179.
See _FORTIFY_SOURCE (since glibc 2.3.4)
2018-04-16 18:52:58 +08:00
chenwei f2602fcff6 Nginx: bugfix, shouldnot pollute `socket type` 2018-04-10 17:28:10 +08:00
chenwei 6ef175012c Nginx: some logs are no longer needed on nginx-fstack. 2018-04-09 15:42:21 +08:00
陈威 778eaa4b45
Nginx : a more friendly hint
If the f-stack primary process hasn't been initialized successful, the nginx master gives a more friendly hint.
2018-03-22 15:41:17 +08:00
chenwei 7703b7e50a Nginx: bugfix, secondary worker should be spawned after primary worker completing initialization of fstack(dpdk)
When starting nginx with mutil-processes, secondary worker may be spawned before primary worker completing initialization of fstack(dpdk), so errors occurred, for one, in kni.
2018-03-12 17:13:02 +08:00
logwang 6b34d16078 Set the default configuration `kern.ncallout`(number of entries in
callwheel and size of timeout() preallocation).
2018-03-01 16:07:35 +08:00
chenwei 65c723a426 Nginx : bugfix, changing `listening socket type` in cycle may lead to errors.
Uses a temporaty variable to hold of potentially changing socket type but
does not modify `listening socket type` in cycle.
2018-03-01 15:39:33 +08:00
chenwei 42f547056e Nginx: revise indent. 2018-02-24 17:08:59 +08:00
chenwei 76e16b226f Nginx : add a creation flag SOCK_FSTACK(create-fstack-socket) for socket()
1. `#define SOCK_FSTACK 0x1000`
2. when we want to create socket by fstack, we code like this :
`s = ngx_socket(domain, type | SOCK_FSTACK , protocol);`
2018-02-24 16:45:10 +08:00
chenwei d1d95d5185 Nginx : directive proxy_kernel_network_stack
1. Add a new directive proxy_kernel_network_stack :
    Syntax: 	proxy_kernel_network_stack on | off;
    Default: 	proxy_kernel_network_stack off;
   Context: 	http, stream, mail, server
  This directive is available only when NGX_HAVE_FF_STACK is defined.
  Determines whether proxy should go throught kernel network stack or fstack.
2.Update F-Stack_Nginx_APP_Guide.md
2018-02-05 15:55:20 +08:00
chenwei 4e5f8d85e1 Nginx : replace macro with inline function to implement ```ngx_ff_skip_listening_socket``` 2018-02-01 16:30:46 +08:00
chenwei ab555adef4 Nginx: hijack `recvmsg`.
Since Nginx calls `recvmsg` in stream with udp, we must
hijack this function, so that the network IO can pass through
f-stack.
2018-01-31 13:47:44 +08:00
chenwei f6a681c496 Nginx : ngx_configure_listening_sockets
1. Nginx based on fstack delays setting up server on fstack until ngx_worker_process_init. ngx_configure_listening_sockets should as well.
2. FStack does not support IP_PKTINFO
2018-01-31 13:37:58 +08:00
chenwei 0a6b81772e Nginx : Fix Compile error
Fix compile error when configure nginx with --with-stream
2018-01-31 09:02:25 +08:00
chenwei dcfbe1ad39 Nginx: Restore ngx_get_connection and ngx_free_connection
The code that we used to preserve ngx_get_connection and ngx_free_connection thread safety , is not necessary now.
2018-01-29 16:41:35 +08:00
陈威 6484644fe3
Nginx: Cut out code about poll-kernel frequency
Cut out unreasonable code about poll-kernel frequency
2018-01-26 17:14:13 +08:00
陈威 67b8d9710a
Nginx: Restore unexpected Comment 2018-01-17 17:33:01 -06:00
chenwei f4c5cf3972 Nginx : Get rid of "ff_host" thread, so single thread is used for both fstack and kernel. 2018-01-17 17:51:08 +08:00
logwang e340d433ea Nginx: fix crash when server configuration item [`kernel_network_stack`] is on and uses `proxy_pass`.
When nginx is configured like this:
```
server {
    listen       8000;
    kernel_network_stack on;
    location / {
        proxy_pass http://127.0.0.1:8080/;
    }
}
```
nginx will crash, becasue kernel network stack is handled in a single thread, but we have hijacked all the socket apis, it causes that all apis enter to f-stack's path which is in main thread.
2018-01-11 18:20:41 +08:00
chenwei 2b31b4e34c Nginx : The I/O functions with glue code may be called before ngx_max_sockets is initialized, fix this error. 2017-12-14 15:07:30 +08:00
chenwei df18ef7de7 Nginx : Follow nginx programming convention - indent. 2017-12-14 14:55:36 +08:00
chenwei acc0462acd rename "timers" and "events_posted" 2017-12-09 15:24:58 +08:00
chenwei 590bcd338b rename ngx_event_actions_dy to ngx_ff_host_event_actions 2017-12-09 15:02:13 +08:00
chenwei 142257e3b6 rename module module ff_channel to ff_host_event 2017-12-09 14:55:48 +08:00
chenwei 5c797d9e1a Using a more friendly name : belong_to_aeds to belong_to_host 2017-12-09 14:18:11 +08:00
chenwei 447a82c866 Using a more friendly name
1.  remove the assert(ff_fdisused(sockfd))
2017-12-09 14:07:08 +08:00
chenwei 3ce9eefdd7 Nginx: support kernel network stack, so we can do what fstack can't do,
e.g. unix socket, ipc (with APP on kernel network stack), packet from kernel network stack.
1. Add a new directive kernel_network_stack :
    Syntax: 	kernel_network_stack on | off;
    Default: 	kernel_network_stack off;
   Context: 	http, server
  This directive is available only when NGX_HAVE_FF_STACK is defined.
  Determines whether server should run on kernel network stack or fstack.
2. Use a simpler and  more effective solution to discriminate fstack fd(file descriptor, only socket for now) from kernel fd.
2017-12-08 18:32:08 +08:00
logwang aa3f528959 Configuration: optimize the description. 2017-12-01 16:53:57 +08:00
logwang ee61971c95 Nginx: fix that worker may crash when reload or recv signals. 2017-11-20 17:06:02 +08:00
logwang 20be49f608 Nginx: hijack `read` and `write`.
Since libssl calls `read` and `write` when SSL handshake, we must
hijack these two functions, so that the network IO can pass through
f-stack.
2017-09-26 17:00:20 +08:00
logwang 1c388a5257 Update f-stack.conf of nginx.
Close #81.
2017-09-25 12:03:26 +08:00
logwang 63fb3d1fbf Fix nginx coredump on virtio vm and support kni.
1.close #67.
2.replace ff_primary process to primary worker process(the first one to
start and the last one to exit).
3.it's not graceful to reload.
2017-09-05 20:24:51 +08:00
ppliu1979 a4079f754c fix a compile error in ngx_ff_channel.c 2017-08-25 19:03:59 +08:00
logwang 406002113b Support nginx reload.
close #12.
For more details, see doc/F-Stack_Nginx_APP_Guide.md.
2017-08-23 16:54:32 +08:00
logwang 64abcf71e3 Add configuration item: vlan_strip 2017-08-09 16:52:16 +08:00
logwang 5825eee0c3 Optimize ngx_ff_module 2017-08-09 14:50:21 +08:00
logwang a02c88d651 Simplify startup arguments and add ff_fdisused.
Changes:
1.Simplify f-stack startup arguments:"--conf, --proc-type, --proc-id".
2.add a function `ff_fdisused` to check if fd is used in f-stack.
2017-08-08 22:36:49 +08:00
logwang 7e048838a7 Add API: ff_gettimeofday.
Since f-stack run with polling mode, nginx will call gettimeofday every loop, and cost a lot.
With this commit, f-stack will update current timespec periodically in
ff_hardclock_job. And ff_gettimeofday will get this value.
In nginx, hijack gettimeofday to call ff_gettimeofday.
2017-08-04 18:04:43 +08:00
logwang a43cdca49a Fix #51: nginx readv errors.
When use nginx as a proxy, nginx error logs always print 'readv() failed
(9: Bad file descriptor) while reading upstream'.
In previous commit: 10c5711ed2, i removed
`readv`, caused this issue.
2017-08-04 11:24:40 +08:00
logwang 5efe15ae45 Fix #42: add a license for ngx_ff_module.c.
Since ngx_ff_module.c was derived from nginx_ofp's ngx_ofp_module.c, but
according to #42, nginx_ofp's ngx_ofp_module.c may be derived from
opendp/dpdk-nginx's ans_module.c and nginx_ofp didn't have a license, so
add opendp/dpdk-nginx's license.
2017-06-29 12:56:18 +08:00
logwang 6b26207ec3 Nginx auto/make compatible with /bin/sh 2017-06-20 11:19:01 +08:00
logwang 10c5711ed2 Fix #38: nginx crash on Suse12.
The newer version of libcrypto will invoke read and close function when
dl_init, the real address of read/close function can’t be determined in
compilation phase and libcrypto will seek read/close symbol in ELF
files and other libraries. However nginx_fstack redefined these two
functions, this causes these symbols to be found in nginx_fstack. But the real read/close function is NULL before ff_mod_init, this leads to crash.

Changes:
1.if real_close is NULL, assign it with the address of close function in Glibc.
2.remove unnecessary read/readv/write.
2017-06-20 10:48:26 +08:00
Travis Lee 0f704af614 fix NGX_EXCLUSIVE_EVENT compile error on linux 4.5+ and glibc 2.24+
if Linux >= 4.5 and glibc >= 2.24, will compile with EPOLLEXCLUSIVE, but FreeBSD does not supported EPOLLEXCLUSIVE.
2017-06-01 12:15:11 +08:00
logwang 7abd0fb2a9 Add tool: sysctl.
This commit contains an ipc library implemented by dpdk rte_ring and
sysctl tool ported from FreeBSD.

With this commit we can get and set FreeBSD kernel state in runtime.
2017-05-23 23:13:49 +08:00
whl739 82aa761e87 Fix #3: Compiling errors on Ubuntu.
On Ubuntu, you should use gawk instead of the default mawk.And use bash to excute `./configure --prefix=/usr/local/nginx_fstack --with-ff_module`.
2017-05-08 18:15:46 +08:00
logwang a9643ea85c init 2017-04-21 18:43:26 +08:00