Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unifying the platform api for get_pcie_aer_stats with PcieBase #197

Merged
merged 2 commits into from
Jun 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sonic_platform_base/sonic_pcie/pcie_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def load_config_file(self):
config_file = "{}/pcie{}.yaml".format(self.config_path, conf_rev)
try:
with open(config_file) as conf_file:
self.confInfo = yaml.load(conf_file)
self.confInfo = yaml.safe_load(conf_file)
except IOError as e:
print("Error: {}".format(str(e)))
print("Not found config file, please add a config file manually, or generate it by running [pcieutil pcie_generate]")
Expand Down Expand Up @@ -101,9 +101,9 @@ def get_pcie_check(self):
return self.confInfo

# return AER stats of PCIe device
def get_pcie_aer_stats(self, domain=0, bus=0, device=0, func=0):
def get_pcie_aer_stats(self, domain=0, bus=0, dev=0, func=0):
aer_stats = {'correctable': {}, 'fatal': {}, 'non_fatal': {}}
dev_path = os.path.join('/sys/bus/pci/devices', '%04x:%02x:%02x.%d' % (domain, bus, device, func))
dev_path = os.path.join('/sys/bus/pci/devices', '%04x:%02x:%02x.%d' % (domain, bus, dev, func))

# construct AER sysfs filepath
correctable_path = os.path.join(dev_path, "aer_dev_correctable")
Expand Down