Linux 有问必答:如何在Ubuntu或者Debian中编译安装ixgbe驱动

简介:

Linux 有问必答:如何在Ubuntu或者Debian中编译安装ixgbe驱动

提问: 我想为我的Intel 10G网卡下载安装最新的ixgbe驱动。我该如何在Ubuntu(或者Debian)中安装ixgbe驱动?

Intel的10G网卡(比如,82598、 82599、 x540)由ixgbe驱动支持。现代的Linux发行版已经带有了ixgbe驱动,通过可加载模块的方式使用。然而,有些情况你希望在你机器上的自己编译安装ixgbe驱动,比如,你想要体验ixbge驱动的最新特性时。同样,内核默认自带的ixgbe驱动中的一个问题是不允许你自定义驱动的参数。如果你想要一个完全定制的ixgbe驱动(比如 RSS、多队列、中断阈值等等),你需要手动从源码编译ixgbe驱动。

这里是如何在Ubuntu、Debian或者它们的衍生版中下载安装ixgbe驱动的教程。

第一步: 安装前提

安装之前,需要安装匹配的内核头文件和开发工具包。

 
 
  1. $ sudo apt-get install linux-headers-$(uname -r)
  2. $ sudo apt-get install gcc make

第二步: 编译Ixgbe驱动

最新的ixgbe驱动中下载源码。

 
 
  1. $ wget http://sourceforge.net/projects/e1000/files/ixgbe%20stable/3.23.2/ixgbe-3.23.2.tar.gz

如下编译ixgbe驱动。

 
 
  1. $ tar xvfvz ixgbe-3.23.2.tar.gz
  2. $ cd ixgbe-3.23.2/src
  3. $ make

第三步: 检查Ixgbe驱动

编译之后,你会看到在ixgbe-3.23.2/src目录下创建了ixgbe.ko。这就是会加载到内核之中的ixgbe驱动。

用modinfo命令检查内核模块的信息。注意你需要指定模块文件的绝对路径(比如 ./ixgbe.ko 或者 /home/xmodulo/ixgbe/ixgbe-3.23.2/src/ixgbe.ko)。输出中会显示ixgbe内核的版本。

 
 
  1. $ modinfo ./ixgbe.ko

 
 
  1. filename: /home/xmodulo/ixgbe/ixgbe-3.23.2/src/ixgbe.ko
  2. version: 3.23.2
  3. license: GPL
  4. description: Intel(R) 10 Gigabit PCI Express Network Driver
  5. author: Intel Corporation,
  6. srcversion: 2ADA5E537923E983FA9DAE2
  7. alias: pci:v00008086d00001560sv*sd*bc*sc*i*
  8. alias: pci:v00008086d00001558sv*sd*bc*sc*i*
  9. alias: pci:v00008086d0000154Asv*sd*bc*sc*i*
  10. alias: pci:v00008086d00001557sv*sd*bc*sc*i*
  11. alias: pci:v00008086d0000154Fsv*sd*bc*sc*i*
  12. alias: pci:v00008086d0000154Dsv*sd*bc*sc*i*
  13. alias: pci:v00008086d00001528sv*sd*bc*sc*i*
  14. alias: pci:v00008086d000010F8sv*sd*bc*sc*i*
  15. alias: pci:v00008086d0000151Csv*sd*bc*sc*i*
  16. alias: pci:v00008086d00001529sv*sd*bc*sc*i*
  17. alias: pci:v00008086d0000152Asv*sd*bc*sc*i*
  18. alias: pci:v00008086d000010F9sv*sd*bc*sc*i*
  19. alias: pci:v00008086d00001514sv*sd*bc*sc*i*
  20. alias: pci:v00008086d00001507sv*sd*bc*sc*i*
  21. alias: pci:v00008086d000010FBsv*sd*bc*sc*i*
  22. alias: pci:v00008086d00001517sv*sd*bc*sc*i*
  23. alias: pci:v00008086d000010FCsv*sd*bc*sc*i*
  24. alias: pci:v00008086d000010F7sv*sd*bc*sc*i*
  25. alias: pci:v00008086d00001508sv*sd*bc*sc*i*
  26. alias: pci:v00008086d000010DBsv*sd*bc*sc*i*
  27. alias: pci:v00008086d000010F4sv*sd*bc*sc*i*
  28. alias: pci:v00008086d000010E1sv*sd*bc*sc*i*
  29. alias: pci:v00008086d000010F1sv*sd*bc*sc*i*
  30. alias: pci:v00008086d000010ECsv*sd*bc*sc*i*
  31. alias: pci:v00008086d000010DDsv*sd*bc*sc*i*
  32. alias: pci:v00008086d0000150Bsv*sd*bc*sc*i*
  33. alias: pci:v00008086d000010C8sv*sd*bc*sc*i*
  34. alias: pci:v00008086d000010C7sv*sd*bc*sc*i*
  35. alias: pci:v00008086d000010C6sv*sd*bc*sc*i*
  36. alias: pci:v00008086d000010B6sv*sd*bc*sc*i*
  37. depends: ptp,dca
  38. vermagic: 3.11.0-19-generic SMP mod_unload modversions
  39. parm: InterruptType:Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default IntMode (deprecated) (array of int)
  40. parm: IntMode:Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default 2 (array of int)
  41. parm: MQ:Disable or enable Multiple Queues, default 1 (array of int)
  42. parm: DCA:Disable or enable Direct Cache Access, 0=disabled, 1=descriptor only, 2=descriptor and data (array of int)
  43. parm: RSS:Number of Receive-Side Scaling Descriptor Queues, default 0=number of cpus (array of int)
  44. parm: VMDQ:Number of Virtual Machine Device Queues: 0/1 = disable, 2-16 enable (default=8) (array of int)
  45. parm: max_vfs:Number of Virtual Functions: 0 = disable (default), 1-63 = enable this many VFs (array of int)
  46. parm: VEPA:VEPA Bridge Mode: 0 = VEB (default), 1 = VEPA (array of int)
  47. parm: InterruptThrottleRate:Maximum interrupts per second, per vector, (0,1,956-488281), default 1 (array of int)
  48. parm: LLIPort:Low Latency Interrupt TCP Port (0-65535) (array of int)
  49. parm: LLIPush:Low Latency Interrupt on TCP Push flag (0,1) (array of int)
  50. parm: LLISize:Low Latency Interrupt on Packet Size (0-1500) (array of int)
  51. parm: LLIEType:Low Latency Interrupt Ethernet Protocol Type (array of int)
  52. parm: LLIVLANP:Low Latency Interrupt on VLAN priority threshold (array of int)
  53. parm: FdirPballoc:Flow Director packet buffer allocation level:
  54. 1 = 8k hash filters or 2k perfect filters
  55. 2 = 16k hash filters or 4k perfect filters
  56. 3 = 32k hash filters or 8k perfect filters (array of int)
  57. parm: AtrSampleRate:Software ATR Tx packet sample rate (array of int)
  58. parm: FCoE:Disable or enable FCoE Offload, default 1 (array of int)
  59. parm: LRO:Large Receive Offload (0,1), default 1 = on (array of int)
  60. parm: allow_unsupported_sfp:Allow unsupported and untested SFP+ modules on 82599 based adapters, default 0 = Disable (array of int)

第四步: 测试Ixgbe驱动

在测试新的模块之前,如果你内核中已存在旧版本ixgbe模块的话你需要先移除它。

 
 
  1. $ sudo rmmod ixgbe

接着使用insmod命令插入新编译的ixgbe模块。确保指定一个模块的绝对路径。

 
 
  1. $ sudo insmod ./ixgbe.ko

如果上面的命令成功运行,就不会显示任何的信息。

如果你需要,你可以尝试加入额外的参数。比如,设置RSS的队列数量为16:

 
 
  1. $ sudo insmod ./ixgbe.ko RSS=16

检查/var/log/kern.log来查看ixgbe驱动是否成功激活。查看日志中的“Intel(R) 10 Gigabit PCI Express Network Driver”。ixgbe的版本信息应该和之前的modinfo的显示应该相同。

 
 
  1. Sep 18 14:48:52 spongebob kernel: [684717.906254] Intel(R) 10 Gigabit PCI Express Network Driver - version 3.22.3

第五步: 安装Ixgbe驱动

一旦你验证新的ixgbe驱动可以成功加载,最后一步是在你的系统中安装驱动。

 
 
  1. $ sudo make install

ixgbe.ko 会安装在/lib/modules//kernel/drivers/net/ethernet/intel/ixgbe 下。

从这一步起,你可以用下面的modprobe命令加载ixgbe驱动了。注意你不必再指定绝对路径。

 
 
  1. $ sudo modprobe ixgbe

如果你希望在启动时加载ixgbe驱动,你可以在/etc/modules的最后加入“ixgbe”。

原文发布时间:2015-03-30

本文来自云栖合作伙伴“linux中国”

目录
相关文章
|
28天前
|
Linux API 调度
Linux系统驱动跟裸机驱动的区别
Linux系统驱动跟裸机驱动的区别
27 0
|
1月前
|
Ubuntu Java 测试技术
【Linux】一站式教会:Ubuntu(无UI界面)使用apache-jmeter进行压测
【Linux】一站式教会:Ubuntu(无UI界面)使用apache-jmeter进行压测
|
27天前
|
存储 缓存 Linux
【Shell 命令集合 磁盘维护 】Linux 设置和查看硬盘驱动器参数 hdparm命令使用教程
【Shell 命令集合 磁盘维护 】Linux 设置和查看硬盘驱动器参数 hdparm命令使用教程
35 0
|
3天前
|
Linux Go
Linux命令Top 100驱动人生! 面试必备
探索Linux命令不再迷茫!本文分10部分详解20个基础命令,带你由浅入深掌握文件、目录管理和文本处理。 [1]: <https://cloud.tencent.com/developer/article/2396114> [2]: <https://pan.quark.cn/s/865a0bbd5720> [3]: <https://yv4kfv1n3j.feishu.cn/docx/MRyxdaqz8ow5RjxyL1ucrvOYnnH>
46 0
|
13天前
|
缓存 Ubuntu
Debian/Ubuntu清理硬盘空间
请注意,在执行清理操作时,务必小心核实要删除的文件,以免意外删除重要数据。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
20 4
|
16天前
|
人工智能 Ubuntu 机器人
【ubuntu】 Linux(ubuntu)创建python的虚拟环境
【ubuntu】 Linux(ubuntu)创建python的虚拟环境
|
16天前
|
Ubuntu Unix Linux
【Linux/Ubuntu】Linux/Ubuntu运行python脚本
【Linux/Ubuntu】Linux/Ubuntu运行python脚本
|
16天前
|
Linux
Linux驱动运行灯 Heartbeat
Linux驱动运行灯 Heartbeat
8 0
|
17天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器
|
21天前
|
Ubuntu NoSQL 关系型数据库
Ubuntu系统下安装常用软件
Ubuntu系统下安装常用软件
42 0
Ubuntu系统下安装常用软件