I want to have any Traffic generator(say iperf,D-ITG or even ping) to send data to a tun interface. This tun interface should automatically forward to NIC which is binded to DPDK. I want to run l3fwd example which picks up data from the interface.
I used the option --vdev=net_tun0 in commandline which creates tun interface. I thought tun/tap PMD will automatically poll the packets at tun/tap interface and redirect to/from NIC. But, that's not happening. I am not able to receive any packets.
I require dpdk and traffic generator to run on the same PC. DPDK should pick the traffic at the userspace.
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
rte_eth_rx_burst
and use rte_eth_tx_burst
inside DPDK Application.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
examples/skeleton
or testpmd
or examples/l2fwd with no mac update`vdev=net_tap0,iface=<your desired name for interface>
to the DPDK application.ip
or ifconfig
bring up the interface with ip address and the state as up (Promisc mode is optional).route -n
.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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.