Bug 291431

Summary: order in /sys/class/net/eth is backwards from /sys/bus/pci/devices
Product: [Fedora] Fedora Reporter: John Reiser <jreiser>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: medium    
Version: 8   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-19 19:56:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Reiser 2007-09-14 18:27:04 UTC
Description of problem: The order of devices in /sys/class/net/eth is backwards
from the order in /sys/bus/pci/devices.  This causes needless confusion.


Version-Release number of selected component (if applicable):
kernel-2.6.23-0.174.rc6.fc8


How reproducible:
always

Steps to Reproduce:
1.ls -l /sys/class/net/eth*/device
2.
3.
  
Actual results:
lrwxrwxrwx 1 root root 0 2007-09-14 10:43 /sys/class/net/eth0/device ->
../../../devices/pci0000:00/0000:00:09.0/0000:01:09.0
lrwxrwxrwx 1 root root 0 2007-09-14 10:43 /sys/class/net/eth1/device ->
../../../devices/pci0000:00/0000:00:09.0/0000:01:08.0
lrwxrwxrwx 1 root root 0 2007-09-14 10:43 /sys/class/net/eth2/device ->
../../../devices/pci0000:00/0000:00:09.0/0000:01:07.0
lrwxrwxrwx 1 root root 0 2007-09-14 10:43 /sys/class/net/eth3/device ->
../../../devices/pci0000:00/0000:00:0a.0

Notice that eth* order is 0,1,2,3 while device order is 01:{09,08,07}, 00:0a. 
This is backwards.

Expected results: Order of eth* is the same as device order.  In this case:
  eth0 -> 00:0a
  eth1 -> 01:07
  eth2 -> 01:08
  eth3 -> 01:09


Additional info:

Comment 1 Dave Jones 2007-09-19 19:56:23 UTC
I don't think there's an easy way to fix this.

The problem is that PCI device probing isn't predictable (which is why unless
you use HWADDR to bind ethN names to NICs, eth0 could be a different device
depending on the order in which the devices get probed).

If this was to change however, it'd likely need fairly involved changes that
should really be done upstream rather than in Fedora.  netdev.org is
probably a much better place to ask.