Since the question is not that clear (whether it is DPDK RX-TX or Kernel RX-TX), here are the answers for DPDK application point of view
- DPDK TUN PMD allows creating Kernel TUN interface with ip layer
onwards (there is no MAC Layer). just like all PMD devices, you have
to poll with
rte_eth_rx_burst
and use rte_eth_tx_burst
inside
DPDK Application.
- Similarly, if you plan to use TAP PMD, dpdk will create Kernel TAP
the interface which has to be polled with
rte_eth_rx_burst
and
rte_eth_tx_burst
inside DPDK application.
Once you use vdev=net_tap0
this creates Kernel tap interface dtap0
. So to grab packets received to Kernel interface you have call rte_eth_rx_burst
to send a specific packet to Kernel TAP interface you need to use rte_eth_tx_burst
.
as per your requirement which is to direct any traffic generator to kernel to TAP interface, then send to physical NIC bound with DPDK, this what you have to do
- make use a simple application like
examples/skeleton
or testpmd
or examples/l2fwd with no mac update`
- ensure you pass the
vdev=net_tap0,iface=<your desired name for interface>
to the DPDK application.
- Using
ip
or ifconfig
bring up the interface with ip address and the state as up (Promisc mode is optional).
- ensure your destination address route is through tap interface by cross-checking
route -n
.
- now kick start your traffic generator with dest-ip and interface as required.
Note: In my deployment case, I ended up setting static ARP too.
This will send the packet to kernel TAP interface, which is then intercepted by DPDK application via rx_burst calls. Using port to port forward behaviour this is then forwarded to DPDK Physical NIC. In reverse direction, the packet received from physical nic is bought into the application by rx_burst and then tx_burst to TAP PMD. this will then inject to the kernel TAP interface.