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

hssistats: fix variable name #3133

Merged
merged 1 commit into from
Jun 17, 2024
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
hssistats: fix variable name
The "port_index" used while collecting HSSI statistics is actually an index
into a row in the list of statistics counters. Changed to "stat_index".

Signed-off-by: Michael Adler <michael.adler@intel.com>
  • Loading branch information
michael-adler committed Jun 17, 2024
commit bcde7596f55cbb37a3aa2b60c12ae3d952e78aa3
14 changes: 7 additions & 7 deletions binaries/hssi/ethernet/hssistats.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_hssi_stats(self):
stats_list.append("{0: <32} |".format(str))

for port in range(0, self.hssi_csr.HSSI_PORT_COUNT):
port_index = 0
stat_index = 0
# add active ports
enable = self.register_field_get(hssi_feature_list.port_enable,
port)
Expand All @@ -124,24 +124,24 @@ def get_hssi_stats(self):
31, 1, 1)
res, value_lsb = self.read_reg(0, ctl_addr.value)
if not res:
stats_list[port_index] += "{}|".format("N/A").rjust(20, ' ')
port_index = port_index + 1
stats_list[stat_index] += "{}|".format("N/A").rjust(20, ' ')
stat_index = stat_index + 1
continue

# Read MSB value
ctl_addr.value = self.register_field_set(ctl_addr.value,
31, 1, 0)
res, value_msb = self.read_reg(0, ctl_addr.value)
if not res:
stats_list[port_index] += "{}|".format("N/A").rjust(20, ' ')
port_index = port_index + 1
stats_list[stat_index] += "{}|".format("N/A").rjust(20, ' ')
stat_index = stat_index + 1
continue

# 64 bit value
value = (value_msb << 32) | (value_lsb)

stats_list[port_index] += "{}|".format(value).rjust(20, ' ')
port_index = port_index + 1
stats_list[stat_index] += "{}|".format(value).rjust(20, ' ')
stat_index = stat_index + 1

print("\n")
for i in range(len(self.hssi_eth_stats)):
Expand Down
Loading