All of lore.kernel.org
 help / color / mirror / Atom feed
* pciutils: problem identifying PCI devices uniquely
@ 2012-06-28 10:02 Holger Eitzenberger
  2012-07-03  1:44 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Holger Eitzenberger @ 2012-06-28 10:02 UTC (permalink / raw)
  To: linux-pci

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: pciutils: problem identifying PCI devices uniquely
  2012-06-28 10:02 pciutils: problem identifying PCI devices uniquely Holger Eitzenberger
@ 2012-07-03  1:44 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2012-07-03  1:44 UTC (permalink / raw)
  To: linux-pci; +Cc: Martin Mareš

[+cc Martin, pciutils maintainer]

On Thu, Jun 28, 2012 at 4:02 AM, Holger Eitzenberger
<holger@eitzenberger.org> wrote:
> 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?

I think you're referring to the "Slot Identification" capability.  As
far as I can tell, the kernel ignores it.

I don't see spec details about it; the PCI spec v3 says it's fully
documented in the PCI to PCI Bridge spec, but I don't see anything in
the P2P bridge spec v1.2.  But I suppose if pciutils knows how to
decode it, it must be documented *somewhere*.

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

Yes.  The kernel uses segment/bus/device/function to identify a PCI device.

I'm not sure exactly what your objective is, but maybe this is
related: https://fedoraproject.org/wiki/Features/ConsistentNetworkDeviceNaming

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-03  1:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-28 10:02 pciutils: problem identifying PCI devices uniquely Holger Eitzenberger
2012-07-03  1:44 ` Bjorn Helgaas

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.