Commit Graph

382 Commits

Author SHA1 Message Date
Hawker d957b83157 update comments 2021-03-06 19:04:45 +08:00
Hawker c0e965e941 update create_tcp_flow parameter 2021-03-06 19:04:45 +08:00
Hawker cd0965ba8a update init_flow 2021-03-06 19:04:45 +08:00
Hawker 900256fd7d update create_tcp_flow parameter 2021-03-06 19:04:45 +08:00
Hawker be1c8e2e75 Replace deprecated filter api with generic flowapi 2021-03-06 19:04:45 +08:00
Hawker fc73e3a9a4 update init_flow 2021-03-06 19:04:45 +08:00
Hawker 6c89f403ee Replace deprecated filter api with generic flowapi 2021-03-06 19:04:45 +08:00
Hawker 55151ab9d2 Bugfix: support rte_flow_isolate for multi lcore (#562)
* Bugfix: support rte_flow_isolate

init flow isolate mode only run once
2020-11-25 11:31:04 +08:00
Hawker 2474e16370
Bugfix: support rte_flow_isolate for multi lcore (#562)
* Bugfix: support rte_flow_isolate

init flow isolate mode only run once
2020-11-25 11:31:04 +08:00
fengbojiang 62653ab1a5 Fix bug of `sysctl` in tools/compat/sysctl.c.
The ff msg shouldn't to free while `ff_ipc_send` success but `ff_ipc_recv` failed (such as F-Stack app are breaking by gdb).
2020-11-21 21:27:55 +08:00
fengbojiang 32ff8fda83 Fix bug of `sysctl` in tools/compat/sysctl.c.
The ff msg shouldn't to free while `ff_ipc_send` success but `ff_ipc_recv` failed (such as F-Stack app are breaking by gdb).
2020-11-21 21:27:55 +08:00
zhangxiang10 eff1a060f0 解析file_prefix&pci-whitelist配置 2020-11-17 19:19:19 +08:00
zhangxiang10 199154d90d 解析file_prefix&pci-whitelist配置 2020-11-17 19:19:19 +08:00
zhangxiang10 c661338e72 解析file_prefix&pci-whitelist配置 2020-11-17 19:04:23 +08:00
zhangxiang10 838bd0fa9c 解析file_prefix&pci-whitelist配置 2020-11-17 19:04:23 +08:00
fengbojiang 3a84cd1fec User APP can use AF_INET6/PF_INET6 directly whether call ff socket or linux API, such as inet_ntoa/inet_aton. 2020-09-03 01:35:22 +08:00
fengbojiang 8d21adc4b7 User APP can use AF_INET6/PF_INET6 directly whether call ff socket or linux API, such as inet_ntoa/inet_aton. 2020-09-03 01:35:22 +08:00
fengbojiang 1b5649a396 Add configuration options `symmetric_rss` to set whether to use symmetric RSS. 2020-08-30 00:55:08 +08:00
fengbojiang f41205e9f3 Add configuration options `symmetric_rss` to set whether to use symmetric RSS. 2020-08-30 00:55:08 +08:00
fengbojiang(姜凤波) 56101252f6 upgrade F-STACK_VERSION to 1.21. 2020-06-19 10:54:34 +08:00
fengbojiang(姜凤波) 591a17d568 upgrade F-STACK_VERSION to 1.21. 2020-06-19 10:54:34 +08:00
johnjiang 37a7c72f09 DPDK: upgrade to DPDK 19.11.2(LTS). 2020-06-18 16:55:50 +00:00
johnjiang 4418919fe2 DPDK: upgrade to DPDK 19.11.2(LTS). 2020-06-18 16:55:50 +00:00
johnjiang e27c5f4e3a Merge branch 'dev' into feature-knictl 2020-05-21 10:56:12 +08:00
johnjiang 632c79327e
Merge branch 'dev' into feature-knictl 2020-05-21 10:56:12 +08:00
pengtian 0b1e7c031e #add knictl support 2020-05-14 18:30:34 +08:00
pengtian 47507c1510 #add knictl support 2020-05-14 18:30:34 +08:00
johnjiang 53638472c1 Merge pull request #475 from jinhao2/dev
modify dump codes.
2020-01-10 14:36:47 +08:00
johnjiang 4ad0b6400b
Merge pull request #475 from jinhao2/dev
modify dump codes.
2020-01-10 14:36:47 +08:00
rolfliu 37720803e1 Fix #43 #434 for Nginx transparent proxy 2020-01-10 14:26:02 +08:00
rolfliu 851ac5c081 Fix #43 #434 for Nginx transparent proxy 2020-01-10 14:26:02 +08:00
jinhao2 cd5b4948de update ff_dump_packets 2020-01-08 21:23:33 +08:00
jinhao2 e18b415d94 update ff_dump_packets 2020-01-08 21:23:33 +08:00
jinhao2 80d23aa1da update indent size 2020-01-08 21:13:12 +08:00
jinhao2 4dfcdbcc8d update indent size 2020-01-08 21:13:12 +08:00
jin.hao1 a2728d1e67 Update ff_config.h
use 4 spaces indent.
2020-01-07 21:10:08 +08:00
jin.hao1 4b75b83d36
Update ff_config.h
use 4 spaces indent.
2020-01-07 21:10:08 +08:00
jin.hao1 6d051c0454 update config.c
use 4 space other than tab.
2020-01-07 21:04:17 +08:00
jinhao2 ce40395e0c dump packets by core, instead of by ports;without fopen/fclose while dumping 2020-01-08 12:09:40 +08:00
jin.hao1 bb6dcc1c33
update config.c
use 4 space other than tab.
2020-01-07 21:04:17 +08:00
jinhao2 819aafb684 dump packets by core, instead of by ports;without fopen/fclose while dumping 2020-01-08 12:09:40 +08:00
fengbojiang f67a26a199 Add `ip6_fastfwd.c` in `Makefile`. 2019-11-23 11:40:18 +08:00
fengbojiang 7b0de5a004 Add `ip6_fastfwd.c` in `Makefile`. 2019-11-23 11:40:18 +08:00
Jayath Sathyanarayana 316f2a31b4 Merge patch of Configuration param to skip "TX checksum offload", refer #448. 2019-11-04 13:10:27 +08:00
Jayath Sathyanarayana 3a3642c7f7 Merge patch of Configuration param to skip "TX checksum offload", refer #448. 2019-11-04 13:10:27 +08:00
fengbojiang 86cd82dc87 SOCKET: support `SO_REUSEPORT`. 2019-11-04 10:44:07 +08:00
fengbojiang 7f7be099b6 SOCKET: support `SO_REUSEPORT`. 2019-11-04 10:44:07 +08:00
fengbojiang(姜凤波) b99e7124e8 Fixed #426, F-stack compile error in Red Hat 8.0 with gcc 8.2.1. 2019-10-31 15:58:26 +08:00
fengbojiang(姜凤波) b8b4b7b9d7 Fixed #426, F-stack compile error in Red Hat 8.0 with gcc 8.2.1. 2019-10-31 15:58:26 +08:00
fengbojiang(姜凤波) 7abbdf7aa5 Fix crash of `netstat -n`, refer #438. 2019-10-29 15:31:14 +08:00
fengbojiang(姜凤波) 73e135b80c Fix crash of `netstat -n`, refer #438. 2019-10-29 15:31:14 +08:00
johnjiang a36df1e44e Merge pull request #441 from open-estuary/dev
lib/ff_config.c : Fix data overflow in more than 64 cores
2019-10-24 20:58:16 +08:00
johnjiang 59e841c5a2
Merge pull request #441 from open-estuary/dev
lib/ff_config.c : Fix data overflow in more than 64 cores
2019-10-24 20:58:16 +08:00
beard-627 868cca5674 lib/ff_config.c 2019-09-18 17:01:54 +08:00
beard-627 813e23e238 lib/ff_config.c 2019-09-18 17:01:54 +08:00
fengbojiang(姜凤波) d39775a93b Fix mac set bug. 2019-09-04 21:37:56 +08:00
fengbojiang(姜凤波) c9b3c75a23 Fix mac set bug. 2019-09-04 21:37:56 +08:00
fengbojiang(姜凤波) 5fbf4a15eb Bonding: supported. but it can't work in multi-processes, to be fix. 2019-09-04 21:17:10 +08:00
fengbojiang(姜凤波) c0f666848d Bonding: supported. but it can't work in multi-processes, to be fix. 2019-09-04 21:17:10 +08:00
fengbojiang(姜凤波) 1e14958312 packet_dispatcher support vlan. 2019-08-06 22:19:12 +08:00
fengbojiang(姜凤波) aa18b738d4 packet_dispatcher support vlan. 2019-08-06 22:19:12 +08:00
fengbojiang(姜凤波) 19dac219c8 Merge branch 'master' into dev
Fix bug of kni while set `vlan_strip=0`.
2019-08-06 22:11:54 +08:00
fengbojiang(姜凤波) 67c27ffe02 Merge branch 'master' into dev
Fix bug of kni while set `vlan_strip=0`.
2019-08-06 22:11:54 +08:00
fengbojiang(姜凤波) a20fd2ae31 Fix bug of kni while set `vlan_strip=0`. 2019-08-06 22:05:27 +08:00
fengbojiang(姜凤波) 3bb4314f74 Fix bug of kni while set `vlan_strip=0`. 2019-08-06 22:05:27 +08:00
root 7a9cdd23b7 KNI: remove the feature of monitor port's link status.
And if you want to use kni, you should do one of two action:
1. `insmod rte_kni.ko carrier=on` while init dpdk running environment.
2. or run `echo 1 > /sys/class/net/veth0/carrier` after enable veth0 up.

Refer #401, but this is not the real reason of #401, it is the DPDK's ENA driver can't work correctly in multi-processes.
2019-07-29 13:38:10 +00:00
root 3f18f1a26a KNI: remove the feature of monitor port's link status.
And if you want to use kni, you should do one of two action:
1. `insmod rte_kni.ko carrier=on` while init dpdk running environment.
2. or run `echo 1 > /sys/class/net/veth0/carrier` after enable veth0 up.

Refer #401, but this is not the real reason of #401, it is the DPDK's ENA driver can't work correctly in multi-processes.
2019-07-29 13:38:10 +00:00
fengbojiang(姜凤波) 1068dedc41 Modified vlan code. 2019-07-29 15:29:24 +08:00
fengbojiang(姜凤波) a08b952138 Modified vlan code. 2019-07-29 15:29:24 +08:00
HongBo Long 86d95e99f0 set freebsd mbuf vlan information when the vlan_strip is enable && get ether_type error when the vlan_strip is disabled 2019-07-29 15:27:40 +08:00
HongBo Long f66f945850 set freebsd mbuf vlan information when the vlan_strip is enable && get ether_type error when the vlan_strip is disabled 2019-07-29 15:27:40 +08:00
fengbojiang(姜凤波) c6dae7f8fe Merge branch 'master' into dev
vlan bug fix
2019-07-29 15:08:46 +08:00
fengbojiang(姜凤波) faeec574ca Merge branch 'master' into dev
vlan bug fix
2019-07-29 15:08:46 +08:00
fengbojiang(姜凤波) ab2d620de6 Modified vlan code. 2019-07-29 14:47:11 +08:00
fengbojiang(姜凤波) 00c65d220e Modified vlan code. 2019-07-29 14:47:11 +08:00
johnjiang 8eb6d4d5ae Merge pull request #403 from dragonorloong/master
vlan buf fix
2019-07-29 14:31:51 +08:00
johnjiang bae15df596
Merge pull request #403 from dragonorloong/master
vlan buf fix
2019-07-29 14:31:51 +08:00
johnjiang 185c857ebb Merge pull request #414 from jinhao2/dev
support more than 32 processes; support 52bytes rsskey; compile failed.
2019-07-29 13:58:21 +08:00
johnjiang 2479a83f3c
Merge pull request #414 from jinhao2/dev
support more than 32 processes; support 52bytes rsskey; compile failed.
2019-07-29 13:58:21 +08:00
jin.hao1 fd7b974f08 Update ff_dpdk_if.c
update codes.
2019-07-29 08:43:45 +08:00
jin.hao1 b467d9c428
Update ff_dpdk_if.c
update codes.
2019-07-29 08:43:45 +08:00
jin.hao1 a6e2dd0ebd Update ff_dpdk_if.c
code aligned.
2019-07-29 08:42:28 +08:00
jin.hao1 fa32b23ec3
Update ff_dpdk_if.c
code aligned.
2019-07-29 08:42:28 +08:00
fengbojiang(姜凤波) 7e4b7a1537 Merge branch 'master' into dev 2019-07-26 17:37:02 +08:00
fengbojiang(姜凤波) 86a4dcb0fe Merge branch 'master' into dev 2019-07-26 17:37:02 +08:00
10077240 58f65b59d5 fix bug: Can not support more than 32 processes 2019-07-26 16:52:57 +08:00
10077240 78415de5a0 fix bug: Can not support more than 32 processes 2019-07-26 16:52:57 +08:00
fengbojiang cea0be3c81 Tools: update top. 2019-07-25 22:33:42 +08:00
fengbojiang 0f5432bb05 Tools: update top. 2019-07-25 22:33:42 +08:00
fengbojiang(姜凤波) a8ea1bed90 Tools: All tools can work in parallel now. 2019-07-25 17:19:28 +08:00
fengbojiang(姜凤波) 6194fcd20a Tools: All tools can work in parallel now. 2019-07-25 17:19:28 +08:00
10077240 c005dd8b8e support more than 32 processes; support 52bytes rsskey; compile failed. 2019-07-25 11:27:30 +08:00
10077240 34e766d2b6 support more than 32 processes; support 52bytes rsskey; compile failed. 2019-07-25 11:27:30 +08:00
fengbojiang(姜凤波) 7cb21a2b2b IPv6: support multi-processes, deep copy NDP packet and dispatch. 2019-07-17 17:31:47 +08:00
fengbojiang(姜凤波) 10b909a1b3 IPv6: support multi-processes, deep copy NDP packet and dispatch. 2019-07-17 17:31:47 +08:00
root c84854ee3b IPv6: `netstat` tool support ipv6. 2019-07-15 21:04:09 +08:00
root ca915d33ee IPv6: `netstat` tool support ipv6. 2019-07-15 21:04:09 +08:00
root 3f2c0f7483 Always define FF_IOCTL6, because `top` and other tools not distinguish between inet or inet6 2019-07-15 20:02:58 +08:00
root 5f5ff92287 Always define FF_IOCTL6, because `top` and other tools not distinguish between inet or inet6 2019-07-15 20:02:58 +08:00
root e49450aae1 Fix define PF_INET6_LINUX 2019-07-15 17:22:15 +08:00
root 9e60a85fe5 Fix define PF_INET6_LINUX 2019-07-15 17:22:15 +08:00
fengbojiang(姜凤波) e499fe2b2a Merge branch 'dev' of https://github.com/F-Stack/f-stack into dev 2019-07-12 20:58:31 +08:00
fengbojiang(姜凤波) 6bbb2125dc Merge branch 'dev' of https://github.com/F-Stack/f-stack into dev 2019-07-12 20:58:31 +08:00
fengbojiang(姜凤波) adfdf56113 IPv6: FreeBSD stack and f-stack support ipv6. 2019-07-12 20:56:01 +08:00
fengbojiang(姜凤波) d7140ab746 IPv6: FreeBSD stack and f-stack support ipv6. 2019-07-12 20:56:01 +08:00
HongBo Long 2a7631a6bc set freebsd mbuf vlan information when the vlan_strip is enable && get ether_type error when the vlan_strip is disabled 2019-07-09 20:02:42 +08:00
HongBo Long 49056e3ae7 set freebsd mbuf vlan information when the vlan_strip is enable && get ether_type error when the vlan_strip is disabled 2019-07-09 20:02:42 +08:00
root 5910503df7 fix the issue that set the incorrect crc_strip flag. 2019-07-05 14:45:00 +08:00
root e4b4439165 fix the issue that set the incorrect crc_strip flag. 2019-07-05 14:45:00 +08:00
jfb8856606 ea837b1efb add `make install` and `make uninstall` in f-tack's lib and tools, refer #396 2019-07-01 19:18:54 +08:00
jfb8856606 5af66259d5 add `make install` and `make uninstall` in f-tack's lib and tools, refer #396 2019-07-01 19:18:54 +08:00
fengbojiang(姜凤波) dcc64c7196 remove unused code. 2019-06-27 18:21:45 +08:00
fengbojiang(姜凤波) 4de33dfa9f remove unused code. 2019-06-27 18:21:45 +08:00
fengbojiang(姜凤波) ad241aff99 Add pkt_tx_delay parameter in config.ini.
It should be default while handling large concurrent requests, otherwise
it will reduce the throughput.
But if there are only a little, you can set it to less than 100, even to
0, to reduce the delay of the connection.
2019-06-27 17:44:19 +08:00
fengbojiang(姜凤波) 59bb71f60e Add pkt_tx_delay parameter in config.ini.
It should be default while handling large concurrent requests, otherwise
it will reduce the throughput.
But if there are only a little, you can set it to less than 100, even to
0, to reduce the delay of the connection.
2019-06-27 17:44:19 +08:00
fengbojiang(姜凤波) 7f9cfd7ec2 modify RTE_MAX to RTE_ALIGN_CEIL while init mempool. 2019-06-27 12:12:59 +08:00
fengbojiang(姜凤波) 16d80a6ddc modify RTE_MAX to RTE_ALIGN_CEIL while init mempool. 2019-06-27 12:12:59 +08:00
jfb8856606 d30ea9060e Reupgrade DPDK to 18.11. 2019-06-25 19:12:58 +08:00
fengbojiang(姜凤波) 173e66311e Merge branch 'master' into dev 2019-06-25 17:15:06 +08:00
fengbojiang(姜凤波) d9e0c21a28 Add dispatch API reference. 2019-06-25 12:38:19 +08:00
logwang 5f73f9b957 Merge branch 'dev' into master 2019-05-21 22:19:57 +08:00
10077240 04cef02d60 use 4 spaces instead tab 2019-04-01 15:42:01 +08:00
jin.hao1 6149c27496 Update ff_memory.c 2019-04-01 15:03:51 +08:00
10077240 5bf882b459 modify according to MR.Wang 2019-04-01 14:54:36 +08:00
10077240 0da6ab43f7 modify makefile as needes 2019-03-29 10:49:35 +08:00
10077240 ef5ab85936 not use mcopy when transmit from bsd to dpdk 2019-03-29 10:42:02 +08:00
johnjiang fba559f45b Merge pull request #355 from jinhao2/master
ff_traffic.tx info should save the sent packets
2019-03-18 11:07:06 +08:00
jin.hao1 49d7ad40cc recommit 2019-03-15 18:07:15 +08:00
jin.hao1 268488030d ff_traffic.tx info should save the sent packets
send_burst()  send several pkts which maybe composed by several mbufs, use rte_pktmbuf_pkt_len() to get actual length.
2019-03-15 16:18:17 +08:00
fengbojiang(姜凤波) e8591dc5c0 F-Stack's kni can work on DPDK 18.11 LTS now. 2019-03-14 17:17:58 +08:00
fengbojiang(姜凤波) ee6c3aa356 modify packet_dispatcher to support response package direct. 2019-03-08 15:12:57 +08:00
teacup-on-rockingchair d3f10a087d Add support for getsockopt TCP_INFO 2019-02-24 10:51:25 +02:00
fengbojiang(姜凤波) d3f2221c0c Fix the IP/TCP/UDP csum error of txmode offloads, refer #317. 2019-01-18 18:05:18 +08:00
fengbojiang(姜凤波) 5af785ecea Revert "DPDK:upgrade to 18.11.0 LTS."
This reverts commit 8850115bd8.
2019-01-18 17:27:45 +08:00
fengbojiang 2accbca75e Format code. 2018-12-06 22:41:39 +08:00
jfb8856606 28440c506f DPDK:upgrade to 18.11.0 LTS. 2018-12-06 22:17:51 +08:00
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
logwang 8755b2de54 Fix bug: freebsd sysctl config not work. 2017-09-21 15:03:05 +08:00
logwang 3b14d13555 Merge pull request #78 from yuyang0/multiple-nic
Multiple nic enhancement.
2017-09-21 13:55:17 +08:00
YuYang 80a6164c5c multiple NIC support
In current implementation, cores and ports are one to one mapped, this
PR allowed user to specify the core list used to handle single port. for
example cores 1,2,3 handle port 0 and cores 4,5,6 handle port 1.

- Add `port_list` config to dpdk section (used to specify the enabled port list)

- Add `lcore_list` config to port section(used to specify the core list mapped to that port)

- Delete `nb_ports` config in dpdk section

- Delete `port_mask` config in dpdk section
2017-09-21 12:33:25 +08:00
logwang 8cf1d457cb Optimize makefile 2017-09-14 15:25:07 +08:00
YuYang 34b2fad45f use CONF_CFLAGS to pass extra CLFAGS 2017-09-06 10:26:12 +08:00
Andy 08dba0109c add lvs toa option 2017-09-04 23:19:12 -04:00
logwang df692c6078 Fix null pointer when `numa_on=0`. 2017-09-04 11:42:18 +08:00
logwang 1eaf0ac36a Add tool: netstat.
Including libraries: libutil,libmemstat,libxo.
2017-08-31 21:34:50 +08:00
ppliu1979 27fdd30224 Fix the wrong operator order in ff_rss_check function. 2017-08-30 18:29:03 +08:00
logwang a9e7dcf4da Fix ff_rss_check function bug.
1.Close #22.
2.Configure the HW indirection table when initializing port.
3.Use several LSBs of the rss hash result according to reta_size when
calculating queue index.
2017-08-28 17:12:07 +08:00
Andy 8fecf4dd08 user prosess lr->loop called every 100us when idle 2017-08-24 07:41:07 -04:00
logwang a1720b1d7a Merge pull request #57 from isjy/master
add top tool
2017-08-24 19:12:24 +08:00
Andy e7741141d0 add top tool 2017-08-24 02:17:34 -04:00
logwang 6a812e619b Merge branch 'master' of https://github.com/F-Stack/f-stack 2017-08-23 17:00:59 +08:00