Linux kernel upgrade-update NIC driver

Source: Internet
Author: User

    • Shing
    • Email: [Email protected]
    • Blog: http://blOg.csdn.net/qifengzou
    • Date: 2015.03.20 01:00
    • Reprint please indicate the CSDN blog from "Chifeng"
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:D 0: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 :D 0: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:00.1 Ethernet Controller [0200]: Intel Corporation 82599EB 10-gigabit sfi/sfp+ netwo RK Connection [8086:10FB] (rev.)
03:00.0 Ethernet Controller [0200]: Intel Corporation 82599EB 10-gigabit SFP + networ K Connection [8086:154d] (rev.)
03:00.1 Ethernet Controller [0200]: Intel Corporation 82599EB 10-gigabit SFP + Network Connection [8086:154d] (rev.)
08:00.0 Ethernet Controller [0200]: Intel Corporation I350 Gigabit Network Connection [ 8086:1521 ] (rev.)
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 allows you to see *.ko support for which device model, the driver for the target core (2.6.33-110.el6.x86_64) can be/lib/modules/2.6.33-110.el6.x86_ The catalog of "want to find", 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

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

06, to the official website to download the network card driver
Now that you have made it clear that the target kernel's NIC driver does not support the current network card device, this means that once the new kernel is enabled, the system will not function properly. 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 the network card 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_64
The above command will generate the NIC driver Igb.ko. 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 whether the network card driver supports the current network card
step ⑦ will generate the NIC driver Igb.ko, which can be verified by the 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:v00008086d000010a9sv*sd*bc*sc*i*
alias:pci:v00008086d000010a7sv*sd*bc*sc*i*
alias:pci:v00008086d000010e8sv*sd*bc*sc*i*
alias:pci:v00008086d00001526sv*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:v00008086d00000440sv*sd*bc*sc*i*
alias:pci:v00008086d0000043csv*sd*bc*sc*i*
alias:pci:v00008086d0000043asv*sd*bc*sc*i*
alias:pci:v00008086d00000438sv*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:v00008086d00001527sv*sd*bc*sc*i*
alias:pci:v00008086d0000150fsv*sd*bc*sc*i*
alias:pci:v00008086d0000150esv*sd*bc*sc*i*
alias:pci:v00008086d00001524sv*sd*bc*sc*i*
alias:pci:v00008086d00001523sv*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*
alias:pci:v00008086d0000157csv*sd*bc*sc*i*
alias:pci:v00008086d0000157bsv*sd*bc*sc*i*
alias:pci:v00008086d00001538sv*sd*bc*sc*i*
alias:pci:v00008086d00001537sv*sd*bc*sc*i*
alias:pci:v00008086d00001536sv*sd*bc*sc*i*
alias:pci:v00008086d00001533sv*sd*bc*sc*i*
alias:pci:v00008086d00001f45sv*sd*bc*sc*i*
alias:pci:v00008086d00001f41sv*sd*bc*sc*i*
alias:pci:v00008086d00001f40sv*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 o f 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, a [ 8086:1521] message is found in the displayed information 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.