Skip to content

Commit

Permalink
t/nvmept_pi: add support for xNVMe ioengine
Browse files Browse the repository at this point in the history
Add a command-line option to run this script using the xNVMe ioengine
with the async io_uring_cmd backend. The default remains to use the
io_uring_cmd ioengine.

Example:

python3 t/nvmept_pi.py --dut /dev/ng1n1 --lbaf 6 --ioengine xnvme --fio ./fio

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
vincentkfu committed Mar 7, 2024
1 parent 450cc0c commit b140fc5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions t/nvmept_pi.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def setup(self, parameters):

fio_args = [
"--name=nvmept_pi",
"--ioengine=io_uring_cmd",
"--cmd_type=nvme",
f"--ioengine={self.fio_opts['ioengine']}",
f"--filename={self.fio_opts['filename']}",
f"--rw={self.fio_opts['rw']}",
f"--bsrange={self.fio_opts['bsrange']}",
Expand All @@ -63,6 +62,12 @@ def setup(self, parameters):
option = f"--{opt}={self.fio_opts[opt]}"
fio_args.append(option)

if self.fio_opts['ioengine'] == 'io_uring_cmd':
fio_args.append('--cmd_type=nvme')
elif self.fio_opts['ioengine'] == 'xnvme':
fio_args.append('--thread=1')
fio_args.append('--xnvme_async=io_uring_cmd')

super().setup(fio_args)


Expand Down Expand Up @@ -686,6 +691,7 @@ def parse_args():
'(e.g., /dev/ng0n1). WARNING: THIS IS A DESTRUCTIVE TEST', required=True)
parser.add_argument('-l', '--lbaf', nargs='+', type=int,
help='list of lba formats to test')
parser.add_argument('-i', '--ioengine', default='io_uring_cmd')
args = parser.parse_args()

return args
Expand Down Expand Up @@ -906,6 +912,7 @@ def main():

for test in TEST_LIST:
test['fio_opts']['filename'] = args.dut
test['fio_opts']['ioengine'] = args.ioengine

test_env = {
'fio_path': fio_path,
Expand Down

0 comments on commit b140fc5

Please sign in to comment.