Commit Graph

157 Commits

Author SHA1 Message Date
fengbojiang 1c44a070ea Add an API `ff_get_traffic` to get traffic for QoS or other. 2023-10-20 11:51:22 +08:00
fengbojiang 2e31158d7d Modify vlan filter log. 2023-09-27 11:18:52 +08:00
fengbojiang 2b8b0936db Add vlan_filter argument in config.ini for RSS with vlan.
Set Rx VLAN filter, and then the dirvier(such as MLX5) will set
FLOW RSS to enable L3/L4 RSS below vlan hdr.
This action won't need after DPDK-20.11.
2023-09-26 15:31:56 +08:00
fengbojiang ef24ad2478 Sync some features from branch of dev.
1. Added F-Stack FreeBSD support. see 9f7a1423a0 .
2. Enable INET6 by default in helloworld. see 51c91ab0ad .
3. Added FDIR support. see 4854315d0d .
4. To avoid compiling errors when gcc version >= 10. see 6daadb0b5c .
5. Modify `struct linux_sockaddr` same to `struct sockaddr` in linux. see d96a9d10f4 .
6. Sync some modified of ff_config.c, inclue set dpdk log level, Avoid memory leaks, suppor vip_addr and vip_addr6, etc. see git log lib/ff_config.c in branch of dev.
7. Sync some modified of ff_syscall_wrapper.c, include ff_sendmsg, ff_recvmsg, ip6_opt_convert, etc. see git log lib/ff_syscall_wrapper.c in branch of dev.
8. The CPU usage of packet_dispatcher() is modified to usr. see 0508c8b8ec .
9. If process_dispatch_ring() has data packet to be processed and it is considered non-idle state. see 81dd6c7a24 .
10. Fix a plurality of packets may not statistics in ff_traffic.rx_packets and ff_traffic.rx_bytes. see 0b4a084c8a .
11. Added FF_IPSEC=1 in lib/Makefile, disable by default.
12. Some other modified.
2023-09-12 21:01:47 +08:00
fengbojiang e3917f8953 vlan_strip support kni. 2022-11-12 23:40:58 +08:00
fengbojiang 2156ba56d9 Merge branch 'master' of https://github.com/F-Stack/f-stack 2022-08-27 20:48:45 +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 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
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
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
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
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
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
jinhao2 ce40395e0c dump packets by core, instead of by ports;without fopen/fclose while dumping 2020-01-08 12:09:40 +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
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(姜凤波) 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