diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index fe380a325..1daa67df4 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -4171,7 +4171,8 @@ Example response: { "name": "app_thread", "admin_qpairs": 1, - "io_qpairs": 4 + "io_qpairs": 4, + "pending_bdev_io": 1721 } ] } diff --git a/include/spdk/nvmf.h b/include/spdk/nvmf.h index f7ae54b9b..db225e0b3 100644 --- a/include/spdk/nvmf.h +++ b/include/spdk/nvmf.h @@ -81,6 +81,7 @@ struct spdk_nvmf_transport_opts { struct spdk_nvmf_poll_group_stat { uint32_t admin_qpairs; uint32_t io_qpairs; + uint64_t pending_bdev_io; }; /** diff --git a/lib/event/subsystems/nvmf/nvmf_rpc.c b/lib/event/subsystems/nvmf/nvmf_rpc.c index 601a126d7..8d260b573 100644 --- a/lib/event/subsystems/nvmf/nvmf_rpc.c +++ b/lib/event/subsystems/nvmf/nvmf_rpc.c @@ -1656,6 +1656,7 @@ rpc_nvmf_get_stats(struct spdk_io_channel_iter *i) spdk_json_write_named_string(ctx->w, "name", spdk_thread_get_name(spdk_get_thread())); spdk_json_write_named_uint32(ctx->w, "admin_qpairs", stat.admin_qpairs); spdk_json_write_named_uint32(ctx->w, "io_qpairs", stat.io_qpairs); + spdk_json_write_named_uint64(ctx->w, "pending_bdev_io", stat.pending_bdev_io); spdk_json_write_object_end(ctx->w); } diff --git a/lib/nvmf/ctrlr_bdev.c b/lib/nvmf/ctrlr_bdev.c index e6c15f057..0b1ba9dcc 100644 --- a/lib/nvmf/ctrlr_bdev.c +++ b/lib/nvmf/ctrlr_bdev.c @@ -1,8 +1,8 @@ /*- * BSD LICENSE * - * Copyright (c) Intel Corporation. - * All rights reserved. + * Copyright (c) Intel Corporation. All rights reserved. + * Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -213,6 +213,7 @@ nvmf_bdev_ctrl_queue_io(struct spdk_nvmf_request *req, struct spdk_bdev *bdev, if (rc != 0) { assert(false); } + req->qpair->group->stat.pending_bdev_io++; } int