Repository navigation
Conversation
Parse aer_dev_correctable, aer_dev_fatal and aer_dev_nonfatal for every PCI device under /sys/bus/pci/devices, exposing them as the optional AerCorrectable, AerFatal and AerNonFatal fields. They are nil when the kernel does not expose AER statistics for a device. AER parsing was previously only reachable through network interfaces (/sys/class/net/<iface>/device). The file parsers are refactored to take a file path so both callers share them; the net class behaviour is unchanged. Signed-off-by: Lakshmi Pradeep <lakshmi.pradeep@neyon.ai>
Parse aer_rootport_total_err_cor, aer_rootport_total_err_fatal and aer_rootport_total_err_nonfatal into the optional AerRootPortTotalErrCor, AerRootPortTotalErrFatal and AerRootPortTotalErrNonFatal fields. The kernel creates these files only on AER-capable PCIe Root Ports, where they count every error reported to the port by the devices below it; the fields are nil elsewhere. Signed-off-by: Lakshmi Pradeep <lakshmi.pradeep@neyon.ai>
Member
|
Please do not tag mention maintainers directly. We have a number of maintainers and review as soon as we can. Direct pings are unnecessary and somewhat rude. |
Contributor
Author
|
Sorry, didn't mean to be rude. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two commits, both adding optional fields to
PciDevice. Every field isnilwhen the kernel does not create the file:AerCorrectable,AerFatalandAerNonFatal, parsed fromaer_dev_correctable,aer_dev_fatalandaer_dev_nonfatalunder/sys/bus/pci/devices/<BDF>/.AerRootPortTotalErrCor,AerRootPortTotalErrFatalandAerRootPortTotalErrNonFatal, parsed fromaer_rootport_total_err_{cor,fatal,nonfatal}. The kernel creates these only on AER-capable Root Ports. They count every error reported to the port by the devices below it.Why
AER parsing already exists, but it is only reachable through
/sys/class/net/<iface>/device. GPUs, NVMe drives and InfiniBand HCAs have no net-class entry, so procfs cannot read their AER counters today. A rising correctable count is often the first sign of a degrading PCIe link, before the device drops off the bus.Implementation
net_class_aer.gonow take a file path and report whether the file existed. The existing net-class functions are thin wrappers around them, so their behaviour is unchanged.parsePciDevicealready uses for optional files, such as SR-IOV and power management.If you would rather keep
PciDevices()to its current reads and expose AER through methods, as in #887, I am happy to rework it that way.Testing
TestPciDevicescovers four cases: a device with non-zero AER counters, one with all-zero counters, one with no AER files, and Root Port totals on0000:00:02.1.TestAerCountersis updated, becauseenp3s0f0points at the0000:a2:00.0fixture, which now has non-zero values.go test ./...passes, and golangci-lint v2.14.0 reports 0 issues._OSC). I injected 2 receiver errors, 1 bad TLP and 1 completion timeout into apcie-root-portwithpcie_aer_inject_error. The parsed values matched the kernel's counters exactly: RxErr 2, BadTLP 1 and CmpltTO 1, with Root Port totals of 3 correctable and 1 non-fatal.e1000eandigbcannot report AER upstream, because their Device Control error-reporting bits are read-only. So errors reported by an endpoint below a port were not covered.Ref: Documentation/ABI/testing/sysfs-bus-pci-devices-aer_stats