Changing order of module loading in kernel

I have two type of ports, em and igb. Is it possible to change the order of loading of these two modules? By default em is loaded first an then igb.
Here's the related part of GENERIC kernel:

Code:
# PCI Ethernet NICs.
device          de              # DEC/Intel DC21x4x (``Tulip'')
device          em              # Intel PRO/1000 Gigabit Ethernet Family
device          igb             # Intel PRO/1000 PCIE Server Gigabit Family
 
No eloquently simple way AFAIK.

There's rcorder(8)(). Maybe you can leave igb in /boot/loader.conf, then write a start-up script for em, which would include loading the if_em module. Finally, specify if_igb as REQUIRE in your custom service start-up file.

Not pretty; maybe someone else will have a better idea.
 
May I ask why? em and igb support different NIC chipsets, so it's not like they're going to stomp on each other when detecting the NICs. And, if you don't like the order that they number the NICs, you can always rename the interfaces.

So, why does it matter which order the drivers are loaded?
 
Write a shell script that runs ifconfig and shows the interfaces in any order you like. Modifying a device driver for cosmetic issues is misguided.
 
j4ck said:
I have two type of ports, em and igb. Is it possible to change the order of loading of these two modules? By default em is loaded first an then igb.

How do you know which one is loaded first?
If my memory works, there is a way to specify each driver in which arena (SI_SUB_DRIVERS) has to be loaded, but there is no particular order within the same arena. This means that pretty much all drivers are loaded in the same arena and without any specific order. Therefore, there is no common way of changing the loading order of the drivers, I guess.

And I don't see any reason to do that, too.
 
Back
Top