[SOLVED] install another ethernet driver

Kernels & Hardware, configuring network, installing services

[SOLVED] install another ethernet driver

Postby elboulangero » 2011-06-21 07:01

Hie everyone, it's just a question about something weird happening here on my computer. It's about the ethernet driver.

I've got a Dell Optiplex Desktop here, the CPU is a Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz. The integrated ethernet here is from intel also, it's a 82579LM Gigabit Network Connection. This computer is running a Debian Squeeze 64bits, distrib sid, kernel 2.6.39-2-amd64.

Well, here goes the story. I had a lot of trouble with the ethernet card, being very slow, and it just didn't work when i was using tftp. So I downloaded and compiled the latest driver available on Intel website. Currently with debian sid, the version for the driver ( e1000e ) is version: 1.3.10-k2. From Intel I got the version 1.3.17-NAPI.
Alright, so I build it, and move the module manually to the right place, replacing the previous version at the same time ie :
Code: Select all
$ sudo cp e1000e.ko /lib/modules/2.6.39-2-amd64/kernel/drivers/net/e1000e/e1000e.ko


This fix my problem. However, there is is still something bothering me. When I want to check, after rebooting, that I did it right, here is what happens :
Code: Select all
$ sudo ethtool -i eth1
driver: e1000e
version: 1.3.10-k2


Dammit ! looks like the old driver isn't ready to leave ! More disturbing, I ask to modinfo now :
Code: Select all
$ sudo modinfo e1000e
filename:       /lib/modules/2.6.39-2-amd64/kernel/drivers/net/e1000e/e1000e.ko
version:        1.3.17-NAPI


So, which one should I trust ? Is there something I didn't do properly when installing the module ? Or maybe I just don't understand ethtool and modinfo enough.
Last edited by elboulangero on 2011-07-08 17:19, edited 3 times in total.
elboulangero
 
Posts: 10
Joined: 2011-06-21 06:25

Re: e1000e from intel - ethtool and modinfo don't agree

Postby elboulangero » 2011-06-21 07:06

A little bit more information. After I reboot my machine, I do a :
Code: Select all
$ lsmod | grep e1000e
e1000e                128034  0


Well, now, try to remove and insert the module again, and compare the size :
Code: Select all
$ sudo modprobe -r e1000e
$ sudo modprobe e1000e
$ lsmod | grep e1000e
e1000e                145794  0


This is definitely not the same driver, ethtool was right. So, why the driver loaded at boot time is not the one I compiled and put in /lib/modules.... ??
elboulangero
 
Posts: 10
Joined: 2011-06-21 06:25

Re: e1000e from intel - ethtool and modinfo don't agree

Postby bw123 » 2011-06-21 14:34

You just copied it without using modprobe to reinsert the first time, so it never updated itself. Is it still confused now?
wheezy/KDE4, GNU/Linux 3.14-0.bpo.1-amd64
User avatar
bw123
 
Posts: 1839
Joined: 2011-05-09 06:02
Location: TN_USA

Re: e1000e from intel - ethtool and modinfo don't agree

Postby elboulangero » 2011-06-22 07:01

Nope bw123, I'm still confused.

Maybe I didn't explain myself properly. The problem is that the new module is never loaded at boot time, I have to rmmod the old e1000e and modprobe the new one every time I start the computer.

Today I rebuilt the driver from source, and this time I ran the make install ( in sudo mode of ocurse ) instead of copying the module manually. The only difference I see is that the make install run a /sbin/depmod -a || true, which is something I didn't do before.

Anyway, I reboot, and the situation is still the same :
Code: Select all
$ sudo ethtool -i eth1
driver: e1000e
version: 1.3.10-k2


And then :
Code: Select all
$ sudo modprobe -r e1000e
$ sudo modprobe e1000e
$ sudo ethtool -i eth1
driver: e1000e
version: 1.3.17-NAPI


We don't speak about modinfo anymore. Cause if I understand properly :
* modinfo tells about the file found in /lib/modules/version.../e1000e.ko, not about the e1000e currently loaded.
* ethtool tells me about the module currently loaded, and shows that the module automatically loaded at boot is not the right one.
* and because i'm a little bit paranoid, I do the lsmod as well ( see previous post ), which confirms that after rmmod e1000e / modprobe e1000e, the driver is different.

Well, any idea about where I'm wrong ?
elboulangero
 
Posts: 10
Joined: 2011-06-21 06:25

Re: e1000e from intel - ethtool and modinfo don't agree

Postby bw123 » 2011-06-22 13:20

elboulangero wrote:Nope bw123, I'm still confused.

Today I rebuilt the driver from source, and this time I ran the make install ( in sudo mode of ocurse ) instead of copying the module manually. The only difference I see is that the make install run a /sbin/depmod -a || true, which is something I didn't do before.


hehe, I stay confused when it somes to modprobe, but have you tried to see if there is more than one driver?

Code: Select all
sudo find / -name e1000*
[sudo] password for bw:
/lib/modules/2.6.32-5-amd64/kernel/drivers/net/e1000
/lib/modules/2.6.32-5-amd64/kernel/drivers/net/e1000/e1000.ko
/lib/modules/2.6.32-5-amd64/kernel/drivers/net/e1000e
/lib/modules/2.6.32-5-amd64/kernel/drivers/net/e1000e/e1000e.ko


elboulangero wrote:We don't speak about modinfo anymore. Cause if I understand properly :
* modinfo tells about the file found in /lib/modules/version.../e1000e.ko, not about the e1000e currently loaded.
* ethtool tells me about the module currently loaded, and shows that the module automatically loaded at boot is not the right one.
* and because i'm a little bit paranoid, I do the lsmod as well ( see previous post ), which confirms that after rmmod e1000e / modprobe e1000e, the driver is different.

Well, any idea about where I'm wrong ?


Well, according to man modinfo it's like this

modinfo extracts information from the Linux Kernel modules given on the
command line. If the module name is not a filename, then the /lib/mod‐
ules/version directory is searched, as is also done by modprobe(8) when
loading kernel modules.


There's a few places to look for module info, and aliases have something to do with it also. I don't see how you could be loading the old driver if it's not present, didn't you replace it? Modinfo may think it's the old one though, because it really liked the other one, and refuses to just let it go? I don't know about ethtool, but these things are complicated and they may be rivals, and trying to throw you off the track.
wheezy/KDE4, GNU/Linux 3.14-0.bpo.1-amd64
User avatar
bw123
 
Posts: 1839
Joined: 2011-05-09 06:02
Location: TN_USA

Re: e1000e from intel - ethtool and modinfo don't agree

Postby elboulangero » 2011-07-08 07:51

I finally got it !! I understood and solved ! Man, the explanation is quite easy actually, once you hear about the initial ramfs.

Well in case this post interests someone, here is the explanation :

First, one should know that boot happens in 3 steps :
1. Kernel starts.
2. Kernel loads initramfs ( or initial ram disk ), which is a kind of filesystem containing initialisation stuff, and also the modules !
3. FInally, the real root filesystem is mounted, and kernel passes control to the /sbin/init.

So, if I come back to my Ethernet driver problem, well after I build and install it, for sure my module is in the right place, ie /lib/modules/2.6.39-2-amd64/kernel/drivers/net/e1000e/e1000e.ko. But at boot time, the kernel doesn't look here : it loads the module from the initramfs.

So I just have to update the initramfs, by running the command :
Code: Select all
$ sudo dpkg-reconfigure linux-image-2.6.39-2-amd64


where linux-image-2.6.39-2-amd64 stands for my kernel package name. By doing this, the initramfs is regenerated according to the files in my root filesystem, and this time it will include my new Ethernet driver.

That's it ! Well for people who wants to know more, have a look here http://kernel-handbook.alioth.debian.org/ch-initramfs.html.

Cheers
elboulangero
 
Posts: 10
Joined: 2011-06-21 06:25


Return to System configuration

Who is online

Users browsing this forum: No registered users and 25 guests

fashionable