diff options
Diffstat (limited to 'src/spdk/test/config_converter')
-rw-r--r-- | src/spdk/test/config_converter/config.ini | 153 | ||||
-rw-r--r-- | src/spdk/test/config_converter/config_virtio.ini | 21 | ||||
-rw-r--r-- | src/spdk/test/config_converter/spdk_config.json | 526 | ||||
-rw-r--r-- | src/spdk/test/config_converter/spdk_config_virtio.json | 133 | ||||
-rwxr-xr-x | src/spdk/test/config_converter/test_converter.sh | 26 |
5 files changed, 859 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 000000000..bbfc17373 --- /dev/null +++ b/src/spdk/test/config_converter/config.ini @@ -0,0 +1,153 @@ +#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 + IOPollRate 0 + 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 + 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 + MN SPDK_Controller1 + 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 + MN SPDK_Controller2 + 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 000000000..b2b7f4c71 --- /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 000000000..af8dcfbcc --- /dev/null +++ b/src/spdk/test/config_converter/spdk_config.json @@ -0,0 +1,526 @@ +{ + "subsystems": [ + { + "subsystem": "accel", + "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": "bdev_set_options" + }, + { + "params": { + "base_bdev": "Nvme0n1", + "split_size_mb": 0, + "split_count": 8 + }, + "method": "bdev_split_create" + }, + { + "params": { + "retry_count": 4, + "timeout_us": 0, + "nvme_adminq_poll_period_us": 100000, + "nvme_ioq_poll_period_us": 0, + "action_on_timeout": "none" + }, + "method": "bdev_nvme_set_options" + }, + { + "params": { + "trtype": "PCIe", + "name": "Nvme0", + "traddr": "0000:00:04.0" + }, + "method": "bdev_nvme_attach_controller" + }, + { + "params": { + "enable": true, + "period_us": 10000000 + }, + "method": "bdev_nvme_set_hotplug" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc0" + }, + "method": "bdev_malloc_create" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc1" + }, + "method": "bdev_malloc_create" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc2" + }, + "method": "bdev_malloc_create" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc3" + }, + "method": "bdev_malloc_create" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc4" + }, + "method": "bdev_malloc_create" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc5" + }, + "method": "bdev_malloc_create" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc6" + }, + "method": "bdev_malloc_create" + }, + { + "params": { + "block_size": 4096, + "num_blocks": 32768, + "name": "Malloc7" + }, + "method": "bdev_malloc_create" + }, + { + "params": { + "block_size": 2048, + "name": "AIO0", + "filename": "/tmp/sample_aio0" + }, + "method": "bdev_aio_create" + }, + { + "params": { + "block_size": 2048, + "name": "AIO1", + "filename": "/tmp/sample_aio1" + }, + "method": "bdev_aio_create" + }, + { + "params": { + "block_size": 2048, + "name": "AIO2", + "filename": "/tmp/sample_aio2" + }, + "method": "bdev_aio_create" + }, + { + "params": { + "block_size": 2048, + "name": "AIO3", + "filename": "/tmp/sample_aio1" + }, + "method": "bdev_aio_create" + }, + { + "params": { + "block_size": 2048, + "name": "AIO4", + "filename": "/tmp/sample_aio2" + }, + "method": "bdev_aio_create" + }, + { + "params": { + "name": "Pmem0", + "pmem_file": "/tmp/sample_pmem" + }, + "method": "bdev_pmem_create" + } + ] + }, + { + "subsystem": "scsi", + "config": null + }, + { + "subsystem": "nvmf", + "config": [ + { + "params": { + "acceptor_poll_rate": 10000 + }, + "method": "nvmf_set_config" + }, + { + "params": { + "max_subsystems": 1024 + }, + "method": "nvmf_set_max_subsystems" + }, + { + "params": { + "max_namespaces": 20, + "allow_any_host": false, + "serial_number": "SPDK00000000000001", + "model_number": "SPDK_Controller1", + "nqn": "nqn.2016-06.io.spdk:cnode1" + }, + "method": "nvmf_create_subsystem" + }, + { + "params": { + "listen_address": { + "adrfam": "IPv4", + "traddr": "10.0.2.15", + "trsvcid": "4420", + "trtype": "RDMA" + }, + "nqn": "nqn.2016-06.io.spdk:cnode1" + }, + "method": "nvmf_subsystem_add_listener" + }, + { + "params": { + "host": "nqn.2016-06.io.spdk:init", + "nqn": "nqn.2016-06.io.spdk:cnode1" + }, + "method": "nvmf_subsystem_add_host" + }, + { + "params": { + "namespace": { + "bdev_name": "Nvme0n1p5", + "nsid": 1 + }, + "nqn": "nqn.2016-06.io.spdk:cnode1" + }, + "method": "nvmf_subsystem_add_ns" + }, + { + "params": { + "namespace": { + "bdev_name": "Nvme0n1p6", + "nsid": 2 + }, + "nqn": "nqn.2016-06.io.spdk:cnode1" + }, + "method": "nvmf_subsystem_add_ns" + }, + { + "params": { + "allow_any_host": false, + "serial_number": "SPDK00000000000002", + "model_number": "SPDK_Controller2", + "nqn": "nqn.2016-06.io.spdk:cnode2" + }, + "method": "nvmf_create_subsystem" + }, + { + "method": "nvmf_subsystem_add_listener", + "params": { + "listen_address": { + "adrfam": "IPv4", + "traddr": "10.0.2.15", + "trsvcid": "4421", + "trtype": "RDMA" + }, + "nqn": "nqn.2016-06.io.spdk:cnode2" + } + }, + { + "method": "nvmf_subsystem_add_host", + "params": { + "host": "nqn.2016-06.io.spdk:init", + "nqn": "nqn.2016-06.io.spdk:cnode2" + } + }, + { + "method": "nvmf_subsystem_add_ns", + "params": { + "namespace": { + "bdev_name": "Malloc1", + "nsid": 1 + }, + "nqn": "nqn.2016-06.io.spdk:cnode2" + } + }, + { + "method": "nvmf_subsystem_add_ns", + "params": { + "namespace": { + "bdev_name": "Malloc2", + "nsid": 2 + }, + "nqn": "nqn.2016-06.io.spdk:cnode2" + } + }, + { + "method": "nvmf_subsystem_add_ns", + "params": { + "namespace": { + "bdev_name": "AIO0", + "nsid": 3 + }, + "nqn": "nqn.2016-06.io.spdk:cnode2" + } + }, + { + "method": "nvmf_subsystem_add_ns", + "params": { + "namespace": { + "bdev_name": "AIO1", + "nsid": 4 + }, + "nqn": "nqn.2016-06.io.spdk:cnode2" + } + } + ] + }, + { + "subsystem": "nbd", + "config": [] + }, + { + "subsystem": "vhost", + "config": [ + { + "params": { + "cpumask": "1", + "ctrlr": "naa.vhost.0" + }, + "method": "vhost_create_scsi_controller" + }, + { + "params": { + "scsi_target_num": 0, + "bdev_name": "Malloc4", + "ctrlr": "naa.vhost.0" + }, + "method": "vhost_scsi_controller_add_target" + }, + { + "params": { + "scsi_target_num": 1, + "bdev_name": "AIO3", + "ctrlr": "naa.vhost.0" + }, + "method": "vhost_scsi_controller_add_target" + }, + { + "params": { + "scsi_target_num": 2, + "bdev_name": "Nvme0n1p2", + "ctrlr": "naa.vhost.0" + }, + "method": "vhost_scsi_controller_add_target" + }, + { + "params": { + "cpumask": "1", + "ctrlr": "naa.vhost.1" + }, + "method": "vhost_create_scsi_controller" + }, + { + "params": { + "scsi_target_num": 0, + "bdev_name": "AIO4", + "ctrlr": "naa.vhost.1" + }, + "method": "vhost_scsi_controller_add_target" + }, + { + "params": { + "dev_name": "Malloc6", + "readonly": true, + "ctrlr": "vhost.1", + "cpumask": "1" + }, + "method": "vhost_create_blk_controller" + }, + { + "params": { + "dev_name": "Malloc5", + "readonly": false, + "ctrlr": "naa.vhost.2", + "cpumask": "1" + }, + "method": "vhost_create_blk_controller" + }, + { + "params": { + "cpumask": "1", + "io_queues": 2, + "ctrlr": "naa.vhost.3" + }, + "method": "vhost_create_nvme_controller" + }, + { + "params": { + "bdev_name": "Nvme0n1p0", + "ctrlr": "naa.vhost.3" + }, + "method": "vhost_nvme_controller_add_ns" + }, + { + "params": { + "bdev_name": "Nvme0n1p1", + "ctrlr": "naa.vhost.3" + }, + "method": "vhost_nvme_controller_add_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", + "default_time2wait": 2 + }, + "method": "iscsi_set_options" + }, + { + "params": { + "portals": [ + { + "cpumask": "0x1", + "host": "127.0.0.1", + "port": "4000" + }, + { + "cpumask": "0x1", + "host": "127.0.0.1", + "port": "4001" + } + ], + "tag": 1 + }, + "method": "iscsi_create_portal_group" + }, + { + "params": { + "initiators": [ + "ANY" + ], + "tag": 1, + "netmasks": [ + "127.0.0.1/32" + ] + }, + "method": "iscsi_create_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": "iscsi_create_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": "iscsi_create_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 000000000..f9608311c --- /dev/null +++ b/src/spdk/test/config_converter/spdk_config_virtio.json @@ -0,0 +1,133 @@ +{ + "subsystems": [ + { + "subsystem": "accel", + "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": "bdev_set_options" + }, + { + "params": { + "retry_count": 4, + "timeout_us": 0, + "nvme_adminq_poll_period_us": 1000000, + "nvme_ioq_poll_period_us": 0, + "action_on_timeout": "none" + }, + "method": "bdev_nvme_set_options" + }, + { + "params": { + "enable": false, + "period_us": 100000 + }, + "method": "bdev_nvme_set_hotplug" + }, + { + "params": { + "name": "VirtioScsi0", + "dev_type": "scsi", + "vq_size": 512, + "trtype": "user", + "traddr": "naa.vhost.0", + "vq_count": 8 + }, + "method": "bdev_virtio_attach_controller" + }, + { + "params": { + "name": "VirtioScsi1", + "dev_type": "scsi", + "vq_size": 512, + "trtype": "user", + "traddr": "naa.vhost.1", + "vq_count": 8 + }, + "method": "bdev_virtio_attach_controller" + }, + { + "params": { + "name": "VirtioBlk4", + "dev_type": "blk", + "vq_size": 512, + "trtype": "user", + "traddr": "vhost.1", + "vq_count": 1 + }, + "method": "bdev_virtio_attach_controller" + } + ] + }, + { + "subsystem": "scsi", + "config": null + }, + { + "subsystem": "nvmf", + "config": [ + { + "params": { + "acceptor_poll_rate": 10000 + }, + "method": "nvmf_set_config" + }, + { + "params": { + "max_subsystems": 1024 + }, + "method": "nvmf_set_max_subsystems" + } + ] + }, + { + "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, + "default_time2wait": 2 + }, + "method": "iscsi_set_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 000000000..1b3279a85 --- /dev/null +++ b/src/spdk/test/config_converter/test_converter.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +testdir=$(readlink -f "$(dirname "$0")") +rootdir=$(readlink -f "$testdir/../../") +source "$rootdir/test/common/autotest_common.sh" + +CONVERTER_DIR=$testdir +SPDK_BUILD_DIR=$rootdir + +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 + +$SPDK_BUILD_DIR/scripts/config_converter.py < $CONVERTER_DIR/config.ini > $CONVERTER_DIR/config_converter.json +$SPDK_BUILD_DIR/scripts/config_converter.py < $CONVERTER_DIR/config_virtio.ini > $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 |