Spdk/test
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
..
accel test/accel: add case for RPC accel_assign_opc 2023-01-06 16:13:52 +00:00
app llvm_vfio_fuzz: call spdk_thread_exit() 2022-11-23 08:22:04 +00:00
bdev test/bdev_raid: extended state checks 2023-01-09 12:39:19 +00:00
blobfs add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
blobstore add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
common pkgdep/dnf: install tc tool from iproute-tc package 2023-01-10 13:08:38 +00:00
compress add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
cpp_headers update Intel copyright notices 2022-11-10 08:28:53 +00:00
dd add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
dma test/dma: call spdk_thread_exit() 2022-11-23 08:22:04 +00:00
dpdk_memory_utility add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
env add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
event Add SPDX header to various files 2022-11-29 08:27:51 +00:00
external_code add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
ftl test/ftl: add cases line to cover RPC bdev_ftl_get_stats 2023-01-09 14:49:25 +00:00
fuzz fuzz/vhost: assign unique core masks to vhost and fuzz app 2022-12-07 09:21:13 +00:00
interrupt Add SPDX header to various files 2022-11-29 08:27:51 +00:00
ioat add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
iscsi_tgt test/iscsi_tgt: run most Calsoft tests serially 2022-12-23 09:27:48 +00:00
json_config module/iobuf: introduce iobuf module 2022-12-16 09:06:07 +00:00
lvol add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
make nvmf: Add copy command support 2022-11-30 08:50:06 +00:00
nvme misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
nvmf test/nvmf: Manually remove cpu lock files 2022-12-14 08:03:25 +00:00
ocf Add SPDX header to various files 2022-11-29 08:27:51 +00:00
openstack add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
packaging add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
pmem add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
rpc lib/trace: add trace_get_info RPC 2022-12-05 09:50:38 +00:00
rpc_client add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
rpc_plugins autotest: Use rpc_cmd() for rpc plugin-based tests 2021-04-02 08:22:42 +00:00
scheduler Add SPDX header to various files 2022-11-29 08:27:51 +00:00
setup scripts/setup: Stop checking for broken uio_pci_generic driver 2022-12-14 08:03:17 +00:00
sma sma test: disable line wrapping for base64 2022-12-16 09:22:52 +00:00
spdkcli spdkcli: add uring bdev support 2022-12-20 09:17:07 +00:00
thread thread: test SPDK spinlocks in an application 2022-12-06 21:20:17 +00:00
unit bdev/nvme: Count number of NVMe errors per type or code 2023-01-10 13:12:05 +00:00
vfio_user test/vfio_user: remove unnecessary VFIO_QEMU_BIN default value 2023-01-09 14:49:35 +00:00
vhost test/vhost: Don't remove QEMU's pidfile when terminating the process 2022-12-22 08:53:50 +00:00
vmd add (c) and SPDX header to bash files as needed 2022-11-29 08:27:51 +00:00
Makefile update Intel copyright notices 2022-11-10 08:28:53 +00:00
spdk_cunit.h update Intel copyright notices 2022-11-10 08:28:53 +00:00