e1000e NIC Driver change in Linux Kernel

IT牛人.117 2015-11-18 09:00

Story

Intel PRO/1000 PCIe Network Driver in kernel source tree hasn’t been touched for quite some time, it’s been2.3.2-kfrom 3.10 all the way up to 4.1.

Not until Linux 4.2 was it bumped up to3.2.5-k.

I didn’t realized the change until after installinglinux-image-generic-lts-wilyHWE kernel (based on 4.2) on my Linux Workstation (running Ubuntu 14.04 LTS with ksplice - up and running for 127 days…).

After rebooting, as usual I checked for newe1000eversions and found new 3.2.7.1 VS 3.2.4.2. No waste of time, downloaded the source and built a new kernel module.

While building, I checkedmodinfo e1000eand was surprised to find that the kernel built-in driver version has been bumped up to3.2.5-k, even newer than the previously used3.2.4.2. Interesting!

I had a look at theLinux 4.3source code, finding thate1000edriver version was again bumped up to version 3.2.6-k.

Well, still falling behind the latest e1000e stable release on SourceForge.

One interesting fact found when browsing through the source code, kernel built-in driver has a-ksuffix defined asDRV_EXTRAVERSION. I reckon it’s just to distinguish kernel built-in driver from self-compiled kernel modules (or 3rd party driver update packages).

#include "e1000.h"
 
#define DRV_EXTRAVERSION "-k"
    
#define DRV_VERSION "3.2.6" DRV_EXTRAVERSION
char e1000e_driver_name[] = "e1000e";
const char e1000e_driver_version[] = DRV_VERSION;

Build and load e1000e on a running system

It’s pretty straightforward: Download the source tarball, extract it, change directory to src/ and run make install, remove current loaded e1000e module, reload the newly built module, assign the interface IP(s), done. Just bear in mind that the statistics will be reset, I don’t care ;-D

tar axvf e1000e-<ver>.tar.gz

cd e1000e-<ver>/src && make install

rmmod e1000e

modprobe e1000e

# or modprobe followed by the full path of the newly built e1000e kernel module

modprobe /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/intel/e1000e/e1000e.ko

NOTE: On Ubuntu you’ll need the toolchain (build-essentialand probably more, figure it out yourself) and kernel header for the running kernel.

BTW: e1000e 3.3.1 was released on the day after I wrote this article, damn, build again!

[返回] [原文链接]