diff options
Diffstat (limited to 'src/spdk/test/config_converter')
-rw-r--r-- | src/spdk/test/config_converter/config.ini | 151 | ||||
-rw-r--r-- | src/spdk/test/config_converter/config_virtio.ini | 21 | ||||
-rw-r--r-- | src/spdk/test/config_converter/spdk_config.json | 481 | ||||
-rw-r--r-- | src/spdk/test/config_converter/spdk_config_virtio.json | 138 | ||||
-rwxr-xr-x | src/spdk/test/config_converter/test_converter.sh | 23 |
5 files changed, 814 insertions, 0 deletions
diff --git a/src/spdk/test/config_converter/config.ini b/src/spdk/test/config_converter/config.ini new file mode 100644 index 00000000..2d71f982 --- /dev/null +++ b/src/spdk/test/config_converter/config.ini @@ -0,0 +1,151 @@ +#comment1 +[Global] + Comment "Global section"#comment2 + ReactorMask 0xF #comment3 +#comment4 + #comment5 +[Nvmf] + MaxQueuesPerSession 4 + MaxQueueDepth 128 + InCapsuleDataSize 4096 + MaxIOSize 131072 + AcceptorPollRate 10000 + IOUnitSize 131072 + +[Nvme] + TransportID "trtype:PCIe traddr:0000:00:04.0" Nvme0 + +[Bdev] + BdevIoPoolSize 65536 + BdevIoCacheSize 256 + +[Split] + Split Nvme0n1 8 + +[Nvme] + RetryCount 4 + TimeoutUsec 0 + ActionOnTimeout None + AdminPollRate 100000 + HotplugEnable Yes + +[iSCSI] + NodeBase "iqn.2016-06.io.spdk" + AuthFile /usr/local/etc/spdk/auth.conf + Timeout 30 + DiscoveryAuthMethod Auto + DiscoveryAuthGroup AuthGroup1 + MaxSessions 16 + ImmediateData Yes + ErrorRecoveryLevel 0 + MaxR2T 256 + NopInInterval 10 + AllowDuplicateIsid Yes + MinConnectionsPerCore 4 + DefaultTime2Wait 2 + QueueDepth 128 + +[Malloc] + NumberOfLuns 8 + LunSizeInMB 128 + BlockSize 4096 + +[Pmem] + Blk /tmp/sample_pmem Pmem0 + +[AIO] + AIO /tmp/sample_aio0 AIO0 2048 + AIO /tmp/sample_aio1 AIO1 2048 + AIO /tmp/sample_aio2 AIO2 2048 + AIO /tmp/sample_aio1 AIO3 2048 + AIO /tmp/sample_aio2 AIO4 2048 + +[VhostBlk0] + Name vhost.1 + Dev Malloc6 + ReadOnly yes + Cpumask 0x1 + +[VhostScsi0] + Name naa.vhost.0 + Target 0 Malloc4 + Target 1 AIO3 + Target 2 Nvme0n1p2 + # Target 3 Nvme1n1p2 + Cpumask 0x1 + +[VhostScsi1] + Name naa.vhost.1 + Target 0 AIO4 + Cpumask 0x1 + +[VhostBlk1] + Name naa.vhost.2 + Dev Malloc5 + ReadOnly no + Cpumask 0x1 + +[VhostNvme0] + Name naa.vhost.3 + NumberOfQueues 2 + Namespace Nvme0n1p0 + Namespace Nvme0n1p1 + Cpumask 0x1 + +[Subsystem1] + NQN nqn.2016-06.io.spdk:cnode1 + Listen RDMA 10.0.2.15:4420 + AllowAnyHost No + Host nqn.2016-06.io.spdk:init + SN SPDK00000000000001 + MaxNamespaces 20 + Namespace Nvme0n1p5 1 + Namespace Nvme0n1p6 2 + +[Subsystem2] + NQN nqn.2016-06.io.spdk:cnode2 + Listen RDMA 10.0.2.15:4421 + AllowAnyHost No + Host nqn.2016-06.io.spdk:init + SN SPDK00000000000002 + Namespace Malloc1 + Namespace Malloc2 + Namespace AIO0 + Namespace AIO1 + +[InitiatorGroup1] + InitiatorName ANY + Netmask 127.0.0.1/32 + +[PortalGroup1] + Portal DA1 127.0.0.1:4000 + Portal DA2 127.0.0.1:4001@0xF + +[TargetNode1] + TargetName disk1 + TargetAlias "Data Disk1" + Mapping PortalGroup1 InitiatorGroup1 + AuthMethod Auto + AuthGroup AuthGroup1 + # Enable header and data digest + # UseDigest Header Data + UseDigest Auto + # Use the first malloc target + LUN0 Malloc0 + # Using the first AIO target + LUN1 AIO2 + # Using the second storage target + LUN2 AIO3 + # Using the third storage target + LUN3 AIO4 + QueueDepth 128 + +[TargetNode2] + TargetName disk2 + TargetAlias "Data Disk2" + Mapping PortalGroup1 InitiatorGroup1 + AuthMethod Auto + AuthGroup AuthGroup1 + UseDigest Auto + LUN0 Nvme0n1p3 + QueueDepth 32 diff --git a/src/spdk/test/config_converter/config_virtio.ini b/src/spdk/test/config_converter/config_virtio.ini new file mode 100644 index 00000000..b2b7f4c7 --- /dev/null +++ b/src/spdk/test/config_converter/config_virtio.ini @@ -0,0 +1,21 @@ +[VirtioUser0] + Path naa.vhost.0 + Queues 8 + +[VirtioUser1] + Path naa.vhost.1 + Queues 8 + +#[VirtioUser2] +# Path naa.vhost.3 +# Queues 8 + +#[VirtioUser3] +# Path naa.vhost.2 +# Type Blk +# Queues 8 + +[VirtioUser4] + Path vhost.1 + Type Blk +# Queues 8 diff --git a/src/spdk/test/config_converter/spdk_config.json b/src/spdk/test/config_converter/spdk_config.json new file mode 100644 index 00000000..4b4ba572 --- /dev/null +++ b/src/spdk/test/config_converter/spdk_config.json @@ -0,0 +1,481 @@ +{ + "subsystems": [ + { + "subsystem": "copy", + "config": null + }, + { + "subsystem": "interface", + "config": null + }, + { + "subsystem": "net_framework", + "config": null + }, + { + "subsystem": "bdev", + "config": [ + { + "params": { + "bdev_io_pool_size": 65536, + "bdev_io_cache_size": 256 + }, + "method": "set_bdev_options" + }, + { + "params": { + "base_bdev": "Nvme0n1", + "split_size_mb": 0, + "split_count": 8 + }, + "method": "construct_split_vbdev" + }, + { + "params": { + "retry_count": 4, + "timeout_us": 0, + "nvme_adminq_poll_period_us": 100000, + "action_on_timeout": "none" + }, + "method": "set_bdev_nvme_options" + }, + { + "params": { + "trtype": "PCIe", + "name": "Nvme0", + "traddr": "0000:00:04.0" + }, + "method": "construct_nvme_bdev" + }, + { + "params": { + "enable": true, + "period_us": 10000000 + }, + "method": "set_bdev_nvme_hotplug" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc0" + }, + "method": "construct_malloc_bdev" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc1" + }, + "method": "construct_malloc_bdev" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc2" + }, + "method": "construct_malloc_bdev" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc3" + }, + "method": "construct_malloc_bdev" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc4" + }, + "method": "construct_malloc_bdev" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc5" + }, + "method": "construct_malloc_bdev" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc6" + }, + "method": "construct_malloc_bdev" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc7" + }, + "method": "construct_malloc_bdev" + }, + { + "params": { + "block_size": 2048, + "name": "AIO0", + "filename": "/tmp/sample_aio0" + }, + "method": "construct_aio_bdev" + }, + { + "params": { + "block_size": 2048, + "name": "AIO1", + "filename": "/tmp/sample_aio1" + }, + "method": "construct_aio_bdev" + }, + { + "params": { + "block_size": 2048, + "name": "AIO2", + "filename": "/tmp/sample_aio2" + }, + "method": "construct_aio_bdev" + }, + { + "params": { + "block_size": 2048, + "name": "AIO3", + "filename": "/tmp/sample_aio1" + }, + "method": "construct_aio_bdev" + }, + { + "params": { + "block_size": 2048, + "name": "AIO4", + "filename": "/tmp/sample_aio2" + }, + "method": "construct_aio_bdev" + }, + { + "params": { + "name": "Pmem0", + "pmem_file": "/tmp/sample_pmem" + }, + "method": "construct_pmem_bdev" + } + ] + }, + { + "subsystem": "scsi", + "config": null + }, + { + "subsystem": "nvmf", + "config": [ + { + "params": { + "acceptor_poll_rate": 10000 + }, + "method": "set_nvmf_target_config" + }, + { + "params": { + "in_capsule_data_size": 4096, + "io_unit_size": 131072, + "max_qpairs_per_ctrlr": 4, + "max_queue_depth": 128, + "max_io_size": 131072, + "max_subsystems": 1024 + }, + "method": "set_nvmf_target_options" + }, + { + "params": { + "max_namespaces": 20, + "listen_addresses": [ + { + "trtype": "RDMA", + "adrfam": "IPv4", + "trsvcid": "4420", + "traddr": "10.0.2.15" + } + ], + "hosts": [ + "nqn.2016-06.io.spdk:init" + ], + "namespaces": [ + { + "bdev_name": "Nvme0n1p5", + "nsid": 1 + }, + { + "bdev_name": "Nvme0n1p6", + "nsid": 2 + } + ], + "allow_any_host": false, + "serial_number": "SPDK00000000000001", + "nqn": "nqn.2016-06.io.spdk:cnode1" + }, + "method": "construct_nvmf_subsystem" + }, + { + "params": { + "listen_addresses": [ + { + "trtype": "RDMA", + "adrfam": "IPv4", + "trsvcid": "4421", + "traddr": "10.0.2.15" + } + ], + "hosts": [ + "nqn.2016-06.io.spdk:init" + ], + "namespaces": [ + { + "bdev_name": "Malloc1", + "nsid": 1 + }, + { + "bdev_name": "Malloc2", + "nsid": 2 + }, + { + "bdev_name": "AIO0", + "nsid": 3 + }, + { + "bdev_name": "AIO1", + "nsid": 4 + } + ], + "allow_any_host": false, + "serial_number": "SPDK00000000000002", + "nqn": "nqn.2016-06.io.spdk:cnode2" + }, + "method": "construct_nvmf_subsystem" + } + ] + }, + { + "subsystem": "nbd", + "config": [] + }, + { + "subsystem": "vhost", + "config": [ + { + "params": { + "cpumask": "1", + "ctrlr": "naa.vhost.0" + }, + "method": "construct_vhost_scsi_controller" + }, + { + "params": { + "scsi_target_num": 0, + "bdev_name": "Malloc4", + "ctrlr": "naa.vhost.0" + }, + "method": "add_vhost_scsi_lun" + }, + { + "params": { + "scsi_target_num": 1, + "bdev_name": "AIO3", + "ctrlr": "naa.vhost.0" + }, + "method": "add_vhost_scsi_lun" + }, + { + "params": { + "scsi_target_num": 2, + "bdev_name": "Nvme0n1p2", + "ctrlr": "naa.vhost.0" + }, + "method": "add_vhost_scsi_lun" + }, + { + "params": { + "cpumask": "1", + "ctrlr": "naa.vhost.1" + }, + "method": "construct_vhost_scsi_controller" + }, + { + "params": { + "scsi_target_num": 0, + "bdev_name": "AIO4", + "ctrlr": "naa.vhost.1" + }, + "method": "add_vhost_scsi_lun" + }, + { + "params": { + "dev_name": "Malloc6", + "readonly": true, + "ctrlr": "vhost.1", + "cpumask": "1" + }, + "method": "construct_vhost_blk_controller" + }, + { + "params": { + "dev_name": "Malloc5", + "readonly": false, + "ctrlr": "naa.vhost.2", + "cpumask": "1" + }, + "method": "construct_vhost_blk_controller" + }, + { + "params": { + "cpumask": "1", + "io_queues": 2, + "ctrlr": "naa.vhost.3" + }, + "method": "construct_vhost_nvme_controller" + }, + { + "params": { + "bdev_name": "Nvme0n1p0", + "ctrlr": "naa.vhost.3" + }, + "method": "add_vhost_nvme_ns" + }, + { + "params": { + "bdev_name": "Nvme0n1p1", + "ctrlr": "naa.vhost.3" + }, + "method": "add_vhost_nvme_ns" + } + ] + }, + { + "subsystem": "iscsi", + "config": [ + { + "params": { + "allow_duplicated_isid": true, + "default_time2retain": 20, + "mutual_chap": false, + "require_chap": false, + "immediate_data": true, + "node_base": "iqn.2016-06.io.spdk", + "nop_in_interval": 10, + "max_connections_per_session": 2, + "first_burst_length": 8192, + "max_queue_depth": 64, + "nop_timeout": 30, + "chap_group": 1, + "max_sessions": 16, + "error_recovery_level": 0, + "disable_chap": false, + "auth_file": "/usr/local/etc/spdk/auth.conf", + "min_connections_per_core": 4, + "default_time2wait": 2 + }, + "method": "set_iscsi_options" + }, + { + "params": { + "portals": [ + { + "cpumask": "0x1", + "host": "127.0.0.1", + "port": "4000" + }, + { + "cpumask": "0x1", + "host": "127.0.0.1", + "port": "4001" + } + ], + "tag": 1 + }, + "method": "add_portal_group" + }, + { + "params": { + "initiators": [ + "ANY" + ], + "tag": 1, + "netmasks": [ + "127.0.0.1/32" + ] + }, + "method": "add_initiator_group" + }, + { + "params": { + "luns": [ + { + "lun_id": 0, + "bdev_name": "Malloc0" + }, + { + "lun_id": 1, + "bdev_name": "AIO2" + }, + { + "lun_id": 2, + "bdev_name": "AIO3" + }, + { + "lun_id": 3, + "bdev_name": "AIO4" + } + ], + "mutual_chap": false, + "name": "iqn.2016-06.io.spdk:disk1", + "alias_name": "Data Disk1", + "require_chap": false, + "chap_group": 1, + "pg_ig_maps": [ + { + "ig_tag": 1, + "pg_tag": 1 + } + ], + "data_digest": false, + "disable_chap": false, + "header_digest": false, + "queue_depth": 64 + }, + "method": "construct_target_node" + }, + { + "params": { + "luns": [ + { + "lun_id": 0, + "bdev_name": "Nvme0n1p3" + } + ], + "mutual_chap": false, + "name": "iqn.2016-06.io.spdk:disk2", + "alias_name": "Data Disk2", + "require_chap": false, + "chap_group": 1, + "pg_ig_maps": [ + { + "ig_tag": 1, + "pg_tag": 1 + } + ], + "data_digest": false, + "disable_chap": false, + "header_digest": false, + "queue_depth": 32 + }, + "method": "construct_target_node" + } + ] + } + ] +} diff --git a/src/spdk/test/config_converter/spdk_config_virtio.json b/src/spdk/test/config_converter/spdk_config_virtio.json new file mode 100644 index 00000000..00391f0b --- /dev/null +++ b/src/spdk/test/config_converter/spdk_config_virtio.json @@ -0,0 +1,138 @@ +{ + "subsystems": [ + { + "subsystem": "copy", + "config": null + }, + { + "subsystem": "interface", + "config": null + }, + { + "subsystem": "net_framework", + "config": null + }, + { + "subsystem": "bdev", + "config": [ + { + "params": { + "bdev_io_pool_size": 65536, + "bdev_io_cache_size": 256 + }, + "method": "set_bdev_options" + }, + { + "params": { + "retry_count": 4, + "timeout_us": 0, + "nvme_adminq_poll_period_us": 1000000, + "action_on_timeout": "none" + }, + "method": "set_bdev_nvme_options" + }, + { + "params": { + "enable": false, + "period_us": 100000 + }, + "method": "set_bdev_nvme_hotplug" + }, + { + "params": { + "name": "VirtioScsi0", + "dev_type": "scsi", + "vq_size": 512, + "trtype": "user", + "traddr": "naa.vhost.0", + "vq_count": 8 + }, + "method": "construct_virtio_dev" + }, + { + "params": { + "name": "VirtioScsi1", + "dev_type": "scsi", + "vq_size": 512, + "trtype": "user", + "traddr": "naa.vhost.1", + "vq_count": 8 + }, + "method": "construct_virtio_dev" + }, + { + "params": { + "name": "VirtioBlk4", + "dev_type": "blk", + "vq_size": 512, + "trtype": "user", + "traddr": "vhost.1", + "vq_count": 1 + }, + "method": "construct_virtio_dev" + } + ] + }, + { + "subsystem": "scsi", + "config": null + }, + { + "subsystem": "nvmf", + "config": [ + { + "params": { + "acceptor_poll_rate": 10000 + }, + "method": "set_nvmf_target_config" + }, + { + "params": { + "in_capsule_data_size": 4096, + "io_unit_size": 131072, + "max_qpairs_per_ctrlr": 64, + "max_queue_depth": 128, + "max_io_size": 131072, + "max_subsystems": 1024 + }, + "method": "set_nvmf_target_options" + } + ] + }, + { + "subsystem": "nbd", + "config": [] + }, + { + "subsystem": "vhost", + "config": [] + }, + { + "subsystem": "iscsi", + "config": [ + { + "params": { + "allow_duplicated_isid": false, + "default_time2retain": 20, + "mutual_chap": false, + "require_chap": false, + "immediate_data": true, + "node_base": "iqn.2016-06.io.spdk", + "nop_in_interval": 30, + "max_connections_per_session": 2, + "first_burst_length": 8192, + "max_queue_depth": 64, + "nop_timeout": 60, + "chap_group": 0, + "max_sessions": 128, + "error_recovery_level": 0, + "disable_chap": false, + "min_connections_per_core": 4, + "default_time2wait": 2 + }, + "method": "set_iscsi_options" + } + ] + } + ] +} diff --git a/src/spdk/test/config_converter/test_converter.sh b/src/spdk/test/config_converter/test_converter.sh new file mode 100755 index 00000000..5594df2d --- /dev/null +++ b/src/spdk/test/config_converter/test_converter.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +CONVERTER_DIR=$(readlink -f $(dirname $0)) +SPDK_BUILD_DIR=$CONVERTER_DIR/../../ +source $CONVERTER_DIR/../common/autotest_common.sh + +function test_cleanup() { + rm -f $CONVERTER_DIR/config_converter.json $CONVERTER_DIR/config_virtio_converter.json +} + +function on_error_exit() { + set +e + test_cleanup + print_backtrace + exit 1 +} + +trap 'on_error_exit' ERR + +cat $CONVERTER_DIR/config.ini | python3 $SPDK_BUILD_DIR/scripts/config_converter.py > $CONVERTER_DIR/config_converter.json +cat $CONVERTER_DIR/config_virtio.ini | python3 $SPDK_BUILD_DIR/scripts/config_converter.py > $CONVERTER_DIR/config_virtio_converter.json +diff -I "cpumask" -I "max_queue_depth" -I "queue_depth" <(jq -S . $CONVERTER_DIR/config_converter.json) <(jq -S . $CONVERTER_DIR/spdk_config.json) +diff <(jq -S . $CONVERTER_DIR/config_virtio_converter.json) <(jq -S . $CONVERTER_DIR/spdk_config_virtio.json) +test_cleanup |