Re: How does user specify PCI board instance for configuration?

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

 



On Thu, Jan 11, 2018 at 08:26:52AM +0100, Greg KH wrote:
> On Wed, Jan 10, 2018 at 09:17:23PM +0000, Grant Edwards wrote:
>
>> If a user needs to provide configuration information specific to a
>> particular PCI board, how does one have the user identify the
>> board?
> 
> It's a hard thing to do :(
> 
>> When my driver's probe() function is called, it appears that
>> pdev->slot is null, so that's not useful.
> 
> Yes, not all BIOSes support that.
> 
>> Should I use pci_name(pdev) as the identifier for the user to
>> specify when configuring a particular board?
> 
> You can, but how are you "configuring a particular board"?

The thought was that there would be a module parameter that contained
sets of "board ID" and config values.  What could be used for the
"board ID" is the question.  Through a bit of trial and error, the
user can determine which pci_name (e.g. 0000:07:00.0) belongs to which
board.  If those names are "stable", then the user could then create a
module parameter with the desired configuration value(s) for each
pci_name.

> > Is pci_name(pdev) associated with a phisical slot guaranteed to be
> > unchaged after a reboot?  After other PCI cards are added/removed?
> 
> It can randomly change every boot, the PCI addressing scheme is not
> deterministic, sorry.

But doesn't the new "predictable" network interface naming scheme
assume that it is deterministic and name the device based on its PCI
address?

    $ ifconfig | grep '^en'
    enp1s5    Link encap:Ethernet  HWaddr 00:13:8f:ff:20:ba  

    $ lspci | grep -i Ethernet
    01:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter (rev 10)

    $ cat /etc/network/interfaces
    [...]
    auto enp1s5
    iface enp1s5 inet static
       address 192.168.14.253
       netmask 255.255.0.0
       gateway 192.168.0.253
       dns-nameservers 8.8.8.8 8.8.4.4

If the PCI addressing scheme isn't predictable after reboot, then
won't the network device name change and the network configuration get
broken?

At least with network cards, there's a MAC address you can use to
differentiate one card from another if you need to.  With all of the
serial cards I've seen, there isn't: if you install multiple serial
cards of the same model, they're completely identical from the
driver's POV.  Perhaps they should have had serial numbers that the
driver could read, but there's no way the additional cost can be
justified when multiple-card installations are uncommon.

-- 
Grant


--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux