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

Linux下Chelsio T5调试方法相关推荐

  1. Linux下core文件调试方法收藏

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明 http://littlewhitetwo.blogbus.com/logs/35544335.html 在程序不寻常退出时,内核会在 ...

  2. linux下的程序调试方法汇总

    原文地址:http://blog.csdn.net/guochaoxxl/article/details/51878051 搞电子都知道,电路不是焊接出来的,是调试出来的.程序员也一定认同,程序不是写 ...

  3. Linux下core文件调试方法

    core dump又叫核心转储, 当程序运行过程中发生异常, 程序异常退出时, 由操作系统把程序当前的内存状况存储在一个core文件中, 叫core dump. (Linux中如果内存越界会收到SIG ...

  4. LINUX下的gdb调试方法

    首先对目标文件进行编译 例如: gcc test.c -o test 这时会生成一个文件test,然后我们就可以对test进行调试了 示例: gdb test 好了以后是设定断点 示例: break ...

  5. linux单步调试方法,linux下gdb单步调试(中).doc

    linux下gdb单步调试(中) linux下gdb单步调试(中) linux下gdb单步调试(中) 一.设置断点( BreakPoint ) 我们用 break 命令来设置断点.正面有几点设置断点的 ...

  6. 一份简单的在 Linux下编译及调试 C 代码的指南

    摘要: 一份简单的在 Linux下编译及调试 C 代码的指南 对于Linux下的C程序员来说,几乎天天都会和Linux打交道.但在很多人的眼中,Linux是一个易用性极差.靠命令驱动的操作系统,根本无 ...

  7. linux下eclipse的使用教程,linux下Eclipse的使用方法总结.doc

    linux下Eclipse的使用方法总结 安装的版本 jdk-6u7-linux-i586.bin eclipse-cpp-ganymede-SR1-linux-gtk.tar.gz 主机方面的设置 ...

  8. Linux下的程序调试——GDB

    无论是多么优秀的程序员,都难以保证自己在编写代码时不会出现任何错误,因此调试是软件开发过程中的一个必不可少的 组成部分.当程序完成编译之后,它很可能无法正常运行,或者会彻底崩溃,或者不能实现预期的功能 ...

  9. Linux下环境变量配置方法梳理(.bash_profile和.bashrc的区别)

    博客园 首页 新随笔 联系 管理 订阅 <div class="blogStats"><!--done--> 随笔- 556  文章- 38  评论- 77 ...

最新文章

  1. 一个Java程序员的面试心得,最终入职阿里
  2. Boost::context模块fiber的throw测试程序
  3. vue webpack打包入口文件是哪个_Vue 学习笔记(二十五):webpack 相关
  4. 小程序底部弹窗css_微信小程序之animation底部弹窗动画(两种方法)
  5. Linux shell 下的复制和粘贴(Copy Paste Operation on Linux shell)
  6. BZOJ.1178.[APIO2009]会议中心(贪心 倍增)
  7. Java类的初始化顺序 (静态变量、静态初始化块、变量、初始...
  8. Zoho:尽快修复已遭利用的 ManageEngine 严重漏洞
  9. Here we are 团队简介
  10. Android RootTrustManager 证书校验简单分析
  11. 二级java题型及分值_计算机二级java考试内容
  12. vue 动态背景图轮播
  13. hbase与hadoop版本兼容问题,强烈谴责hadoop生态圈耦合性
  14. html图片控件显示图片不清楚,jQuery图片模糊插件crossfade.js
  15. 安装Oracle 19c 的系统配置要求
  16. VUE图片裁剪,打码,旋转功能
  17. 搭建一个独立英文网站费用多少?
  18. JDBC防止SQL注入原理
  19. @程序员,你也是一杯茶,一支烟,一个BUG 改一天吗?
  20. php 屏蔽搜索机器人,php实现判断访问来路是否为搜索引擎机器人的方法

热门文章

  1. 身份认证技术基础知识
  2. 什么时间吃nmn比较好,nmn服用产生效果和时间,请正确认识
  3. 新媒体数据分析:新媒体运营主要做什么?
  4. 《后端从入门到熟悉-序言》
  5. 普及!cmnet、cmiot还傻傻分不清楚?APN设置看看这一篇就够了!!
  6. python文件的两种类型是什么意思_Python文件处理里encoding和encode有事区别,bytes类型是什么意思?...
  7. C语言-函数-学会方程你的数学能力会乘风破浪突飞猛进-学会函数你的编程能力将百尺竿头更进一步
  8. 2022-2028全球及中国铝硅合金电子封装材料行业研究及十四五规划分析报告
  9. java命令行简单实现推箱子小游戏
  10. NodeJs+VueJs +前端实现批量打印二维码