【问题标题】:Cannot add a DPDK-bound interface to the OVS bridge无法将 DPDK 绑定接口添加到 OVS 网桥
【发布时间】:2021-02-19 18:21:15
【问题描述】:

我尝试使用 ovs-vsctl 向 OVS 桥添加 PCI 接口 (I219-V) 失败:

root@pc:/home/me# ovs-vsctl add-port br0 tryport -- set Interface tryport type=dpdk options:dpdk-devargs=0000:00:1f.6
ovs-vsctl: Error detected while setting up 'tryport': Error attaching device '0000:00:1f.6' to DPDK.  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/usr/local/var/log/openvswitch".

OVS 和 DPDK 版本:

ovs-vsctl: 2.15.90
DB Schema 8.2.0
libdpdk: 21.02.0

添加失败:

2021-02-19T18:12:32.543Z|00126|dpdk|ERR|EAL: Driver cannot attach the device (0000:00:1f.6)
2021-02-19T18:12:32.543Z|00127|dpdk|ERR|EAL: Failed to attach device on primary process
2021-02-19T18:12:32.543Z|00128|netdev_dpdk|WARN|Error attaching device '0000:00:1f.6' to DPDK
2021-02-19T18:12:32.543Z|00129|netdev|WARN|tryport: could not set configuration (Invalid argument)
2021-02-19T18:12:32.543Z|00130|dpdk|ERR|Invalid port_id=32
2021-02-19T18:12:32.547Z|00131|dpdk|ERR|EAL: Driver cannot attach the device (0000:00:1f.6)
2021-02-19T18:12:32.547Z|00132|dpdk|ERR|EAL: Failed to attach device on primary process
2021-02-19T18:12:32.547Z|00133|netdev_dpdk|WARN|Error attaching device '0000:00:1f.6' to DPDK
2021-02-19T18:12:32.547Z|00134|netdev|WARN|tryport2: could not set configuration (Invalid argument)
2021-02-19T18:12:32.547Z|00135|dpdk|ERR|Invalid port_id=32

这是 OVS DB 的内容,EAL 似乎初始化正确:

root@pc:/home/me# ovs-vsctl list Open_Vswitch
_uuid               : 4150fd20-ecbd-4ee3-a438-0c74d0411831
bridges             : []
cur_cfg             : 9
datapath_types      : [netdev, system]
datapaths           : {}
db_version          : "8.2.0"
dpdk_initialized    : true
dpdk_version        : "DPDK 21.02.0"
external_ids        : {hostname=pc, rundir="/usr/local/var/run/openvswitch", system-id=""}
iface_types         : [bareudp, dpdk, dpdkvhostuser, dpdkvhostuserclient, erspan, geneve, gre, gtpu, internal, ip6erspan, ip6gre, lisp, patch, stt, system, tap, vxlan]
manager_options     : []
next_cfg            : 9
other_config        : {dpdk-init="true"}
ovs_version         : "2.15.90"
ssl                 : []
statistics          : {}
system_type         : Ubuntu
system_version      : "20.04-focal"

这是当前的接口设置,设备使用dpdk-devbind绑定到vfio-pci:

➜  ~ dpdk-devbind.py -s

Network devices using DPDK-compatible driver
============================================
0000:00:1f.6 'Ethernet Connection (10) I219-V 0d4f' drv=vfio-pci unused=

Network devices using kernel driver
===================================
0000:00:14.3 'Wireless-AC 9462 02f0' if=wlp0s20f3 drv=iwlwifi unused=vfio-pci *Active*

IOMMU 已启用:

➜  ~ sudo dmesg | grep -e DMAR -e IOMMU
[    0.015758] ACPI: DMAR 0x000000006CAFE000 0000A8 (v01 LENOVO TP-N2Q   00001250 PTEC 00000002)
[    0.055802] DMAR: IOMMU enabled
[    0.157186] DMAR: Host address width 39
[    0.157188] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[    0.157196] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 19e2ff0505e
[    0.157198] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[    0.157203] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
[    0.157205] DMAR: RMRR base: 0x0000006e81a000 end: 0x0000006e839fff
[    0.157207] DMAR: RMRR base: 0x00000079000000 end: 0x0000007d7fffff
[    0.157210] DMAR-IR: IOAPIC id 2 under DRHD base  0xfed91000 IOMMU 1
[    0.157212] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[    0.157213] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[    0.159739] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    0.890022] DMAR: No ATSR found
[    0.890108] DMAR: dmar0: Using Queued invalidation
[    0.890113] DMAR: dmar1: Using Queued invalidation
[    0.891306] DMAR: Intel(R) Virtualization Technology for Directed I/O

我的 grub 和大页面设置:

➜  ~ cat /proc/cmdline 
BOOT_IMAGE=/boot/vmlinuz-5.10.7-051007-generic root=UUID=455abfd8-5778-4930-8062-0ba7a48be98e ro quiet splash iommu=pt intel_iommu=on vt.handoff=7
grep HugePages_ /proc/meminfo
HugePages_Total:    2048
HugePages_Free:     1536
HugePages_Rsvd:        0
HugePages_Surp:        0

关于如何进一步调试问题的任何提示?遗憾的是,EAL 错误报告“驱动程序无法附加设备”不是很确定。

【问题讨论】:

  • 你试过用 uio_pci_generic 还是 igb_uio
  • 我尝试将日志级别设置为 eal,debug,以及更改要绑定到 uio_pci_generic 的内核模块,但我仍然收到:2021-02-20T01:53:49.187Z|00586 |dpdk|ERR|EAL:驱动程序无法附加设备 (0000:00:1f.6) 2021-02-20T01:53:49.187Z|00587|dpdk|ERR|EAL:无法在主进程上附加设备 2021-02 -20T01:53:49.187Z|00588|netdev_dpdk|WARN|将设备“0000:00:1f.6”附加到 DPDK 时出错 2021-02-20T01:53:49.187Z|00589|netdev|WARN|tryport2:无法设置配置(无效参数)2021-02-20T01:53:49.187Z|00590|dpdk|ERR|Invalid port_id=32
  • @EminS 我的问题是have you tried manually binding with uio_pci_generic or igb_uio for DPDK sample applications?。在英特尔支持的 DPDK 下我找到 i219 但不是 i219-v
  • 你试过手动绑定dpdk驱动吗?什么是 i219-V 的 pci BDF。 ?
  • 只是想指出stackoverflow.com/users/10504469/jin-leestackoverflow.com/users/2359227/tomer-shetah 状态the issue is related to ubuntu and linux-device-driver。可以jin-leetomer-hetah分享见解以帮助Ermin S

标签: dpdk openvswitch


【解决方案1】:

安装包 libdpdk-dev 解决了这个问题。

【讨论】:

  • 正如 ubuntu cmets 根据官方包信息packages.debian.org/sid/libdpdk-dev 所述,这意味着这些是DPDK libraries compiled with SSE as minimum。因此,我无法理解如何使用手动 DPDK 21.02.0,但您为什么建议从 UBUNTU 安装 DPDK 开发包。你将如何为其他发行版解决这个问题?
  • 因此将其标记为不是答案。
猜你喜欢
  • 2015-08-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多