PCIE AER

AER: PCI Express Advanced Error Reporting

Overview

1. What is the PCI Express AER Driver?

PCI Express error signaling can occur on the PCI Express link itself or on behalf of transactions initiated on the link. PCI Express defines two error reporting paradigms: the baseline capability and the Advanced Error Reporting capability. The baseline capability is required of all PCI Express components providing a minimum defined set of error reporting requirement . Advanced Error Reporting capability is implemented with a PCI Express advanced error reporting extended capability structure providing more robust error reporting.

The PCI Express AER driver provides the infrastructure to support PCI Express Advanced Error Reporting capability. The PCI Express AER driver provides three basic functions:

  • Gathers the comprehensive error information if errors occurred.
  • Reports error to the users.
  • Performs error recovery actions.

AER driver only attaches root ports which support PCI-Express AER capability.

2. How AER does work?

PCI Express errors are classified into two types: correctable errors and uncorrectable errors. This classification is based on the impacts of those errors, which may result in degraded performance or function failure.

  • Correctable errors pose no impacts on the functionality of the interface. The PCI Express protocol can recover without any software intervention or any loss of data. These errors are detected and corrected by hardware. The AER driver clears the device's correctable error status register accordingly and logs these errors.
  • Unlike correctable errors, uncorrectable errors impact functionality of the interface. Uncorrectable errors can cause a particular transaction or a particular PCI Express link to be unreliable.
  • Depending on those error conditions, uncorrectable errors are further classified into non-fatal errors and fatal errors.
    • Non-fatal errors cause the particular transaction to be unreliable, but the PCI Express link itself is fully functional.
    • Fatal errors, on the other hand, cause the link to be unreliable.

When AER is enabled, a PCI Express device will automatically send an error message to the PCIe root port above it when the device captures an error. The Root Port, upon receiving an error reporting message, internally processes and logs the error message in its PCI Express capability structure. Error information being logged includes storing the error reporting agent's requestor ID into the Error Source Identification Registers and setting the error bits of the Root Error Status Register accordingly. If AER error reporting is enabled in Root Error Command Register, the Root Port generates an interrupt if an error is detected.

Note that the errors as described above are related to the PCI Express hierarchy and links. These errors do not include any device specific errors because device specific errors will still get sent directly to the device driver.

User Guide

1. Include the PCI Express AER Root Driver into the Linux Kernel

The PCI Express AER Root driver is a Root Port service driver attached to the PCI Express Port Bus driver. If a user wants to use it, the driver has to be compiled. Option CONFIG_PCIEAER supports this capability. It depends on CONFIG_PCIEPORTBUS, so pls. set CONFIG_PCIEPORTBUS=y and CONFIG_PCIEAER=y.

2. Load PCI Express AER Root Driver

Some systems have AER support in firmware. Enabling Linux AER support at the same time the firmware handles AER may result in unpredictable behavior. Therefore, Linux does not handle AER events unless the firmware grants AER control to the OS via the ACPI _OSC method. See the PCI FW 3.0 Specification for details regarding _OSC usage.

3. AER error output

When a PCIe AER error is captured, an error message will be output to console. If it's a correctable error, it is output as a warning. Otherwise, it is printed as an error. So users could choose different log level to filter out correctable error messages.

Below shows an example:

0000:50:00.0: PCIe Bus Error: severity=Uncorrected (Fatal), type=Transaction Layer, id=0500(Requester ID)
0000:50:00.0:   device [8086:0329] error status/mask=00100000/00000000
0000:50:00.0:    [20] Unsupported Request    (First)
0000:50:00.0:   TLP Header: 04000001 00200a03 05010000 00050100

In the example, RequesterID means the ID of the device who sends the error message to root port. Pls. refer to pci express specs for other fields.

4. AER Statistics / Counters

When PCIe AER errors are captured, the counters / statistics are also exposed in the form of sysfs attributes which are documented at Documentation/ABI/testing/sysfs-bus-pci-devices-aer_stats

Documentation/ABI/testing/sysfs-bus-pci-devices-aer_stats

==========================
PCIe Device AER statistics
==========================
These attributes show up under all the devices that are AER capable. These
statistical counters indicate the errors "as seen/reported by the device".
Note that this may mean that if an endpoint is causing problems, the AER
counters may increment at its link partner (e.g. root port) because the
errors may be "seen" / reported by the link partner and not the
problematic endpoint itself (which may report all counters as 0 as it never
saw any problems).

What:           /sys/bus/pci/devices/<dev>/aer_dev_correctable
Date:           July 2018
KernelVersion: 4.19.0
Contact:        linux-pci@vger.kernel.org, rajatja@google.com
Description:    List of correctable errors seen and reported by this
                PCI device using ERR_COR. Note that since multiple errors may
                be reported using a single ERR_COR message, thus
                TOTAL_ERR_COR at the end of the file may not match the actual
                total of all the errors in the file. Sample output:
-------------------------------------------------------------------------
localhost /sys/devices/pci0000:00/0000:00:1c.0 # cat aer_dev_correctable
Receiver Error 2
Bad TLP 0
Bad DLLP 0
RELAY_NUM Rollover 0
Replay Timer Timeout 0
Advisory Non-Fatal 0
Corrected Internal Error 0
Header Log Overflow 0
TOTAL_ERR_COR 2
-------------------------------------------------------------------------

What:           /sys/bus/pci/devices/<dev>/aer_dev_fatal
Date:           July 2018
KernelVersion: 4.19.0
Contact:        linux-pci@vger.kernel.org, rajatja@google.com
Description:    List of uncorrectable fatal errors seen and reported by this
                PCI device using ERR_FATAL. Note that since multiple errors may
                be reported using a single ERR_FATAL message, thus
                TOTAL_ERR_FATAL at the end of the file may not match the actual
                total of all the errors in the file. Sample output:
-------------------------------------------------------------------------
localhost /sys/devices/pci0000:00/0000:00:1c.0 # cat aer_dev_fatal
Undefined 0
Data Link Protocol 0
Surprise Down Error 0
Poisoned TLP 0
Flow Control Protocol 0
Completion Timeout 0
Completer Abort 0
Unexpected Completion 0
Receiver Overflow 0
Malformed TLP 0
ECRC 0
Unsupported Request 0
ACS Violation 0
Uncorrectable Internal Error 0
MC Blocked TLP 0
AtomicOp Egress Blocked 0
TLP Prefix Blocked Error 0
TOTAL_ERR_FATAL 0
-------------------------------------------------------------------------

What:           /sys/bus/pci/devices/<dev>/aer_dev_nonfatal
Date:           July 2018
KernelVersion: 4.19.0
Contact:        linux-pci@vger.kernel.org, rajatja@google.com
Description:    List of uncorrectable nonfatal errors seen and reported by this
                PCI device using ERR_NONFATAL. Note that since multiple errors
                may be reported using a single ERR_FATAL message, thus
                TOTAL_ERR_NONFATAL at the end of the file may not match the
                actual total of all the errors in the file. Sample output:
-------------------------------------------------------------------------
localhost /sys/devices/pci0000:00/0000:00:1c.0 # cat aer_dev_nonfatal
Undefined 0
Data Link Protocol 0
Surprise Down Error 0
Poisoned TLP 0
Flow Control Protocol 0
Completion Timeout 0
Completer Abort 0
Unexpected Completion 0
Receiver Overflow 0
Malformed TLP 0
ECRC 0
Unsupported Request 0
ACS Violation 0
Uncorrectable Internal Error 0
MC Blocked TLP 0
AtomicOp Egress Blocked 0
TLP Prefix Blocked Error 0
TOTAL_ERR_NONFATAL 0
-------------------------------------------------------------------------

============================
PCIe Rootport AER statistics
============================
These attributes show up under only the rootports (or root complex event
collectors) that are AER capable. These indicate the number of error messages as
"reported to" the rootport. Please note that the rootports also transmit
(internally) the ERR_* messages for errors seen by the internal rootport PCI
device, so these counters include them and are thus cumulative of all the error
messages on the PCI hierarchy originating at that root port.

What:           /sys/bus/pci/devices/<dev>/aer_stats/aer_rootport_total_err_cor
Date:           July 2018
KernelVersion: 4.19.0
Contact:        linux-pci@vger.kernel.org, rajatja@google.com
Description:    Total number of ERR_COR messages reported to rootport.

What:       /sys/bus/pci/devices/<dev>/aer_stats/aer_rootport_total_err_fatal
Date:           July 2018
KernelVersion: 4.19.0
Contact:        linux-pci@vger.kernel.org, rajatja@google.com
Description:    Total number of ERR_FATAL messages reported to rootport.

What:       /sys/bus/pci/devices/<dev>/aer_stats/aer_rootport_total_err_nonfatal
Date:           July 2018
KernelVersion: 4.19.0
Contact:        linux-pci@vger.kernel.org, rajatja@google.com
Description:    Total number of ERR_NONFATAL messages reported to rootport.

本文分享自微信公众号 - WriteSimpleDemo(this_is_a_wechat),作者:PedroQin

原文出处及转载信息见文内详细说明,如有侵权,请联系 yunjia_community@tencent.com 删除。

原始发表时间:2020-02-12

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • tsc:Marking TSC unstable due to check_tsc_sync_source failed

    First it isn't really an issue as the kernel is only letting you know that the I...

    PedroQin
  • 网卡中断绑定

    PedroQin
  • DEVICESCAN failed: aborted matching pattern /dev/discs/disc*

    该问题出现概率不大,但是由于基数大了,还是会不时就会出现,让你想忽略都没法忽略。今天之前一直以为该问题是hardware导致,如硬盘问题等。但是今天做了一版fo...

    PedroQin
  • WashU EpiGenome Browser使用教程

    WashU EpiGenome Browser 是我用过最赞的浏览器,没有之一。希望大伙跟着教程好好学习下! 还有更多教程见:http://epigenomeg...

    生信技能树
  • HOJ-2056 Bookshelf(线性动态规划)

    L is a rather sluttish guy. He almost never clean up his surroundings or regulat...

    ShenduCC
  • 有限闭包系统中的极大闭集和半空间分离(CS AI)

    研究了抽象闭包系统中闭集和半空间分离的一些算法性质。假设基础闭包系统是有限的,并由相应的闭包算子给出,证明了半空间分离问题是np完全的。与此相反,对于极大闭集分...

    RockNPeng
  • 幕后光伏系统的发电临近预报(CS SC)

    在低压配电系统中,光伏打系统(PVSs)的数量迅速增加,需要对这些系统进行实时监控。然而,考虑到必要的投资成本,实时监控基础设施的安装似乎在不久的将来无法实现。...

    非过度曝光
  • TW洞见 | 敏捷回顾7步法

    Paulo和TC一直在收集整理关于敏捷回顾的任何想法和活动。在这篇内容里面,他们分享了7步法来帮助你组织你的下一次回顾。 Agenda structure: 1...

    ThoughtWorks
  • uva 699 The Falling Leaves

    Each year, fall in the North Central region is accompanied by the brilliant colo...

    用户1624346
  • Feature selection特征选择

    This recipe along with the two following it will be centered around automatic fe...

    到不了的都叫做远方

扫码关注云+社区

领取腾讯云代金券

玩转腾讯云 有奖征文活动