F-Stack / f-stack

F-Stack is an user space network development kit with high performance based on DPDK, FreeBSD TCP/IP stack and coroutine API.
http://www.f-stack.org
Other
3.86k stars 898 forks source link

Support for TAP interface with kernel #841

Open gaurav-4g opened 1 month ago

gaurav-4g commented 1 month ago

Hi,

As DPDK has discontinued KNI support from release 23.11 , any plan to support other alternatives like TAP

zhaozihanzzh commented 1 month ago

I think virtio_user has been supported in F-Stack. According to this example file, we can change type to 1 to use virtio_user instead of kni as exception path type.

tarasko commented 1 month ago

I recently made a small patch to F-Stack to allow arbitrary arguments for DPDK. This way DPDK is able to create a TAP interface.

In config.init

extra_args=--vdev=net_tap0,mac=00:00:00:00:00:01
tx_csum_offoad_skip=1

[port0]
addr=192.168.100.3
netmask=255.255.255.0
gateway=192.168.100.1
broadcast=192.168.100.255

Then with a little extra configuration I was able to run a regular client against F-Stack based server through TAP on the same machine.

$ sudo ip addr add 192.168.100.2/24 dev dtap0
$ sudo arp -s 192.168.100.3 00:00:00:00:00:01
$ sudo ff_arp -p 0 -s 192.168.100.2 00:00:00:00:00:01

https://github.com/tarasko/f-stack/tree/feature/add_dpdk_extra_args

What do you think of this approach? It is quite convenient for testing.