LogicChains
LogicChains

Reputation: 4412

How to connect to the internet from DPDK running in a VM

DPDK is a library for kernel bypass packet processing: https://www.dpdk.org/. F-Stack is a TCP/IP library built atop it: https://github.com/F-Stack/f-stack. I've set up a Linux VMWare VPN with two NICs, have given the second to DPDK, and am attempting to run a very simple test application on it that uses F-Stack and DPDK to connect to the internet. This is however failing (fails to connect).

When I attempt to run a simple server, it also fails, in that I cannot connect to it from Curl or a browser running in the VM.

The test application displays no errors (the DPDK initialisation works fine), and behaves correctly when the DPDK stuff is replaced with standard Linux networking functions that don't bypass the kernel.

My question is, is there anything I need to do to make the above setup work, so that DPDK running on the second NIC in my VM can connect to the internet? E.g. set up some kind of mapping somewhere, or change the virtual network connection type on the VM (currently set to NAT). My networking knowledge is limited so it's quite possible I'm missing something very basic.

Upvotes: 0

Views: 1159

Answers (1)

Vipin Varghese
Vipin Varghese

Reputation: 4798

Summarizing the answer based on the updates from the comments as

Send packets directly between userspace and Kernel using DPDK, there are 3 options

  1. KNI PMD
  2. TUN/TAP PMD
  3. veth pair with one interface to DPDK via PCAP PMD.

the easiest way to try it out is by using DPDK example/skeleton with ./build/basicfwd -l 3 --vdev=net_tap0,ifaace=dpdk-kerenl0 -w [pcie bus address for DPDK NIC-2]. This will allow packets to send and receive over kernel via DPDK (where DPDK will act as pass-through). You can modify the basicfwd.c to process packets which you desire too.

If using FSTACK, I humbly request to check carrier section https://github.com/F-Stack/f-stack/blob/dev/README.md this makes use of KNI or veth to accomplish the same

Upvotes: 1

Related Questions