本站首页    管理页面    写新日志    退出


天堂之光 人间希望

你我共同品味

JAVA的浓香.

Linux的清芬.

«August 2026»
1
2345678
9101112131415
16171819202122
23242526272829
3031


我的分类(专题)

日志更新

最新评论

留言板

链接

联系我

msn:zhanglincon@hotmail.com


Blog信息
blog名称:
日志总数:99
评论数量:281
留言数量:4
访问次数:834506
建立时间:2005年11月17日




Linux kernel2.6.18实现Atl1千兆网卡配置实例全程详解
原创空间,  软件技术

zhanglincon 发表于 2008/3/31 14:19:13

电脑配置:          华硕P5E-VM/HDMI主板          4GB内存              集成显卡          集成Attansic Technology Gorp L1 Gigabit Ethernet 网卡          320GB串口硬盘          At1 千兆网卡for linux驱动官方提供下载点:http://atl1.sourceforge.net/          提供:AtL1Linux_v0.1.40.6.tar.gz和AtL1Linux_v1.0.41.0.tar.gz            支持内核:The driver has been accepted into the 2.6.20-mm series kernels.                                   We hope to make it into the 2.6.21 mainline kernel. No guarantees, though     In general, if you want to run a vendor version of the driver and you're using a 2.6.17, 2.6.18, or 2.6.19 kernel, use driver version 1.0.41.0. Note however that NEITHER of the vendor versions will work with kernel 2.6.20 or later.        经多方试验,  该网站上提供的这两款驱动,对于AS4 UP4 2.6.9-42.ELsmp内核不适用,因为想尽一切办法编译好重启后,能找到网卡,但仍然是一个unkown ethernet ,而且怎么都通不了网,故对AS4不适用.         AS5 2.6.18-* 内核经过多方试验后,只有AtL1Linux_v1.0.41.0.tar.gz适用,下面把我的详细步骤写下来供参考:            1、到http://atl1.sourceforge.net/把1.0.41.0给down下来,用U盘复制到/tmp目录下:     2、编译:      [root@localhost tmp]#tar zxvf AtL1Linux_v1.0.41.0.tar.gz       [root@localhost tmp]#cd Atl1Linux_xv1.0.41.0/src      [root@localhost src]#make install        ...        ....       install -D -m 644 atl1.7.gz /usr/share/man/man7/atl1.7.gz       man -c -P'cat >/dev/mull' atl1 || true       Formatting page,please wait...      [root@localhost src]#insmod atl1       insmod: can't read 'atl1':No such file or directory     (原因:insmod加载模块必须指定绝对路径,而modprobe加载模块则不需要指定绝对路径,解决方法:)      [root@localhost src]#insmod /tmp/Atl1Linux_xv1.0.41.0/src/atl1.ko          或者       [root@localhost src]#modprobe atl1      OK,网卡驱动已经编译好了,我们现在来试一下:       [root@localhost src]#modprobe eth0       [root@localhost src]#ifconfig eth0 192.168.1.251       [root@localhost src]#ping 192.168.1.100       PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.       64 bytes from 192.168.1.100 icmp_seq=1 ttl=64 time=2.5 ms       64 bytes from 192.168.1.100 icmp_seq=2 ttl=64 time=2.48 ms       64 bytes from 192.168.1.100 icmp_seq=3 ttl=64 time=1.03 ms       64 bytes from 192.168.1.100 icmp_seq=4 ttl=64 time=1.53 ms       64 bytes from 192.168.1.100 icmp_seq=5 ttl=64 time=2.17 ms      如果出现类似以上提示出现,恭喜你,成功了:       到这里已经编译成功,按常理来说只要重启后就可以找到网卡并配置IP等详细信息,这种网卡则不行,必须做第三步:     3、手动编辑ifcfg-eth0配置文件      [root@localhost src]#vi /etc/sysconfig/network-scripts/ifcfg-eth0      内容修改为:      #Attansic Technology Corp L1 Gigabit Ethernet ...      DEVICE=eth0      IPADDR=192.168.1.251      NETMASK=255.255.255.0      BOOTPROTO=nono      解释:      第一行:网卡型号      第二行:在linux中的第eth0网卡      第三行:eth0网卡的IP地址      第四行: etho网卡的子网掩码      第五行:开启是否加载,yes为加载,no为不加载      第六行:是否启用BOOTP服务,也就是DHCP自动获取IP服务      做完这3步,恭喜您,Atl1千兆网卡已经安装成功,并为其指定了IP地址.重启即可生效,但请别高兴得太早---- 重启后网是通了,上传呢是很正常的,但是下载呢,是奇慢无比的,不信,你可以试下..把这台linux游戏服务器共享出去,在别的机子上面复制文件到这台机子上,速度很快;从别的机子复制这个共享里边的任何一个文件会奇慢无比!   原因是因为atl1网卡for linux驱动的tso模块有问题所致,屏蔽就好了,方法有两个,我只记得其中一个了:  4、   重启电脑,登陆进去后用:     ethtool -K eth0 tso off            重启即可完美解决..      5、最后别忘了,在/etc/rc.d/rc.local中加一条命令:    ethtool -K eth0 tso off        否则,每次重启后都需要敲这条命令才能解决TSO模块问题          注意:      网上关于这类网卡,有过帖,不过,发觉都不够完整,要么在第二步的后,多了一个手动挂载步骤,要么少了第三步,均不成功...如,在第二步后多的步骤:      在/etc/modprobe.conf文件中,手加添加以下代码让其自动加载相应网卡:        alias eth0 atl1        alias eth1 atl1        options atl1 Speed=10,100 Duplex=2,1    经过测试和仔细查看了驱动中的说明文档发现,这样修改只适用于该主板有两块这样的网卡,而不适于只有单块网卡的主板,另外insmod .../atl1.ko 成功并重启后,该文件会自动多出 alias eth0 atl1来,而不需要手动添加..    如果在只有一块这种网卡,而又手动添加了上面三行代码的话,不好意思,你等着哭好了,嘿嘿...   KNOWN BUGS/PROBLEMS 1. Some Via chipsets don't play well with message signalled interrupts (MSI), and will generate a flood of APIC errors in dmesg or system logs when the atl1 driver starts sending and receiving packets. If this happens, modify your kernel's boot line and add this kernel parameter: pci=nomsi. A fix was added to 2.6.21.4 and later kernels, so you shouldn't see the error if you're running 2.6.21.4 or later. 2. There is a bug in the atl1 driver that results in a kernel hang or crash (oops) under heavy network load IF AND ONLY IF you have 4GB or more RAM in your system. This happens because of an L1 hardware design issue that is exposed by the atl1 driver. If you encounter this problem, modify your kernel's boot line and add this kernel parameter: mem=3900M. A fix was added to the 2.6.23 kernel. 3. Another atl1 bug affects older real-time (RT) kernels. The symptom is very sluggish network performance, accompanied by a log entry that looks like this: date:time hostname kernel: network driver disabled raw interrupts: atl 1_xmit_frame+0x0/0x7c0 [atl1] This problem was fixed in 2.6.23, and is fixed in all later kernels. 4. There is a bug in the driver that causes memory corruption during the shutdown of the interface if and only if you have 4GB or more RAM in your system (and your system utilizes all that memory). The bug has been solved and is in the process of being incorporated into kernel 2.6.26. It has been backported to 2.6.25. 5. If you see this message (or lots of them) in your system log: atl1 0000:02:00.0: hw csum wrong, pkt_flag:1600, err_flag:80 it generally means you're encountering a bug in the L1 hardware that isn't handled well by the atl1 driver. Basically, the L1 hardware treats a fragmented IP packet as an error, when, in fact, it may not be erroneous at all. Fragmented packets can occur, for example, if your MTU size is set too large. In my own case, my DSL modem/router has its MTU size set to 1500 bytes, but it needs 8 of those bytes for its own use. If my Linux box also has its MTU size set to 1500, then inbound and outbound packets will be fragmented at the DSL router so it can add (or remove) its 8 bits. Here's where the hardware bug comes into play. When the L1 hardware receives a fragmented packet, it sets an error flag in one of its registers, and the driver, upon seeing the error bit, spews the "hw csum wrong" message. This has been fixed in the 2.6.27 kernel and beyond. The fragmentation will still occur, but the atl1 driver won't spew the error message that contributes to network slowdown. You can avoid this condition and significantly improve network performance by adjusting the MTU size downward on your atl1 box. I use an MTU size of 1492 bytes on all my systems that sit behind the DSL modem/router. This MTU size leaves room for the DSL modem/router to add its 8 bits and avoid fragmentation altogether. 6. If you try and build vendor version 1.2.40.3 under Centos 5{.12}, you'll encounter this error: /home/jcliburn/atl1/vendor_drivers/l1-linux-v1.2.40.2/src/kcompat.h:1116: error: redefinition of typedef ‘irq_handler_t’include/linux/interrupt.h:67: error: previous declaration of ‘irq_handler_t’ was heremake[2]: *** [/home/jcliburn/atl1/vendor_drivers/l1-linux-v1.2.40.2/src/at_main.o] Error 1make[1]: *** [_module_/home/jcliburn/atl1/vendor_drivers/l1-linux-v1.2.40.2/src] Error 2make[1]: Leaving directory `/usr/src/kernels/2.6.18-92.1.18.el5-x86_64'make: *** [default] Error 2 To remedy this, simply comment out line 1116 in the file named kcompat.h. 删除1116行


阅读全文(5027) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.031 second(s), page refreshed 144845678 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号