【91】PCIe header format分类

PCIe错误发生后,如果未被屏蔽且类型允许,错误header会被记录在AERcap的headerlogregs中。特定的错误如CompletionTimeout、AtomicOpEgressBlocked等会生成headerlog。LinuxAER服务器的__printer_tlp_header函数会打印出问题设备的headerlogreg。TLPHeader的格式和解析涉及到PCIeTLPheader的DW0,包括不同类型的数据传输、请求者和完成者ID等信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  •     哪些错误会记录header

    PCIe错误产生后,如果对应的错误没有被mask住,并且错误类型又是可以产生header log的错误,那么在AER cap中header log regs中会记录对应的header。

     具体哪些错误会记录header log见下面table中介绍

Table 6-2 General PCI Express Error List
Table 6-3 Physical Layer Error List
Table 6-4 Data Link Layer Error List
Table 6-5 Transaction Layer Error List

    具体需要记录header的错误类型有:Uncorrectable Internal Error(optional)、Poisoned TLP Received、Poisoned TLP Blocked、ECRC Check Failed、UR、Completion Timeout(如果completion timeout prefix/header log capable为1)、Completer Abort、Unexpected Completion、ACS Violation、MC Blocked TLP、AtomicOp Egress Blocked、TLP Prefix Blocked、Malformed TLP。

    Completion Timeout比较特殊,需要看 Advanced Error Capabilities and Control Register (Offset 18h)的Completion Timeout Prefix/Header Log Capable bit是否为1。

  • AER server对head log的打印

    linux AER server的__printer_tlp_header函数会打印出错的设备的header log reg(如果把整条链路打通的情况下),比如下面的打印TLP Header:4a000001 04000004 00000000 00000000

  • 翻译过程

    我们拿着4a000001 04000004 00000000 00000000就需要去spec看到底是类型的header(其实就是查询各种table)。上图后面的注释就是我翻译后的结果:

4a000001:3DW的completion with data的header。

04000004:completer ID为04:0.0,completion status是SC,byte count为4Byte。

00000000:request ID为0:0.0。

    也就说,CPU(0:00.0)访问EP(04:00.0),但是04:00.0超时没有返回completion,导致CPU出现completion timeout的错误。由于没有抓trace,我们不知道是CPU发起了memory read EP的请求还是CPU发起的configuration read EP的请求,但是知道EP超时没有返回completion。

  • Spec对header format的分类

1、TLP header DW0

PCIe TLP header DW0的格式都是一样的,如Figure 2-5显示。

PCIe的TLP header可能是4DW也可能是3DW,其中DW0的byte0的bit7-5(Fmt[7:5])决定了TLP header format是3DW还是4DW,header后面有没有data。

DW0的byte0的bit4-0(Type[4:0])决定了TLP的类型。

常见的TLP header类型就是memory readmemory write、I/O read、I/O write、configuration read type 0、configuration write type 0、configuration read type 1、configuration write type 1、Cpl、CplD这10种。memory readmemory write有3DW或者4DW的format。因此,常用的TLP header有12种组合(其他还有一些不常见的,见table 2-3):

(1)3DW no data, memory read(byte0为0000 0000b)

(2)4DW no data, memory read(byte0为0010 0000b)

(3)3DW with data, memory write(byte0为0100 0000b)

(4)4DW with data, memory write(byte0为0110 0000b)

(5)3DW no data, I/O read(byte0为0000 0010b)

(6)3DW with data, I/O write(byte0为0100 0010b)

(7)3DW no data, config read type 0 (byte0为0000 0100b)

(8)3DW with data, config write type 0 (byte0为0100 0100b)

(9)3DW no data, config read type 1(byte0为0000 0101b)

(10)3DW with data config write type 1(byte0为0100 0101b)

(11)3DW no data, completion(byte0为0000 1010b)

(12)3DW with data, completion(byte0为0100 1010b)

2、4DW no data,memory read和4DW with data,memory write

对于4DW no data,memory read (byte0为0010 0000b)和4DW with data, memory write(byte0为0110 0000b),TLP header 格式如下

    其中RequesterID字段(bit31-16)的高8bit(bit31-24)为bus,中间5bit(bit23-19)为device,低3bit(bit18-16)为function。

3、3DW no data,memory read和3DW with data,memory

    对于3DW no data, memory read(byte0为0000 0000b)和3DW with data, memory write(byte0为0100 0000b),TLP header 格式如下

    其中RequesterID字段(bit31-16)的高8bit(bit31-24)为bus,中间5bit(bit23-19)为device,低3bit(bit18-16)为function。

4、3DW no data, I/O read和3DW with data, I/O write

    3DW no data, I/O read(byte0为0000 0010b)和3DW with data, I/O write(byte0为0100 0010b),TLP header 格式如下

    其中RequesterID字段(bit31-16)的高8bit(bit31-24)为bus,中间5bit(bit23-19)为device,低3bit(bit18-16)为function。

5、configuration transaction

    3DW no data, config read type 0 (byte0为0000 0100b)、3DW with data, config write type 0 (byte0为0100 0100b)、3DW no data, config read type 1(byte0为0000 0101b)、3DW with data config write type 1(byte0为0100 0101b),TLP header 格式如下:

    其中RequesterID字段(bit31-16)的高8bit(bit31-24)为bus,中间5bit(bit23-19)为device,低3bit(bit18-16)为function。

    其中Byte10的bit3-0为Extended Register Number[3:0],Byte11的bit5-0为Register Number[5:0]。

6、completion transaction

    3DW no data, completion(byte0为0000 1010b)和3DW with data, completion (byte0为0100 1010b), TLP header格式如下:

    其中completer ID和Requester ID的高8bit为bus,中间5bit为device,低3bit为function。


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

linjiasen

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

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

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

打赏作者

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

抵扣说明:

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

余额充值