Commit 9d503727 authored by Evgeniy Kochetov's avatar Evgeniy Kochetov Committed by Ben Walker
Browse files

nvmf: Add BDEV IO pending statistics



This patch adds statistics for BDEV IO pending state in NVMf subsytem
which may help to detect lack of resources and configure pool size
correctly.

Signed-off-by: default avatarEvgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I6c60c27efe3efed194b2d2c46a707af7c2808fe9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445290


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
parent da999b69
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4171,7 +4171,8 @@ Example response:
      {
        "name": "app_thread",
        "admin_qpairs": 1,
        "io_qpairs": 4
        "io_qpairs": 4,
        "pending_bdev_io": 1721
      }
    ]
  }
+1 −0
Original line number Diff line number Diff line
@@ -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;
};

/**
+1 −0
Original line number Diff line number Diff line
@@ -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);
	}

+3 −2
Original line number Diff line number Diff line
/*-
 *   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