Commit b7e49409 authored by John Kariuki's avatar John Kariuki Committed by Tomasz Zawadzki
Browse files

scripts/nvmf_perf: enable idxd in nvmf_tgt



Add configuration options to enable using IDXD
for data digest during NVMe-oF performance testing.

Change-Id: I54d443c35c67e0331e3d6ec4aecb577fc7f544c7
Signed-off-by: default avatarJohn Kariuki <John.K.Kariuki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10282


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 8a6c8ba9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -152,6 +152,9 @@ Optional, SPDK Target only:
  for ADQ testing. You need and ADQ-capable NIC like the Intel E810.
- bpf_scripts - list of bpftrace scripts that will be attached during the
  test run. Available scripts can be found in the spdk/scripts/bpf directory.
- idxd_settings - bool. Only for TCP transport. Enable offloading CRC32C
  calculation to IDXD. You need a CPU with the Intel(R) Data Streaming
  Accelerator (DSA) engine.

### Initiator system settings section

@@ -226,6 +229,10 @@ Optional, SPDK Initiator only:
- adq_enable - bool; only for TCP transport. Configure system modules, NIC
  settings and create priority traffic classes for ADQ testing.
  You need an ADQ-capable NIC like Intel E810.
- enable_data_digest - bool; only for TCP transport. Enable the data
  digest for the bdev controller. The target can use IDXD to calculate the
  data digest or fallback to a software optimized implementation on system
  that don't have the Intel(R) Data Streaming Accelerator (DSA) engine.

### Fio settings section

+18 −1
Original line number Diff line number Diff line
@@ -1054,6 +1054,7 @@ class SPDKTarget(Target):
        self.num_shared_buffers = 4096
        self.bpf_proc = None
        self.bpf_scripts = []
        self.enable_idxd = False

        if "num_shared_buffers" in target_config:
            self.num_shared_buffers = target_config["num_shared_buffers"]
@@ -1063,6 +1064,11 @@ class SPDKTarget(Target):
            self.dif_insert_strip = target_config["dif_insert_strip"]
        if "bpf_scripts" in target_config:
            self.bpf_scripts = target_config["bpf_scripts"]
        if "idxd_settings" in target_config:
            self.enable_idxd = target_config["idxd_settings"]

        self.log_print("====IDXD settings:====")
        self.log_print("IDXD enabled: %s" % (self.enable_idxd))

    def get_num_cores(self, core_mask):
        if "0x" in core_mask:
@@ -1219,8 +1225,11 @@ class SPDKTarget(Target):
            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.app.framework_set_scheduler(self.client, name=self.scheduler_name)
        if self.enable_idxd:
            rpc.idxd.idxd_scan_accel_engine(self.client, config_number=0, config_kernel_mode=None)
            self.log_print("Target IDXD accel engine enabled")

        rpc.app.framework_set_scheduler(self.client, name=self.scheduler_name)
        rpc.framework_start_init(self.client)

        if self.bpf_scripts:
@@ -1340,6 +1349,11 @@ class SPDKInitiator(Initiator):
        # Required fields
        self.num_cores = initiator_config["num_cores"]

        # Optional fields
        self.enable_data_digest = False
        if "enable_data_digest" in initiator_config:
            self.enable_data_digest = initiator_config["enable_data_digest"]

    def install_spdk(self):
        self.log_print("Using fio binary %s" % self.fio_bin)
        self.exec_cmd(["git", "-C", self.spdk_dir, "submodule", "update", "--init"])
@@ -1378,6 +1392,9 @@ class SPDKInitiator(Initiator):
            if self.enable_adq:
                nvme_ctrl["params"].update({"priority": "1"})

            if self.enable_data_digest:
                nvme_ctrl["params"].update({"ddgst": self.enable_data_digest})

            bdev_cfg_section["subsystems"][0]["config"].append(nvme_ctrl)

        return json.dumps(bdev_cfg_section, indent=2)