diff --git a/scripts/perf/nvmf/common.py b/scripts/perf/nvmf/common.py index affdd064c..a233df9e3 100644 --- a/scripts/perf/nvmf/common.py +++ b/scripts/perf/nvmf/common.py @@ -1,17 +1,4 @@ -import os -import re -import json -from itertools import product, chain -from subprocess import check_output, CalledProcessError, Popen - - -def get_used_numa_nodes(): - used_numa_nodes = set() - for bdf in get_nvme_devices_bdf(): - with open("/sys/bus/pci/devices/%s/numa_node" % bdf, "r") as numa_file: - output = numa_file.read() - used_numa_nodes.add(int(output)) - return used_numa_nodes +from subprocess import check_output def get_nvme_devices_count(): @@ -36,7 +23,3 @@ def get_nvme_devices(): output = [x for x in output.split("\n") if "nvme" in x] print("Done getting kernel NVMe names") return output - - -def nvmet_command(nvmet_bin, command): - return check_output("%s %s" % (nvmet_bin, command), shell=True).decode(encoding="utf-8") diff --git a/scripts/perf/nvmf/run_nvmf.py b/scripts/perf/nvmf/run_nvmf.py index 156e816ac..c4f02d553 100755 --- a/scripts/perf/nvmf/run_nvmf.py +++ b/scripts/perf/nvmf/run_nvmf.py @@ -1031,7 +1031,10 @@ class KernelTarget(Target): self.nvmet_bin = target_config["nvmet_bin"] def stop(self): - nvmet_command(self.nvmet_bin, "clear") + self.nvmet_command(self.nvmet_bin, "clear") + + def nvmet_command(self, nvmet_bin, command): + return self.exec_cmd([nvmet_bin, *(command.split(" "))]) def kernel_tgt_gen_subsystem_conf(self, nvme_list): @@ -1098,8 +1101,8 @@ class KernelTarget(Target): self.kernel_tgt_gen_subsystem_conf(nvme_list) self.subsys_no = len(nvme_list) - nvmet_command(self.nvmet_bin, "clear") - nvmet_command(self.nvmet_bin, "restore kernel.conf") + self.nvmet_command(self.nvmet_bin, "clear") + self.nvmet_command(self.nvmet_bin, "restore kernel.conf") if self.enable_adq: self.adq_configure_tc()