我的应用程序从 NFS 客户端接收数据到 NFS 服务器(用户空间 NFS 服务器 - NFS Ganesha),一旦在服务器中接收到数据包,应用程序就会开始处理数据包并发送出去。
我是 DPDK 的新手,我正在分析其中的功能以了解和适应我的应用程序,以便通过避免从/向内核/用户空间复制一些数据来提高性能。
我发现 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 接口进行操作,这样我就可以避免多个内核/用户空间复制)
更新:通过将正确的 GRUB 选项设置为iommu=pt, intel_iommu=on在主机中解决了上述问题
问题2:如何在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