diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..e721362 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: BSD-3-Clause +# + +SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) +include $(SPDK_ROOT_DIR)/mk/spdk.common.mk +include $(SPDK_ROOT_DIR)/mk/spdk.modules.mk + +APP = zvfs + +C_SRCS := zv2404fs.c + +SPDK_LIB_LIST = $(ALL_MODULES_LIST) event event_bdev + +include $(SPDK_ROOT_DIR)/mk/spdk.app.mk diff --git a/fio_script/bdev.fio b/fio_script/bdev.fio new file mode 100755 index 0000000..9e03025 --- /dev/null +++ b/fio_script/bdev.fio @@ -0,0 +1,18 @@ +[global] +ioengine=spdk_bdev +spdk_json_conf=/home/king/share/zvfs/fio_script/zvfs.json +thread=1 +direct=1 +time_based +runtime=10 +rw=randwrite +bs=16K +zonemode=zbd +max_open_zones=8 +initial_zone_reset=1 +zone_append=1 +iodepth=64 + +[test] +filename=Zone0 +numjobs=1 diff --git a/fio_script/io_uring.fio b/fio_script/io_uring.fio new file mode 100755 index 0000000..7211056 --- /dev/null +++ b/fio_script/io_uring.fio @@ -0,0 +1,19 @@ +[global] +thread=1 +group_reporting=1 +direct=1 +verify=0 +time_based=1 +runtime=10 +bs=16K +size=16384 +iodepth=64 +rw=randwrite +filename=kingfs +ioengine=io_uring + +[test] +stonewall +description="variable bs" +bs=16K + diff --git a/fio_script/kingfs b/fio_script/kingfs new file mode 100755 index 0000000..56af658 Binary files /dev/null and b/fio_script/kingfs differ diff --git a/fio_script/libaio.fio b/fio_script/libaio.fio new file mode 100755 index 0000000..09de1d7 --- /dev/null +++ b/fio_script/libaio.fio @@ -0,0 +1,19 @@ +[global] +thread=1 +group_reporting=1 +direct=1 +verify=0 +time_based=1 +runtime=10 +bs=16K +size=16384 +iodepth=64 +rw=randwrite +filename=kingfs +ioengine=libaio + +[test] +stonewall +description="variable bs" +bs=16K + diff --git a/fio_script/nvme.fio b/fio_script/nvme.fio new file mode 100755 index 0000000..fd119a3 --- /dev/null +++ b/fio_script/nvme.fio @@ -0,0 +1,18 @@ +[global] +thread=1 +group_reporting=1 +direct=1 +verify=0 +time_based=1 +ramp_time=10 +runtime=10 +bs=16K +size=16384 +iodepth=64 +rw=randwrite +ioengine=spdk + +[test] +numjobs=1 +filename=trtype=PCIe traddr=0000.03.00.0 ns=1 +bs=16k diff --git a/fio_script/psync.fio b/fio_script/psync.fio new file mode 100755 index 0000000..13618e7 --- /dev/null +++ b/fio_script/psync.fio @@ -0,0 +1,20 @@ + +[global] +thread=1 +group_reporting=1 +direct=1 +verify=0 +time_based=1 +runtime=10 +bs=16K +size=16384 +iodepth=64 +rw=randwrite +filename=kingfs +ioengine=psync + +[test] +stonewall +description="variable bs" +bs=16K + diff --git a/fio_script/zvfs.json b/fio_script/zvfs.json new file mode 100755 index 0000000..be22443 --- /dev/null +++ b/fio_script/zvfs.json @@ -0,0 +1,35 @@ +{ + "subsystems": [ + { + "subsystem": "bdev", + "config": [ + { + "method": "bdev_nvme_attach_controller", + "params": + { + "trtype": "PCIe", + "name":"Nvme0", + "traddr":"0000:03:00.0" + } + }, + { + "method": "bdev_malloc_create", + "params": { + "name": "Malloc0", + "num_blocks": 2097152, + "block_size": 512 + } + }, + { + "method": "bdev_zone_block_create", + "params": { + "base_bdev": "Malloc0", + "name": "Zone0", + "zone_capacity": 262144, + "optimal_open_zones": 8 + } + } + ] + } + ] +} diff --git a/zv2404fs.c b/zv2404fs.c new file mode 100755 index 0000000..fe90aad --- /dev/null +++ b/zv2404fs.c @@ -0,0 +1,54 @@ + + +#include + +#include +#include +#include +#include + + +void zv2404_spdk_bdev_event_cb(enum spdk_bdev_event_type type, struct spdk_bdev *bdev, + void *event_ctx) { + + printf("zv2404_spdk_bdev_event_cb\n"); + +} + + + + +static void zv2404fs_entry(void *ctx) { + + + struct spdk_bs_dev *bs_dev = NULL; + + int rc = spdk_bdev_create_bs_dev_ext("Malloc0", zv2404_spdk_bdev_event_cb, NULL, &bs_dev); + if (rc != 0) { + spdk_app_stop(0); + } + + + + printf("zv2404fs_entry\n"); + +} + + +int main(int argc, char *argv[]) { + + if (argc != 2) return -1; + + struct spdk_app_opts opts = {}; + + spdk_app_opts_init(&opts, sizeof(opts)); + opts.name = "zv2404fs"; + opts.json_config_file = argv[1]; + + spdk_app_start(&opts, zv2404fs_entry, NULL); + + printf("hello spdk\n"); + +} + +