Subject: Re: [PATCH] Expose netdevice dev_id through sysfs

From: Andrey Borzenkov <[email-masked]>
Date: Sun, 20 Apr 2008 09:21:03 +0400

On Sunday 20 April 2008, David Miller wrote:
> We're trying to provide uniqueness amongst all devices in the system
> that are using the same MAC address.
> 
> On a Sparc system, for example, ethernet chips driven by several
> different drivers can end up with the same MAC address, as the
> system IDPROM specified ethernet MAC is what will be used by
> default.
> 

On Sparc system we also have global device tree which provides unique
and persistent reference to every device. Solaris has no problems with
having same MAC for all interfaces.

> So we need some global scheme.  And this dev_id value would need to be
> persistent.  As best as I can tell, such things aren't available.

What is exactly wrong with using device topology path? This should exist
on any system, it is unique and it is persistent.

> Sure we could do something silly like use the device I/O physical
> address, but that would defeat the whole purpose of making device
> identification agnostic to I/O bus geography.  I could move the
> card to a different slot and it would have a different dev_id.
> 

Sure; a card in different slot *is* a different device. And when broken
card is replaced in the same slot for all practical purposes it *is* the
same device even if MAC has changed.

Nobody makes cable labels like "card with MAC xxx"; every cable label has
something like "shelf 2; PCI slot 3; port 1".