Hi Friends,
A brief description before i put in my queries.... :)
Background :-
-----------------
Assume that a motherboard has 'N' physical ethernet devices (eth devices).
For each of these devices the linux kernel assign a particular ID. e.g. eth0, eth1, eth2, etc .......
These device ID's are assigned when the linux kernel has come up and done some basic initialization.
Also these device ID's do not change while the linux kernel is up and running.
With the same kernel version and driver version the eth device number assigned to a particular
physical port does not change over multiple system reboots.
Query :-
---------
I would like to know a few things, with the second query being most important.
1) When i make changes to the kernel code (not related to eth devices) i need to recompile the kernel
and give it a new number. For this the eth driver also needs to be recompiled with the newer number.
Sometimes after compilation the kernel mapping of ethernet ID (eth0, eth1, etc ....) to the
physical port changes. And this behaviour is a "sometimes behaviour". ie. If i build kernel and driver
and if the mapping changes, the mapping remains same for the kernel version number. But if rebuild
the kernel then mapping again changes with this newer mapping remaining constant for this newer version.
2) How does the linux kernel map the ethernet device ID to the physical port.
For e.g. :- How does it detect that port 'X' will have eth4 as device ID.
Ashutosh.