DPDK Hello world : error allocating rte services array in custom Linux

半世苍凉 提交于 2021-01-29 08:01:25

问题


This is regarding Helloworld program in DPDK in custom linux running with VM player. I have installed DPDK19.11 in a Ubuntu VM and tried Hello world program. I have also allocated hugepages and mounted in /mnt/huge. It's working fine. The NIC driver is e1000.

Then I installed DPDK 19.11 using the same steps in a custom Linux distribution. It was not working well. I noticed that NIC driver info is mentioned as PCNET32 from AMD(somewhere in custom Linux creation this might be set).

Hence I have used rmmod command to remove PCNET32 and INSMOD command to load e1000.

When I put /sbin/lsmod | grep e1000 I am getting e1000 entry as well. But hello world program fails saying that

EAL: Detected 4 lcores
EAL: Detected 1 NUMA nodes
....
EAL: error allocating rte services array
EAL: FATAL rte_service_init() failed
EAL: rte_service_init() failed
PANIC in main
cannot init EAL

One more observation, after insmod command, when I put ethtool -i eth0 it says cannot get driver information: no such device. Earlier it used to display PCNET32. Now it should display e1000 in the same way as Ubuntu. If restart network service again, it shows PCNET32 again.

Can someone help me to understand these two things and guide me to resolve these issues?

Edit: This example is from DPDK helloworld. I have executed the program with the following command
./helloworld -l 0-3 -n 1 --no-pci --loglevel=eal,8
Log contents

EAL: Probing VFIO support  
EAL: IOMMU type 1 ( Type 1 ) is supported  
EAL: IOMMU type 7 ( sPAPR ) is not supported  
EAL: IOMMU type 8 (No-IOMMU ) is not supported  
EAL: VFIO support initialized  
EAL: Ask a virtual area of  bytes  
EAL: Virtual area found  
EAL: Setting up physically contiguous memory  
EAL: Setting Max no of open files to 4096  
EAL: Detected memory type:scoket_id :0  
EAL: Creating 4 segment lists  
EAL: Ask a virtual area of  bytes  
EAL: Virtual area found at 
EAL: Master lcore 0 is ready  
EAL: lcore 3 is ready  
EAL: lcore 1 is ready  
EAL: lcore 2 is ready  
EAL: NUMA is not supported  
EAL: alloc_seg():get_mempolicy: Function not implemented  
EAL: Ask a virtual area 
EAL: Virtual area found 
EAL: attempted to allocate 1 segments, but only 0 were allocated  
EAL: error allocating rte services array  
EAL: rte_service_init() failed  
PANIC in main() 
Cannot init EAL  
5:[./helloworld(_start_ _]  
4:[/lib/libc.so.6(_ _libc_start)  
3:[./helloworld() 
2:[./helloworld(__rte_panic)  
1:[./helloworld(rte_dump_stack) 
 

I verified with ldd helloworld command. Libnuma is linked with helloworld.

I understand the issue may not be with NIC interface based on comments.
It seems insmod command is not enough to enable e1000 driver to NIC interface.

Just also want to understand how to enable Intel drivers such as e1000 with any of the interfaces by default or manually(using insmod) as it's required to leverage DPDK high performance.

I simply copied DPDK full installation from Ubuntu where I did build and did make helloworld with RTE_TARGET to custom Linux. It worked for MySQL, Java, Tomcat. Would that it be any issue?

Please let me know if you need more details.

Edit 2:
I have already created huge pages and mounted using the following steps after booting.

echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge

Please find cat /proc/meminfo output

Hugepages Total = 1024
Hugepages Free = 1024
Hugepages Rsvd = 0
Hugepages Surp = 0
Hugepage Size 2048.

But helloworld program failed again

These are the same steps I carried out in Ubuntu as well. There it's working fine.

Then I tried as you suggested helloworld with --no-huge option.It works fine. Thanks for your help !
May I know is there any step missed in hugepage setup. How do I avail hugepage feature?

The other option could be building linux with different version of kernel, glibc etc in align with Ubuntu vm configuration to avail hugepages.

Would appreciate your suggestion.

Edit 3:

After adding ethernet0.virtualDev = "e1000" in vmx file for vm, intel e1000 NIC card is enabled by default.


回答1:


DPDK is generally compiled and tested in standard Linux distro's like Ubuntu/Fedro etc., so not guarantee it works as expected in your custom Linux machine. Also DPDK functions only on supported hardware in which I don't see AMD PCnet32 interface is available in the supported NICs unlike Intel e1000 NIC. Either virtual emulated or baremetal native NICs, should be supported by DPDK library is mandatory. Secondly, you cannot expect it to work when you perform NICs rmmod of original driver and modprobe any other driver.




回答2:


based on the live debug with @vijay, the issue is not with DPDK libraries or DPDK build but with the environment in use. Current binaries for target Linux is not built via cross-toolchain. Instead Ubuntu is used to create binaries and copied to target.

Request to use DPDK cross build for libraries and PMD for the target. Suggested the flags be used as

export RTE_SDK=[dpdk parent]
export RTE_TARGET=[dpdk target]
export SYSROOT=[path to toolchain sysroot]
export ARCH=[target architecutre]
export RTE_KERNELDIR=[path to toolchain linux]
export CROSS=$CROSS_COMPILE
export EXTRA_CFLAGS="--sysroot=$SDKTARGETSYSROOT"


来源:https://stackoverflow.com/questions/63772125/dpdk-hello-world-error-allocating-rte-services-array-in-custom-linux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!