DPDK KNI 示例应用程序

DPDK KNI sample application

我的应用程序从 NFS 客户端接收数据到 NFS 服务器(用户 space NFS 服务器 - NFS Ganesha),一旦服务器接收到数据包,应用程序就开始处理数据包并发送出去。

我是 DPDK 的新手,我正在分析其中的特性以理解和适应我的应用程序,以便通过避免一些数据复制来提高性能 from/to kernel/user space.

我发现 KNI 很有用,在启动 KNI 示例应用程序后,我看到了以下输出。 我还可以看到新接口 vEth0_0 和 vEth1_0。但是我什至无法在分配IP后对这些接口执行ping操作。

$$ ./examples/kni/build/kni -n 4 -c 0xf0 -- -P -p 0x3 --config="(0,4,6,8),(1,5,7,9) “

*Checking link status
.done
Port 0 Link Up - speed 10000 Mbps - full-duplex
Port 1 Link Up - speed 10000 Mbps - full-duplex
APP: Lcore 5 is reading from port 1
APP: Lcore 6 is writing to port 0
APP: Lcore 7 is writing to port 1
APP: Lcore 4 is reading from port 0
APP: Configure network interface of 0 up
PMD: ixgbe_set_rx_function(): Vector rx enabled, please make sure RX burst size no less than 32.
APP: Configure network interface of 1 up
PMD: ixgbe_set_rx_function(): Vector rx enabled, please make sure RX burst size no less than 32.*

所以我的问题是 DPDK 中 KNI 示例应用程序的预期输出是什么? 以及如何用于我的应用程序? (能不能用vEth0_0接口操作,避免多次kernel/userspace拷贝)

更新: 通过将正确的 GRUB 选项设置为 iommu=pt、intel_iommu=on

,在主机中解决了上述问题

问题二: 如何在 VM 中使用 KNI? VM 内的 KNI 启动有问题。

KNI: /dev/kni opened
KNI: Creating kni...
KNI: tx_phys:      0x000000017a6af140, tx_q addr:      0xffff88017a6af140
KNI: rx_phys:      0x000000017a6b1180, rx_q addr:      0xffff88017a6b1180
KNI: alloc_phys:   0x000000017a6b31c0, alloc_q addr:   0xffff88017a6b31c0
KNI: free_phys:    0x000000017a6b5200, free_q addr:    0xffff88017a6b5200
KNI: req_phys:     0x000000017a6b7240, req_q addr:     0xffff88017a6b7240
KNI: resp_phys:    0x000000017a6b9280, resp_q addr:    0xffff88017a6b9280
KNI: mbuf_phys:    0x0000000187c00000, mbuf_kva:       0xffff880187c00000
KNI: mbuf_va:      0x00002aaa32800000
KNI: mbuf_size:    2048
KNI: pci_bus: 00:03:00
KNI: Error: Device not supported by ethtool

KNI 应用程序的问题是,如果 DMA 映射有问题,它不会直接显示错误。 "dmesg" 在主机系统中显示 DMA 映射与网络设备有问题。

后来发现igb_uio驱动需要设置内核选项“iommu=pt,intel_iommu=on”。所以在 /etc/default/grub 文件中进行设置并执行 "update-grub" 后,我可以使用 [= 打开 KNI 界面26=] 驱动程序和网络堆栈工作正常。

来宾虚拟机中的 KNI 仍然无法正常工作。正在检查这个。