From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8345DA055D; Mon, 1 Mar 2021 02:48:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CA0940684; Mon, 1 Mar 2021 02:48:52 +0100 (CET) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id 6F71F4014E for ; Mon, 1 Mar 2021 02:48:50 +0100 (CET) Received: by inbox.dpdk.org (Postfix, from userid 33) id 444EEA0561; Mon, 1 Mar 2021 02:48:50 +0100 (CET) From: bugzilla@dpdk.org To: dev@dpdk.org Date: Mon, 01 Mar 2021 01:48:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: other X-Bugzilla-Version: 19.11 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: weix.ling@intel.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 Subject: [dpdk-dev] [Bug 644] [dpdk-19.11.7]usertools/dpdk-devbind.py: bind NIC port to DPDK failed in vm. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" https://bugs.dpdk.org/show_bug.cgi?id=3D644 Bug ID: 644 Summary: [dpdk-19.11.7]usertools/dpdk-devbind.py: bind NIC port to DPDK failed in vm. Product: DPDK Version: 19.11 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: Normal Component: other Assignee: dev@dpdk.org Reporter: weix.ling@intel.com Target Milestone: --- DPDK version:=C2=A0 19.11.7-rc1(cbcd84e3304f43623efe34236f548a1bdae68ca4) Other software versions: qemu-4.2.1 OS: Ubuntu 20.04.1 LTS/5.10.0-051000-generic Compiler:=C2=A0gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2) Hardware platform:=C2=A0Intel(R) Xeon(R) Platinum 8280M CPU @ 2.70GHz NIC hardware:=C2=A0fortville_spirit NIC firmware:=C2=A05.10.0-051000-generic/8.00 0x80008b8a 1.2766.0 Test Setup Steps to reproduce List the steps to reproduce the issue. #1.Bind nic port to vfio-pci on host usertools/dpdk-devbind.py --force --bind=3Dvfio-pci 0000:af:00.0 0000:af:00= .1 #2.Start testpmd on host x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 1,2,3,4,5,6,7,8,9,10,11,12 = -n 4 -w 0000:af:00.0 --file-prefix=3Dvhost_56195_20210225181454 --vdev 'net_vhost0,iface=3D/root/dpdk/vhost-net0,queues=3D2,client=3D1' --vdev 'net_vhost1,iface=3D/root/dpdk/vhost-net1,queues=3D2,client=3D1' -- -i --nb= -cores=3D4 --rxq=3D2 --txq=3D2 --txd=3D1024 --rxd=3D1024 set fwd txonly start #3.Start vm on host taskset -c 46,47,48,49,50,51,52,53 /home/QEMU/qemu-4.2.1/bin/qemu-system-x8= 6_64 -name vm0 -enable-kvm -pidfile /tmp/.vm0.pid -daemonize -monitor unix:/tmp/vm0_monitor.sock,server,nowait -netdev user,id=3Dnttsip1,hostfwd=3Dtcp:10.240.183.220:6000-:22 -device e1000,netdev=3Dnttsip1 -chardev socket,id=3Dchar0,path=3D/root/dpdk/vhost-net0,server -netdev type=3Dvhost-user,id=3Dnetdev0,chardev=3Dchar0,vhostforce,queues=3D2 -device virtio-net-pci,netdev=3Dnetdev0,mac=3D52:54:00:00:00:02,mrg_rxbuf=3Don,mq= =3Don,vectors=3D6 -chardev socket,id=3Dchar1,path=3D/root/dpdk/vhost-net1,server -netdev type=3Dvhost-user,id=3Dnetdev1,chardev=3Dchar1,vhostforce,queues=3D2 -device virtio-net-pci,netdev=3Dnetdev1,mac=3D52:54:00:00:00:03,mrg_rxbuf=3Don,mq= =3Don,vectors=3D6 -cpu host -smp 8 -m 8192 -object memory-backend-file,id=3Dmem,size=3D8192M,mem-path=3D/mnt/huge,share=3Don -= numa node,memdev=3Dmem -mem-prealloc -chardev socket,path=3D/tmp/vm0_qga0.sock,server,nowait,id=3Dvm0_qga0 -device virtio= -serial -device virtserialport,chardev=3Dvm0_qga0,name=3Dorg.qemu.guest_agent.0 -vn= c :4 -drive file=3D/home/image/ubuntu1910.img #4.Bind nic to virtio in vm echo 0000:00:04.0 > /sys/bus/pci/devices/0000\:00\:04.0/driver/unbind modprobe virtio-pci echo 0000:00:04.0 > /sys/bus/pci/drivers/virtio-pci/bind echo 0000:00:05.0 > /sys/bus/pci/devices/0000\:00\:05.0/driver/unbind modprobe virtio-pci echo 0000:00:05.0 > /sys/bus/pci/drivers/virtio-pci/bind #5.Set vm params echo 0 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages umount `awk '/hugetlbfs/ { print $2 }' /proc/mounts` awk '/hugetlbfs/ { print $2 }' /proc/mounts mkdir -p /mnt/huge mount -t hugetlbfs nodev /mnt/huge cat /proc/mounts |grep hugetlbfs rmmod vfio_pci rmmod vfio_iommu_type1 rmmod vfio modprobe vfio modprobe vfio-pci echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode #6.Bind nic port to vfio-pci in vm usertools/dpdk-devbind.py --force --bind=3Dvfio-pci 0000:00:04.0 0000:00:05= .0 Show the output from the previous commands. root@ubuntuvm1910:~/dpdk# usertools/dpdk-devbind.py --force --bind=3Dvfio-p= ci 0000:00:04.0 0000:00:05.0 Traceback (most recent call last): File "usertools/dpdk-devbind.py", line 755, in main() File "usertools/dpdk-devbind.py", line 743, in main check_modules() File "usertools/dpdk-devbind.py", line 198, in check_modules if module_is_loaded(mod["Name"]): File "usertools/dpdk-devbind.py", line 177, in module_is_loaded release =3D platform.uname().release AttributeError: 'tuple' object has no attribute 'release' Expected Result Explain what is the expected result in text or as an example output: # Bind nic port to vfio-pci in vm successfully. Regression Is this issue a regression: (Y) Version the regression was introduced: Specify git id if known. Bad commit: commit 1e794e710d186d209eb3a424f56285c9b47774f6 (HEAD) Author: Yongxin Liu Date: Mon Nov 23 11:05:33 2020 +0800 usertools: fix binding built-in kernel driver [ upstream commit 7a016af4aa6bd2f8425b4fb2d59e5dd19f12bceb ] A driver can be loaded as a dynamic module or a built-in module. In commit 681a67288655 ("usertools: check if module is loaded before binding"), the script only checks modules in /sys/module/. However, for built-in kernel driver, it only shows up in /sys/module/, if it has a version or at least one parameter. So add check for modules in /lib/modules/$(uname -r)/modules.builtin. Fixes: 681a67288655 ("usertools: check if module is loaded before binding") Signed-off-by: Yongxin Liu Reviewed-by: Anatoly Burakov --=20 You are receiving this mail because: You are the assignee for the bug.=