DPDK应用程序无法正常工作

时间:2019-01-08 14:35:57

标签: dpdk huge-pages

我正在DPDK中构建Helloworld应用程序。我收到错误消息No free hugepages reported in hugepages-1048567

(1)我使用RTE_TARGET=x86_64-linuxapp-native-gcc构建DPDK-18.11。

(2)我运行usertools/dpdk-setup.sh,运行[15](构建DPDK)。

(3)运行[22],分配大页面。我设置了1024个大页面。

(4)运行[18],插入igb_uio模块。

(5)运行[24],将我的NIC(e1000e)绑定到igb_uio模块。

然后,我转到examples/helloworld/,运行make来构建应用程序。当我跑步 ./build/app/helloworld -l 0-1 -n 4,我得到以下提名(没有免费的大页):

xiarui@wcf-OptiPlex-7060:~/dpdk/dpdk-18.11/examples/helloworld/build/app$ sudo ./helloworld -l 0 -n 4
EAL: Detected 12 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: PCI device 0000:00:1f.6 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 8086:15bb net_e1000_em
hello from core 0

我已经在设置脚本中分配了hugepages,并获得以下输出:

AnonHugePages:         0 kB
ShmemHugePages:        0 kB
HugePages_Total:    1024
HugePages_Free:     1024
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

此外,我发现e1000e无法绑定到VFIO,所以我只使用igb_uio驱动程序。

Network devices using DPDK-compatible driver
============================================
0000:00:1f.6 'Ethernet Connection (7) I219-LM 15bb' drv=igb_uio unused=e1000e

我的主机配置文件是: CPU:

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              12
On-line CPU(s) list: 0-11
Thread(s) per core:  2
Core(s) per socket:  6
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               158
Model name:          Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Stepping:            10
CPU MHz:             800.493
CPU max MHz:         4600.0000
CPU min MHz:         800.0000
BogoMIPS:            6384.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            12288K
NUMA node0 CPU(s):   0-11

内存:

xiarui@wcf-OptiPlex-7060:~/dpdk/dpdk-18.11/examples/helloworld/build/app$ free -h
              total        used        free      shared  buff/cache   available
Mem:           7.6G        2.4G        4.4G        159M        809M        4.8G
Swap:          2.0G          0B        2.0G

我运行pktgen-3.6.0时情况变得更糟。我收到以下错误:

>>> sdk '/home/xiarui/dpdk/dpdk-18.11', target 'x86_64-native-linuxapp-gcc'
   Trying ./app/x86_64-native-linuxapp-gcc/pktgen
sudo -E ./app/x86_64-native-linuxapp-gcc/pktgen -l 0-1 -n 4 --proc-type auto --log-level 7 --file-prefix pg -- -T -P --crc-strip -m 1.0 -f themes/black-yellow.theme

Copyright (c) <2010-2019>, Intel Corporation. All rights reserved. Powered by DPDK
EAL: Detected 12 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Auto-detected process type: PRIMARY
EAL: Multi-process socket /var/run/dpdk/pg/mp_socket
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: PCI device 0000:00:1f.6 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 8086:15bb net_e1000_em
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio

*** Copyright (c) <2010-2019>, Intel Corporation. All rights reserved.
*** Pktgen created by: Keith Wiles -- >>> Powered by DPDK <<<

Initialize Port 0 -- TxQ 1, RxQ 1,  Src MAC 8c:ec:4b:a5:17:4f

eth_em_start(): Unable to initialize the hardware
!PANIC!: rte_eth_dev_start: port=0, Input/output error
PANIC in pktgen_config_ports():
rte_eth_dev_start: port=0, Input/output error6: [./app/x86_64-native-linuxapp-gcc/pktgen(_start+0x2a) [0x56038a3d29ba]]
5: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fe0b33a3b97]]
4: [./app/x86_64-native-linuxapp-gcc/pktgen(main+0xe52) [0x56038a3ca782]]
3: [./app/x86_64-native-linuxapp-gcc/pktgen(pktgen_config_ports+0x1ef1) [0x56038a403761]]
2: [./app/x86_64-native-linuxapp-gcc/pktgen(__rte_panic+0xc5) [0x56038a3bb544]]
1: [./app/x86_64-native-linuxapp-gcc/pktgen(rte_dump_stack+0x2e) [0x56038a4f5f4e]]

你能和我分享一些想法吗?谢谢您的宝贵时间。

2 个答案:

答案 0 :(得分:1)

df['instance'] = pandas.Series(['1', '1', '2', '2', '3', '3'])
df['status'] = pandas.Series(['p', 'p', 'f', 'f', 'f', 'f'])
df['event'] = pandas.Series(['a', 'b', 'a', 'c', 'a', 'd'])
df['status'] = df['status'].astype('category')
df['status'].cat.set_categories(['p', 'f'], inplace=True)
df['event'] = df['event'].astype('category')
df['event'].cat.set_categories(df['event'].unique(), inplace=True)
pt = df.pivot(index='instance', columns='event')

Output:
         status               
event         a    b    c    d
instance                      
1             p    p  NaN  NaN
2             f  NaN    f  NaN
3             f  NaN  NaN    f

没有免费的1GB大页面不是错误,这只是一个信息。

您获得了grid-template-columns:1fr 1fr; 的输出,因此您的hello world应用程序可以正常工作,恭喜!

答案 1 :(得分:-1)

我在 string the_date -rw-r--r-- 12 30067 10224 -rw-r--r-- 64 30067 10224 -rw-r--r-- 64 30067 10224 中运行df_all_files = pd.DataFrame(df_all_files.string.str.rsplit('',1).tolist(), columns = ['string','the_date']) ,但情况很糟糕。我收到以下错误:

testpmd

我想,看来该应用无法从大页面分配内存。

谢谢您的时间。

编辑

我想我对usertools/dpdk-setup.sh太刻薄了。因此,我尝试分配Launching app EAL: Detected 12 lcore(s) EAL: Detected 1 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: No free hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... EAL: PCI device 0000:00:1f.6 on NUMA socket -1 EAL: Invalid NUMA socket, default to 0 EAL: probe driver: 8086:15bb net_e1000_em Interactive-mode selected testpmd: create a new mbuf pool <mbuf_pool_socket_0>: n=203456, size=2176, socket=0 testpmd: preferred mempool ops selected: ring_mp_mc EAL: Error - exiting with code: 1 Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate memory 个大页面。然后,一切正常。

hugepage allocation

我在VBox中发现,我只有两个lcore,我只分配了128个大页面,并且一切正常。但是,当我使用具有12个内核的桌面时,128个大页面是不够的。

您能分享一些分配大页面的原则吗?或越多越好。感谢您分享您的想法。