From 791f697320637fb39375ce4a80c287afaff8f395 Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Mon, 15 Jul 2024 18:47:18 +0000 Subject: [PATCH] t/nvmept_fdp: accommodate devices with many RUHS Fio can only accept 128 placement IDs to write to. It is possible for namespaces to have thousands of placement IDs. Adjust the standard tests to acommodate this situation. Instead of just assuming that the device has fewer than 128 placement IDs, change the expected RUAMW calculations to also work for the case where the namespace has more than 128 placement IDs exceeds 128. Also adjust the scheme test to work where there are more RUHS than the max scheme entries allowed. Signed-off-by: Vincent Fu --- t/nvmept_fdp.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/t/nvmept_fdp.py b/t/nvmept_fdp.py index 1739e8fc2..31a54a1ef 100755 --- a/t/nvmept_fdp.py +++ b/t/nvmept_fdp.py @@ -36,6 +36,10 @@ from fiotestlib import FioJobCmdTest, run_fio_tests from fiotestcommon import SUCCESS_NONZERO +# This needs to match FIO_MAX_DP_IDS and DP_MAX_SCHEME_ENTRIES in +# dataplacement.h +FIO_MAX_DP_IDS = 128 +DP_MAX_SCHEME_ENTRIES = 32 class FDPTest(FioJobCmdTest): """ @@ -133,7 +137,7 @@ def setup(self, parameters): 'maxplid': FIO_FDP_NUMBER_PLIDS-1, # parameters for 400, 401 tests 'hole_size': 64*1024, - 'nios_for_scheme': FIO_FDP_NUMBER_PLIDS//2, + 'nios_for_scheme': min(FIO_FDP_NUMBER_PLIDS//2, DP_MAX_SCHEME_ENTRIES), } if 'number_ios' in self.fio_opts and isinstance(self.fio_opts['number_ios'], str): self.fio_opts['number_ios'] = eval(self.fio_opts['number_ios'].format(**mapping)) @@ -212,9 +216,10 @@ def _check_robin(self, plid_list, fdp_status): """ ruamw = [FIO_FDP_MAX_RUAMW] * FIO_FDP_NUMBER_PLIDS - remainder = int(self.fio_opts['number_ios'] % len(plid_list)) - whole = int((self.fio_opts['number_ios'] - remainder) / len(plid_list)) - logging.debug("PLIDs in the list should receive %d writes; %d PLIDs will receive one extra", + number_ios = self.fio_opts['number_ios'] % (len(plid_list)*FIO_FDP_MAX_RUAMW) + remainder = int(number_ios % len(plid_list)) + whole = int((number_ios - remainder) / len(plid_list)) + logging.debug("PLIDs in the list should show they have received %d writes; %d PLIDs will receive one extra", whole, remainder) for plid in plid_list: @@ -225,6 +230,9 @@ def _check_robin(self, plid_list, fdp_status): logging.debug("Expected ruamw values: %s", str(ruamw)) for idx, ruhs in enumerate(fdp_status['ruhss']): + if idx >= FIO_FDP_NUMBER_PLIDS: + break + if ruhs['ruamw'] != ruamw[idx]: logging.error("RUAMW mismatch with idx %d, pid %d, expected %d, observed %d", idx, ruhs['pid'], ruamw[idx], ruhs['ruamw']) @@ -1053,7 +1061,7 @@ def main(): test['fio_opts']['filename'] = args.dut fdp_status = get_fdp_status(args.dut) - FIO_FDP_NUMBER_PLIDS = fdp_status['nruhsd'] + FIO_FDP_NUMBER_PLIDS = min(fdp_status['nruhsd'], 128) update_all_ruhs(args.dut) FIO_FDP_MAX_RUAMW = check_all_ruhs(args.dut) if not FIO_FDP_MAX_RUAMW: