Spdk/module/bdev
Shuhei Matsumoto e33ae4a6d5 bdev/nvme: Count number of NVMe errors per type or code
Error counters for NVMe error was added in the generic bdev layer but
we want to know more detailed information for some use cases.

Add NVMe error counters per type and per code as module specific
statistics.

For status codes, the first idea was to have different named member
for each status code value. However, it was bad and too hard to test,
review, and maintain.

Instead, we have just two dimensional uint32_t arrays, and increment
one of these uint32_t values based on the status code type and status
code. Then, when dump the JSON, we use spdk_nvme_cpl_get_status_string()
and spdk_nvme_cpl_get_status_type_string().

This idea has one potential downside. This idea consumes 4 (types) *
256 (codes) * 4 (counter) = 4KB per NVMe bdev. We can make this smarter
if memory allocation is a problem. Hence we add an option
nvme_error_stat to enable this feature only if the user requests.

Additionally, the string returned by spdk_nvme_cpl_get_status_string()
or spdk_nvme_cpl_get_status_type_string() has uppercases, spaces, and
hyphens. These should not be included in JSON strings. Hence, convert
these via spdk_strcpy_replace().

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I07b07621e777bdf6556b95054abbbb65e5f9ea3e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15370
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2023-01-10 13:12:05 +00:00
..
aio update Intel copyright notices 2022-11-10 08:28:53 +00:00
compress bdev/compress: limit operations performed on reduce_thread 2022-12-05 09:51:26 +00:00
crypto bdev/crypto: do not create mempool for session private data 2022-12-19 08:35:14 +00:00
daos bdev/daos: fix write of multiple iovs 2022-11-28 20:09:48 +00:00
delay update Intel copyright notices 2022-11-10 08:28:53 +00:00
error update Intel copyright notices 2022-11-10 08:28:53 +00:00
ftl misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
gpt update Intel copyright notices 2022-11-10 08:28:53 +00:00
iscsi misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
lvol lvol: remove unused lvs->destruct 2022-12-08 12:55:07 +00:00
malloc update Intel copyright notices 2022-11-10 08:28:53 +00:00
null update Intel copyright notices 2022-11-10 08:28:53 +00:00
nvme bdev/nvme: Count number of NVMe errors per type or code 2023-01-10 13:12:05 +00:00
ocf bdev/ocf: Add runtime cache bdev flush support 2022-11-18 08:38:03 +00:00
passthru update Intel copyright notices 2022-11-10 08:28:53 +00:00
pmem update Intel copyright notices 2022-11-10 08:28:53 +00:00
raid raid1: io path implementation 2023-01-09 12:39:19 +00:00
rbd bdev/rbd: limit operations performed on main thread 2022-12-05 09:51:26 +00:00
split update Intel copyright notices 2022-11-10 08:28:53 +00:00
uring bdev/uring: handle the out of resoruce from uring 2022-11-15 08:31:45 +00:00
virtio update Intel copyright notices 2022-11-10 08:28:53 +00:00
xnvme bdev_xnvme: Remove duplicate invocation of bdev_xnvme_destruct 2023-01-09 12:43:49 +00:00
zone_block update Intel copyright notices 2022-11-10 08:28:53 +00:00
Makefile configure: rename --with-reduce --with-vbdev-compress 2022-12-08 12:55:27 +00:00