Commit 2e449d41 authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

scripts/nvmf_perf: group measurement options



Groupt variables used for enabling addtional
measurements together for better readibility.

Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Change-Id: If61de427294fea6ae9a2d5c53f74b6c9e5aa3e6a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15338


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent f5d6d594
Loading
Loading
Loading
Loading
+27 −25
Original line number Diff line number Diff line
@@ -370,6 +370,20 @@ class Target(Server):
        super().__init__(name, general_config, target_config)

        # Defaults
        self.enable_zcopy = False
        self.scheduler_name = "static"
        self.null_block = 0
        self._nics_json_obj = json.loads(self.exec_cmd(["ip", "-j", "address", "show"]))
        self.subsystem_info_list = []
        self.initiator_info = []
        self.nvme_allowlist = []
        self.nvme_blocklist = []

        # Target-side measurement options
        self.enable_pm = False
        self.pm_delay = 0
        self.pm_interval = 0
        self.pm_count = 1
        self.enable_sar = False
        self.sar_delay = 0
        self.sar_interval = 0
@@ -383,46 +397,34 @@ class Target(Server):
        self.bandwidth_count = 0
        self.enable_dpdk_memory = False
        self.dpdk_wait_time = 0
        self.enable_zcopy = False
        self.scheduler_name = "static"
        self.null_block = 0
        self._nics_json_obj = json.loads(self.exec_cmd(["ip", "-j", "address", "show"]))
        self.subsystem_info_list = []
        self.initiator_info = []
        self.enable_pm = False
        self.pm_delay = 0
        self.pm_interval = 0
        self.pm_count = 1
        self.nvme_allowlist = []
        self.nvme_blocklist = []

        if "null_block_devices" in target_config:
            self.null_block = target_config["null_block_devices"]
        if "sar_settings" in target_config:
            self.enable_sar, self.sar_delay, self.sar_interval, self.sar_count = target_config["sar_settings"]
        if "pcm_settings" in target_config:
            self.enable_pcm = True
            self.pcm_dir, self.pcm_delay, self.pcm_interval, self.pcm_count = target_config["pcm_settings"]
        if "enable_bandwidth" in target_config:
            self.enable_bandwidth, self.bandwidth_count = target_config["enable_bandwidth"]
        if "enable_dpdk_memory" in target_config:
            self.enable_dpdk_memory, self.dpdk_wait_time = target_config["enable_dpdk_memory"]
        if "scheduler_settings" in target_config:
            self.scheduler_name = target_config["scheduler_settings"]
        if "zcopy_settings" in target_config:
            self.enable_zcopy = target_config["zcopy_settings"]
        if "results_dir" in target_config:
            self.results_dir = target_config["results_dir"]
        if "pm_settings" in target_config:
            self.enable_pm, self.pm_delay, self.pm_interval, self.pm_count = target_config["pm_settings"]
            # Normalize pm_count - <= 0 means to loop indefinitely so let's avoid that to not block forever
            self.pm_count = self.pm_count if self.pm_count > 0 else 1
        if "blocklist" in target_config:
            self.nvme_blocklist = target_config["blocklist"]
        if "allowlist" in target_config:
            self.nvme_allowlist = target_config["allowlist"]
            # Blocklist takes precedence, remove common elements from allowlist
            self.nvme_allowlist = list(set(self.nvme_allowlist) - set(self.nvme_blocklist))
        if "pm_settings" in target_config:
            self.enable_pm, self.pm_delay, self.pm_interval, self.pm_count = target_config["pm_settings"]
            # Normalize pm_count - <= 0 means to loop indefinitely so let's avoid that to not block forever
            self.pm_count = self.pm_count if self.pm_count > 0 else 1
        if "sar_settings" in target_config:
            self.enable_sar, self.sar_delay, self.sar_interval, self.sar_count = target_config["sar_settings"]
        if "pcm_settings" in target_config:
            self.enable_pcm = True
            self.pcm_dir, self.pcm_delay, self.pcm_interval, self.pcm_count = target_config["pcm_settings"]
        if "enable_bandwidth" in target_config:
            self.enable_bandwidth, self.bandwidth_count = target_config["enable_bandwidth"]
        if "enable_dpdk_memory" in target_config:
            self.enable_dpdk_memory, self.dpdk_wait_time = target_config["enable_dpdk_memory"]

        self.log.info("Items now on allowlist: %s" % self.nvme_allowlist)
        self.log.info("Items now on blocklist: %s" % self.nvme_blocklist)