Linux下Chelsio T5调试方法

T5是Chelsio的网络芯片,具体的硬件参数可以参考《Chelsio T5 HW Debug Guide V1.02.pdf》文档,如有需要请留言留下你的邮箱,我发给你。

现在我们着重讲述它在Linux下的的相关调试方法。

T5的调试分为2步:

  1. T5芯片firmware的烧录。
  2. T5芯片在Linux下的驱动调试。

 

我的调试环境为:

CPU:Intel Xeon E5-2648L

内存:64GB

硬盘:512G

系统:ubuntu 15.10 64 bit destop版本

 

一、T5 firmware的烧录

注意:

  1. 如果T5芯片是第一次烧录,即T5为空,则在烧录之前,硬件上需要把T5芯片的debug0_data0引脚下拉,烧录完成后,再复原。当正确烧录一次之后,再次烧录时,此引脚不用再下拉。
  2. 烧写所需要的所有文件,均为芯片供应商提供。t5seeprom为源码形式,如果提供的t5seeprom不能运行,则需要重新编译生成t5seeprom。

T5的firmware烧录方法如下(使用su权限):

  1. 使用 lspci | grep -i chelsio查看chelsio的前缀,比如我的为03:00.0

root@jojo-desktop:/home/jojo# lspci | grep -i chelsio

03:00.0 Ethernet controller: Chelsio Communications Inc Device 50a9

03:00.1 Ethernet controller: Chelsio Communications Inc Device 50a9

03:00.2 Ethernet controller: Chelsio Communications Inc Device 50a9

03:00.3 Ethernet controller: Chelsio Communications Inc Device 50a9

03:00.4 Ethernet controller: Chelsio Communications Inc Device 54a9

03:00.5 SCSI storage controller: Chelsio Communications Inc Device 55a9

03:00.6 Fibre Channel: Chelsio Communications Inc Device 56a9

 

2、用t5seeprom烧写eeprom文件,使用以下命令(命令中为03:00.0为第1步获取到的chelsio前缀):

./t5seeprom -b 03:00.0 write -f:./ok/eeprom.bin -K NA:000743112200

root@jojo-desktop:/home/jojo/t5# ./t5seeprom -b 03:00.0 write -f:./ok/eeprom.bin -K NA:000743112200

Using Part number(from Board) :����������������

Using Serial number(from Board) :������������������������

Using MAC address(from Board) :������������

Read 0x8000 bytes from file ./ok/eeprom.bin

0xb30 bytes of 0x8000 written

0x1808 bytes of 0x8000 written

0x25c0 bytes of 0x8000 written

0x3294 bytes of 0x8000 written

0x3f68 bytes of 0x8000 written

0x4c40 bytes of 0x8000 written

0x5914 bytes of 0x8000 written

0x65ec bytes of 0x8000 written

0x72c0 bytes of 0x8000 written

0x7f94 bytes of 0x8000 written

Wrote those bytes to serial eeprom starting at 0x0

 

3、用cxgbtool烧写bootstrap文件和firmware文件,烧写过程不会有LOG提示,持续10秒钟左右。

cxgbtool enp3s0f0 loadfw ./ok/t5fwbootstrap-1.2.0.0.bin

cxgbtool enp3s0f0 loadfw ./ok/t5fw-1.13.32.0.bin

至此,烧写firmware完成。

 

二、T5在linux下的驱动调试:

 

1. 从chelsio官网下载驱动,网址为:https://service.chelsio.com/

我的下载配置如下:

 

2. 下载后,解压,make即可。顺利的话,会在build/src/network/cxgb4/下生成cxgb4.ko文件,insmod此ko文件。完成后可使用lsmod查看cxgb4是否存在。

3. 使用dmesg | grep cxgb4 查看驱动的log,确认Firmware version和Bootstrap version能正常打印出来,则表示驱动加载OK。

 

root@jojo-desktop:/home/jojo/t5# dmesg | grep cxgb4

[   12.650763] cxgb4: module verification failed: signature and/or required key missing - tainting kernel

[   14.282757] cxgb4 0000:03:00.4: firmware on card (1.13.32.0) is older than the version bundled with this driver, installing firmware 1.16.63.0 on card.

[   39.856587] cxgb4 0000:03:00.4: Coming up as MASTER: Initializing adapter

[   40.430381] cxgb4 0000:03:00.4: Successfully configured using Firmware Configuration File "/lib/firmware/cxgb4/t5-config.txt", version 0x100002a, computed checksum 0x36228c7d

[   40.454405] cxgb4 0000:03:00.4: max_ordird_qp 255 max_ird_adapter 4096

[   40.459109] cxgb4 0000:03:00.4: Registering cxgb4 panic handler.., Buffer start address = ffff880c42c00000

[   40.469888] cxgb4 0000:03:00.4: 128 MSI-X vectors allocated, nic 32 ofld 28 rdma cpl 2 rdma ciq 28 iscsi 12 iscsit 24

[   40.484350] cxgb4 0000:03:00.4: PCIe link speed is 8.0GT/s, device supports 8.0GT/s

[   40.484353] cxgb4 0000:03:00.4: PCIe link width is x8, device supports x8

[   40.486116] cxgb4 0000:03:00.4: Chelsio T580-KR rev 1

[   40.486118] cxgb4 0000:03:00.4: S/N: \xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff, P/N: \xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff

[   40.486120] cxgb4 0000:03:00.4: Firmware version: 1.16.63.0

[   40.486121] cxgb4 0000:03:00.4: Bootstrap version: 1.2.0.0

[   40.486122] cxgb4 0000:03:00.4: TP Microcode version: 0.1.4.9

[   40.486123] cxgb4 0000:03:00.4: No Expansion ROM loaded

[   40.486124] cxgb4 0000:03:00.4: Serial Configuration version: 0x0

[   40.486125] cxgb4 0000:03:00.4: VPD version: 0x0

[   40.486127] cxgb4 0000:03:00.4: Configuration: RNIC MSI-X, Offload capable

[   40.494763] cxgb4 0000:03:00.4 enp3s0f4d1: renamed from eth1

[   40.508616] cxgb4 0000:03:00.4 enp3s0f4: renamed from eth0

4. 使用ifconfig -a查看网卡是否被正常识别:

root@jojo-desktop:/home/jojo/t5#ifconfig -a

 

enp3s0f4  Link encap:Ethernet  HWaddr 48:48:48:48:48:48  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:27

 

enp3s0f4d1 Link encap:Ethernet  HWaddr 48:48:48:48:48:50  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:27

注意看errors后面带的数字,为0表示没有error,为其它数值,则可能硬件有问题,需要排查。

至此,驱动加载OK。剩下的,就是测试了,把它当成网口测试即OK,这里不再详述。

编译驱动时,有可能遇到的问题和解决方法(以下全部在su权限下执行):

 

1、apt-get: Package has no installation candidate

解决方法:机器连网,apt-get update

如果还出现,有可能还需要 apt upgrade

 

2、编译t5seeprom时出现:pci/pci.h no such file or directory

解决方法:查看t5包里,包含的t5seeprom是否可用,如果可用,就不需要编译了,它只是烧录t5 firmware的工具,不是驱动。

 

3、cxgbtool 不可用

解决方法:ubuntu/redhat系统一般都带有该工具,可以直接使用,但麒麟系统有时候没包含,则需要自己编译。编译驱动目录下的tools/cxgb4,会在该目录下生成cxgbtool工具。

 

4、编译T5驱动时,提示缺少什么库就连网安装什么库,当安装不上时,apt-get update, apt upgrade。

 

5、编译驱动时,如果提示Makefile没指定KDIR,则自己export一次:

#export KDIR = /lib/modules/xxxx/build

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

masterbee

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值