All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [dpdk-dev] [Bug 644] [dpdk-19.11.7]usertools/dpdk-devbind.py: bind NIC port to DPDK failed in vm.
Date: Mon, 01 Mar 2021 01:48:49 +0000	[thread overview]
Message-ID: <bug-644-3@http.bugs.dpdk.org/> (raw)

https://bugs.dpdk.org/show_bug.cgi?id=644

            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: 
 19.11.7-rc1(cbcd84e3304f43623efe34236f548a1bdae68ca4)
Other software versions: qemu-4.2.1
OS: Ubuntu 20.04.1 LTS/5.10.0-051000-generic
Compiler: gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
Hardware platform: Intel(R) Xeon(R) Platinum 8280M CPU @ 2.70GHz
NIC hardware: fortville_spirit
NIC firmware: 5.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=vfio-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=vhost_56195_20210225181454   --vdev
'net_vhost0,iface=/root/dpdk/vhost-net0,queues=2,client=1' --vdev
'net_vhost1,iface=/root/dpdk/vhost-net1,queues=2,client=1' -- -i --nb-cores=4
--rxq=2 --txq=2 --txd=1024 --rxd=1024
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-x86_64
 -name vm0 -enable-kvm -pidfile /tmp/.vm0.pid -daemonize -monitor
unix:/tmp/vm0_monitor.sock,server,nowait -netdev
user,id=nttsip1,hostfwd=tcp:10.240.183.220:6000-:22 -device
e1000,netdev=nttsip1  -chardev
socket,id=char0,path=/root/dpdk/vhost-net0,server -netdev
type=vhost-user,id=netdev0,chardev=char0,vhostforce,queues=2 -device
virtio-net-pci,netdev=netdev0,mac=52:54:00:00:00:02,mrg_rxbuf=on,mq=on,vectors=6
-chardev socket,id=char1,path=/root/dpdk/vhost-net1,server -netdev
type=vhost-user,id=netdev1,chardev=char1,vhostforce,queues=2 -device
virtio-net-pci,netdev=netdev1,mac=52:54:00:00:00:03,mrg_rxbuf=on,mq=on,vectors=6
-cpu host -smp 8 -m 8192 -object
memory-backend-file,id=mem,size=8192M,mem-path=/mnt/huge,share=on -numa
node,memdev=mem -mem-prealloc -chardev
socket,path=/tmp/vm0_qga0.sock,server,nowait,id=vm0_qga0 -device virtio-serial
-device virtserialport,chardev=vm0_qga0,name=org.qemu.guest_agent.0 -vnc :4
-drive file=/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=vfio-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=vfio-pci
0000:00:04.0 0000:00:05.0
Traceback (most recent call last):
  File "usertools/dpdk-devbind.py", line 755, in <module>
    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 = 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 <yongxin.liu@windriver.com>
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 <yongxin.liu@windriver.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2021-03-01  1:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01  1:48 bugzilla [this message]
2021-03-01 10:08 ` [dpdk-dev] [Bug 644] [dpdk-19.11.7]usertools/dpdk-devbind.py: bind NIC port to DPDK failed in vm Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-644-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.