Storage Performance Development Kit (SPDK)
 help / color / mirror / Atom feed
From: Harris, James R <james.r.harris at intel.com>
To: spdk@lists.01.org
Subject: Re: [SPDK] Debugging /sys driver_override affecting driver binding
Date: Mon, 02 Jul 2018 16:54:38 +0000	[thread overview]
Message-ID: <0576F8C5-AB9F-4F50-BD77-B99EB4AF800A@intel.com> (raw)
In-Reply-To: 28D485C5-DBA2-4CBE-8008-F385195FE39F@oracle.com

[-- Attachment #1: Type: text/plain, Size: 3164 bytes --]

Hi Lance,

I haven’t seen this problem before.  Does this system have multiple NVMe devices, and only one (or a subset) of them has driver_override set?

I notice that the two examples you gave were both for PCI BDF 40:00.0 – I assume that means this was collected on two different systems?

https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-pci seems to indicate that something must be writing “nvme” to that file – i.e. it’s not done internally by the kernel.  Maybe our setup.sh script should at least check for this – i.e. don’t reset driver_override to (null) but print a warning message if it finds it set to “nvme”.

-Jim


From: SPDK <spdk-bounces(a)lists.01.org> on behalf of Lance Hartmann ORACLE <lance.hartmann(a)oracle.com>
Reply-To: Storage Performance Development Kit <spdk(a)lists.01.org>
Date: Tuesday, June 26, 2018 at 10:17 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] Debugging /sys driver_override affecting driver binding


During my experimentation of unbinding NVMe controllers from the Linux nvme driver and then binding them to vfio-pci for use with SPDK, I encountered unusual behavior with one of the controllers.   For some, initially inexplicable, reason, one of the NVMe controllers did get unbound as desired from the nvme driver, but it refused to bind to vfio-pci, whereas all the other NVMe controllers had no trouble at all binding to vfio-pci.  Inspection of the kernel log (dmesg) didn’t help.   And so after a bunch of debugging I uncovered the culprit:   the /sys driver attribute, driver_override.   By default, all of my NVMe controller’s appeared to have that attribute empty/null, e.g.:

# cat /sys/bus/pci/devices/0000:40:00.0/driver_override
(null)

However, I discovered that for the NVMe controller that refused to bind to vfio-pci, its driver_override attribute contained the string “nvme”:

# cat /sys/bus/pci/devices/0000:40:00.0/driver_override
nvme

Per Linux kernel documentation, ABI/testing/sysfs-bus-pci:

This file allows the driver for a device to be specified which
will override standard static and dynamic ID matching.  When
specified, only a driver with a name matching the value written
to driver_override will have an opportunity to bind to the
device.
…

Eureka!   So, that explains why I had a particular NVMe device that refused to bind to vfio-pci.   I wanted to share this discovery with other folks in case that run into a similar issue.   Now, the mystery that remains:    how and why did this particular NVMe controller get its driver_override attribute set to “nvme”?   It’s not being used as boot device, I’ve never attempted to use it with LVM (Linux Logical Volume Management), nor built any file systems on it, or any such thing.   I grep’d through both my real rootfs’s /etc and searched through my initramfs as well, but I’ve yet to discover what’s responsible for setting that particular NVMe controller’s driver_override.    Anyone have some ideas?

thanks,
--
Lance Hartmann
lance.hartmann(a)oracle.com<mailto:lance.hartmann(a)oracle.com>


[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 11540 bytes --]

             reply	other threads:[~2018-07-02 16:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 16:54 Harris, James R [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-07-03 22:35 [SPDK] Debugging /sys driver_override affecting driver binding Lance Hartmann ORACLE
2018-07-02 20:57 Harris, James R
2018-07-02 19:42 Lance Hartmann ORACLE
2018-06-26 17:17 Lance Hartmann ORACLE

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=0576F8C5-AB9F-4F50-BD77-B99EB4AF800A@intel.com \
    --to=spdk@lists.01.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox