在Debian系的Linux中編譯並安裝ixgbe驅動的教程_Linux

來源:互聯網
上載者:User

Intel的10G網卡(比如,82598、 82599、 x540)由ixgbe驅動支援。現代的Linux發行版已經帶有了ixgbe驅動,通過可載入模組的方式使用。然而,有些情況你希望在你機器上的自己編譯安裝ixgbe驅動,比如,你想要體驗ixbge驅動的最新特性時。同樣,核心預設內建的ixgbe驅動中的一個問題是不允許你自訂驅動的參數。如果你想要一個完全定製的ixgbe驅動(比如 RSS、多隊列、中斷閾值等等),你需要手動從源碼編譯ixgbe驅動。

這裡是如何在Ubuntu、Debian或者它們的衍生版中下載安裝ixgbe驅動的教程。
第一步: 安裝前提

安裝之前,需要安裝匹配的核心標頭檔和開發套件。

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

第二步: 編譯Ixgbe驅動

從最新的ixgbe驅動中下載源碼。

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

如下編譯ixgbe驅動。

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

第三步: 檢查Ixgbe驅動

編譯之後,你會看到在ixgbe-3.23.2/src目錄下建立了ixgbe.ko。這就是會載入到核心之中的ixgbe驅動。

用modinfo命令檢查核心模組的資訊。注意你需要指定模組檔案的絕對路徑(比如 ./ixgbe.ko 或者 /home/xmodulo/ixgbe/ixgbe-3.23.2/src/ixgbe.ko)。輸出中會顯示ixgbe核心的版本。

  $ modinfo ./ixgbe.ko
filename: /home/xmodulo/ixgbe/ixgbe-3.23.2/src/ixgbe.ko  version: 3.23.2  license: GPL  description: Intel(R) 10 Gigabit PCI Express Network Driver  author: Intel Corporation,  srcversion: 2ADA5E537923E983FA9DAE2  alias: pci:v00008086d00001560sv*sd*bc*sc*i*  alias: pci:v00008086d00001558sv*sd*bc*sc*i*  alias: pci:v00008086d0000154Asv*sd*bc*sc*i*  alias: pci:v00008086d00001557sv*sd*bc*sc*i*  alias: pci:v00008086d0000154Fsv*sd*bc*sc*i*  alias: pci:v00008086d0000154Dsv*sd*bc*sc*i*  alias: pci:v00008086d00001528sv*sd*bc*sc*i*  alias: pci:v00008086d000010F8sv*sd*bc*sc*i*  alias: pci:v00008086d0000151Csv*sd*bc*sc*i*  alias: pci:v00008086d00001529sv*sd*bc*sc*i*  alias: pci:v00008086d0000152Asv*sd*bc*sc*i*  alias: pci:v00008086d000010F9sv*sd*bc*sc*i*  alias: pci:v00008086d00001514sv*sd*bc*sc*i*  alias: pci:v00008086d00001507sv*sd*bc*sc*i*  alias: pci:v00008086d000010FBsv*sd*bc*sc*i*  alias: pci:v00008086d00001517sv*sd*bc*sc*i*  alias: pci:v00008086d000010FCsv*sd*bc*sc*i*  alias: pci:v00008086d000010F7sv*sd*bc*sc*i*  alias: pci:v00008086d00001508sv*sd*bc*sc*i*  alias: pci:v00008086d000010DBsv*sd*bc*sc*i*  alias: pci:v00008086d000010F4sv*sd*bc*sc*i*  alias: pci:v00008086d000010E1sv*sd*bc*sc*i*  alias: pci:v00008086d000010F1sv*sd*bc*sc*i*  alias: pci:v00008086d000010ECsv*sd*bc*sc*i*  alias: pci:v00008086d000010DDsv*sd*bc*sc*i*  alias: pci:v00008086d0000150Bsv*sd*bc*sc*i*  alias: pci:v00008086d000010C8sv*sd*bc*sc*i*  alias: pci:v00008086d000010C7sv*sd*bc*sc*i*  alias: pci:v00008086d000010C6sv*sd*bc*sc*i*  alias: pci:v00008086d000010B6sv*sd*bc*sc*i*  depends: ptp,dca  vermagic: 3.11.0-19-generic SMP mod_unload modversions  parm: InterruptType:Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default IntMode (deprecated) (array of int)  parm: IntMode:Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default 2 (array of int)  parm: MQ:Disable or enable Multiple Queues, default 1 (array of int)  parm: DCA:Disable or enable Direct Cache Access, 0=disabled, 1=descriptor only, 2=descriptor and data (array of int)  parm: RSS:Number of Receive-Side Scaling Descriptor Queues, default 0=number of cpus (array of int)  parm: VMDQ:Number of Virtual Machine Device Queues: 0/1 = disable, 2-16 enable (default=8) (array of int)  parm: max_vfs:Number of Virtual Functions: 0 = disable (default), 1-63 = enable this many VFs (array of int)  parm: VEPA:VEPA Bridge Mode: 0 = VEB (default), 1 = VEPA (array of int)  parm: InterruptThrottleRate:Maximum interrupts per second, per vector, (0,1,956-488281), default 1 (array of int)  parm: LLIPort:Low Latency Interrupt TCP Port (0-65535) (array of int)  parm: LLIPush:Low Latency Interrupt on TCP Push flag (0,1) (array of int)  parm: LLISize:Low Latency Interrupt on Packet Size (0-1500) (array of int)  parm: LLIEType:Low Latency Interrupt Ethernet Protocol Type (array of int)  parm: LLIVLANP:Low Latency Interrupt on VLAN priority threshold (array of int)  parm: FdirPballoc:Flow Director packet buffer allocation level:  1 = 8k hash filters or 2k perfect filters  2 = 16k hash filters or 4k perfect filters  3 = 32k hash filters or 8k perfect filters (array of int)  parm: AtrSampleRate:Software ATR Tx packet sample rate (array of int)  parm: FCoE:Disable or enable FCoE Offload, default 1 (array of int)  parm: LRO:Large Receive Offload (0,1), default 1 = on (array of int)  parm: allow_unsupported_sfp:Allow unsupported and untested SFP+ modules on 82599 based adapters, default 0 = Disable (array of int)

第四步: 測試Ixgbe驅動

在測試新的模組之前,如果你核心中已存在舊版本ixgbe模組的話你需要先移除它。

  $ sudo rmmod ixgbe

接著使用insmod命令插入新編譯的ixgbe模組。確保指定一個模組的絕對路徑。

  $ sudo insmod ./ixgbe.ko

如果上面的命令成功運行,就不會顯示任何的資訊。

如果你需要,你可以嘗試加入額外的參數。比如,設定RSS的隊列數量為16:

  $ sudo insmod ./ixgbe.ko RSS=16

檢查/var/log/kern.log來查看ixgbe驅動是否成功啟用。查看日誌中的“Intel(R) 10 Gigabit PCI Express Network Driver”。ixgbe的版本資訊應該和之前的modinfo的顯示應該相同。

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

第五步: 安裝Ixgbe驅動

一旦你驗證新的ixgbe驅動可以成功載入,最後一步是在你的系統中安裝驅動。

  $ sudo make install

ixgbe.ko 會安裝在/lib/modules//kernel/drivers/net/ethernet/intel/ixgbe 下。

從這一步起,你可以用下面的modprobe命令載入ixgbe驅動了。注意你不必再指定絕對路徑。

  $ sudo modprobe ixgbe

如果你希望在啟動時載入ixgbe驅動,你可以在/etc/modules的最後加入“ixgbe”。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.