Skip to content

Commit

Permalink
feat: Read PCIE AER counters class/net
Browse files Browse the repository at this point in the history
Linux provides AER counters in the path /sys/class/net/<iface>/device/

This is split amoung 3 different files:
aer_dev_correctable
aer_dev_fatal
aer_dev_nonfatal

Signed-off-by: Diego Asturias <[email protected]>
  • Loading branch information
dasturiasArista committed Dec 9, 2024
1 parent 7945973 commit d030571
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 2 deletions.
17 changes: 15 additions & 2 deletions sysfs/net_class_aer_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
// Copyright (c) 2024 Arista Networks, Inc. All rights reserved.
// Arista Networks, Inc. Confidential and Proprietary.
// Copyright 2024 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

package sysfs

Expand Down
59 changes: 59 additions & 0 deletions testdata/fixtures.ttar
Original file line number Diff line number Diff line change
Expand Up @@ -13326,6 +13326,65 @@ Mode: 644
Directory: fixtures/sys/devices/pci0000:00/0000:00:1f.6
Mode: 755
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/aer_dev_correctable
Lines: 9
RxErr 1
BadTLP 2
BadDLLP 3
Rollover 4
Timeout 5
NonFatalErr 6
CorrIntErr 7
HeaderOF 8
TOTAL_ERR_COR 9
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/aer_dev_fatal
Lines: 19
Undefined 10
DLP 11
SDES 12
TLP 13
FCP 14
CmpltTO 15
CmpltAbrt 16
UnxCmplt 17
RxOF 18
MalfTLP 19
ECRC 20
UnsupReq 21
ACSViol 22
UncorrIntErr 23
BlockedTLP 24
AtomicOpBlocked 25
TLPBlockedErr 26
PoisonTLPBlocked 27
TOTAL_ERR_FATAL 28
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/aer_dev_nonfatal
Lines: 19
Undefined 30
DLP 31
SDES 32
TLP 33
FCP 34
CmpltTO 35
CmpltAbrt 36
UnxCmplt 37
RxOF 38
MalfTLP 39
ECRC 40
UnsupReq 41
ACSViol 42
UncorrIntErr 43
BlockedTLP 44
AtomicOpBlocked 45
TLPBlockedErr 46
PoisonTLPBlocked 47
TOTAL_ERR_FATAL 48
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/ari_enabled
Lines: 1
0
Expand Down

0 comments on commit d030571

Please sign in to comment.