aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/nvme/nvme_qpair.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2019-07-19 18:39:18 +0000
committerWarner Losh <imp@FreeBSD.org>2019-07-19 18:39:18 +0000
commitc37fc318c480325d211fd20f79b05ffb6edd42b5 (patch)
treef11b2f839a4e297617a10c54a0464c0f3c34c09b /sys/dev/nvme/nvme_qpair.c
parent710becdd96ed18951479603da62e66f9880a4a5d (diff)
downloadsrc-c37fc318c480325d211fd20f79b05ffb6edd42b5.tar.gz
src-c37fc318c480325d211fd20f79b05ffb6edd42b5.zip
Keep track of the number of retried commands.
Retried commands can indicate a performance degredation of an nvme drive. Keep track of the number of retries and report it out via sysctl, just like number of commands an interrupts.
Notes
Notes: svn path=/head/; revision=350146
Diffstat (limited to 'sys/dev/nvme/nvme_qpair.c')
-rw-r--r--sys/dev/nvme/nvme_qpair.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c
index 098b6d63f532..7c28f04213a7 100644
--- a/sys/dev/nvme/nvme_qpair.c
+++ b/sys/dev/nvme/nvme_qpair.c
@@ -393,6 +393,8 @@ nvme_qpair_complete_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr,
error = nvme_completion_is_error(cpl);
retry = error && nvme_completion_is_retry(cpl) &&
req->retries < nvme_retry_count;
+ if (retry)
+ qpair->num_retries++;
if (error && (print_on_error == ERROR_PRINT_ALL ||
(!retry && print_on_error == ERROR_PRINT_NO_RETRY))) {
@@ -684,6 +686,7 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id,
qpair->num_cmds = 0;
qpair->num_intr_handler_calls = 0;
+ qpair->num_retries = 0;
qpair->cmd = (struct nvme_command *)queuemem;
qpair->cpl = (struct nvme_completion *)(queuemem + cmdsz);
prpmem = (uint8_t *)(queuemem + cmdsz + cplsz);