Bug 291431 - order in /sys/class/net/eth is backwards from /sys/bus/pci/devices
Summary: order in /sys/class/net/eth is backwards from /sys/bus/pci/devices
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 8
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-09-14 18:27 UTC by John Reiser
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-09-19 19:56:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.