Skip to contentSkip to conversation

NICs trading places ?

DISCUSSION Dave Jones 11 participants 15 messages Mar 28, 2003 – Mar 29, 2003 Network drivers

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

I just upgraded a box with 2 NICs in it to 2.5.66, and found that what was eth0 in 2.4 is now eth1, and vice versa. Is this phenomenon intentional ? documented ?
What caused it to do this ?

The box in question has a DEC Tulip and a 3com 3c905, but I imagine this would affect any system with >1 NIC of different vendors/drivers ?

Dave

#1 lore raw
Quoted 4 lines · Dave Jones

I just upgraded a box with 2 NICs in it to 2.5.66, and found that what was eth0 in 2.4 is now eth1, and vice versa. Is this phenomenon intentional ? documented ?
What caused it to do this ?

That's a bug that no one has tracked down yet.

Jamal reported it, too.

ethX numbering shouldn't be changing without a good reason...

Jeff

#2 lore raw
In reply to Dave Jones

That's bitten me several times, not just 2.4 -> 2.5 but also within different versions of 2.4-RHL :-(

I've head you can spell out pci IDs in modules.conf to nail it down but I haven't gotten around to trying it -

Joe

Quoted 19 lines · Dave Jones

I just upgraded a box with 2 NICs in it to 2.5.66, and found that what was eth0 in 2.4 is now eth1, and vice versa. Is this phenomenon intentional ? documented ?
What caused it to do this ?

The box in question has a DEC Tulip and a 3com 3c905, but I imagine this would affect any system with >1 NIC of different vendors/drivers ?

Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw
In reply to Dave Jones
Quoted 4 lines · Dave Jones

I just upgraded a box with 2 NICs in it to 2.5.66, and found that what was eth0 in 2.4 is now eth1, and vice versa. Is this phenomenon intentional ? documented ?
What caused it to do this ?

Is this a Red Hat system? I encountered the same thing on a
RHAS system. Basically, Anaconda had controlled the module load order in /etc/modules.conf for 2.4. Because my network drivers were built in in 2.5, they loaded in the order of the compile-in. This turned out to be the reverse order.
Swapping eth0 and eth1 in /etc/modules.conf fixed the problem
for me. This is not to say it is "Red Hat's fault" or that this is entirely the same situation, but I figured this would make a good datapoint.

Joel

Signature · 10 lines
"It is not the function of our government to keep the citizen from
 falling into error; it is the function of the citizen to keep the
 government from falling into error."
	- Robert H. Jackson

Joel Becker
Senior Member of Technical Staff
Oracle Corporation
E-mail: [email protected]
Phone: (650) 506-8127
#4 lore raw

On Fri, 28 Mar 2003 14:25:25 -0800 Joel Becker <[email protected]> wrote:

| On Fri, Mar 28, 2003 at 10:10:37PM +0000, Dave Jones wrote:
| > I just upgraded a box with 2 NICs in it to 2.5.66, and found
| > that what was eth0 in 2.4 is now eth1, and vice versa.
| > Is this phenomenon intentional ? documented ?
| > What caused it to do this ?
| 
| 	Is this a Red Hat system?  I encountered the same thing on a
| RHAS system.  Basically, Anaconda had controlled the module load order
| in /etc/modules.conf for 2.4.  Because my network drivers were built in
| in 2.5, they loaded in the order of the compile-in.  This turned out to
| be the reverse order.
| 	Swapping eth0 and eth1 in /etc/modules.conf fixed the problem
| for me.  This is not to say it is "Red Hat's fault" or that this is
| entirely the same situation, but I figured this would make a good
| datapoint.

I saw this same problem at home last night, not on a RH system, so I think it's just a 2.5.lately thing.

--
~Randy

author
#5 lore raw
In reply to Joel Becker
Quoted 2 lines · Joel Becker

Is this a Red Hat system? I encountered the same thing on a
RHAS system.

I've seen the same issue on a SuSE box, and a Debian box.

Quoted 4 lines

Basically, Anaconda had controlled the module load order
in /etc/modules.conf for 2.4. Because my network drivers were built in in 2.5, they loaded in the order of the compile-in. This turned out to be the reverse order.

NICs built into kernel in both 2.4 and 2.5.

Dave

#6 lore raw
In reply to Dave Jones
Quoted 8 lines · Dave Jones

I just upgraded a box with 2 NICs in it to 2.5.66, and found that what was eth0 in 2.4 is now eth1, and vice versa. Is this phenomenon intentional ? documented ?
What caused it to do this ?

The box in question has a DEC Tulip and a 3com 3c905, but I imagine this would affect any system with >1 NIC of different vendors/drivers ?

Intentional? No.
Documented? I suppose you can find complaints from others mentioning the same thing.
Cause? eth discovery order is not well-defined.

Once or twice I have submitted patches to rectify. They help for a while and then someone breaks things again. I am not quite sure, apologies in case I misremember, but maybe the most recent breakage was caused by Marc Zyngier with EISA bus changes.

Google turns up
http://www.uwsg.iu.edu/hypermail/linux/kernel/0301.2/1139.html

Let me add the patch referred to there. Maybe Jeff likes it this time.

Andries

drivers/net/3c59x.c +7 -1
diff -u --recursive --new-file -X /linux/dontdiff a/drivers/net/3c59x.c b/drivers/net/3c59x.c
@@ -1439,8 +1439,14 @@
  		acpi_set_WOL(dev);
 	}
 	retval = register_netdev(dev);
-	if (retval == 0)
+	if (retval == 0) {
+		int i;
+		printk("%s: 3c59x, address", dev->name);
+		for (i = 0; i < 6; i++)
+			printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]);
+		printk("\n");
 		return 0;
+	}
 
 free_ring:
 	pci_free_consistent(pdev,
#7 lore raw
Quoted 2 lines · Andries Brouwer

Cause? eth discovery order is not well-defined.

It's a continual irritation.

drivers/net/3c59x.c line 1449

Quoted 8 lines
drivers/net/3c59x.c +7 -0
+	if (retval == 0) {
+		int i;
+		printk("%s: 3c59x, address", dev->name);
+		for (i = 0; i < 6; i++)
+			printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]);
+		printk("\n");
 		return 0;
+	}

hm. typing `ifconfig' shows this information.

#8 lore raw
Quoted 12 lines · Andrew Morton

drivers/net/3c59x.c line 1449

Quoted 8 lines · Andries Brouwer
drivers/net/3c59x.c +7 -0
+	if (retval == 0) {
+		int i;
+		printk("%s: 3c59x, address", dev->name);
+		for (i = 0; i < 6; i++)
+			printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]);
+		printk("\n");
 		return 0;
+	}

hm. typing `ifconfig' shows this information.

I like uniformity.
Either all eth cards should have their address in dmesg, or none. Almost all do.

And: ifconfig does not give the card types.
So presently one needs both boot messages and ifconfig.

And: in some situations the system does not boot because of eth numbering mixup, and one never gets the opportunity to ask ifconfig.

Andries

#9 lore raw
Quoted 7 lines · Andries Brouwer

And: ifconfig does not give the card types.
So presently one needs both boot messages and ifconfig.

And: in some situations the system does not boot because of eth numbering mixup, and one never gets the opportunity to ask ifconfig.

ifconfig can bind cards to devices based on mac addresses. /sbin/hotplug can also be used for this.

I recommend doing this for anyone with more than one nic card in their machine.

thanks,

greg k-h

#10 lore raw
Quoted 10 lines · Greg KH
Quoted 6 lines · Andries Brouwer

And: ifconfig does not give the card types.
So presently one needs both boot messages and ifconfig.

And: in some situations the system does not boot because of eth numbering mixup, and one never gets the opportunity to ask ifconfig.

Quoted 5 lines

ifconfig can bind cards to devices based on mac addresses. /sbin/hotplug can also be used for this.

I recommend doing this for anyone with more than one nic card in their machine.

Actually nameif(8) is the preferred way of doing this.

Jeff

#11 lore raw
Quoted 11 lines · Jeff Garzik
Quoted 10 lines · Greg KH
Quoted 6 lines · Andries Brouwer

And: ifconfig does not give the card types.
So presently one needs both boot messages and ifconfig.

And: in some situations the system does not boot because of eth numbering mixup, and one never gets the opportunity to ask ifconfig.

Quoted 8 lines
Quoted 5 lines

ifconfig can bind cards to devices based on mac addresses. /sbin/hotplug can also be used for this.

I recommend doing this for anyone with more than one nic card in their machine.

Actually nameif(8) is the preferred way of doing this.

Oops, sorry, that's what I meant. Call nameif in a /sbin/hotplug script when the network interface is registered.

greg k-h

#12 lore raw
In reply to Andries Brouwer
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Andries" == Andries Brouwer <[email protected]> writes:

Andries> I am not quite sure, apologies in case I misremember, but Andries> maybe the most recent breakage was caused by Marc Zyngier Andries> with EISA bus changes.

Well, it is not exactly related to EISA bus, although part of the same patch.

The real problem is that some old drivers are still initialized from Space.c (they simply do not know about init_etherdev (NULL, ...), after all these years). So yes, I broke 3c509 in this respect. I also broke znet if that matters. Oh, and the EISA part of depca in the AC tree.

So the questions are :
- Should Space.c die ? I think so.
- Should 2.5 be the place and time to kill it ? I also think so.

I know it is a pain for most of us to have interfaces being renumbered. But relying on something as static as Space.c is the wrong answer IMHO.

        M.
Signature · 1 line
Places change, faces change. Life is so very strange.
#13 lore raw
In reply to Dave Jones
Quoted 4 lines · Dave Jones

I just upgraded a box with 2 NICs in it to 2.5.66, and found that what was eth0 in 2.4 is now eth1, and vice versa. Is this phenomenon intentional ? documented ?
What caused it to do this ?

I've seen the same thing for 5+ years. Multiple things can trigger it, eg:

Always having your NIC drivers compiled in, and then moving between different kernel versions.

Going from modular NIC drivers to compiled in drivers can bite you.

Isn't life fun.

Dax

#14 lore raw

commence Dax Kelson quotation:

Quoted 10 lines · Dave Jones
Quoted 5 lines

I just upgraded a box with 2 NICs in it to 2.5.66, and found that what was eth0 in 2.4 is now eth1, and vice versa. Is this phenomenon intentional ? documented ?
What caused it to do this ?

I've seen the same thing for 5+ years. Multiple things can trigger it, eg:

Quoted 6 lines

Always having your NIC drivers compiled in, and then moving between different kernel versions.

Going from modular NIC drivers to compiled in drivers can bite you.

Isn't life fun.

Something I have been meaning to write as soon as I get bitten by this myself is a script that uses the "ip link set X name Y" command (possibly in conjuction with a MAC-to-name map, or else just a simple sort) to name the interfaces consistently.

Signature · 1 line
Sean Neakums - <[email protected]>