Skip to content

Commit

Permalink
t/nvmept_fdp: accommodate devices with many RUHS
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vincentkfu committed Jul 15, 2024
1 parent 0e3c007 commit 791f697
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions t/nvmept_fdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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:
Expand All @@ -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'])
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 791f697

Please sign in to comment.