Commit Graph

183 Commits

Author SHA1 Message Date
fengbojiang 71d1223396 modify `struct linux_sockaddr` same to `struct sockaddr` in linux. 2021-03-06 19:18:56 +08:00
fengbojiang 8d0052bc9a Fix some issues of ff msg. 2021-03-06 19:18:53 +08:00
fengbojiang(姜凤波) aa61e4b567 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 a25f323c2b Add IPv6 net addr parameters in config
Co-authored-by: fengbojiang <fengbojiang@tencent.com>
2021-03-06 19:18:52 +08:00
fengbojiang 8bced645ba 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 d901720491 Fix #568, Insufficient condition in ff_rte_frm_extcl function. 2021-03-06 19:18:52 +08:00
Jianfeng Tan fa552ee2a0 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 1d7d040e1e update comments 2021-03-06 19:18:52 +08:00
Hawker e0b370687c update comments 2021-03-06 19:18:52 +08:00
Hawker 7c80353275 update comments 2021-03-06 19:18:52 +08:00
Hawker bee2fff99e update create_tcp_flow parameter 2021-03-06 19:18:51 +08:00
Hawker 4542e5fbd4 update init_flow 2021-03-06 19:18:50 +08:00
Hawker 714126626a Replace deprecated filter api with generic flowapi 2021-03-06 19:18:50 +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 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 199154d90d 解析file_prefix&pci-whitelist配置 2020-11-17 19:19:19 +08:00
zhangxiang10 838bd0fa9c 解析file_prefix&pci-whitelist配置 2020-11-17 19:04:23 +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 f41205e9f3 Add configuration options `symmetric_rss` to set whether to use symmetric RSS. 2020-08-30 00:55:08 +08:00
fengbojiang(姜凤波) 591a17d568 upgrade F-STACK_VERSION to 1.21. 2020-06-19 10:54:34 +08:00
johnjiang 4418919fe2 DPDK: upgrade to DPDK 19.11.2(LTS). 2020-06-18 16:55:50 +00:00
johnjiang 632c79327e
Merge branch 'dev' into feature-knictl 2020-05-21 10:56:12 +08:00
pengtian 47507c1510 #add knictl support 2020-05-14 18:30:34 +08:00
johnjiang 4ad0b6400b
Merge pull request #475 from jinhao2/dev
modify dump codes.
2020-01-10 14:36:47 +08:00
rolfliu 851ac5c081 Fix #43 #434 for Nginx transparent proxy 2020-01-10 14:26:02 +08:00
jinhao2 e18b415d94 update ff_dump_packets 2020-01-08 21:23:33 +08:00
jinhao2 4dfcdbcc8d update indent size 2020-01-08 21:13:12 +08:00
jin.hao1 4b75b83d36
Update ff_config.h
use 4 spaces indent.
2020-01-07 21:10:08 +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 7b0de5a004 Add `ip6_fastfwd.c` in `Makefile`. 2019-11-23 11:40:18 +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 7f7be099b6 SOCKET: support `SO_REUSEPORT`. 2019-11-04 10:44:07 +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(姜凤波) 73e135b80c Fix crash of `netstat -n`, refer #438. 2019-10-29 15:31:14 +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 813e23e238 lib/ff_config.c 2019-09-18 17:01:54 +08:00
fengbojiang(姜凤波) c9b3c75a23 Fix mac set bug. 2019-09-04 21:37:56 +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(姜凤波) aa18b738d4 packet_dispatcher support vlan. 2019-08-06 22:19:12 +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(姜凤波) 3bb4314f74 Fix bug of kni while set `vlan_strip=0`. 2019-08-06 22:05:27 +08: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(姜凤波) a08b952138 Modified vlan code. 2019-07-29 15:29:24 +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(姜凤波) faeec574ca Merge branch 'master' into dev
vlan bug fix
2019-07-29 15:08:46 +08:00
fengbojiang(姜凤波) 00c65d220e Modified vlan code. 2019-07-29 14:47:11 +08:00
johnjiang bae15df596
Merge pull request #403 from dragonorloong/master
vlan buf fix
2019-07-29 14:31:51 +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 b467d9c428
Update ff_dpdk_if.c
update codes.
2019-07-29 08:43:45 +08:00