Commit 66f42f37 authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

perf/nvmf: set protection information on null bdevs



Use --dif-type and --md-size option for bdev_null_create
rpc when creating null bdevs. Needed for DIF/DIX comparison
tests.

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


Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 7049fe93
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -38,6 +38,11 @@ So for example providing 2 IP's with 16 NVMe drives present will result in each
Integer. Use null block devices instead of present NVMe drives.
If set to 1, can be used for latency measurements as described in Test Case 3 of performance report.

### null_block_dif_type

Integer. Enable data protection on created null block device. Defaults to 0 if option
not present in JSON configuration file. See doc/jsonrpc.md "bdev_null_create" for details.

### num_cores

List of CPU cores to assign for running SPDK NVMe-OF Target process. Can specify exact core numbers or ranges, eg:
+10 −2
Original line number Diff line number Diff line
@@ -558,7 +558,7 @@ class KernelTarget(Target):
class SPDKTarget(Target):

    def __init__(self, name, username, password, mode, nic_ips, transport="rdma",
                 null_block_devices=0, sar_settings=None, pcm_settings=None,
                 null_block_devices=0, null_block_dif_type=0, sar_settings=None, pcm_settings=None,
                 bandwidth_settings=None, dpdk_settings=None, num_shared_buffers=4096,
                 num_cores=1, **kwargs):

@@ -567,6 +567,7 @@ class SPDKTarget(Target):
                                         dpdk_settings)
        self.num_cores = num_cores
        self.num_shared_buffers = num_shared_buffers
        self.null_block_dif_type = null_block_dif_type

    def spdk_tgt_configure(self):
        self.log_print("Configuring SPDK NVMeOF target via RPC")
@@ -586,9 +587,16 @@ class SPDKTarget(Target):
        self.log_print("Done configuring SPDK NVMeOF Target")

    def spdk_tgt_add_nullblock(self, null_block_count):
        md_size = 0
        block_size = 4096
        if self.null_block_dif_type != 0:
            md_size = 128

        self.log_print("Adding null block bdevices to config via RPC")
        for i in range(null_block_count):
            rpc.bdev.bdev_null_create(self.client, 102400, 4096, "Nvme{}n1".format(i))
            self.log_print("Setting bdev protection to :%s" % self.null_block_dif_type)
            rpc.bdev.bdev_null_create(self.client, 102400, block_size + md_size, "Nvme{}n1".format(i),
                                      dif_type=self.null_block_dif_type, md_size=md_size)
        self.log_print("SPDK Bdevs configuration:")
        rpc.client.print_dict(rpc.bdev.bdev_get_bdevs(self.client))