From f9dd94b5159ce5fe2b1eb2a09b1653863a8d70eb Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Tue, 2 Feb 2021 16:05:51 +0100 Subject: [PATCH] scripts/nvmf_perf: add adq_enable option to configuration file Parse the config file for "adq_enable" flag and enable the option in SPDK Target and SPDK Initiator configuration. At this point the flag has no effect on the generated traffic, as the system and priority queues are not configured properly. These settings will be added gradually in following patches. Change-Id: I5d7bc892f3aa7bbe691b7e0983294b56fcf994f5 Signed-off-by: Karol Latecki Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6260 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- scripts/perf/nvmf/README.md | 10 ++++++++++ scripts/perf/nvmf/run_nvmf.py | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/scripts/perf/nvmf/README.md b/scripts/perf/nvmf/README.md index d0f9a0598..52c7d4879 100644 --- a/scripts/perf/nvmf/README.md +++ b/scripts/perf/nvmf/README.md @@ -61,6 +61,11 @@ Number of shared buffers to use when creating transport layer. Boolean. If set to true - enable "dif_insert_or_strip" option for TCP transport layer. +### adq_enable + +Configure and use ADQ on selected system. Only available when using Intel E810 NICs. +Set to "true" to enable. + ## Initiator Describes initiator arguments. There can be more than one initiator section in the configuration file. @@ -107,6 +112,11 @@ by default. Not used if "mode" is set to "spdk". Path to the fio binary that will be used to compile SPDK and run the test. If not specified, then the script will use /usr/src/fio/fio as the default. +### adq_enable + +Configure and use ADQ on selected system. Only available when using Intel E810 NICs. +Set to "true" to enable. + ### extra_params Space separated string with additional settings for "nvme connect" command diff --git a/scripts/perf/nvmf/run_nvmf.py b/scripts/perf/nvmf/run_nvmf.py index ac5999be9..aef600c14 100755 --- a/scripts/perf/nvmf/run_nvmf.py +++ b/scripts/perf/nvmf/run_nvmf.py @@ -31,6 +31,12 @@ class Server: self.local_nic_info = [] self._nics_json_obj = {} + self.enable_adq = False + self.adq_priority = None + if "adq_enable" in server_config and server_config["adq_enable"]: + self.enable_adq = server_config["adq_enable"] + self.adq_priority = 1 + if not re.match("^[A-Za-z0-9]*$", name): self.log_print("Please use a name which contains only letters or numbers") sys.exit(1) @@ -705,7 +711,8 @@ class SPDKTarget(Target): # Create RDMA transport layer rpc.nvmf.nvmf_create_transport(self.client, trtype=self.transport, num_shared_buffers=self.num_shared_buffers, - dif_insert_or_strip=self.dif_insert_strip) + dif_insert_or_strip=self.dif_insert_strip, + sock_priority=self.adq_priority) self.log_print("SPDK NVMeOF transport layer:") rpc.client.print_dict(rpc.nvmf.nvmf_get_transports(self.client)) @@ -809,6 +816,12 @@ class SPDKTarget(Target): self.log_print("Target socket options:") rpc.client.print_dict(rpc.sock.sock_impl_get_options(self.client, impl_name="posix")) + if self.enable_adq: + rpc.sock.sock_impl_set_options(self.client, impl_name="posix", enable_placement_id=1) + rpc.bdev.bdev_nvme_set_options(self.client, timeout_us=0, action_on_timeout=None, + nvme_adminq_poll_period_us=100000, retry_count=4) + rpc.nvmf.nvmf_set_config(self.client, acceptor_poll_rate=10000) + rpc.app.framework_set_scheduler(self.client, name=self.scheduler_name) rpc.framework_start_init(self.client) @@ -926,6 +939,10 @@ class SPDKInitiator(Initiator): "adrfam": "IPv4" } } + + if self.enable_adq: + nvme_ctrl["params"].update({"priority": "1"}) + bdev_cfg_section["subsystems"][0]["config"].append(nvme_ctrl) return json.dumps(bdev_cfg_section, indent=2)