Commit Graph

14 Commits

Author SHA1 Message Date
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 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
zengyi1001 0f2a196b68 Add IPv6 net addr parameters in config
Co-authored-by: fengbojiang <fengbojiang@tencent.com>
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 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
fengbojiang(姜凤波) faeec574ca Merge branch 'master' into dev
vlan bug fix
2019-07-29 15:08:46 +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
10077240 04cef02d60 use 4 spaces instead tab 2019-04-01 15:42:01 +08:00
10077240 5bf882b459 modify according to MR.Wang 2019-04-01 14:54:36 +08:00
10077240 ef5ab85936 not use mcopy when transmit from bsd to dpdk 2019-03-29 10:42:02 +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 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
logwang 213fa7b358 Support RX/TX offload according to HW's capability
RX: VLAN strip, CRC strip, IP/TCP/UDP checksum.
TX: IP/TCP/UDP checksum, TSO.

Note that TSO has a problem: when enable TSO,
F-Stack is much slower(Temporarily not resolved).
So TSO is disabled by default.
Edit config.ini to enable it.
2017-05-06 21:52:25 +08:00
logwang a9643ea85c init 2017-04-21 18:43:26 +08:00