[SRU][Zesty]PCI: Add pci_mmap_resource_range() and use it for ARM64

Bug #1712580 reported by Manoj Iyer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Incomplete
High
Manoj Iyer

Bug Description

[Impact]
uio device binding inside VM would fail with errors
EAL: Detected 3 lcore(s)
EAL: Probing VFIO support...
EAL: PCI device 0000:00:01.0 on NUMA socket -1
EAL: probe driver: 1af4:1000 net_virtio
EAL: Cannot open /sys/bus/pci/devices/0000:00:01.0/resource1: No such file or directory
EAL: Cannot open /sys/bus/pci/devices/0000:00:01.0/resource0: No such file or directory
EAL: Error - exiting with code: 1
  Cause: Requested device 0000:00:01.0 cannot be used

[Fix]
Fixed in linus kernel 4.13 by patch David Woodhouse (4):
PCI: Move multiple declarations of pci_mmap_page_range() to <linux/pci.h>
PCI: Use BAR index in sysfs attr->private instead of resource pointer
PCI: Add BAR index argument to pci_mmap_page_range()
PCI: Add pci_mmap_resource_range() and use it for ARM64

[Test]
Please see comment #3 and comment #4 for ARM64 testing on QDF2400 system, and subsequent comments for testing on other arches.

[Regression Potential]
Patch touches PCI subsystem on all architectures, and PCI drivers. Regression tested on ARM64, ppc64el and AMD64.

Tags: qdf2400 zesty
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1712580

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: zesty
Revision history for this message
Manoj Iyer (manjo) wrote : Can you please help test kernel for bug #712580

Jeff,

I have a test kernel in
https://launchpad.net/~centriq-team/+archive/ubuntu/lp1712580/ This
kernel has patches to fix the Ubunt u bug
https://launchpad.net/bugs/1712580

Could you also please reply-all and share the test case and test setup
along with your test results on QDF2400 platform? I need to be able to
verify that it works for other architectures as well, especially for
amd64 and ppc64el because these patches impact the generic kernel.

Thanks
Manoj Iyer.

Revision history for this message
Manoj Iyer (manjo) wrote :

From WuFan:

HI Manoj,

Sorry for the delay. I haven't got chance to test your patch but I do find a (much) simple way to verify it. In a working system you have:

/home/ubuntu>ls /sys/bus/pci/devices/0002\:01\:00.0/resource*
/sys/bus/pci/devices/0002:01:00.0/resource
/sys/bus/pci/devices/0002:01:00.0/resource0
/sys/bus/pci/devices/0002:01:00.0/resource1
/sys/bus/pci/devices/0002:01:00.0/resource2

While a failing system has this:

ubuntu@controller:~$ ls /sys/bus/pci/devices/0002\:01\:00.0/resource*
/sys/bus/pci/devices/0002:01:00.0/resource

Here the PCI device could be any PCIe NIC.

Thanks,
Fan

Revision history for this message
Manoj Iyer (manjo) wrote :

= Testing =

== Before applying the patch ==
$ lspci
0000:00:00.0 PCI bridge: Airgo Networks, Inc. Device 0401
0000:01:00.0 Ethernet controller: Mellanox Technologies MT27700 Family [ConnectX-4]
0004:00:00.0 PCI bridge: Airgo Networks, Inc. Device 0401
0005:00:00.0 PCI bridge: Airgo Networks, Inc. Device 0401

$ ls /sys/bus/pci/devices/0000\:01\:00.0/resource*
/sys/bus/pci/devices/0000:01:00.0/resource

== After applying the patch ==
$ ls /sys/bus/pci/devices/0000\:01\:00.0/resource*
/sys/bus/pci/devices/0000:01:00.0/resource
/sys/bus/pci/devices/0000:01:00.0/resource0
/sys/bus/pci/devices/0000:01:00.0/resource0_wc

Manoj Iyer (manjo)
description: updated
Revision history for this message
Manoj Iyer (manjo) wrote :

= Testing ppc64el =

== Before the patch ==
ubuntu@cameron:~$ lspci | grep PCIe
0005:05:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0005:05:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0005:05:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0005:05:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)

ubuntu@cameron:~$ ls /sys/bus/pci/devices/0005\:05\:00.0/resource*
/sys/bus/pci/devices/0005:05:00.0/resource
/sys/bus/pci/devices/0005:05:00.0/resource0
/sys/bus/pci/devices/0005:05:00.0/resource0_wc
/sys/bus/pci/devices/0005:05:00.0/resource2
/sys/bus/pci/devices/0005:05:00.0/resource2_wc
/sys/bus/pci/devices/0005:05:00.0/resource4
/sys/bus/pci/devices/0005:05:00.0/resource4_wc

== After the patch ==
ubuntu@cameron:~$ uname -a
Linux cameron 4.10.0-33-generic #37~lp1712580+build.3-Ubuntu SMP Thu Aug 24 18:56:29 UTC 2017 ppc64le ppc64le ppc64le GNU/Linux

ubuntu@cameron:~$ lspci | grep PCIe
0005:05:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0005:05:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0005:05:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0005:05:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)

ubuntu@cameron:~$ ls /sys/bus/pci/devices/0005\:05\:00.0/resource*
/sys/bus/pci/devices/0005:05:00.0/resource
/sys/bus/pci/devices/0005:05:00.0/resource0
/sys/bus/pci/devices/0005:05:00.0/resource0_wc
/sys/bus/pci/devices/0005:05:00.0/resource2
/sys/bus/pci/devices/0005:05:00.0/resource2_wc
/sys/bus/pci/devices/0005:05:00.0/resource4
/sys/bus/pci/devices/0005:05:00.0/resource4_wc

description: updated
Manoj Iyer (manjo)
description: updated
description: updated
Revision history for this message
Manoj Iyer (manjo) wrote :

= Testing AMD64 =

== Before patch ==
ubuntu@betelnut:~$ lspci | grep Mellanox
01:00.0 Ethernet controller: Mellanox Technologies MT27520 Family [ConnectX-3 Pro]

ubuntu@betelnut:~$ ls /sys/bus/pci/devices/0000\:01\:00.0/resource*
/sys/bus/pci/devices/0000:01:00.0/resource
/sys/bus/pci/devices/0000:01:00.0/resource0
/sys/bus/pci/devices/0000:01:00.0/resource2
/sys/bus/pci/devices/0000:01:00.0/resource2_wc

== After patch ==
ubuntu@betelnut:~$ uname -a
Linux betelnut 4.10.0-33-generic #37~lp1712580+build.3-Ubuntu SMP Thu Aug 24 18:57:45 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

ubuntu@betelnut:~$ lspci | grep Mellanox01:00.0 Ethernet controller: Mellanox Technologies MT27520 Family [ConnectX-3 Pro]

ubuntu@betelnut:~$ ls /sys/bus/pci/devices/0000\:01\:00.0/resource*
/sys/bus/pci/devices/0000:01:00.0/resource
/sys/bus/pci/devices/0000:01:00.0/resource0
/sys/bus/pci/devices/0000:01:00.0/resource2
/sys/bus/pci/devices/0000:01:00.0/resource2_wc

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.