mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bill Davidsen <davidsen@tmr.com>
To: Matt Domsch <Matt_Domsch@dell.com>
Cc: Arjan van de Ven <arjan@infradead.org>,
	Dave Jones <davej@redhat.com>,
	linux-pci@atrey.karlin.mff.cuni.cz, Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.18-rc5] PCI: sort device lists breadth-first
Date: Tue, 12 Sep 2006 17:06:00 -0400	[thread overview]
Message-ID: <45072138.5040207@tmr.com> (raw)
In-Reply-To: <20060912030848.GA18381@lists.us.dell.com>

Matt Domsch wrote:

>On Mon, Sep 11, 2006 at 03:36:06PM -0400, Bill Davidsen wrote:
>  
>
>>Arjan van de Ven wrote:
>>    
>>
>>>Maybe the kernel's initial ordering should do a numeric sort by mac
>>>address or something.. (or userspace should)
>>>
>>>      
>>>
>>That wouldn't match any existing setup, and would be subject to mid-list 
>>insertions if a NIC were added/replaced. And that is fragile.
>>
>>I was looking for an easy way to do PCI slot to MAC, and from there MAC 
>>to IP, so any NIC plugged into a given slot could be called eth0 (for 
>>instance) and given the "right" IP address, but that's not easy. Can be 
>>done with some searching in /sys, but it's non-trivial.
>>    
>>
>
>So, I did almost this in
>userspace. http://linux.dell.com/files/name_eths/.  It uses the PCI
>IRQ Routing table to determine if a PCI device is embedded on the
>motherboard, or is in an add-in slot, and if so, which slot.  It
>orders the list of thereby possible PCI NICs with all the embeddeds
>first, in ascending PCI breadth-first order, then orders all the
>add-in NICs in PCI slot number ascending order, subsort PCI
>breadth-first for those nifty multiport cards.  It rewrites
>modprobe.conf to load network drivers 'proper' order and outputs an
>/etc/mactab file that can be used by the second half of the script to
>write HWADDR lines into Red Hat-style ifcfg-eth* files, and into
>openSuSE udev ethernet rules file.
>  
>
I am not (generally) concerned with the embedded NICs, it's the slots I 
have had bite me. I do see what you're doing, although I didn't do it 
quite the same way.

>This works great, until you add another NIC into an add-in slot
>somewhere in the middle (e.g. you have 2 embedded NICs eth0 and eth1,
>and a NIC card in PCI slot 4 eth2, then at some later point you add a
>NIC card into PCI slot 2).  You either have to manually configure a
>name for the new card, or run name_eths again and expect the NIC in
>PCI slot 2 to become eth2, and the one in slot4 to become eth3.
>  
>
And this is why I want to do a slot to name translation, which may 
result in gaps in the names. That doesn't seem to matter. Then I can put 
a label over the slot, like "public" or "private" and know that adding 
another NIC, or replacing a failed NIC will leave my labels intact.

>The pure C udev helper I'm working on behaves similarly, though would
>negate the need to edit config files, as it assigns a name "on the
>fly" at device discovery time.
>
>For the relatively rare cases of adding a NIC, I'm OK with this.  I
>don't have a better way to handle it, but am open to ideas.
>  
>
You have mine. I tried putting labels on the NIC, but the machine go to 
live timezones away and repairs are done by whoever has the service 
contract.

>We could assign names like eth-embedded-1, eth-embedded-2,
>eth-slot2-1, eth-slot4-1 if we wanted to change how people think of
>ethernet names (and this would be similar to how large network
>switches work: blade N, port M.  We've got 15 usable chars in the name
>after all...
>
Opens the door for change, for sure. Since I have had to use multi-drop 
NICs and nameset like e_slot1_jack2 is an interesting concept. Or 
perhaps just append the jack index no matter how many connections it 
has. So eth2-0 would be a NIC and socket. Then when I run out of slots 
and have to go to a two or four post card, the primary name wouldn't change.

Your idea has just enough usefulness to be dangerous ;-) Thanks.

-- 
bill davidsen <davidsen@tmr.com>
  CTO TMR Associates, Inc
  Doing interesting things with small computers since 1979


  reply	other threads:[~2006-09-12 20:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-08  3:14 Matt Domsch
2006-09-08 15:56 ` Dave Jones
2006-09-08 16:18   ` Matt Domsch
2006-09-08 16:55     ` Arjan van de Ven
2006-09-11 19:36       ` Bill Davidsen
2006-09-12  3:08         ` Matt Domsch
2006-09-12 21:06           ` Bill Davidsen [this message]
2006-09-08 16:45   ` Greg KH
2006-09-08 18:20 ` Andrew Morton
2006-09-08 18:52   ` Matt Domsch
2006-09-08 18:59   ` Alexey Dobriyan
2006-09-09  9:05   ` Jeff Garzik
2006-09-09 12:11     ` Pavel Machek
2006-09-10 11:26       ` Stefan Richter
2006-09-10 13:02     ` Greg KH
2006-09-15  3:53 ` Dan Carpenter
2006-09-15 13:02   ` Matt Domsch
2006-09-16  2:39     ` Dan Carpenter
2006-09-08  3:18 Matt Domsch
2006-09-08 19:34 Matt Domsch
2006-09-09 14:37 Ragnar Kjørstad

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=45072138.5040207@tmr.com \
    --to=davidsen@tmr.com \
    --cc=Matt_Domsch@dell.com \
    --cc=arjan@infradead.org \
    --cc=davej@redhat.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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

Powered by JetHome