From owner-dev-commits-src-main@freebsd.org Fri Mar 12 19:00:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 604AE5AA61B; Fri, 12 Mar 2021 19:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dxw9y2Gvyz4kZH; Fri, 12 Mar 2021 19:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 411801CC94; Fri, 12 Mar 2021 19:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12CJ0Mki068560; Fri, 12 Mar 2021 19:00:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12CJ0MgI068559; Fri, 12 Mar 2021 19:00:22 GMT (envelope-from git) Date: Fri, 12 Mar 2021 19:00:22 GMT Message-Id: <202103121900.12CJ0MgI068559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9c5137beb5f2 - main - ccr: Add per-port stats of queued and completed requests. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c5137beb5f28292410888d0770bdf24c15e1312 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2021 19:00:22 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9c5137beb5f28292410888d0770bdf24c15e1312 commit 9c5137beb5f28292410888d0770bdf24c15e1312 Author: John Baldwin AuthorDate: 2021-03-12 18:35:32 +0000 Commit: John Baldwin CommitDate: 2021-03-12 18:59:35 +0000 ccr: Add per-port stats of queued and completed requests. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29176 --- sys/dev/cxgbe/crypto/t4_crypto.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 46ea9d778fe3..8cb5924c6b4c 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -168,6 +168,9 @@ struct ccr_port { int rx_channel_id; int tx_channel_id; u_int active_sessions; + + counter_u64_t stats_queued; + counter_u64_t stats_completed; }; struct ccr_session { @@ -2128,6 +2131,11 @@ ccr_sysctls(struct ccr_softc *sc) SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "active_sessions", CTLFLAG_RD, &sc->ports[i].active_sessions, 0, "Count of active sessions"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "queued", + CTLFLAG_RD, &sc->ports[i].stats_queued, "Requests queued"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "completed", + CTLFLAG_RD, &sc->ports[i].stats_completed, + "Requests completed"); } } @@ -2141,6 +2149,8 @@ ccr_init_port(struct ccr_softc *sc, int port) sc->ports[port].rxq = &sc->adapter->sge.rxq[pi->vi->first_rxq]; sc->ports[port].rx_channel_id = pi->rx_c_chan; sc->ports[port].tx_channel_id = pi->tx_chan; + sc->ports[port].stats_queued = counter_u64_alloc(M_WAITOK); + sc->ports[port].stats_completed = counter_u64_alloc(M_WAITOK); _Static_assert(sizeof(sc->port_mask) * NBBY >= MAX_NPORTS - 1, "Too many ports to fit in port_mask"); sc->port_mask |= 1u << port; @@ -2199,10 +2209,19 @@ ccr_attach(device_t dev) return (0); } +static void +ccr_free_port(struct ccr_softc *sc, int port) +{ + + counter_u64_free(sc->ports[port].stats_queued); + counter_u64_free(sc->ports[port].stats_completed); +} + static int ccr_detach(device_t dev) { struct ccr_softc *sc; + int i; sc = device_get_softc(dev); @@ -2230,6 +2249,9 @@ ccr_detach(device_t dev) counter_u64_free(sc->stats_sglist_error); counter_u64_free(sc->stats_process_error); counter_u64_free(sc->stats_sw_fallback); + for_each_port(sc->adapter, i) { + ccr_free_port(sc, i); + } sglist_free(sc->sg_iv_aad); free(sc->iv_aad_buf, M_CCR); sc->adapter->ccr_softc = NULL; @@ -2827,6 +2849,7 @@ ccr_process(device_t dev, struct cryptop *crp, int hint) s->pending++; #endif counter_u64_add(sc->stats_inflight, 1); + counter_u64_add(s->port->stats_queued, 1); } else counter_u64_add(sc->stats_process_error, 1); @@ -2871,6 +2894,7 @@ do_cpl6_fw_pld(struct sge_iq *iq, const struct rss_header *rss, mtx_unlock(&s->lock); #endif counter_u64_add(sc->stats_inflight, -1); + counter_u64_add(s->port->stats_completed, 1); switch (s->mode) { case HASH: