git: a33b29a0447b - main - qat: Count request allocation failures

Mark Johnston markj at FreeBSD.org
Thu Jan 14 16:46:19 UTC 2021


The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=a33b29a0447b24a054ecc48e51355d2abf7e6b5b

commit a33b29a0447b24a054ecc48e51355d2abf7e6b5b
Author:     Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-01-14 16:41:28 +0000
Commit:     Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-01-14 16:41:28 +0000

    qat: Count request allocation failures
    
    This can be useful for troubleshooting performance problems.
    
    MFC after:      3 days
    Sponsored by:   Rubicon Communications, LLC (Netgate)
---
 sys/dev/qat/qat.c    | 5 +++++
 sys/dev/qat/qatvar.h | 1 +
 2 files changed, 6 insertions(+)

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 */


More information about the dev-commits-src-all mailing list