本文最后更新于 1269 天前,其中的信息可能已经有所发展或是发生改变。
解决CentOS lspci(command not found)方法
yum install pciutils
centos 安装C编译环境,以及基本的环境
yum -y groupinstall "Development Tools" && yum -y install gcc gcc-c++ openssl openssl-devel pcre pcre-devel zlib zlib-devel
Linux ixgbe网卡(光模块)兼容性问题
[root@localhost src]# lspci | grep Eth
17:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
17:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
案例2
06:00.0 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
06:00.1 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
下载驱动
wget https://downloadmirror.intel.com/14687/eng/ixgbe-5.12.5.tar.gz
安装驱动遇到的问题
- Kernel header files not in any of the expected locations.错误解决
====================================================
Makefile:71: *** Kernel header files not in any of the expected locations.
Makefile:72: *** Install the appropriate kernel development package, e.g.
Makefile:73: *** kernel-devel, for building kernel modules and try again. Stop.
====================================================
依赖包安装完成的情况下
是因为在Makefile文件中,它连接的目录为/usr/src/linux
但是系统里面并没有这个目录,这个时候可以使用以下命令:
cd /usr/src/
ln -s ./kernels/3.10.0-1160.49.1.el7.x86_64/ linux
创建一个软链接。
再执行:
make
最后成功编译!
make && make install 环境
tar -zxvf ixgbe-5.12.5.tar.gz
cd ./ixgbe-5.12.5/src
make
输出:
LD [M] /root/ixgbe-5.12.5/src/ixgbe.ko
make install
其他命令
5. 其他相关命令
查看现有的模块安装情况
查看模块情况:modinfo ./ixgbe.ko
查看模块安装情况:lsmod | grep ixgbe
删除模块:rmmod ixgbe.ko
安装模块:insmod ./ixgbe.ko
修改模块:modprobe ixgbe
添加启动参数:insmod ./ixgbe.ko FdirPballoc=3 RSS=16
查看安装信息:dmesg
安装目录:
make install
ixgbe.ko将会安装在下列目录
/lib/modules/<kernel-version>/kernel/drivers/net/ixgbe
启动时候加载方式:modprobe ixgbe
其他方法-二
但是使用ip addr或者ifconfig -a命令,却找不到网卡,使用demsg可以看到以下出错信息:
ixgbe 0000:06:00.0: failed to load because an unsupported SFP+ module type was detected
解决问题的方法是:
卸载ixgbe驱动(万兆网卡的驱动)
rmmod ixgbe
再加载ixgbe参数
modprobe ixgbe allow_unsupported_sfp=1
对allow_unsupported_sfp的解释
allow_unsupported_sfp:Allow unsupported and untested SFP+ modules on 82599-based adapters (uint)
重新加载后,大部分情况下ifconfig或ip addr就能够看到网卡信息了。