[root@localhost dpdk-19.11]# ./usertools/dpdk-devbind.py -b igb_uio 0000:05:00.0 [root@localhost dpdk-19.11]# ./examples/kni/build/app/kni -c 0xFFFFF -n 4 -- -P -p 0x01 --config="(0,0,1)" EAL: Detected 128 lcore(s) EAL: Detected 4 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode ‘PA‘ EAL: Probing VFIO support... EAL: PCI device 0000:05:00.0 on NUMA socket 0 EAL: probe driver: 19e5:200 net_hinic net_hinic: Initializing pf hinic-0000:05:00.0 in primary process net_hinic: Device 0000:05:00.0 hwif attribute: net_hinic: func_idx:0, p2p_idx:0, pciintf_idx:0, vf_in_pf:0, ppf_idx:0, global_vf_id:15, func_type:2 net_hinic: num_aeqs:4, num_ceqs:4, num_irqs:32, dma_attr:2 net_hinic: API CMD poll status timeout net_hinic: chain type: 0x7 net_hinic: chain hw cpld error: 0x1 net_hinic: chain hw check error: 0x0 net_hinic: chain hw current fsm: 0x0 net_hinic: chain hw current ci: 0x0 net_hinic: Chain hw current pi: 0x1 net_hinic: Send msg to mgmt failed net_hinic: Failed to get board info, err: -110, status: 0x0, out size: 0x0 net_hinic: Check card workmode failed, dev_name: 0000:05:00.0 net_hinic: Create nic device failed, dev_name: 0000:05:00.0 net_hinic: Initialize 0000:05:00.0 in primary failed EAL: Requested device 0000:05:00.0 cannot be used EAL: PCI device 0000:06:00.0 on NUMA socket 0 EAL: probe driver: 19e5:200 net_hinic EAL: PCI device 0000:7d:00.0 on NUMA socket 0 EAL: probe driver: 19e5:a222 net_hns3 EAL: PCI device 0000:7d:00.1 on NUMA socket 0 EAL: probe driver: 19e5:a221 net_hns3 EAL: PCI device 0000:7d:00.2 on NUMA socket 0 EAL: probe driver: 19e5:a222 net_hns3 EAL: PCI device 0000:7d:00.3 on NUMA socket 0 EAL: probe driver: 19e5:a221 net_hns3 EAL: Error - exiting with code: 1 Cause: No supported Ethernet device found [root@localhost dpdk-19.11]# ./usertools/dpdk-devbind.py -u 0000:05:00.0 [root@localhost dpdk-19.11]# modprobe vfio [root@localhost dpdk-19.11]# modprobe vfio-pci [root@localhost dpdk-19.11]# ./usertools/dpdk-devbind.py -b vfio-pci 0000:05:00.0 -------换成vfio [root@localhost dpdk-19.11]# ./examples/kni/build/app/kni -c 0xFFFFF -n 4 -- -P -p 0x01 --config="(0,0,1)" EAL: Detected 128 lcore(s) EAL: Detected 4 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode ‘VA‘ EAL: Probing VFIO support... EAL: VFIO support initialized EAL: PCI device 0000:05:00.0 on NUMA socket 0 EAL: probe driver: 19e5:200 net_hinic EAL: using IOMMU type 1 (Type 1) net_hinic: Initializing pf hinic-0000:05:00.0 in primary process net_hinic: Device 0000:05:00.0 hwif attribute: net_hinic: func_idx:0, p2p_idx:0, pciintf_idx:0, vf_in_pf:0, ppf_idx:0, global_vf_id:15, func_type:2 net_hinic: num_aeqs:4, num_ceqs:4, num_irqs:32, dma_attr:2 net_hinic: Get public resource capability: net_hinic: host_id: 0x0, ep_id: 0x0, intr_type: 0x0, max_cos_id: 0x7, er_id: 0x0, port_id: 0x0 net_hinic: host_total_function: 0xf2, host_oq_id_mask_val: 0x8, max_vf: 0x78 net_hinic: pf_num: 0x2, pf_id_start: 0x0, vf_num: 0xf0, vf_id_start: 0x10 net_hinic: Get share resource capability: net_hinic: host_pctxs: 0x0, host_cctxs: 0x0, host_scqs: 0x0, host_srqs: 0x0, host_mpts: 0x0 net_hinic: Get l2nic resource capability: net_hinic: max_sqs: 0x10, max_rqs: 0x10, vf_max_sqs: 0x4, vf_max_rqs: 0x4 net_hinic: Initialize 0000:05:00.0 in primary successfully EAL: PCI device 0000:06:00.0 on NUMA socket 0 EAL: probe driver: 19e5:200 net_hinic EAL: PCI device 0000:7d:00.0 on NUMA socket 0 EAL: probe driver: 19e5:a222 net_hns3 EAL: PCI device 0000:7d:00.1 on NUMA socket 0 EAL: probe driver: 19e5:a221 net_hns3 EAL: PCI device 0000:7d:00.2 on NUMA socket 0 EAL: probe driver: 19e5:a222 net_hns3 EAL: PCI device 0000:7d:00.3 on NUMA socket 0 EAL: probe driver: 19e5:a221 net_hns3 KNI: Can not open /dev/kni APP: Initialising port 0 ... net_hinic: Disable vlan filter succeed, device: hinic-0000:05:00.0, port_id: 0 net_hinic: Disable vlan strip succeed, device: hinic-0000:05:00.0, port_id: 0 net_hinic: Set new mac address 44:a1:91:a4:9b:eb net_hinic: Disable promiscuous, nic_dev: hinic-0000:05:00.0, port_id: 0, promisc: 0 net_hinic: Disable allmulticast succeed, nic_dev: hinic-0000:05:00.0, port_id: 0 net_hinic: Enable promiscuous, nic_dev: hinic-0000:05:00.0, port_id: 0, promisc: 0 KNI: KNI subsystem has not been initialized. Invoke rte_kni_init() first EAL: Error - exiting with code: 1 Cause: Fail to create kni for port: 0 [root@localhost dpdk-19.11]# ls /dev/kni ls: cannot access /dev/kni: No such file or directory [root@localhost dpdk-19.11]# gcc -V
dpdk 创建kni
https://blog.csdn.net/sinat_20184565/article/details/92700223
[root@localhost dpdk-19.11]# ls -l /dev | awk /10,/ crw-r--r--. 1 root root 10, 235 Aug 25 06:44 autofs crw-------. 1 root root 10, 62 Aug 25 06:44 cpu_dma_latency crw-------. 1 root root 10, 203 Aug 25 06:44 cuse crw-rw-rw-. 1 root root 10, 229 Aug 25 06:44 fuse crw-------. 1 root root 10, 183 Aug 25 06:44 hwrng crw-------. 1 root root 10, 232 Aug 25 06:44 kvm crw-rw----. 1 root disk 10, 237 Aug 25 06:44 loop-control crw-------. 1 root root 10, 59 Aug 25 06:44 memory_bandwidth crw-------. 1 root root 10, 61 Aug 25 06:44 network_latency crw-------. 1 root root 10, 60 Aug 25 06:44 network_throughput crw-------. 1 root root 10, 231 Aug 25 06:44 snapshot crw-------. 1 root root 10, 239 Aug 25 06:44 uhid crw-------. 1 root root 10, 63 Aug 25 06:44 vga_arbiter crw-------. 1 root root 10, 238 Aug 25 06:44 vhost-net crw-------. 1 root root 10, 241 Aug 25 06:44 vhost-vsock crw-------. 1 root root 10, 130 Aug 25 06:44 watchdog [root@localhost dpdk-19.11]# cat /proc/misc 196 vfio 130 watchdog 59 memory_bandwidth 60 network_throughput 61 network_latency 62 cpu_dma_latency 183 hw_random 235 autofs 231 snapshot 232 kvm 63 vga_arbiter
[root@localhost dpdk-19.11]# cat /proc/misc 58 kni 196 vfio 130 watchdog 59 memory_bandwidth 60 network_throughput 61 network_latency 62 cpu_dma_latency 183 hw_random 235 autofs 231 snapshot 232 kvm 63 vga_arbiter [root@localhost dpdk-19.11]# ls -l /dev | awk /10,/ crw-r--r--. 1 root root 10, 235 Aug 25 06:44 autofs crw-------. 1 root root 10, 62 Aug 25 06:44 cpu_dma_latency crw-------. 1 root root 10, 203 Aug 25 06:44 cuse crw-rw-rw-. 1 root root 10, 229 Aug 25 06:44 fuse crw-------. 1 root root 10, 183 Aug 25 06:44 hwrng crw-------. 1 root root 10, 232 Aug 25 06:44 kvm crw-rw----. 1 root disk 10, 237 Aug 25 06:44 loop-control crw-------. 1 root root 10, 59 Aug 25 06:44 memory_bandwidth crw-------. 1 root root 10, 61 Aug 25 06:44 network_latency crw-------. 1 root root 10, 60 Aug 25 06:44 network_throughput crw-------. 1 root root 10, 231 Aug 25 06:44 snapshot crw-------. 1 root root 10, 239 Aug 25 06:44 uhid crw-------. 1 root root 10, 63 Aug 25 06:44 vga_arbiter crw-------. 1 root root 10, 238 Aug 25 06:44 vhost-net crw-------. 1 root root 10, 241 Aug 25 06:44 vhost-vsock crw-------. 1 root root 10, 130 Aug 25 06:44 watchdog [root@localhost dpdk-19.11]# mknod /dev/kni c 10 58 [root@localhost dpdk-19.11]# ls -l /dev | awk /10,/ crw-r--r--. 1 root root 10, 235 Aug 25 06:44 autofs crw-------. 1 root root 10, 62 Aug 25 06:44 cpu_dma_latency crw-------. 1 root root 10, 203 Aug 25 06:44 cuse crw-rw-rw-. 1 root root 10, 229 Aug 25 06:44 fuse crw-------. 1 root root 10, 183 Aug 25 06:44 hwrng crw-r--r--. 1 root root 10, 58 Aug 26 23:59 kni crw-------. 1 root root 10, 232 Aug 25 06:44 kvm crw-rw----. 1 root disk 10, 237 Aug 25 06:44 loop-control crw-------. 1 root root 10, 59 Aug 25 06:44 memory_bandwidth crw-------. 1 root root 10, 61 Aug 25 06:44 network_latency crw-------. 1 root root 10, 60 Aug 25 06:44 network_throughput crw-------. 1 root root 10, 231 Aug 25 06:44 snapshot crw-------. 1 root root 10, 239 Aug 25 06:44 uhid crw-------. 1 root root 10, 63 Aug 25 06:44 vga_arbiter crw-------. 1 root root 10, 238 Aug 25 06:44 vhost-net crw-------. 1 root root 10, 241 Aug 25 06:44 vhost-vsock crw-------. 1 root root 10, 130 Aug 25 06:44 watchdog
/* Check FD and open */ if (kni_fd < 0) { kni_fd = open("/dev/" KNI_DEVICE, O_RDWR); if (kni_fd < 0) { RTE_LOG(ERR, KNI, "Can not open /dev/%s\n", KNI_DEVICE); return -1; } }
[root@localhost dpdk-19.11]# ls /dev/kni -al crw-r--r--. 1 root root 10, 57 Aug 26 23:32 /dev/kni [root@localhost dpdk-19.11]# chmod 666 /dev/kni [root@localhost dpdk-19.11]# ls /dev/kni -al crw-rw-rw-. 1 root root 10, 57 Aug 26 23:32 /dev/kni
[root@localhost dpdk-19.11]# ./examples/kni/build/app/kni -c 0xFFFFF -n 4 -- -P -p 0x01 --config="(0,0,1)" EAL: Detected 128 lcore(s) EAL: Detected 4 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode ‘PA‘ EAL: Probing VFIO support... EAL: VFIO support initialized EAL: PCI device 0000:05:00.0 on NUMA socket 0 EAL: probe driver: 19e5:200 net_hinic EAL: using IOMMU type 1 (Type 1) net_hinic: Initializing pf hinic-0000:05:00.0 in primary process net_hinic: Device 0000:05:00.0 hwif attribute: net_hinic: func_idx:0, p2p_idx:0, pciintf_idx:0, vf_in_pf:0, ppf_idx:0, global_vf_id:15, func_type:2 net_hinic: num_aeqs:4, num_ceqs:4, num_irqs:32, dma_attr:2 net_hinic: Get public resource capability: net_hinic: host_id: 0x0, ep_id: 0x0, intr_type: 0x0, max_cos_id: 0x7, er_id: 0x0, port_id: 0x0 net_hinic: host_total_function: 0xf2, host_oq_id_mask_val: 0x8, max_vf: 0x78 net_hinic: pf_num: 0x2, pf_id_start: 0x0, vf_num: 0xf0, vf_id_start: 0x10 net_hinic: Get share resource capability: net_hinic: host_pctxs: 0x0, host_cctxs: 0x0, host_scqs: 0x0, host_srqs: 0x0, host_mpts: 0x0 net_hinic: Get l2nic resource capability: net_hinic: max_sqs: 0x10, max_rqs: 0x10, vf_max_sqs: 0x4, vf_max_rqs: 0x4 net_hinic: Initialize 0000:05:00.0 in primary successfully EAL: PCI device 0000:06:00.0 on NUMA socket 0 EAL: probe driver: 19e5:200 net_hinic EAL: PCI device 0000:7d:00.0 on NUMA socket 0 EAL: probe driver: 19e5:a222 net_hns3 EAL: PCI device 0000:7d:00.1 on NUMA socket 0 EAL: probe driver: 19e5:a221 net_hns3 EAL: PCI device 0000:7d:00.2 on NUMA socket 0 EAL: probe driver: 19e5:a222 net_hns3 EAL: PCI device 0000:7d:00.3 on NUMA socket 0 EAL: probe driver: 19e5:a221 net_hns3 APP: Initialising port 0 ... net_hinic: Disable vlan filter succeed, device: hinic-0000:05:00.0, port_id: 0 net_hinic: Disable vlan strip succeed, device: hinic-0000:05:00.0, port_id: 0 net_hinic: Set new mac address 44:a1:91:a4:9b:eb net_hinic: Disable promiscuous, nic_dev: hinic-0000:05:00.0, port_id: 0, promisc: 0 net_hinic: Disable allmulticast succeed, nic_dev: hinic-0000:05:00.0, port_id: 0 net_hinic: Enable promiscuous, nic_dev: hinic-0000:05:00.0, port_id: 0, promisc: 0 Checking link status done Port0 Link Up - speed 40000Mbps - full-duplex APP: ======================== APP: KNI Running APP: kill -SIGUSR1 29347 APP: Show KNI Statistics. APP: kill -SIGUSR2 29347 APP: Zero KNI Statistics. APP: ======================== APP: Lcore 1 is writing to port 0 APP: Lcore 2 has nothing to do APP: Lcore 4 has nothing to do APP: Lcore 6 has nothing to do APP: Lcore 8 has nothing to do APP: Lcore 10 has nothing to do APP: Lcore 12 has nothing to do APP: Lcore 14 has nothing to do APP: Lcore 16 has nothing to do APP: Lcore 18 has nothing to do APP: Lcore 0 is reading from port 0 APP: Lcore 5 has nothing to do APP: Lcore 9 has nothing to do APP: Lcore 13 has nothing to do APP: Lcore 17 has nothing to do APP: Lcore 3 has nothing to do APP: Lcore 11 has nothing to do APP: Lcore 19 has nothing to do APP: Lcore 15 has nothing to do APP: Lcore 7 has nothing to do APP: Configure network interface of 0 up net_hinic: Set new mac address 44:a1:91:a4:9b:eb
原文:https://www.cnblogs.com/dream397/p/13570607.html