The constructor of DPDK device fails to get any memory pool allocated using rte_mempool_create()

470 views
Skip to first unread message

Raj Joshi

unread,
Mar 10, 2018, 8:33:03 AM3/10/18
to PcapPlusPlus support
Hi,

I am unable to run the DpdkExample-FilterTraffic example as the function rte_mempool_create() returns null in DpdkDevice::InitMemPool. This line. Following is the sample execution when I try to list the ports:
------------------------------------
$ sudo ./DpdkTrafficFilter -l
EAL: Detected 40 lcore(s)
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: PCI device 0000:05:00.0 on NUMA socket 0
EAL:   probe driver: 8086:158b net_i40e
EAL: PCI device 0000:05:00.1 on NUMA socket 0
EAL:   probe driver: 8086:158b net_i40e
PMD: Global register is changed during enable FDIR flexible payload
PMD: Global register is changed during support QinQ parser
PMD: Global register is changed during configure hash input set
PMD: Global register is changed during configure fdir mask
PMD: Global register is changed during configure hash mask
PMD: Global register is changed during support QinQ cloud filter
PMD: Global register is changed during support TPID configuration
Failed to create packets memory pool for port 0, pool name: MBufMemPool0
Error is: 'Success' [Error code: 0]

Could not initialize mBuf mempool. Device not initialized
DPDK port list:
    Port #0: MAC address='3c:fd:fe:b7:e7:f5'; PCI address='0000:00:00.0'; PMD=''
------------------------------------
The red text above are the messages from original source code of PcapPlusPlus. When I tried to debug, I used the following additional line to print the error from rte:
LOG_ERROR("Error is: '%s' [Error code: %d]\n", rte_strerror(rte_errno), rte_errno);
The output of this line is highlighted in yellow. To my surprise, the error code it returns here is 0 which translates to success! But yet, the variable memPool is NULL.

In order to check if my system setup is correct, I decided to run a DPDK example which uses rte_mempool_create() to allocate the memory pool. I ran $DPDK_HOME/examples/multi_process/simple_mp and it works perfectly well. I couldn't find out why. Maybe it was the parameters of the function rte_mempool_create(). So I changed them all as per what was working in DPDK's simple_mp example. Yet the same issue!

I have put together a sort of reduced version of the code where rte_mempool_create() is called exactly like it is called in DpdkDevice::InitMemPool and also exactly like it is called in the DPDK's simple_mp example. I am attaching this code along with the pcapplusplus style Makefile. In reduced.cpp, lines 171-174 are basically calling rte_mempool_create() like it is called in DpdkDevice::InitMemPool. On the other hand, the lines 176-195 are calling rte_mempool_create() like it is called in the DPDK's simple_mp example. There seems to be no issue with rte_eal_init() and it seems to work correctly each time.

After hours of debugging, this now seems to be some issue related to the build environment or maybe I am still missing out something. Possibly there is something different that PcapPlusPlus does, compared to what DPDK does for compiling similar code.

My setup environment
  • Ubuntu 16.04.3 LTS (kernel: 4.13.0-36-generic)
  • dpdk-stable-17.11.1
  • PcapPlusPlus commit id c69d9a6c276569b0006c4ac7e84885530f8524bb
  • Intel XXV710-DA2 NIC card | kernel operations driver: i40e | DPDK operations driver: igb_uio
Any help or advice is greatly appreciated. Thank you!


Regards,
Raj
dpdk-issue.tar.gz

PcapPlusPlus Support

unread,
Mar 10, 2018, 5:26:45 PM3/10/18
to PcapPlusPlus support
Hi Raj,

Thanks for reaching out with this issue.
I actually stumbled upon the same issue with recent DPDK versions (17.11 and 18.02) and I still didn't figure out the reason by now.
I thought this issue was somehow related to the fact that my setup is running DPDK on VirtualBox.
Now I see you encounter the same issue running on a non-virtualized environment.

I'll do some further testing.

Thanks you for assembling the reduced code version. One this I didn't understand from your message is whether one of rte_mempool_create() in this code succeed, could you please elaborate on that?
I'll try your code on my setup and see if I can find anything.

Thanks,

PcapPlusPlus Support

unread,
Mar 11, 2018, 4:36:41 AM3/11/18
to PcapPlusPlus support
Hi again Raj,

Thanks to your help I think I managed to solve the issue.
Like you said, the problem was in PcapPlusPlus makefile - there was a missing library: -lrte_mempool_ring
I added it to the makefile and the mempool seems to be initialized correctly now, and the DPDK example works as expected.
Please pull the latest code from master branch which includes the fix. Notice you'll need to run configure-linux.sh again.

Please let me know if this solves the issue

Thanks,
Reply all
Reply to author
Forward
0 new messages