aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-01-14 16:41:28 +0000
committerMark Johnston <markj@FreeBSD.org>2021-01-14 16:41:28 +0000
commita33b29a0447b24a054ecc48e51355d2abf7e6b5b (patch)
tree6f4e2c36f3822381639247e7a6009244686ba069
parent95ee7d9b879ce42088277c85d85e61f6c79674ad (diff)
downloadsrc-a33b29a0447b24a054ecc48e51355d2abf7e6b5b.tar.gz
src-a33b29a0447b24a054ecc48e51355d2abf7e6b5b.zip
qat: Count request allocation failures
This can be useful for troubleshooting performance problems. MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate)
-rw-r--r--sys/dev/qat/qat.c5
-rw-r--r--sys/dev/qat/qatvar.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/qat/qat.c b/sys/dev/qat/qat.c
index 68cb17078c25..6f74ff3b4bc1 100644
--- a/sys/dev/qat/qat.c
+++ b/sys/dev/qat/qat.c
@@ -1596,6 +1596,10 @@ qat_crypto_init(struct qat_softc *sc)
SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "ring_full",
CTLFLAG_RD, &sc->sc_ring_full_restarts,
"Requests deferred due to in-flight max reached");
+ sc->sc_sym_alloc_failures = counter_u64_alloc(M_WAITOK);
+ SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "sym_alloc_failures",
+ CTLFLAG_RD, &sc->sc_sym_alloc_failures,
+ "Request allocation failures");
return 0;
}
@@ -2069,6 +2073,7 @@ qat_process(device_t dev, struct cryptop *crp, int hint)
qsc = qat_crypto_alloc_sym_cookie(qcb);
if (qsc == NULL) {
+ counter_u64_add(sc->sc_sym_alloc_failures, 1);
error = ENOBUFS;
goto fail2;
}
diff --git a/sys/dev/qat/qatvar.h b/sys/dev/qat/qatvar.h
index f3245ad725b6..3326dc268fc1 100644
--- a/sys/dev/qat/qatvar.h
+++ b/sys/dev/qat/qatvar.h
@@ -818,6 +818,7 @@ struct qat_softc {
counter_u64_t sc_gcm_aad_restarts;
counter_u64_t sc_gcm_aad_updates;
counter_u64_t sc_ring_full_restarts;
+ counter_u64_t sc_sym_alloc_failures;
/* Firmware */
void *sc_fw_mof; /* mof data */