Commit 3caf2e71 authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

nvmf/rdma: Add new statistic to count idle polls



This statistic is incremented when we don't reap
anything from the CQ. Together with the total number
of polls it can be useful to estimate idle percentage.

Change-Id: I61b51d049b0bc506fb8a896e225187e46e75a564
Signed-off-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6295


Community-CI: Broadcom CI
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 36ac75b9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ struct spdk_nvmf_poll_group_stat {
struct spdk_nvmf_rdma_device_stat {
	const char *name;
	uint64_t polls;
	uint64_t idle_polls;
	uint64_t completions;
	uint64_t requests;
	uint64_t request_latency;
+1 −0
Original line number Diff line number Diff line
@@ -2052,6 +2052,7 @@ write_nvmf_transport_stats(struct spdk_json_write_ctx *w,
			spdk_json_write_object_begin(w);
			spdk_json_write_named_string(w, "name", stat->rdma.devices[i].name);
			spdk_json_write_named_uint64(w, "polls", stat->rdma.devices[i].polls);
			spdk_json_write_named_uint64(w, "idle_polls", stat->rdma.devices[i].idle_polls);
			spdk_json_write_named_uint64(w, "completions", stat->rdma.devices[i].completions);
			spdk_json_write_named_uint64(w, "requests",
						     stat->rdma.devices[i].requests);
+4 −0
Original line number Diff line number Diff line
@@ -395,6 +395,7 @@ struct spdk_nvmf_rdma_qpair {
struct spdk_nvmf_rdma_poller_stat {
	uint64_t				completions;
	uint64_t				polls;
	uint64_t				idle_polls;
	uint64_t				requests;
	uint64_t				request_latency;
	uint64_t				pending_free_request;
@@ -3789,6 +3790,8 @@ nvmf_rdma_poller_poll(struct spdk_nvmf_rdma_transport *rtransport,
		SPDK_ERRLOG("Error polling CQ! (%d): %s\n",
			    errno, spdk_strerror(errno));
		return -1;
	} else if (reaped == 0) {
		rpoller->stat.idle_polls++;
	}

	rpoller->stat.polls++;
@@ -4194,6 +4197,7 @@ nvmf_rdma_poll_group_get_stat(struct spdk_nvmf_tgt *tgt,
				device_stat = &(*stat)->rdma.devices[num_devices++];
				device_stat->name = ibv_get_device_name(rpoller->device->context->device);
				device_stat->polls = rpoller->stat.polls;
				device_stat->idle_polls = rpoller->stat.idle_polls;
				device_stat->completions = rpoller->stat.completions;
				device_stat->requests = rpoller->stat.requests;
				device_stat->request_latency = rpoller->stat.request_latency;