Commit Graph

96 Commits (e2d9b9cac596f7e8d87f89bc5e5ff69b8a5ebc16)

Author SHA1 Message Date
fengbojiang a3bbaff58f CONTAINER(DOCKER): support aggregation model while running in container with OVS-DPDK, refer to #298. 2018-11-27 02:02:38 +08:00
DonBearH cac3602237 Setting FF_DPDK with MACHINE_CPUARCH 2018-11-08 14:57:44 +08:00
DonBearH bf05b3b78b Update Makefile for reserving FF_DPDK for x86
The former patch, which add compiler option for arm64, removes the FF_DPDK for x86.
That's a mistake.
2018-11-08 10:03:22 +08:00
dongbo4 9bd490e8d3 Add arch arm64 compiler options 2018-11-07 08:55:09 +00:00
morishima311 7230b27cf0 fix static building path of FF_DPDK 2018-08-24 16:03:23 +09:00
root dfbc4ac350 Merge branch 'master' of https://github.com/F-Stack/f-stack 2018-08-20 16:46:28 +08:00
root 5523938c5b add `base_virtaddr` config. 2018-08-20 16:44:33 +08:00
zhanghaisen a8636dd5c0 fix for issue 261 2018-08-20 14:54:18 +08:00
fengbojiang c506e4369e add "idle_sleep" to reduce CPU usage when no pkts incomming. 2018-08-18 01:45:11 +08:00
fengbojiang 5a73eef15f fix a traffic bug 2018-08-17 17:42:21 +08:00
fengbojiang 03df98dea2 add traffic tool. 2018-08-16 20:29:12 +08:00
whl739 7b9d3e8700 F-Stack: disable kni module by default.
Some omissions.
2018-06-21 17:51:57 +08:00
whl739 dc42d452ae F-Stack: disable kni module by default.
This commit adds a macro `FF_KNI` to determine whether to enable kni.
In Makefile, uncomment the `FF_KNI=1`, kni will be compiled into f-stack.
2018-06-21 17:39:17 +08:00
whl739 86036c745d Config: if proc-id is not configured, use 0. 2018-06-14 22:50:11 +08:00
logwang 5f219b2cad Merge pull request #230 from mscbg/master
F-stack:fix bug, if ff_veth_softc malloc faild, memory should not be read
2018-06-11 11:10:16 +08:00
yanya b0c07b2440 F-stack:fix bug, if ff_veth_softc malloc faild, memory should no be read. 2018-06-11 10:53:38 +08:00
logwang ee889fa71c Merge pull request #228 from boat0/master
make use of numa when setting up rx/tx queues
2018-06-10 22:01:56 +08:00
Xiaozhou Liu c2eceaad4c make use of numa when setting up rx/tx queues 2018-06-10 20:48:48 +08:00
whl739 867abe45fa Misc: some updates.
1.add interface `ff_dup` and `ff_dup2`.
2.add interface `ff_ioctl_freebsd`/`ff_getsockopt_freebsd`/`ff_setsockopt_freebsd` for tools.
3.initial parameter `proc-type` can be NULL, default "auto".
2018-06-10 20:41:48 +08:00
chenwei 968058581b Fstack: fixbug, bad checksum would lead to memleak of dpdk mbuf 2018-05-30 10:36:16 +08:00
whl739 b3aff0ba02 Fix compling error in the newer version of gcc and openssl.
`RAND_pseudo_bytes` is deprecated in the newer version of openssl.
Use `RAND_bytes` instead.
2018-05-28 21:05:36 +08:00
logwang 2bfe3f2e55 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
logwang 5e5c25c329 kern_timeout: decrease the cpu usage of timer.
There's a bug of last version, every tick, the timer will traverse all the
entries in callwheel, when lots of connections comming, the callout
process will use lots of cpu resources.

This commit fixes it, every tick, check the bucket which is hashed with current
tick, if there are entries, compare the callout tick, and invoke
callbacks.
2018-05-10 17:53:18 +08:00
chenwei d16cce93d7 API: [BugFix] On success, `ff_sendmsg` return the number of chars sent. 2018-04-09 11:22:26 +08:00
chenwei 6c629acab4 API : ff_sendmsg, use transient variables to avoid polluting user's data. 2018-02-02 17:58:17 +08:00
chenwei d8829f7e5a API : fix bug of ff_sendmsg and ff_recvmsg
freebsd and linux have a different "struct sockaddr".
In ff_recvmsg and ff_recvmsg, ```msg->msg_name```,which can refer to address, can be expected to be converted .
2018-02-02 15:28:58 +08:00
logwang 39be5a505f ff_kern_timeout: optimize the timecounter.
This timecounter implementation retrieves the current time and reports it
as the equivalent number of counts from a counter incrementing at 'hz'.
2018-01-19 21:03:20 +08:00
logwang e272b945ad FreeBSD: initialize `mp_ncpus`.
Fix crash when executing `./sysctl -w kern.callout_stat=1`.
2018-01-18 21:08:22 +08:00
logwang 62a0d71654 Ipfw: fix "invalid argument" when using `divert`.
Note that this only fix the error, `divert` is still not usable, refer to #136.
If you want to use NAT, you can just use the built-in `ipfw nat`
instead.
2018-01-08 21:53:39 +08:00
logwang 7f4229ea8b Misc: add "extern C" in public header files. 2018-01-02 18:22:40 +08:00
logwang 8740605f9d Remove the unusable api `ff_socketpair`.
Since F-Stack doesn't support AF_UNIX. ff_socketpair couldn't work and
should be removed.
2017-12-27 14:59:15 +08:00
daovanhuy b77f6ee6a0 Fix #124
Fix #124: set/get user data in epoll
2017-12-27 11:28:49 +07:00
chenwei 70bb2888cb 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 b226a4cf7e ff_epoll: rewrite `ff_epoll_ctl`. 2017-12-07 12:24:49 +08:00
logwang 9d39026bdb ff_epoll: support edge-triggered mode.
Convert epoll EPOLLET to kqueue EV_CLEAR.
2017-12-05 17:51:02 +08:00
logwang bc0ac4755a Fix bug: incorrect usage of `rte_pktmbuf_clone` when dispatching arp packets.
Since f-stack uses `rte_pktmbuf_clone` to copy mbuf to other lcores when dispatching arp packets, but it doesn't real copy the packet data. The buf_addr of pktmbuf is pointed to the same address.

The arp response packet is generated with the same mbuf from the request
packet, it just swaps the src and dst address, so the copied mbufs will also be changed.

What we need is a deep copy function, and the arp packets are really small, so deep copy will not harm performance too much.

Fix #53 #111 #112.
2017-12-01 17:25:47 +08:00
logwang 112c74aa2e Fix #107: some invalid usages of kqueue in `ff_epoll`.
1.Both EVFILT_READ and EVFILT_WRITE are values but not flags. It needs to check whether it is equal but not to do logic and.

2.If the read direction of the socket has shutdown, then the filter also sets EV_EOF in `flags`, and returns the socket error (if any) in `fflags`.
2017-11-27 18:39:34 +08:00
logwang 49e481768a Use general protocol header length in protocol filter. 2017-11-21 11:20:14 +08:00
logwang 8cfa29232a Fix #100: tcp anomaly when TSO is enabled.
1.Fix the wrong ip header length and tcp header length.
2.Recalculate the pseudo header checksum and set it to tcp header.
2017-11-20 17:07:10 +08:00
whl739 127dd473af Add tool: ipfw.
ipfw -- interface for firewall, packet scheduler, NAT and so on.

It is comprised of several components: the kernel firewall filter rule processor and its integrated packet accounting facility, the logging facility, NAT, a forward facility, a bridge facility, and an ipstealth facility.
Note that the `dummynet` traffic shaper is not merged.
2017-11-14 16:44:32 +08:00
Xu Jiaxuan 4b3bcd46c0 Fix bug: process input packets error if packet fragment
modified:   lib/ff_dpdk_if.c
2017-11-10 13:58:32 +08:00
logwang eb5902d97d Api: add packet dispatch callback function register.
In some cases, for example, packets are forwarded to your server through
IP tunnel, and they will be received on fixed queues, since RSS doesn't support tunnels.So we need to dispatch them again.

With this commit, we can implement a dispatcher callback function and regist
it, packets retrieved from rx queue will be dispatched again according to
the dispatcher result.
2017-11-09 21:22:13 +08:00
logwang 3b2bd0f641 Add tool: ngctl.
ngctl -- netgraph control utility.
The ngctl utility creates a new netgraph node of type socket which can be used to issue netgraph commands.
2017-11-01 17:38:22 +08:00
logwang bffb72754c Misc: make example in travis-ci and fix return value of `ff_connect`. 2017-10-31 11:08:04 +08:00
logwang a416aa0841 FreeBSD misc: add a macro to turn on NETGRAPH option and return error when call sleep 2017-10-27 18:08:44 +08:00
logwang c36e692a8e Use `KMOD_SRCS` to pass extra kernel module sourcs.
For example, if you have an extra FreeBSD kernel module, and want to
compile it into F-Stack, you can do it like this:
```
cd f-stack/lib
export "KMOD_SRCS=/your/kmod/path/a.c /your/kmod/path/b.c"
export "CONF_CFLAGS=-I/your/kmod/path"
make
```
2017-10-25 15:26:01 +08:00
logwang 20a9422e03 Fix bug: undefined refrence to `fueword`. 2017-10-25 15:16:28 +08:00
logwang a1fd9364a9 FreeBSD: add module netgraph. 2017-10-25 14:38:15 +08:00
YuYang 257bb980b4 less arp ring 2017-09-25 12:05:30 +08:00
logwang 85aab0a645 Optimize tx. 2017-09-22 17:35:50 +08:00