Skip to content

Commit 2a24ac8

Browse files
vladumEdwardSro
authored andcommitted
rdma_topo: Run all checks, even when some fail
Today the 'check' command exits on the first check_fail(), so one bad ACS or additional check (e.g., iommu_group) hides later failures. Move the exit call from check_fail() to cmd_check() and print all results before deciding to exit with error. Signed-off-by: Vlad Dumitrescu <vdumitrescu@nvidia.com> Signed-off-by: Edward Srouji <edwards@nvidia.com>
1 parent 0434340 commit 2a24ac8

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

kernel-boot/rdma_topo

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,6 @@ def check_ok(msg: str):
936936

937937
def check_fail(msg: str):
938938
print(f"FAIL\t{msg}")
939-
sys.exit(100)
940939

941940

942941
def cmd_check(args):
@@ -948,12 +947,15 @@ def cmd_check(args):
948947
check_ok("All ConnectX DMA functions have correct PCI topology")
949948

950949
acs = topo.compute_acs()
950+
fatal = False
951951
for pdev, acs in sorted(acs.items(), key=lambda x: x[0].bdf):
952952
cur_acs = pdev.get_acs_ctrl()
953953
if cur_acs is None:
954954
check_fail(
955955
f"Could not read ACS control register for {pdev.device_type} {pdev.bdf}"
956956
)
957+
fatal = True
958+
continue
957959
new_acs = combine_acs(cur_acs, acs)
958960
if new_acs == cur_acs:
959961
check_ok(
@@ -963,10 +965,14 @@ def cmd_check(args):
963965
check_fail(
964966
f"ACS for {pdev.device_type} {pdev.bdf} has incorrect values {cur_acs:07b} != {acs}, (0x{cur_acs:x} != 0x{new_acs:x})"
965967
)
968+
fatal = True
966969

967970
for nvcx in topo.nvcxs:
968-
nvcx.check()
971+
if not nvcx.check():
972+
fatal = True
969973

974+
if fatal:
975+
sys.exit(100)
970976

971977
# -------------------------------------------------------------------
972978
def args_dump(parser):

0 commit comments

Comments
 (0)