DevHeads.net

Who is responsible to load NIC driver when boot up

Hi

I have a small question about NIC driver (e.g. i40e) loading. Who is
responsible to load i40e driver? And how does he knows we should load
i40e, instead of ixgbe?

Thanks.

Comments

Re: Who is responsible to load NIC driver when boot up

By Steven Tardy at 04/28/2019 - 01:02

On Sat, Apr 27, 2019 at 11:44 PM wuzhouhui < ... at mails dot ucas.ac.cn>
wrote:

`depmod` may put hardware/driver lists into initramfs when `mkinitrd` is
called when a new kernel is installed.
Also check file: /lib/modules/`uname-r`/modules.alias
The modules.alias contains PCI vendor/device IDs which can be found via
`lspci -n`.

Also you can `modinfo i40e` and `modinfo ixgbe` to see a list of PCI
vendor/device IDs which each driver supports.

Most of the time “it just works” be can be confusing tracking down exactly
why one driver loads instead of another.

Re: Who is responsible to load NIC driver when boot up

By wuzhouhui at 04/28/2019 - 01:22

Thanks for you explanation. But who loads (modprobe) drivers, udev, kernel,
or others?

Re: Who is responsible to load NIC driver when boot up

By Stephen John Smoogen at 04/28/2019 - 09:54

On Sun, 28 Apr 2019 at 01:22, wuzhouhui < ... at mails dot ucas.ac.cn>
wrote:

Re: Who is responsible to load NIC driver when boot up

By wuzhouhui at 04/28/2019 - 21:05

I think you are right. I add a dump_stack() and printk() in virtio_net
driver, and following infos printed when boot up:

kernel: Pid: 737, comm: modprobe Not tainted 2.6.32-279.22.1.el6.local.x86_64 #1
kernel: Call Trace:
kernel: [<ffffffff81096ea5>] ? __blocking_notifier_call_chain+0x65/0x80
kernel: [<ffffffffa0044009>] ? init+0x9/0x3c [virtio_net]
kernel: [<ffffffff8100204c>] ? do_one_initcall+0x3c/0x1d0
kernel: [<ffffffff810af701>] ? sys_init_module+0xe1/0x250
kernel: [<ffffffff8100b072>] ? system_call_fastpath+0x16/0x1b
kernel: parent: udevd