Mark
Mark

Reputation: 6464

enable Dpdk application talk to Linux process

I have DPDK-20.11.3 installed.

Given that a Dpdk application is a process from the Linux point of view, I would assume that there should be ways (possibly with constraints) of communication between the Dpdk application and Linux native application (capable of using Linux sockets interface).

What are the possible options, that I could explore? Pipes, shared memory? I don't have any tcp/ip stack ported on dpdk, so I likely can't use sockets at all?

I'd appreciate links and documents that could shed some light on this. Thanks!

Upvotes: 0

Views: 977

Answers (2)

Vipin Varghese
Vipin Varghese

Reputation: 4798

As clarified over comments the real intention is to send and receive full or partial packets into the Kernel network subsystem. The easiest way is to make use of DPDK PCAP PMD or TAP PMD.

How to use:

Tap:

  1. ensure the DPDK application is running in a Linux environment.
  2. making use of DPDK testpmd, l2fwd or skeleton update DPDK EAL by --vdev=net_tap0.
  3. Starting DPDK application will result in tap interface dtap0
  4. bring the interface up by sudo ip link set dtap0 up
  5. One can assign an IP address or use a raw promiscuous device.
  6. pinging both kernel thread and DPDK TAP PMD thread, up to 4Gbps of packet throughput can be achieved for small packets.

PCAP:

  1. Create veth interface pair in Linux using ip link add dev v1 type veth peer name v2
  2. use v1 in linux network subsystem
  3. use v2 in dpdk application by --vdev=net_pcap0,iface=v2

Note:

  1. my recommendation is to use the TAP interface since it is a dedicated PMD handling probe and removed with the DPDK application. Assigning IP address from Linux also allows it to be part of a local termination, firewall and netfilter processing. All kernel network knobs for ipv4formward, TCP, udp and sctp can be exercised too.
  2. I do not recommend the use of KNI PMD, since it is deprecated and will be removed, additional thread in the kernel to handle the buffer management and Netlink, external dependency to be built (not done for most distros package distribution).

environment

Upvotes: 1

Verma
Verma

Reputation: 59

You can use KNI interface. Here is the Sample app for the same. https://doc.dpdk.org/guides-20.11/sample_app_ug/kernel_nic_interface.html

Upvotes: 1

Related Questions