Skip to content

Commit

Permalink
Merge bcde759 into 8f0e4d0
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-adler committed Jun 17, 2024
2 parents 8f0e4d0 + bcde759 commit b5ed5e0
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit b5ed5e0

Please sign in to comment.