Commit Graph

380 Commits

Author SHA1 Message Date
fengbojiang ff8fd2bdc7 Merge branch 'dev' 2022-09-02 16:51:22 +08:00
fengbojiang ae7ea12bc0 F-Stack support HPTS for rack/bbr, and rack work correctly, but bbr
still has some problems when transferring large files, and the
issue with bbr will be attempted to be resolved after FreeBSD is
upgraded to 13.1 in the next release(1.23).
2022-09-01 19:18:12 +08:00
fengbojiang 8bff657153 fix crash while set gateway6. 2022-09-01 16:33:39 +08:00
用jfb8856606 9208ea7922 Fix #679. Fix memory leak while call in_pcbfree. 2022-08-27 17:07:20 +00:00
fengbojiang 2156ba56d9 Merge branch 'master' of https://github.com/F-Stack/f-stack 2022-08-27 20:48:45 +08:00
Sarosh Arif 06447d0b38 ff_syscall_wrapper.c: in ff_recvfrom() in case of zero *fromlen, *from will not be filled with garbadge values 2022-08-23 15:46:55 +05:00
agerguo b60bfba1bb
Update ff_dpdk_if.c
bond numa
2022-08-19 14:42:19 +08:00
fengbojiang 8edd7a76c2 Add include rte_eth_bond_8023ad.h. Fix #681. 2022-07-06 15:39:40 +08:00
Lorisy 1056bf23c3 对于LACP模式下的bond功能,LACP的协商报文驱动默认加入ring队列,但是不会消费,可以使用单独的队列来做lacp的协商 2022-07-06 15:39:34 +08:00
fengbojiang 4b03900402 Add include rte_eth_bond_8023ad.h. Fix #681. 2022-07-05 14:50:22 +08:00
Lorisy f614f3053a 对于LACP模式下的bond功能,LACP的协商报文驱动默认加入ring队列,但是不会消费,可以使用单独的队列来做lacp的协商 2022-06-29 15:40:52 +08:00
johnjiang c1d64d891b Merge pull request #676 from ZZMarquis/patch-1
to avoid compiling errors when gcc version >= 10
2022-06-22 18:41:34 +08:00
johnjiang 1829b7e530 Merge pull request #669 from Jawad-Hussain-23/feature/add_dpdk_log_level_to_config_file
alows user to set dpdk log level from config.ini file.
2022-06-22 18:40:43 +08:00
ZZMarquis 6daadb0b5c to avoid compiling errors when gcc version >= 10
to avoid compiling errors when gcc version >= 10
2022-06-17 22:05:59 +08:00
Muhammad Jawad Hussain b497d0d7ac alows user to set dpdk log level from config.ini file.
Signed-off-by: Muhammad Jawad Hussain <jawad.hussain@emumba.com>
2022-06-08 12:36:38 +05:00
Fidaullah Noonari b3fc40d0d7 Add IP_MINTTL flag in ff_syscall_wrapper.c. 2022-06-02 10:07:06 +05:00
hao 9f7a1423a0 Added F-Stack FreeBSD support (This is a part of the research work at RCSLab, University of Waterloo) 2022-05-31 19:46:09 -04:00
fengbojiang 791e096154 Set lib/ DEBUG mode default. 2022-05-16 15:49:24 +08:00
fengbojiang 73cf01b51d Merge branch 'dev' of https://github.com/F-Stack/f-stack into dev 2022-05-07 12:11:47 +08:00
fengbojiang b874712e25 FF_USE_PAGE_ARRAY compatible DPDK 20.11. 2022-05-07 12:05:35 +08:00
fengbojiang 021aaded2c Support zero copy while call `ff_write`, you can enable it by modify ‘FF_ZC_SEND=1' in `lib/Makefile`.
`FF_ZC_SEND` is same as `FF_USE_PAGE_ARRAY`, it will improve performance slightly in some scenarios, need to be tested in combination with real applications.

You can enable both compilation options at the same time or separately.
2022-05-07 12:02:49 +08:00
Fidaullah Noonari f159b88fa6 remove for loop 2022-04-25 12:55:15 +05:00
Fidaullah Noonari 7aaa203ad6 remove cmsg_len error 2022-04-22 12:03:55 +05:00
Fidaullah Noonari 584a11ee03 ff_syscall_wrapper.c: add linux_cmsghdr and its support in recvmsg
add support for IP_RECVTTL and IP_RECVTOS
2022-04-22 11:22:44 +05:00
fengbojiang 782d5777bd Update annotations for zero-copy API. 2022-04-17 21:05:32 +08:00
fengbojiang f211ded4ff Merge branch 'master' of https://github.com/F-Stack/f-stack into master 2022-04-15 18:15:22 +08:00
fengbojiang 6d3b0f831a Merge branch 'master' of https://github.com/F-Stack/f-stack into master 2022-04-15 18:15:22 +08:00
fengbojiang 9b5a2ec642 Support zero copy while call `ff_write`, you can enable it by modify ‘FF_ZC_SEND=1' in `lib/Makefile`.
`FF_ZC_SEND` is same as `FF_USE_PAGE_ARRAY`, it will improve performance slightly in some scenarios, need to be tested in combination with real applications.

You can enable both compilation options at the same time or separately.
2022-04-15 18:00:49 +08:00
fengbojiang e12886c02c Support zero copy while call `ff_write`, you can enable it by modify ‘FF_ZC_SEND=1' in `lib/Makefile`.
`FF_ZC_SEND` is same as `FF_USE_PAGE_ARRAY`, it will improve performance slightly in some scenarios, need to be tested in combination with real applications.

You can enable both compilation options at the same time or separately.
2022-04-15 18:00:49 +08:00
dingyuan c974c5bfbb Optimize random function in ff_compat.c 2022-04-08 15:06:40 +08:00
fengbojiang b963106775 FF_USE_PAGE_ARRAY compatible DPDK 19.11. 2022-04-08 15:05:46 +08:00
dingyuan cd92171a0f Optimize random function in ff_compat.c 2022-04-07 13:08:04 +08:00
dingyuan e27a576b2a Optimize random function in ff_compat.c 2022-04-07 13:08:04 +08:00
fengbojiang 2151a33ebb Merge branch 'master' of https://github.com/F-Stack/f-stack into master 2022-04-06 11:26:58 +08:00
fengbojiang 93b7ff1c3f Merge branch 'master' of https://github.com/F-Stack/f-stack into master 2022-04-06 11:26:58 +08:00
fengbojiang 1a945e3b22 FF_USE_PAGE_ARRAY compatible DPDK 19.11. 2022-04-06 11:25:02 +08:00
fengbojiang 6faaf06c20 FF_USE_PAGE_ARRAY compatible DPDK 19.11. 2022-04-06 11:25:02 +08:00
johnjiang 405496bac1 Merge pull request #621 from ibtisam-tariq/feature/multiple_pci_whitelist
Add support for multiple `pci_whitelist` in `config.ini`.
2022-03-05 11:50:01 +08:00
Björn Svensson 24a9ac3341 Avoid leaks after errors in freebsd config handler
Freeing allocated memory in an error flow. Currently this would
most likely not occure but a safeguard for future changes.
2022-02-11 17:05:02 +01:00
Björn Svensson 2445361818 Renaming vip6_cfg_hander() to vip6_cfg_handler()
Corrected the output of an error log as well.
2022-02-11 17:04:41 +01:00
Björn Svensson 1df9798077 Correcting check of config value for vip_addr6
Updated for code consistency, but checking the IPv4 vip_addr
pointer might have given problems for IPv6 only configs.
2022-02-11 17:03:03 +01:00
johnjiang f35d059e51 Revert "Fix 'FF_KNI' ifdef in Makefile" 2022-01-10 15:39:36 +08:00
thegreathir dfe277f731 Fix 'FF_KNI' ifdef in Makefile 2021-12-28 13:57:06 +03:30
Ibtisam Tariq f4871358c3 Add support to set interface name of each port in `config.ini`. 2021-11-04 09:58:24 +05:00
Ibtisam Tariq a7826598d4 Add support for multiple `pci_whitelist` in `config.ini`. 2021-11-04 08:54:30 +05:00
fengbojiang e091500c32 fix ‘__uintptr_t’ error. 2021-10-18 19:57:01 +08:00
fengbojiang 64c543441e fix kqueue can't add multi event onetime, modify struct event fromm freebsd11 to freebsd13. 2021-10-18 19:36:31 +08:00
fengbojiang f318b88d4e Modify net.inet.tcp.functions_default from bbr to freebsd, because extra
stacks(bbr and rack) can't work normaly now.
2021-10-15 12:52:22 +08:00
fengbojiang da4b496cab Netgraph and ipfw for FreeBSD 13.0. 2021-10-12 18:59:42 +08:00
fengbojiang 3ae8012231 Merge branch 'dev' into freebsd13 2021-09-30 19:58:08 +08:00
fengbojiang 21cfeb4372 Support extra tcp stacks, rack and bbr. 2021-09-23 15:16:09 +08:00
fengbojiang a08a136a15 modify licence. 2021-09-18 16:48:25 +08:00
fengbojiang 4093ffd426 Update LICENCE. 2021-09-18 16:05:45 +08:00
fengbojiang 9dcb6a7622 Add lib/ff_subr_epoch.c. 2021-09-18 15:10:42 +08:00
fengbojiang 8fe2bf87f3 FreeBSD13 can simply work. 2021-09-18 14:50:06 +08:00
fengbojiang 63f0426fdf fix some issues. 2021-09-16 15:30:22 +08:00
orange30 072d103880 lo port is added 127.0.0.1 when freebsd init.
Sometimes the application need 127.0.0.1 on lo0 after freebsd inited!
2021-09-09 14:30:13 +08:00
orange30 e3cd75fdea
lo port is added 127.0.0.1 when freebsd init.
Sometimes the application need 127.0.0.1 on lo0 after freebsd inited!
2021-09-09 14:30:13 +08:00
fengbojiang 81dd6c7a24 If process_dispatch_ring() has data packet to be processed and it is considered non-idle state. 2021-09-02 12:09:09 +08:00
fengbojiang 0508c8b8ec The CPU usage of packet_dispatcher() is modified to usr. 2021-09-02 12:04:32 +08:00
fengbojiang 0b4a084c8a fix a plurality of packets may not statistics in ff_traffic.rx_packets and ff_traffic.rx_bytes. 2021-09-02 11:47:13 +08:00
fengbojiang e7b7fb6cc9 FreeBSD: Upgrade to FreeBSD-releng-13.0 compiled, to be tested. 2021-08-31 19:00:09 +08:00
fengbojiang 4e3599d820 Support set multi virtual IPv4/IPv6 net addrs in `config.ini`, instead of use `ff_ifconfig`.
Close #421.
2021-06-16 19:26:52 +08:00
fengbojiang 2ea8dd153c modify pcap config. 2021-06-16 19:06:45 +08:00
Hawker 51108f9c2e support `IPV6_RECVPKTINFO` 2021-03-06 19:19:03 +08:00
Hawker d428f7900c Support IPPROTO_IPV6
f-stack中缺乏对`IPPROTO_IPV6`协议相关选项`IPV6_V6ONLY`的支持;无法在ipv6兼容ipv4场景进行网络通信。调用setsockopt时会出现失败。
2021-03-06 19:19:03 +08:00
fengbojiang 7b8cf09355 Support DPDK 20.11.0(LTS). 2021-03-06 19:18:57 +08:00
fengbojiang 4c0b1abdf1 upgrade F-STACK_VERSION to 1.21. 2021-03-06 19:18:57 +08:00
fengbojiang d96a9d10f4 modify `struct linux_sockaddr` same to `struct sockaddr` in linux. 2021-03-06 19:18:56 +08:00
fengbojiang 527e34d48a Fix some issues of ff msg. 2021-03-06 19:18:53 +08:00
fengbojiang(姜凤波) cddb7cd030 Add `ff_regist_pcblddr_fun` to regist a pcb lddr function in F-Stack.
If There are multiple ips, and F-Stack client application can choose a source ip by yourself, instead always use the first ip.
2021-03-06 19:18:52 +08:00
zengyi1001 d53ebd8f3c Add IPv6 net addr parameters in config
Co-authored-by: fengbojiang <fengbojiang@tencent.com>
2021-03-06 19:18:52 +08:00
fengbojiang 8fb48d649e Fix #560, Wrong msg_flags in struct msghdr after calling ff_recvmsg in a Linux application. 2021-03-06 19:18:52 +08:00
freak82 0816b9cb45 Fix #568, Insufficient condition in ff_rte_frm_extcl function. 2021-03-06 19:18:52 +08:00
Jianfeng Tan 06c3e57024 fix use after free issue in mbuf free
Two kinds of mbuf are used in f-stack: freebsd mbuf and dpdk mbuf.

freebsd mbufs are metadata used in freebsd stack, and their data
pointers (m_data) point to dpdk mbuf's data (buf_addr). And they have
their own chain, like this:

  bsd_mbuf1 -> bsd_mbuf2 -> bsd_mbuf3
      \            \            \
    dpdk_mbuf1 -> dpdk_mbuf2 -> dpdk_mbuf3

Considering the map relationship,

- m_freem() is corresponding to rte_pktmbuf_free(), is to free the whole
  chain of mbufs.
- m_free() is corresponding to rte_pktmbuf_free_seg(), is to free the
  specified mbuf segment.

The current implementation in f-stack uses rte_pktmbuf_free() for
m_free(). This leads to mbufs, which are still in use, be freed
unexpectedly. For example, if the bsd_mbuf1 is trimed into zero length,
bsd will invoke m_free() to free the specified segment, however, the
whole mbuf chain is freed by calling rte_pktmbuf_free().

  #0 rte_pktmbuf_free (m=0x22006fb480)
  #1 in ff_dpdk_pktmbuf_free (m=0x22006fb480)
  #2 in ff_mbuf_ext_free (m=0x7ffff7f82800, arg1=0x22006fb480, arg2=0x0)
  #3 in mb_free_ext (m=0x7ffff7f82800)
  #4 in m_free (m=0x7ffff7f82800)
  #5 in sbcompress (sb=, m=0x7ffff7f82800, n=)
  #6 in sbappendstream_locked (sb=, m=0x7ffff7f82800, flags=0)

The fix is straightforward. Use the correct API for segment free.

Reported-by: Yong-Hao Zou <yonghaoz1994@gmail.com>
Signed-off-by: Jianfeng Tan <henry.tjf@antgroup.com>
2021-03-06 19:18:52 +08:00
Hawker c0c877b54c update comments 2021-03-06 19:18:52 +08:00
Hawker 6fb0694d16 update comments 2021-03-06 19:18:52 +08:00
Hawker dc643060d1 update comments 2021-03-06 19:18:52 +08:00
Hawker 8155960f54 update create_tcp_flow parameter 2021-03-06 19:18:51 +08:00
Hawker 170b9c333f update init_flow 2021-03-06 19:18:50 +08:00
Hawker d5f823fe01 Replace deprecated filter api with generic flowapi 2021-03-06 19:18:50 +08:00
fengbojiang 4b7cdbfe03 Fix some issues of ff msg. 2021-03-06 19:04:47 +08:00
fengbojiang 81612f2676 Fix some issues of ff msg. 2021-03-06 19:04:47 +08:00
fengbojiang(姜凤波) 9fc26dbf88 Add `ff_regist_pcblddr_fun` to regist a pcb lddr function in F-Stack.
If There are multiple ips, and F-Stack client application can choose a source ip by yourself, instead always use the first ip.
2021-03-06 19:04:46 +08:00
fengbojiang(姜凤波) 1ddd0f0898 Add `ff_regist_pcblddr_fun` to regist a pcb lddr function in F-Stack.
If There are multiple ips, and F-Stack client application can choose a source ip by yourself, instead always use the first ip.
2021-03-06 19:04:46 +08:00
zengyi1001 25867c09cb Add IPv6 net addr parameters in config
Co-authored-by: fengbojiang <fengbojiang@tencent.com>
2021-03-06 19:04:46 +08:00
zengyi1001 0f2a196b68 Add IPv6 net addr parameters in config
Co-authored-by: fengbojiang <fengbojiang@tencent.com>
2021-03-06 19:04:46 +08:00
fengbojiang f69aa4778c Fix #560, Wrong msg_flags in struct msghdr after calling ff_recvmsg in a Linux application. 2021-03-06 19:04:46 +08:00
fengbojiang 6798bf3e3d Fix #560, Wrong msg_flags in struct msghdr after calling ff_recvmsg in a Linux application. 2021-03-06 19:04:46 +08:00
freak82 f39eac0056 Fix #568, Insufficient condition in ff_rte_frm_extcl function. 2021-03-06 19:04:46 +08:00
freak82 7817f2be74 Fix #568, Insufficient condition in ff_rte_frm_extcl function. 2021-03-06 19:04:46 +08:00
Jianfeng Tan e6161e2b0f fix use after free issue in mbuf free
Two kinds of mbuf are used in f-stack: freebsd mbuf and dpdk mbuf.

freebsd mbufs are metadata used in freebsd stack, and their data
pointers (m_data) point to dpdk mbuf's data (buf_addr). And they have
their own chain, like this:

  bsd_mbuf1 -> bsd_mbuf2 -> bsd_mbuf3
      \            \            \
    dpdk_mbuf1 -> dpdk_mbuf2 -> dpdk_mbuf3

Considering the map relationship,

- m_freem() is corresponding to rte_pktmbuf_free(), is to free the whole
  chain of mbufs.
- m_free() is corresponding to rte_pktmbuf_free_seg(), is to free the
  specified mbuf segment.

The current implementation in f-stack uses rte_pktmbuf_free() for
m_free(). This leads to mbufs, which are still in use, be freed
unexpectedly. For example, if the bsd_mbuf1 is trimed into zero length,
bsd will invoke m_free() to free the specified segment, however, the
whole mbuf chain is freed by calling rte_pktmbuf_free().

  #0 rte_pktmbuf_free (m=0x22006fb480)
  #1 in ff_dpdk_pktmbuf_free (m=0x22006fb480)
  #2 in ff_mbuf_ext_free (m=0x7ffff7f82800, arg1=0x22006fb480, arg2=0x0)
  #3 in mb_free_ext (m=0x7ffff7f82800)
  #4 in m_free (m=0x7ffff7f82800)
  #5 in sbcompress (sb=, m=0x7ffff7f82800, n=)
  #6 in sbappendstream_locked (sb=, m=0x7ffff7f82800, flags=0)

The fix is straightforward. Use the correct API for segment free.

Reported-by: Yong-Hao Zou <yonghaoz1994@gmail.com>
Signed-off-by: Jianfeng Tan <henry.tjf@antgroup.com>
2021-03-06 19:04:46 +08:00
Jianfeng Tan 84456118c7 fix use after free issue in mbuf free
Two kinds of mbuf are used in f-stack: freebsd mbuf and dpdk mbuf.

freebsd mbufs are metadata used in freebsd stack, and their data
pointers (m_data) point to dpdk mbuf's data (buf_addr). And they have
their own chain, like this:

  bsd_mbuf1 -> bsd_mbuf2 -> bsd_mbuf3
      \            \            \
    dpdk_mbuf1 -> dpdk_mbuf2 -> dpdk_mbuf3

Considering the map relationship,

- m_freem() is corresponding to rte_pktmbuf_free(), is to free the whole
  chain of mbufs.
- m_free() is corresponding to rte_pktmbuf_free_seg(), is to free the
  specified mbuf segment.

The current implementation in f-stack uses rte_pktmbuf_free() for
m_free(). This leads to mbufs, which are still in use, be freed
unexpectedly. For example, if the bsd_mbuf1 is trimed into zero length,
bsd will invoke m_free() to free the specified segment, however, the
whole mbuf chain is freed by calling rte_pktmbuf_free().

  #0 rte_pktmbuf_free (m=0x22006fb480)
  #1 in ff_dpdk_pktmbuf_free (m=0x22006fb480)
  #2 in ff_mbuf_ext_free (m=0x7ffff7f82800, arg1=0x22006fb480, arg2=0x0)
  #3 in mb_free_ext (m=0x7ffff7f82800)
  #4 in m_free (m=0x7ffff7f82800)
  #5 in sbcompress (sb=, m=0x7ffff7f82800, n=)
  #6 in sbappendstream_locked (sb=, m=0x7ffff7f82800, flags=0)

The fix is straightforward. Use the correct API for segment free.

Reported-by: Yong-Hao Zou <yonghaoz1994@gmail.com>
Signed-off-by: Jianfeng Tan <henry.tjf@antgroup.com>
2021-03-06 19:04:46 +08:00
Hawker fc7cff57bb update comments 2021-03-06 19:04:46 +08:00
Hawker 76f39db167 update comments 2021-03-06 19:04:46 +08:00
Hawker 663e85b1d7 update comments 2021-03-06 19:04:46 +08:00
Hawker c2cb022c64 update comments 2021-03-06 19:04:46 +08:00
Hawker cb0cb8ee1f update comments 2021-03-06 19:04:45 +08:00
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