在Centos 6上安装Mellanox ConnectX-2 10gbe PCIe卡

我刚刚在运行CentOS 6.7的服务器上安装了一个Mellanox ConnectX-2 10gbe PCIe x8卡。 在启动时,dmesg显示mlx4_core驱动程序被自动加载,但是我看不到对应于该卡的eth1设备。 ifconfig -a只显示eth0 ,这是我的板载/主板千兆networking接口。

所以,我删除了/etc/udev/rules.d/70-persistent-net.rules并重新启动。 它重新创build了70-persistent-net.rules但只有我的板载/主板千兆网卡,Mellanox 10gbe卡没有条目。

输出/etc/udev/rules.d/70-persistent-net.rules

 # PCI device 0x10ec:0x8168 (r8169) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:67:aa:bb:cc", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" 

好消息是, lspci显示了Mellanox卡。 输出lspci | grep -i ether lspci | grep -i ether

 02:00.0 Ethernet controller: Mellanox Technologies MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0) 05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03) 

dmesg相关输出:

 mlx4_core: Mellanox ConnectX core driver v2.2-1 (Feb, 2014) mlx4_core: Initializing 0000:02:00.0 mlx4_core 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 mlx4_core 0000:02:00.0: setting latency timer to 64 alloc irq_desc for 26 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 26 for MSI/MSI-X alloc irq_desc for 27 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 27 for MSI/MSI-X alloc irq_desc for 28 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 28 for MSI/MSI-X alloc irq_desc for 29 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 29 for MSI/MSI-X alloc irq_desc for 30 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 30 for MSI/MSI-X alloc irq_desc for 31 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 31 for MSI/MSI-X alloc irq_desc for 32 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 32 for MSI/MSI-X alloc irq_desc for 33 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 33 for MSI/MSI-X alloc irq_desc for 34 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 34 for MSI/MSI-X alloc irq_desc for 35 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 35 for MSI/MSI-X alloc irq_desc for 36 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 36 for MSI/MSI-X alloc irq_desc for 37 on node -1 alloc kstat_irqs on node -1 mlx4_core 0000:02:00.0: irq 37 for MSI/MSI-X 

任何想法为什么我的Mellanox ConnectX-2没有显示为eth1设备?

这张卡应该原生地工作,没有任何改变。 只要删除您的70-persistent-net.rules /重新启动和/或检查dmesg输出。

您可能在/ etc / sysconfig / network-scripts / ifcfg-ethX文件中遇到UUID或MAC问题。


如果两者都不是这样,请从Mellanox或HP下载驱动程序。

 # modinfo mlx4_en filename: /lib/modules/2.6.32-573.22.1.el6.x86_64/weak-updates/mlnx-en/drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko version: 2.3-2.0.1 (Dec 7 2014) license: Dual BSD/GPL description: Mellanox ConnectX HCA Ethernet driver author: Liran Liss, Yevgeny Petrilin srcversion: 86DD1A5FE5CF17268AFBB0D depends: mlx4_core,compat,ptp vermagic: 2.6.32-504.el6.x86_64 SMP mod_unload modversions parm: inline_thold:threshold for using inline data (uint) parm: udp_rss:Enable RSS for incoming UDP traffic (uint) parm: num_lro:Dummy module parameter to prevent loading issues (uint) parm: pfctx:Priority based Flow Control policy on TX[7:0]. Per priority bit mask (uint) parm: pfcrx:Priority based Flow Control policy on RX[7:0]. Per priority bit mask (uint) 

我想出了解决办法。 我所要做的只是input两个命令来激活CentOS 6中的网卡:

 sudo modprobe mlx4_core sudo modprobe mlx4_en 

现在我有ifconfig -a eth1 ,可以configuration它(IP地址,networking掩码等)

为了使其在重新启动时永久保存,我添加了一个新文件/etc/sysconfig/modules/mellanox.modules ,并将其权限(chmod)设置为755,作为所有者/组:

 #!/bin/sh /sbin/modprobe mlx4_core /sbin/modprobe mlx4_en 

这会在启动/ etc / sysconfig / network-scripts中指定的eth0 / eth1configuration之前,在启动时自动加载内置于CentOS的Mellanox内核模块

现在它就像任何其他networking接口一样工作。