-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sonic_pcie] Add get_pcie_aer_stats and its common implementation (#144)
Introduce a new platform API get_pcie_aer_stats in class PcieBase for retrieving AER stats of a PCIe device. Add common implementation of get_pcie_aer_stats in class PcieUtil Ref: sonic-net/SONiC#702
- Loading branch information
1 parent
8664efc
commit 7fc76b9
Showing
2 changed files
with
101 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,65 @@ | ||
# | ||
# pcie_base.py | ||
# | ||
# Abstract base class for implementing platform-specific | ||
# PCIE functionality for SONiC | ||
# | ||
|
||
try: | ||
import abc | ||
except ImportError as e: | ||
raise ImportError (str(e) + " - required module not found") | ||
|
||
class PcieBase(object): | ||
def __init__(self, path): | ||
""" | ||
Constructor | ||
Args: | ||
pcieutil file and config file path | ||
""" | ||
|
||
@abc.abstractmethod | ||
def get_pcie_device(self): | ||
""" | ||
get current device pcie info | ||
Returns: | ||
A list including pcie device info | ||
""" | ||
return [] | ||
|
||
|
||
@abc.abstractmethod | ||
def get_pcie_check(self): | ||
""" | ||
Check Pcie device with config file | ||
Returns: | ||
A list including pcie device and test result info | ||
""" | ||
return [] | ||
# | ||
# pcie_base.py | ||
# | ||
# Abstract base class for implementing platform-specific | ||
# PCIE functionality for SONiC | ||
# | ||
|
||
try: | ||
import abc | ||
except ImportError as e: | ||
raise ImportError(str(e) + " - required module not found") | ||
|
||
|
||
class PcieBase(object): | ||
def __init__(self, path): | ||
""" | ||
Constructor | ||
Args: | ||
pcieutil file and config file path | ||
""" | ||
|
||
@abc.abstractmethod | ||
def get_pcie_device(self): | ||
""" | ||
get current device pcie info | ||
Returns: | ||
A list including pcie device info | ||
""" | ||
return [] | ||
|
||
@abc.abstractmethod | ||
def get_pcie_check(self): | ||
""" | ||
Check Pcie device with config file | ||
Returns: | ||
A list including pcie device and test result info | ||
""" | ||
return [] | ||
|
||
@abc.abstractmethod | ||
def get_pcie_aer_stats(self, domain, bus, dev, fn): | ||
""" | ||
Returns a nested dictionary containing the AER stats belonging to a | ||
PCIe device | ||
Args: | ||
domain, bus, dev, fn: Domain, bus, device, function of the PCIe | ||
device respectively | ||
Returns: | ||
A nested dictionary where key is severity 'correctable', 'fatal' or | ||
'non_fatal', value is a dictionary of key, value pairs in the format: | ||
{'AER Error type': Error count} | ||
Ex. {'correctable': {'BadDLLP': 0, 'BadTLP': 0}, | ||
'fatal': {'RxOF': 0, 'MalfTLP': 0}, | ||
'non_fatal': {'RxOF': 0, 'MalfTLP': 0}} | ||
For PCIe devices that do not support AER, the value for each | ||
severity key is an empty dictionary. | ||
""" | ||
return {} |
This file contains 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