Re: pciutils: problem identifying PCI devices uniquely

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[+cc Martin, pciutils maintainer]

On Thu, Jun 28, 2012 at 4:02 AM, Holger Eitzenberger
<holger@xxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux