From cac4eec91113f73edaee28cf45a35c52ec5b5d3b Mon Sep 17 00:00:00 2001 From: Shi Jin Date: Mon, 30 Oct 2023 23:25:14 +0000 Subject: [PATCH] fabtests/pytest/common: Allow registering mr with dmabuf Add an input parameter for ClientServerTest to allow registering hmem memory via dmabuf. Signed-off-by: Shi Jin --- fabtests/pytest/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fabtests/pytest/common.py b/fabtests/pytest/common.py index dc2b6660b97..94b9cf17707 100644 --- a/fabtests/pytest/common.py +++ b/fabtests/pytest/common.py @@ -293,10 +293,12 @@ def __init__(self, cmdline_args, executable, memory_type="host_to_host", timeout=None, warmup_iteration_type=None, - completion_type="queue"): + completion_type="queue", + do_dmabuf_reg_for_hmem=False): self._cmdline_args = cmdline_args self._timeout = timeout or cmdline_args.timeout + self.do_dmabuf_reg_for_hmem = do_dmabuf_reg_for_hmem self._server_base_command, server_additonal_environment = self.prepare_base_command("server", executable, iteration_type, completion_semantic, prefix_type, datacheck_type, message_size, @@ -397,6 +399,10 @@ def prepare_base_command(self, command_type, executable, pytest.skip("no {} device".format(host_memory_type)) command += " -D " + host_memory_type + + if self.do_dmabuf_reg_for_hmem: + command += " -R" + additional_environment = None if "PYTEST_XDIST_WORKER" in os.environ: