Linux kernel upgrade-update NIC driver

Source: Internet
Author: User

Upgrade the current kernel (2.6.32-220.el6.x86_64) to the target kernel (2.6.33-110.el6.x86_64) as required by the project, but the compiled target kernel (2.6.33-110.el6.x86_64) The corresponding driver does not necessarily support the corresponding device of the current system. This article details the processing steps of the target kernel driver that cannot support the current NIC device.

01. Compile the target kernel
Please refer to kernel compilation related documents (omitted)

02. Display all network cards
Because a system can support multiple network cards, the following life can be displayed by the current system of all network cards and their basic information:
#ifconfig -A

Em1 Link encap:ethernet HWaddr ec:f4:bb:d0:0b:60
Up broadcast multicast mtu:1500 metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

EM2 Link encap:ethernet HWaddr ec:f4:bb:d0:0b:62
Up broadcast multicast mtu:1500 metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

Em3 Link encap:ethernet HWaddr ec:f4:bb:d0:0b:64
Up broadcast multicast mtu:1500 metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
memory:dbe80000-dbf00000

03. Check the driver required for the network card

Use the Ethtool command to view the NIC driver information since the specified network card:

#ethtool-I. EM3

DRIVER:IGB -Nic em3 dependent IGB driver
Version:3.0.6-k
Firmware-version:1.6-7
bus-info:0000:08:00.0

Note: The IGB driver supports all Gigabit network connections based on 82575, 82576, 82580, and I350.

04. Check the network card model

Through ③ we already know the network card depends on the driver, but still do not know the specific network card driver model, at this time can be queried by the following command:

# Lspci-nn | grep "Eth"

01:00.0 Ethernet Controller [0200]: Intel Corporation 82599EB 10-gigabit sfi/sfp+ Network Connection [8086:10FB] (rev 01)
01:00.1 Ethernet Controller [0200]: Intel Corporation 82599EB 10-gigabit sfi/sfp+ Network Connection [8086:10FB] (rev 01)
03:00.0 Ethernet Controller [0200]: Intel Corporation 82599EB 10-gigabit SFP + Network Connection [8086:154d] (rev 01)
03:00.1 Ethernet Controller [0200]: Intel Corporation 82599EB 10-gigabit SFP + Network Connection [8086:154d] (rev 01)
08:00.0 Ethernet Controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
08:00.1 Ethernet Controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)

Note: Gigabit for gigabit 10-gigabit for million trillion

The current kernel (2.6.32-220.el6.x86_64) Gigabit Network Driver IGB supports the NIC model [8,086:1521] by ④ operation, so the target core (2.6.33-110.el6.x86_64) must be required for the model card [8,086:1521 ] Support.

05, check whether the target core network card driver supports the current model card

The Modinfo command can be used to see which device model the *.ko supports, and the relevant driver for the target kernel (2.6.33-110.el6.x86_64) can be found in the/lib/modules/2.6.33-110.el6.x86_64 directory as follows:

#modinfo/lib/modules/2.6.33-110.el6.x86_64/kernel/drivers/net/igb/igb.ko

Filename:igb.ko
Version:2.1.0-k2
LICENSE:GPL
Description:intel (R) Gigabit Ethernet Network Driver
Author:intel Corporation, <[email protected]>
srcversion:412d1cb4c85682cbf07976f
Alias:pci: v00008086d000010d6sv*sd*bc*sc*i*
alias:pci:v00008086d000010a9sv*sd*bc*sc*i*
Alias:pci: v00008086d000010a7sv*sd*bc*sc*i*
alias:pci:v00008086d000010e8sv*sd*bc*sc*i*
Alias:pci: v00008086d0000150dsv*sd*bc*sc*i*
alias:pci:v00008086d000010e7sv*sd*bc*sc*i*
Alias:pci: v00008086d000010e6sv*sd*bc*sc*i*
alias:pci:v00008086d00001518sv*sd*bc*sc*i*
Alias:pci: v00008086d0000150asv*sd*bc*sc*i*
alias:pci:v00008086d000010c9sv*sd*bc*sc*i*
Alias:pci: v00008086d00001516sv*sd*bc*sc*i*
alias:pci:v00008086d00001511sv*sd*bc*sc*i*
Alias:pci: v00008086d00001510sv*sd*bc*sc*i*
alias:pci:v00008086d0000150fsv*sd*bc*sc*i*
Alias:pci: v00008086d0000150esv*sd*bc*sc*i*
Depends:
vermagic:2.6.33-110.el6.x86_64 SMP mod_unload modversions

The information from the above information cannot be found [ 8086:1521 ], therefore, the target kernel (2.6.33-110.el6.x86_64) network card driver does not support the current network card!

06, download the NIC driver to the official website
     Since it is clear that the target kernel's NIC driver does not support the current NIC device, that is, once the new kernel is enabled, Will cause the system to not work properly with network functionality. If it is an Intel network card device, you can go to: http://www.intel.cn/content/www/cn/zh/homepage.html Download the required driver source to local.

07, compile NIC driver
After extracting the driver source code, compile the driver source code according to the following command format:
#make build_kernel=2.6.33-110.el6.x86_ A network card driver Igb.ko will be generated by the
above command. where Build_kernel indicates which kernel needs to be compiled for the driver, the default is to compile the currently running kernel, which we set as the target kernel ( 2.6.33-110.el6.x86_64 ). So how do you see if the newly generated NIC driver Igb.ko supports the current NIC device?

08, check that the network card driver supports the current network adapter
Step ⑦ will generate a network card driver Igb.ko, you can verify by modinfo command whether the driver supports the NIC device [8,086:1521] as follows:
#modinfo Igb.ko
Filename:igb.ko
version:5.2.9.4
LICENSE:GPL
Description:intel ( R) Gigabit Ethernet Network Driver
Author:intel Corporation, <[email protected]>
Srcversion: E377200391ebf74638feda2
alias:pci:v00008086d000010d6sv*sd*bc*sc*i*
...

......
alias:pci:v00008086d00001522sv*sd*bc*sc*i*
alias:pci:v00008086d00001521sv*sd*bc*sc*i*
alias:pci:v00008086d00001539sv*sd*bc*sc*i*
......
Depends:hwmon
vermagic:2.6.33-110.el6.x86_64 SMP mod_unload modversions
Parm:InterruptThrottleRate:Maximum interrupts per second, per vector, (max 100000), default 3=adaptive (array of int)
Parm:IntMode:Change Interrupt Mode (0=legacy, 1=msi, 2=msi-x), default 2 (array of int)
Parm:Node:set the starting Node to allocate memory on, default-1 (array of int)
Parm:LLIPort:Low Latency Interrupt TCP Port (0-65535), default 0=off (array of int)
Parm:LLIPush:Low Latency Interrupt on TCP Push flag (0,1), default 0=off (array of int)
Parm:LLISize:Low Latency Interrupt on Packet Size (0-1500), default 0=off (array of int)
Parm:RSS:Number of Receive-side Scaling descriptor Queues (0-8), default 1, 0=number of CPUs (array of int)
Parm:VMDQ:Number of Virtual machine Device queues:0-1 = disable, 2-8 Enable, default 0 (array of int)
Parm:max_vfs:Number of Virtual functions:0 = disable, 1-7 Enable, default 0 (array of int)
Parm:MDD:Malicious Driver Detection (0/1), default 1 = enabled. Only available when MAX_VFS is greater than 0 (array of int)
Parm:QueuePairs:Enable tx/rx Queue pairs for interrupt handling (0,1), default 1=on (array of int)
Parm:eee:enable/disable on Parts The feature (array of int)
Parm:DMAC:Disable or set latency for DMA coalescing ((0=off, 1000-10000 (msec), +, (USEC)) (Array of int)
Parm:LRO:Large Receive Offload (0,1), default 0=off (array of int)
Parm:debug:Debug level (0=none, ..., 16=all) (int)
Finally found in the message that was displayed [8086:1521] Message stating that the newly generated driver file can support the current NIC model. So how do you get the target kernel (2.6.33-110.el6.x86_64) to load new drivers?

09. Update Target Kernel driver
First, copy the new driver Igb.ko to the specified directory under the target kernel/lib/modules/2.6.33-110.el6.x86_64
#cp igb.ko/lib/modules/2.6.33-110.el6.x86_64/kernel/drivers/net/igb/
Second, use Depmod to update the dependency of the target kernel (2.6.33-110.el6.x86_64) module
#depmod-A 2.6.33-110.el6.x86_64

10, the above work is completed, you can restart the system!

Linux kernel upgrade-update NIC driver

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.