设为首页 收藏本站
查看: 1631|回复: 0

[经验分享] XEN3.4.2源码编译之显卡,网卡问题

[复制链接]

尚未签到

发表于 2015-10-11 15:08:07 | 显示全部楼层 |阅读模式
  以前源码编译安装没碰到过这些问题,但前些天在源码编译安装的时候,问题来了,不错,还是学到不少。首先,在虚拟机上源码问题安装,一切ok,在物理机上安装,两台机器,一台是intel的集成显卡,于是进不了X window, googled a lot 原来这是一个bug,在 xen maillist发现有个团队专门在解决这个问题,xen在显卡方面还是有很多问题的,大概在2010年5月份也放出了几个patch, 我试了一下,有些文件能打成功,有些不行,最后直接yum install kernel-xen, 用CentOS自带的kernel-xen内核,使用自己编译的xen3.4.2, 搞定;  另一台机器,好吧,这些机器像是故意折腾我似的。。。装好后无显卡问题,但是网卡有问题,激活不了,googled and googled again,  最后啊。。。最后直接下载新的驱动,安装之,搞定。。。。。累就一个字。。。。
  
  
  最常用的几个命令:lsmod, insmod ,modprobe ,dmesg ,lspci
  -----------------------------------------------------------------------------------------------
  网卡:
  07:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5722 Gigabit Ethernet PCI Express
  于是去官方网站上下载了最新的tg3驱动: linux-3.110g.zip
  不知为何Building Driver From TAR File没成功,于是Install the source RPM package:   
  照着它自带的readme文件源码编译成网卡内核模块,再insmod加载进内核,重启,搞定。
  Installation Notes   
                        Broadcom tg3 Linux Driver   
                               Version 3.110g   
                                06/08/2010
  Broadcom Corporation   
                         5300 California Avenue   
                        Irvine, California  92617
  Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Broadcom Corporation   
                           All rights reserved
  Table of Contents   
=================
  Introduction   
  Limitations   
  Packaging   
  Installing Source RPM Package   
  Building Driver From TAR File   
  Driver Settings   
  Driver Defaults   
  Unloading and Removing Driver   
  Driver Messages
  Introduction   
============
  This file describes the tg3 Linux driver for the Broadcom NetXtreme   
10/100/1000 Mbps PCI/PCI-X/PCI Express Ethernet Network Controllers.   
The latest driver is in the latest 2.6 Linux kernel. It can also be   
downloaded from http://www.broadcom.com as a source package, but is   
generally not necessary to do so if you are using the latest 2.6   
upstream kernel from http://www.kernel.org or one of the latest   
vendor kernels from Red Hat, SuSE, or others.
  The tg3 driver from the Broadcom package is almost identical to the   
tg3 driver in the latest 2.6 upstream Linux kernel. It includes some   
additional kernel compatible code to allow it to compile on older 2.6   
and some 2.4 kernels. The version number is also similar but generally   
has a one letter suffix at the end, (e.g. 3.55b) to distinguish it from   
the in-kernel tg3 driver.
  The next few sections on packaging, compiling, and installation apply   
mostly to the Broadcom driver package only.
  Limitations   
===========
  The current version of the driver has been tested on 2.4.x kernels starting   
from 2.4.24 and all 2.6.x kernels. The driver may not compile on kernels   
older than 2.4.24. Testing is concentrated on i386 and x86_64 architectures.   
Only limited testing has been done on some other architectures such as   
powerpc and sparc64.
  Minor changes to some source files and Makefile may be needed on some   
kernels.
  Forcing 1 Gigabit speed in a copper environment is not supported and may   
result in connection issues with certain switches.
  SLES 11 Considerations   
======================
  Starting with SLES 11, all modules not compiled by Novell will refuse to load   
through modprobe by default.  Externally compiled modules can be loaded if the   
"allow_unsupported_modules" flag is toggled in   
/etc/modprobe.d/unsupported-modules, however this will render your kernel and   
whole system unsupportable through Novell.  Please refer to the SLES 11 release   
notes for more details.
  Packaging   
=========
  To replace an older previously installed or in-kernel tg3 driver, follow   
the instructions below.
  The driver package from http://www.broadcom.com is released in two packaging   
formats: source RPM and compressed tar formats. The file names for the two   
packages are tg3-.src.rpm and tg3-.tar.gz respectively.   
Identical source files to build the driver are included in both packages.
  Installing Source RPM Package   
=============================
  The following are general guidelines for installing the driver.
  1. Install the source RPM package:
  rpm -ivh tg3-.src.rpm
  2. CD to the RPM path and build the binary driver for your kernel:
  cd /usr/src/{redhat,OpenLinux,turbo,packages,rpm ..}
  rpm -bb SPECS/tg3.spec
  or
  rpmbuild -bb SPECS/tg3.spec (for RPM version 4.x.x)
  Note that the RPM path is different for different Linux distributions.
  The driver will be compiled for the running kernel by default. To build   
the driver for a kernel different than the running one, specify the   
kernel by defining it in KVER:
  rpmbuild -bb SPECS/tg3.spec --define "KVER "
  where  in the form of 2.x.y-z is the version of another   
kernel that is installed on the system.
  3. Install the newly built package (driver and man page):
  rpm -ivh RPMS//tg3-..rpm
  is the architecture of the machine, e.g. i386:
  rpm -ivh RPMS/i386/tg3-.i386.rpm
  Note that the --force option may be needed on some Linux distributions   
if conflicts are reported.
  The driver will be installed in the following path:
  2.4.x kernels:
  /lib/modules//kernel/drivers/net/tg3.o
  2.6.x kernels:
  /lib/modules//kernel/drivers/net/tg3.ko
  4. Load the driver:
  insmod tg3.o   
or   
   insmod tg3.ko (on 2.6.x kernels)   
or   
   modprobe tg3
  5. To configure network protocol and address, refer to various Linux   
documentations.
  Building Driver From TAR File   
=============================
  The following are general guidelines for installing the driver.
  1. Create a directory and extract the files:
  tar xvzf tg3-.tar.gz
  2. Build the driver tg3.o (or tg3.ko) as a loadable module for the   
running kernel:
  cd src   
   make
  The driver will be compiled for the running kernel by default. To build   
the driver for a kernel different than the running one, specify the   
kernel by defining it in KVER:
  make KVER=
  where  in the form of 2.x.y-z is the version of another   
kernel that is installed on the system.
  3. Test the driver by loading it:
  insmod tg3.o   
or   
   insmod tg3.ko (on 2.6.x kernels)   
or   
   insmod tg3
  4. Install the driver:
  make install
  See RPM instructions above for the location of the installed driver.
  5. To configure network protocol and address, refer to various Linux   
documentations.
  Driver Settings   
===============
  This and the rest of the sections below apply to both the in-kernel tg3   
driver and the tg3 driver package from Broadcom.
  Driver settings can be queried and changed using ethtool. The latest ethtool   
can be downloaded from http://sourceforge.net/projects/gkernel if it is not   
already installed. The following are some common examples on how to use   
ethtool. See the ethtool man page for more information. ethtool settings do   
not persist across reboot or module reload. The ethtool commands can be put   
in a startup script such as /etc/rc.local to preserve the settings across a   
reboot. On Red Hat distributions, "ethtool -s" parameters can be specified   
in the ifcfg-ethx scripts using the ETHTOOL_OPTS keyword. The specified   
ethtool parameters will be set during ifup. Example:   
/etc/sysconfig/network-scripts/ifcfg-eth0:
  ETHTOOL_OPTS="wol g speed 100 duplex half autoneg off"
  Some ethtool examples:
  1. Show current speed, duplex, and link status:
  ethtool eth0
  2. Change speed, duplex, autoneg:
  Example: 100Mbps half duplex, no autonegotiation:
  ethtool -s eth0 speed 100 duplex half autoneg off
  Example: Autonegotiation with full advertisement:
  ethtool -s eth0 autoneg on
  Example: Autonegotiation with 100Mbps full duplex advertisement only:
  ethtool -s eth0 speed 100 duplex full autoneg on
  3. Show flow control settings:
  ethtool -a eth0
  4. Change flow control settings:
  Example: Turn off flow control
  ethtool -A eth0 autoneg off rx off tx off
  Example: Turn flow control autonegotiation on with tx and rx advertisement:
  ethtool -A eth0 autoneg on rx on tx on
  Note that this is only valid if speed is set to autonegotiation.
  5. Show offload settings:
  ethtool -k eth0
  6. Change offload settings:
  Example: Turn off TSO (TCP segmentation offload)
  ethtool -K eth0 tso off
  7. Get statistics:
  ethtool -S eth0
  8. Perform self-test:
  ethtool -t eth0
  Note that the interface (eth0) must be up to do all tests.
  9. See ethtool man page for more options.
  Driver Defaults   
===============
  Speed :                    Autonegotiation with all speeds advertised
  Flow control :             Autonegotiation with rx and tx advertised
  MTU :                      1500 (range 46 - 9000)
  Some chips do not support jumbo MTUs bigger than   
                           1500
  Rx Ring Size :              200 (range 0 - 511)
  Some chips are fixed at 64
  Rx Jumbo Ring Size :        100 (range 0 - 255)
  Not all chips support the jumbo ring, and some   
                            chips that support jumbo frames do not use the   
                            jumbo ring.
  Tx Ring Size :              511 (range (MAX_SKB_FRAGS+1) - 511)
  MAX_SKB_FRAGS varies on different kernels and   
                            different architectures. On a 2.6 kernel for   
                            x86, MAX_SKB_FRAGS is 18.
  Coalesce rx usecs :          20 (range 0 - 1023)
  Coalesce rx usecs irq :      20 (range 0 - 255)   
Coalesce rx frames :          5 (range 0 - 1023)
  Coalesce rx frames irq :      5 (range 0 - 255)
  Coalesce tx usecs :          72 (range 0 - 1023)
  Coalesce tx usecs irq :      20 (range 0 - 255)
  Coalesce tx frames :         53 (range 0 - 1023)
  Coalesce tx frames irq :     5 (range 0 - 255)
  Coalesce stats usecs   : 1000000 (aprox. 1 sec.)
  Some coalescing parameters are not used or have   
                             different defaults on some chips
  MSI :                      Enabled (if supported by the chip and passed   
                                    the interrupt test)
  TSO :                      Enabled on newer chips that support TCP segmentation   
                           offload in hardware
  WoL :                      Disabled
  Unloading and Removing Driver   
=============================
  To unload the driver, use ifconfig to bring down all eth# interfaces opened   
by the driver, then do the following:
  rmmod tg3
  Note that on 2.6 kernels, it is not necessary to bring down the eth#   
interfaces before unloading the driver module.
  If the driver was installed using rpm, do the following to remove it:
  rpm -e tg3
  If the driver was installed using make install from the tar file, the driver   
tg3.o (or tg3.ko) has to be manually deleted from the system. Refer   
to the section "Installing Source RPM Package" for the location of the   
installed driver.
  Driver Messages   
===============
  The following are the most common sample messages that may be logged in the file   
/var/log/messages. Use dmesg -n  to control the level at which messages   
will appear on the console. Most systems are set to level 6 by default. To see   
all messages, set the level higher.
  Driver signon:   
-------------
  tg3.c:v3.110g (June 8, 2010)
  NIC detected:   
------------
  eth0: Tigon3 [partno(BCM95704A6) rev 2003] (PCIX:100MHz:64-bit) MAC address 00:10:18:04:3f:36   
eth0: attached PHY is 5704 (10/100/1000Base-T Ethernet) (WireSpeed[1])   
eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]   
eth0: dma_rwctrl[769f4000] dma_mask[64-bit]
  Link up and speed indication:   
----------------------------
  tg3: eth0: Link is up at 1000 Mbps, full duplex.   
tg3: eth0: Flow control is on for TX and on for RX.
  Link down indication:   
--------------------
  tg3: eth0: Link is down.
             版权声明:本文为博主原创文章,未经博主允许不得转载。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-125539-1-1.html 上篇帖子: xen.cfg的写法及附带的一个例子 下篇帖子: ubuntu install xen
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表