linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Holger Eitzenberger <holger@eitzenberger.org>
To: linux-pci@vger.kernel.org
Subject: pciutils: problem identifying PCI devices uniquely
Date: Thu, 28 Jun 2012 12:02:31 +0200	[thread overview]
Message-ID: <20120628100231.GA21288@mail.eitzenberger.org> (raw)

Hi,

I have a problem identifying PCI devices (NICs in this case) on some
hardware.

In case the questions I have are too stupid please just ignore this
email.

While I usually use the bus:device.function to identify the hardware
this is not possible on some hardware, because the bus numbers are
changing.  And this is all because the box has 4 slots, and each slot
can possibly hold one of 3 different types of modules, differing in
the number of NICs they hold.

I found out that this is a well known problem, which is due to the
fact that the different modules have a different number of PCI bridges
on them.  In my case from 2 to 7 PCI bridges per module.

And then I came across the Chassis Capability (id 04).  On first read
this sounded as it would solve the problem, making the ID unique again
if configured properly, irrespective of the actual slot module used.
Has anyone experience with the Chassis Capability?

In my understanding the Chassis Capability is transparent to the OS,
the devices can still be identified by bus:device.function, correct?

According to the lspci source it should show something like:

  Capabilities: [04] Slot ID: 8 slots, First1, chassis 42

I was unable to find some sample lspci output when googling, a sample
output would be helpfull as well.

What I found helpfull, without the Chassis Capability, was a small tool
I wrote (derived from pciutils/examle.c), which is able to identify
the devices with a "path walk" from the PCI Root Port to the actual
device.  So e. g. when specifying:

 ./example -s '/00:02.0/:05.0/:01.1/:05.1'

In this case '00:02.0' is the Root Port, the other device except the
last are PCI bridges, specified with a wildcard for the bus number.

Would this be a feature of interest for pciutils in general?

Thanks!

 /Holger


             reply	other threads:[~2012-06-28 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28 10:02 Holger Eitzenberger [this message]
2012-07-03  1:44 ` pciutils: problem identifying PCI devices uniquely Bjorn Helgaas

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=20120628100231.GA21288@mail.eitzenberger.org \
    --to=holger@eitzenberger.org \
    --cc=linux-pci@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).