Did you load/inserted vfio-pci driver before starting ovs, else ovs-dpdk won't initialize with support for vfio-pci. If not reload the openvswitch process after loading vfio module in the kernel.
ovs-vswichd.log will help to debug further if above doesn't resolve your error. On Sat, Jul 28, 2018 at 3:26 AM, Vancasola <[email protected]> wrote: > > Hi, > When I try to add a port with dpdk, I met an error: "Error attaching device > '0000:02:00.0' to DPDK".This is the instruction: ovs-vsctl add-port br0 > dpdk-p0 -- set Interface dpdk-p0 type=dpdk > options:dpdk-devargs=0000:02:00.0 I have searched github and many mails, but > I still cannot find the solution(for a long time) :(:(. So can you tell me > how to solve it? > > I have set CONFIG_RTE_BUILD_SHARED_LIB=y in $DPDK_DIR/config/common_base. > > > > http://docs.openvswitch.org/en/latest/intro/install/dpdk/ > > http://docs.openvswitch.org/en/latest/intro/install/ > general/#general-build-reqs > > http://docs.openvswitch.org/en/latest/howto/dpdk/ > > These is my main tutorial. > > > This is a partial display: > > > > > > about hugepages > > > root@sdn:/usr/src/ovs# echo 'vm.nr_hugepages=2048' > > /etc/sysctl.d/hugepages.conf > > root@sdn:/usr/src/ovs# sysctl -w vm.nr_hugepages=1024 > > vm.nr_hugepages = 1024 > > root@sdn:/usr/src/ovs# grep HugePages_ /proc/meminfo > > HugePages_Total: 1024 > > HugePages_Free: 1024 > > HugePages_Rsvd: 0 > > HugePages_Surp: 0 > > root@sdn:/usr/src/ovs# mount -t hugetlbfs none /dev/hugepages`` > > > about vfio’s configuration > > > root@sdn:/usr/src/ovs# dmesg | grep -e DMAR -e IOMMU > > [ 0.000000] ACPI: DMAR 0x00000000CECF8578 000070 (v01 LENOVO TC-FW > 00001790 INTL 00000001) > > [ 0.000000] DMAR: IOMMU enabled > > [ 0.004000] DMAR: Host address width 39 > > [ 0.004000] DMAR: DRHD base: 0x000000fed90000 flags: 0x1 > > [ 0.004000] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap d2008c40660462 > ecap f050da > > [ 0.004000] DMAR: RMRR base: 0x000000cea19000 end: 0x000000cea38fff > > [ 0.004000] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed90000 IOMMU 0 > > [ 0.004000] DMAR-IR: HPET id 0 under DRHD base 0xfed90000 > > [ 0.004000] DMAR-IR: Queued invalidation will be enabled to support x2apic > and Intr-remapping. > > [ 0.004000] DMAR-IR: Enabled IRQ remapping in x2apic mode > > [ 0.744604] DMAR: No ATSR found > > [ 0.744632] DMAR: dmar0: Using Queued invalidation > > [ 0.744680] DMAR: Hardware identity mapping for device 0000:00:00.0 > > [ 0.744681] DMAR: Hardware identity mapping for device 0000:00:01.0 > > [ 0.744682] DMAR: Hardware identity mapping for device 0000:00:14.0 > > [ 0.744682] DMAR: Hardware identity mapping for device 0000:00:16.0 > > [ 0.744683] DMAR: Hardware identity mapping for device 0000:00:16.3 > > [ 0.744684] DMAR: Hardware identity mapping for device 0000:00:17.0 > > [ 0.744685] DMAR: Hardware identity mapping for device 0000:00:1d.0 > > [ 0.744686] DMAR: Hardware identity mapping for device 0000:00:1f.0 > > [ 0.744687] DMAR: Hardware identity mapping for device 0000:00:1f.2 > > [ 0.744688] DMAR: Hardware identity mapping for device 0000:00:1f.3 > > [ 0.744688] DMAR: Hardware identity mapping for device 0000:00:1f.4 > > [ 0.744689] DMAR: Hardware identity mapping for device 0000:00:1f.6 > > [ 0.744691] DMAR: Hardware identity mapping for device 0000:01:00.0 > > [ 0.744692] DMAR: Hardware identity mapping for device 0000:01:00.1 > > [ 0.744694] DMAR: Hardware identity mapping for device 0000:02:00.0 > > [ 0.744695] DMAR: Hardware identity mapping for device 0000:02:00.1 > > [ 0.744695] DMAR: Setting RMRR: > > [ 0.744696] DMAR: Ignoring identity map for HW passthrough device > 0000:00:14.0 [0xcea19000 - 0xcea38fff] > > [ 0.744697] DMAR: Prepare 0-16MiB unity mapping for LPC > > [ 0.744697] DMAR: Ignoring identity map for HW passthrough device > 0000:00:1f.0 [0x0 - 0xffffff] > > [ 0.744699] DMAR: Intel(R) Virtualization Technology for Directed I/O > > > root@sdn:/usr/src/ovs# cat /proc/cmdline | grep iommu=pt > > BOOT_IMAGE=/boot/vmlinuz-4.15.0-29-generic > root=UUID=bdc617a6-3bfc-4b7d-bf4b-72f5cb5dbaff > ro quiet splash iommu=pt intel_iommu=on vt.handoff=1 > > > > And I bind devices to VFIO: > > > > Network devices using DPDK-compatible driver > > ============================================ > > 0000:02:00.0 'Ethernet Controller 10-Gigabit X540-AT2 1528' drv=vfio-pci > unused=ixgbe > > 0000:02:00.1 'Ethernet Controller 10-Gigabit X540-AT2 1528' drv=vfio-pci > unused=ixgbe > > > > And I ensure them initialized > > > root@sdn:/usr/src/ovs# ovs-vsctl get Open_vSwitch . dpdk_initialized > > true > > root@sdn:/usr/src/ovs# ovs-vswitchd --version > > ovs-vswitchd (Open vSwitch) 2.10.90 > > DPDK 17.11.3 > > root@sdn:/usr/src/ovs# ovs-vsctl get Open_vSwitch . dpdk_version > > "DPDK 17.11.3" > > > > Then I add a bridge > > > ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev > > > Add a port: > > > root@sdn:/usr/src/ovs# ovs-vsctl add-port br0 dpdk-p0 -- set Interface > dpdk-p0 type=dpdk options:dpdk-devargs=0000:02:00.0 > > ovs-vsctl: Error detected while setting up 'dpdk-p0': Error attaching > device '0000:02:00.0' to DPDK. See ovs-vswitchd log for details. > > ovs-vsctl: The default log directory is "/usr/local/var/log/openvswitch". > > > Show: > > root@sdn:/usr/src/ovs# ovs-vsctl show > > c74a1be8-374c-48c5-a597-8d0db435ff17 > > Bridge "br0" > > Port "dpdk-p0" > > Interface "dpdk-p0" > > type: dpdk > > options: {dpdk-devargs="0000:02:00.0"} > > error: "Error attaching device '0000:02:00.0' to DPDK" > > Port "br0" > > Interface "br0" > > type: internal > > > > _______________________________________________ > discuss mailing list > [email protected] > https://mail.openvswitch.org/mailman/listinfo/ovs-discuss > > -- Thanks and Regards, Pradeep.K.S.
_______________________________________________ discuss mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
