From 00d587140fdb4abda913830c2a6bd9ec7a22f51a Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Tue, 14 Sep 2021 08:30:18 +0200 Subject: [PATCH] bdev/nvme: remove CSTS from driver-specific JSON info It's not providing a lot of value, while being pretty problematic, as the read is blocking and cannot be easily changed to be non-blocking, as dump_info_json is a synchronous interface. Now that dump_info_json isn't using any synchronous interfaces from the NVMe driver, we can send a bdev_get_bdevs call in the async_init.sh test to verify that. Signed-off-by: Konrad Sztyber Change-Id: Ida31c8d1000a52b0782f698afe46b071ed4e41df Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9488 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Reviewed-by: Shuhei Matsumoto Reviewed-by: Aleksey Marchuk --- module/bdev/nvme/bdev_nvme.c | 9 --------- test/nvmf/host/async_init.sh | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index 28eb1f9164..f72e9686bc 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -1571,7 +1571,6 @@ bdev_nvme_dump_info_json(void *ctx, struct spdk_json_write_ctx *w) const struct spdk_nvme_ctrlr_data *cdata; const struct spdk_nvme_transport_id *trid; union spdk_nvme_vs_register vs; - union spdk_nvme_csts_register csts; char buf[128]; nvme_ns = nvme_bdev->nvme_ns; @@ -1582,7 +1581,6 @@ bdev_nvme_dump_info_json(void *ctx, struct spdk_json_write_ctx *w) cdata = spdk_nvme_ctrlr_get_data(ctrlr); trid = spdk_nvme_ctrlr_get_transport_id(ctrlr); vs = spdk_nvme_ctrlr_get_regs_vs(ctrlr); - csts = spdk_nvme_ctrlr_get_regs_csts(ctrlr); spdk_json_write_named_object_begin(w, "nvme"); @@ -1649,13 +1647,6 @@ bdev_nvme_dump_info_json(void *ctx, struct spdk_json_write_ctx *w) spdk_json_write_object_end(w); - spdk_json_write_named_object_begin(w, "csts"); - - spdk_json_write_named_uint32(w, "rdy", csts.bits.rdy); - spdk_json_write_named_uint32(w, "cfs", csts.bits.cfs); - - spdk_json_write_object_end(w); - spdk_json_write_named_object_begin(w, "ns_data"); spdk_json_write_named_uint32(w, "id", spdk_nvme_ns_get_id(ns)); diff --git a/test/nvmf/host/async_init.sh b/test/nvmf/host/async_init.sh index e2077d82a4..ff3b21c3d3 100755 --- a/test/nvmf/host/async_init.sh +++ b/test/nvmf/host/async_init.sh @@ -35,9 +35,15 @@ $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode0 -t $TEST_TRANSPOR $rpc_py bdev_nvme_attach_controller -b $nvme_bdev -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP \ -f ipv4 -s $NVMF_PORT -n nqn.2016-06.io.spdk:cnode0 +# Make sure the bdev was created successfully +$rpc_py bdev_get_bdevs -b ${nvme_bdev}n1 + # Make sure the reset is also asynchronous $rpc_py bdev_nvme_reset_controller $nvme_bdev +# And that the bdev is still available after a reset +$rpc_py bdev_get_bdevs -b ${nvme_bdev}n1 + # Finally, detach the controller to verify the detach path $rpc_py bdev_nvme_detach_controller $nvme_bdev