Linux Kernel upgrade-update NIC Driver

Source: Internet
Author: User
Tags network function

Linux Kernel upgrade-update NIC Driver
The current kernel (2.6.32-220. el6.x86 _ 64) upgrade to the target kernel (2.6.33-110. el6.x86 _ 64), but the compiled target kernel (2.6.33-110. the corresponding driver of el6.x86 _ 64) does not necessarily support the corresponding device of the current system. This article describes in detail how the target kernel driver cannot support the current Nic device.

01. Compile the target Kernel
Refer to the kernel compilation documentation (omitted)

02. Display All NICs
Because a system supports multiple NICs, you can use the following command to display all NICs of the current system and their basic information:
# Ifconfig-

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 FIG: 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 FIG: 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 FIG: 1000
RX bytes: 0 (0.0 B) TX bytes: 0 (0.0 B)
Memory: dbe80000-dbf00000

03. view the driver required by the NIC

Run the ethtool command to view the NIC driver information of the specified NIC:

# Ethtool-I em3

Driver: igb-The em3 of the NIC depends on the igb driver.
Version: 3.0.6-k
Firmware-version: 1.6-7
Bus-info:. 0

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

 

 

04. view the NIC Model

Through ③ we have known the driver on which the NIC depends, but we do not know the specific NIC Driver Model. At this time, you can run the following command to query:

# Lspci-nn | grep "Eth"

. 0 Ethernet controller [0200]: Intel Corporation 82599EB 10-Gigabit SFI/SFP + Network Connection [8086: 10fb] (rev 01)
. 1 Ethernet controller [0200]: Intel Corporation 82599EB 10-Gigabit SFI/SFP + Network Connection [8086: 10fb] (rev 01)
. 0 Ethernet controller [0200]: Intel Corporation 82599EB 10-Gigabit SFP + Network Connection [8086: 154d] (rev 01)
. 1 Ethernet controller [0200]: Intel Corporation 82599EB 10-Gigabit SFP + Network Connection [8086: 154d] (rev 01)
. 0 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086: 1521] (Rev 01)
. 1 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086: 1521] (Rev 01)

Note: Gigabit is 10 Gigabit 10-Gigabit

 

Operation 4 shows the current kernel (2.6.32-220. el6.x86 _ 64) The gigabit network drive igb supports the NIC model [8086: 1521]. Therefore, the target kernel (2.6.33-110) must be required. el6.x86 _ 64.

05. Check whether the NIC Driver of the target kernel supports the NIC of the current model.

You can use the modinfo command to view *. what kind of device model does ko support? The target kernel (2.6.33-110. el6.x86 _ 64) related drivers can be found in/lib/modules/2.6.33-110. the el6.x86 _ 64 directory is as follows:

# Modinfo/lib/modules/2.6.33-110. el6.x86 _ 64/kernel/drivers/net/igb. ko

Filename: igb. ko
Version: 2.1.0-k2
License: GPL
Description: Intel (R) Gigabit Ethernet Network Driver
Author: Intel Corporation <e1000-devel@lists.sourceforge.net>
Srcversion: 412D1CB4C85682CBF07976F
Alias: pci: v20178086d201710d6sv * sd * bc * SC * I *
Alias: pci: v20178086d201710a9sv * sd * bc * SC * I *
Alias: pci: v20178086d201710a7sv * sd * bc * SC * I *
Alias: pci: v20178086d201710e8sv * sd * bc * SC * I *
Alias: pci: vda-8086d109150dsv * sd * bc * SC * I *
Alias: pci: v20178086d201710e7sv * sd * bc * SC * I *
Alias: pci: v20178086d201710e6sv * sd * bc * SC * I *
Alias: pci: v20178086d20171518sv * sd * bc * SC * I *
Alias: pci: vda-8086d109150asv * sd * bc * SC * I *
Alias: pci: v20178086d201710c9sv * sd * bc * SC * I *
Alias: pci: v20178086d20171516sv * sd * bc * SC * I *
Alias: pci: v20178086d20171511sv * sd * bc * SC * I *
Alias: pci: v20178086d20171510sv * sd * bc * SC * I *
Alias: pci: vda-8086d109150fsv * sd * bc * SC * I *
Alias: pci: vda-8086d109150esv * sd * bc * SC * I *
Depends:
Vermagic: 2.6.33-110. el6.x86 _ 64 SMP mod_unload modversions

Cannot find [ 8086: 1521Therefore, the target kernel (2.6.33-110. el6.x86 _ 64) NIC driver does not support the current Nic!

06. Download the NIC Driver from the official website
Since it has been clarified that the NIC Driver of the target kernel does not support the current Nic device, that is, once the new kernel is enabled, the system will not be able to use the network function normally. For intel Nic devices, go to: http://www.intel.cn/content/www/cn/zh/homepage.html to download the driver source code to your local device.

07. Compile the NIC Driver
Decompress the driver source code and compile the driver source code in the following command format:
# Make BUILD_KERNEL = 2.6.33-110. el6.x86 _ 64
The above command will generate the NIC Driver igb. ko. BUILD_KERNEL indicates the kernel driver to be compiled. By default, the driver is compiled for the currently running kernel. Here we set it to the target kernel ( 2.6.33-110. el6.x86 _ 64). How can I check whether the newly generated NIC Driver igb. ko supports the current Nic device?

08. Check whether the NIC Driver supports the current Nic
Step 7 generates the NIC Driver igb. ko. You can run the modinfo command to verify whether the driver supports the NIC device [8086: 1521], as shown below:
# Modinfo igb. ko
Filename: igb. ko
Version: 5.2.9.4
License: GPL
Description: Intel (R) Gigabit Ethernet Network Driver
Author: Intel Corporation <e1000-devel@lists.sourceforge.net>
Srcversion: E377200391EBF74638FEDA2
Alias: pci: v20178086d201710d6sv * sd * bc * SC * I *
Alias: pci: v20178086d201710a9sv * sd * bc * SC * I *
Alias: pci: v20178086d201710a7sv * sd * bc * SC * I *
Alias: pci: v20178086d201710e8sv * sd * bc * SC * I *
Alias: pci: v20178086d20171526sv * sd * bc * SC * I *
Alias: pci: vda-8086d109150dsv * sd * bc * SC * I *
Alias: pci: v20178086d201710e7sv * sd * bc * SC * I *
Alias: pci: v20178086d201710e6sv * sd * bc * SC * I *
Alias: pci: v20178086d20171518sv * sd * bc * SC * I *
Alias: pci: vda-8086d109150asv * sd * bc * SC * I *
Alias: pci: v20178086d201710c9sv * sd * bc * SC * I *
Alias: pci: vda-8086d0000020.sv * sd * bc * SC * I *
Alias: pci: vda-8086d0000043csv * sd * bc * SC * I *
Alias: pci: vda-8086d0000043asv * sd * bc * SC * I *
Alias: pci: vda-8086d00000438sv * sd * bc * SC * I *
Alias: pci: v20178086d20171516sv * sd * bc * SC * I *
Alias: pci: v20178086d20171511sv * sd * bc * SC * I *
Alias: pci: v20178086d20171510sv * sd * bc * SC * I *
Alias: pci: v20178086d20171527sv * sd * bc * SC * I *
Alias: pci: vda-8086d109150fsv * sd * bc * SC * I *
Alias: pci: vda-8086d109150esv * sd * bc * SC * I *
Alias: pci: v20178086d20171524sv * sd * bc * SC * I *
Alias: pci: v20178086d20171523sv * sd * bc * SC * I *
Alias: pci: v20178086d20171522sv * sd * bc * SC * I *
Alias: pci: v0000 8086D0000 1521Sv * sd * bc * SC * I *
Alias: pci: v20178086d20171539sv * sd * bc * SC * I *
Alias: pci: v20178086d2017157csv * sd * bc * SC * I *
Alias: pci: v20178086d2017157bsv * sd * bc * SC * I *
Alias: pci: v20178086d20171538sv * sd * bc * SC * I *
Alias: pci: v20178086d20171537sv * sd * bc * SC * I *
Alias: pci: v20178086d20171536sv * sd * bc * SC * I *
Alias: pci: v20178086d20171533sv * sd * bc * SC * I *
Alias: pci: vda-8086dda-1f45sv * sd * bc * SC * I *
Alias: pci: v20178086d20171f41sv * sd * bc * SC * I *
Alias: pci: vda-8086dda-1f40sv * 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 that support the feature (array of int)
Parm: DMAC: Disable or set latency for DMA Coalescing (0 = off, 1000-10000 (msec), 250,500 (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, I found [ 8086: 1521] Information, indicating that the new driver file can support the current Nic model. So how can we make the target kernel (2.6.33-110. el6.x86 _ 64) load the new driver?

09. Update the target kernel driver
First, copy the new driver igb. ko to the specified directory in 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 dependencies of the target kernel (2.6.33-110. el6.x86 _ 64) module.
# Depmod-a 2.6.33-110. el6.x86 _ 64

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

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.