To be a better coder
分类: LINUX
2017-12-13 14:41:54
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 |
使用ethtool命令可以查看指定网卡所依赖的网卡驱动信息:
#ethtool -i em3
driver: igb - 网卡em3依赖igb驱动 version: 3.0.6-k firmware-version: 1.6-7 bus-info: 0000:08:00.0 |
04、查看网卡型号
通过③我们已经知道了网卡所依赖的驱动,但是还不知具体的网卡设备型号,此时可通过如下命令查询:
# 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) |
由④的操作可知当前内核(2.6.32-220.el6.x86_64)千兆网络驱动igb支持网卡型号[8086:1521],因此必须要求目标内核(2.6.33-110.el6.x86_64)对该型号网卡[8086:1521]的支持。
05、查看目标内核的网卡驱动是否支持当前型号网卡
可以通过modinfo命令查看*.ko对哪种设备型号的支持,目标内核(2.6.33-110.el6.x86_64)的相关驱动可在/lib/modules/2.6.33-110.el6.x86_64的目录中找到,如下所示:
#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, 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 |
filename: igb.ko version: 5.2.9.4 license: GPL description: Intel(R) Gigabit Ethernet Network Driver author: Intel Corporation, 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 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) |