nvmf: Add queue pair counts statistics

This patch adds number of admin and IO queue pairs per poll group in
NVMf statistics. It can be useful to troubleshoot load sharing issues.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I2a9c0fc99cf5d0729eb130d30540ae52b5207fc9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445288
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Evgeniy Kochetov 2019-05-22 22:12:35 +03:00 committed by Ben Walker
parent fca6ff8f75
commit da999b69b8
4 changed files with 13 additions and 2 deletions

View File

@ -4169,7 +4169,9 @@ Example response:
"result": {
"poll_groups": [
{
"name": "app_thread"
"name": "app_thread",
"admin_qpairs": 1,
"io_qpairs": 4
}
]
}

View File

@ -79,7 +79,8 @@ struct spdk_nvmf_transport_opts {
};
struct spdk_nvmf_poll_group_stat {
int dummy;
uint32_t admin_qpairs;
uint32_t io_qpairs;
};
/**

View File

@ -1654,6 +1654,8 @@ rpc_nvmf_get_stats(struct spdk_io_channel_iter *i)
if (0 == spdk_nvmf_poll_group_get_stat(g_spdk_nvmf_tgt, &stat)) {
spdk_json_write_object_begin(ctx->w);
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_object_end(ctx->w);
}

View File

@ -593,6 +593,12 @@ spdk_nvmf_ctrlr_connect(struct spdk_nvmf_request *req)
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
}
if (0 == qpair->qid) {
qpair->group->stat.admin_qpairs++;
} else {
qpair->group->stat.io_qpairs++;
}
if (cmd->qid == 0) {
SPDK_DEBUGLOG(SPDK_LOG_NVMF, "Connect Admin Queue for controller ID 0x%x\n", data->cntlid);