From nobody Wed Jan 31 00:42:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPjsv0W6Sz580Jp; Wed, 31 Jan 2024 00:42:11 +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 4TPjsv047Dz43tq; Wed, 31 Jan 2024 00:42:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DgWClD4m+ClBGhnghyflKpxqfuD31GJYYSHjs94Nn3k=; b=jaFKr2fJXR2YKRIIgni2LxpcOCfSmjW3NL4qkNcUUoP10hEs+WmoOJIwUVEorDHstmBX+s Zh9VqVpzEx0bf25MWqHJUPZlYlXLgB4fPYsWTFoTK5FDzF0TePZorDFhzb1BWCto02zRma 6K/eJ06zpd/cih+RbDz/9RfDacsdKxUm3Vg2eAbd9M3OhXUwB6HJkHCx4ivZM0jrY5xEa7 V/JB5vi0YXnFWcaqrzl5tc5ZPROKyUOi9PiP+8cLWq+pkQxJKImSk3AS14zvKr4iXq3ghl 0soXdsMZs3JDhNY9XfNGyKV0xXksKxwOdr42E6lHBQVaNrrjwqySHkuRWv2XLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DgWClD4m+ClBGhnghyflKpxqfuD31GJYYSHjs94Nn3k=; b=AvZNKlK5BA0WAiXPB3MaUbyssQ2rycqqMco+10FgeSJY2S7TNcacoK/nQC/xKHfdj0akXu OVRg8mOH/n/6jcKX2KmmqRiHxBgnPPTGAx4rb+nUYcpP/z/0a/VyE90KjfM4QCsOEnUw6w tAAWOk01t9z+2MTXCnTJapyS1Pf2XYuN4f2P8/Iz3eSPQsxJ/63ahYbMmJbn/s3Jrfbz/a WldtlN6nVHI68xF5qcfVVVKwHdjoF+plF1X8aG2MT2vzFEQkaR0Xd1gtqOvRtDukadsBfp ubwjP4ybrxGwjdcYuSUHRK11e6fEaLKs0104YvyaARkqb8ls3ZSxdoNLNdTKSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661731; a=rsa-sha256; cv=none; b=QEYtq5YsAr9n+FDd9vdf22NnR7pzCuRyjOYN5fx08uai+u5IgiXIFm2UbAWkta8x9zEfI+ w7RlNhq8JAToN1mgqinz+PwYXiBH6PayrXubQfmz1sxArdQGEPgTc0rSalkIB7DNy0FoQE gwyhuapI5C6/kABnUQuN6FSV++zLf3wDibTW1jK0iOxnvO6mZ056+T+oqjVO5W7R9rA2ks LmnEq0+rnevvXenzaFEnewTH/s7QRWRwjPzbXDYrMS0OiEOQ4j5sxcLDh/SAMcXMFTiWqZ dOpKheMoPlwblJpLIPvcSSfB/2nAhroRXGwOitglhKcqoZ53eMNUZljJrM2WoA== 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 4TPjst6DfLzxVl; Wed, 31 Jan 2024 00:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40V0gAnh059356; Wed, 31 Jan 2024 00:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0gAG6059353; Wed, 31 Jan 2024 00:42:10 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:42:10 GMT Message-Id: <202401310042.40V0gAG6059353@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: c3d4aea6c5be - main - cxgbe: Add counters for POSIX async I/O requests handled by the driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: c3d4aea6c5bef0dcdc5194d4a828625f4d34a1dc Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c3d4aea6c5bef0dcdc5194d4a828625f4d34a1dc commit c3d4aea6c5bef0dcdc5194d4a828625f4d34a1dc Author: John Baldwin AuthorDate: 2024-01-31 00:40:31 +0000 Commit: John Baldwin CommitDate: 2024-01-31 00:40:31 +0000 cxgbe: Add counters for POSIX async I/O requests handled by the driver Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43668 --- sys/dev/cxgbe/adapter.h | 4 ++++ sys/dev/cxgbe/t4_main.c | 4 ++++ sys/dev/cxgbe/t4_sge.c | 16 ++++++++++++++++ sys/dev/cxgbe/tom/t4_cpl_io.c | 6 +++++- sys/dev/cxgbe/tom/t4_ddp.c | 12 ++++++++++-- 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index c3105ecacffd..3157d08cc67b 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -686,6 +686,8 @@ struct sge_ofld_rxq { uint64_t rx_iscsi_padding_errors; uint64_t rx_iscsi_header_digest_errors; uint64_t rx_iscsi_data_digest_errors; + uint64_t rx_aio_ddp_jobs; + uint64_t rx_aio_ddp_octets; u_long rx_toe_tls_records; u_long rx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); @@ -752,6 +754,8 @@ struct sge_ofld_txq { counter_u64_t tx_iscsi_pdus; counter_u64_t tx_iscsi_octets; counter_u64_t tx_iscsi_iso_wrs; + counter_u64_t tx_aio_jobs; + counter_u64_t tx_aio_octets; counter_u64_t tx_toe_tls_records; counter_u64_t tx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 3b6cb7285e64..4fbc45e16464 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -12026,6 +12026,8 @@ clear_stats(struct adapter *sc, u_int port_id) counter_u64_zero(ofld_txq->tx_iscsi_pdus); counter_u64_zero(ofld_txq->tx_iscsi_octets); counter_u64_zero(ofld_txq->tx_iscsi_iso_wrs); + counter_u64_zero(ofld_txq->tx_aio_jobs); + counter_u64_zero(ofld_txq->tx_aio_octets); counter_u64_zero(ofld_txq->tx_toe_tls_records); counter_u64_zero(ofld_txq->tx_toe_tls_octets); } @@ -12043,6 +12045,8 @@ clear_stats(struct adapter *sc, u_int port_id) ofld_rxq->rx_iscsi_ddp_octets = 0; ofld_rxq->rx_iscsi_fl_pdus = 0; ofld_rxq->rx_iscsi_fl_octets = 0; + ofld_rxq->rx_aio_ddp_jobs = 0; + ofld_rxq->rx_aio_ddp_octets = 0; ofld_rxq->rx_toe_tls_records = 0; ofld_rxq->rx_toe_tls_octets = 0; } diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index b742f22a7d78..76293b06a6a9 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4146,6 +4146,12 @@ add_ofld_rxq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, return; children = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "rx_aio_ddp_jobs", + CTLFLAG_RD, &ofld_rxq->rx_aio_ddp_jobs, 0, + "# of aio_read(2) jobs completed via DDP"); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "rx_aio_ddp_octets", + CTLFLAG_RD, &ofld_rxq->rx_aio_ddp_octets, 0, + "# of octets placed directly for aio_read(2) jobs"); SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_records", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_records, "# of TOE TLS records received"); @@ -4809,6 +4815,8 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx) ofld_txq->tx_iscsi_pdus = counter_u64_alloc(M_WAITOK); ofld_txq->tx_iscsi_octets = counter_u64_alloc(M_WAITOK); ofld_txq->tx_iscsi_iso_wrs = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_aio_jobs = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_aio_octets = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_records = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_octets = counter_u64_alloc(M_WAITOK); add_ofld_txq_sysctls(&vi->ctx, oid, ofld_txq); @@ -4847,6 +4855,8 @@ free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) counter_u64_free(ofld_txq->tx_iscsi_pdus); counter_u64_free(ofld_txq->tx_iscsi_octets); counter_u64_free(ofld_txq->tx_iscsi_iso_wrs); + counter_u64_free(ofld_txq->tx_aio_jobs); + counter_u64_free(ofld_txq->tx_aio_octets); counter_u64_free(ofld_txq->tx_toe_tls_records); counter_u64_free(ofld_txq->tx_toe_tls_octets); free_wrq(sc, &ofld_txq->wrq); @@ -4874,6 +4884,12 @@ add_ofld_txq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_iscsi_iso_wrs", CTLFLAG_RD, &ofld_txq->tx_iscsi_iso_wrs, "# of iSCSI segmentation offload work requests"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_aio_jobs", + CTLFLAG_RD, &ofld_txq->tx_aio_jobs, + "# of zero-copy aio_write(2) jobs transmitted"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_aio_octets", + CTLFLAG_RD, &ofld_txq->tx_aio_octets, + "# of payload octets in transmitted zero-copy aio_write(2) jobs"); SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records, "# of TOE TLS records transmitted"); diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 235d4196226d..2f425c7b5c6d 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2173,6 +2173,7 @@ t4_aiotx_process_job(struct toepcb *toep, struct socket *so, struct kaiocb *job) struct inpcb *inp; struct tcpcb *tp; struct mbuf *m; + u_int sent; int error, len; bool moretocome, sendmore; @@ -2275,7 +2276,9 @@ sendanother: goto out; } - job->aio_sent += m_length(m, NULL); + sent = m_length(m, NULL); + job->aio_sent += sent; + counter_u64_add(toep->ofld_txq->tx_aio_octets, sent); sbappendstream(sb, m, 0); m = NULL; @@ -2328,6 +2331,7 @@ sendanother: * socket. */ aiotx_free_job(job); + counter_u64_add(toep->ofld_txq->tx_aio_jobs, 1); out: if (error) { diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index c529639d9a1f..c50446d98e2b 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -319,8 +319,11 @@ insert_ddp_data(struct toepcb *toep, uint32_t n) placed = n; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; - if (placed > 0) + if (placed > 0) { job->msgrcv = 1; + toep->ofld_rxq->rx_aio_ddp_jobs++; + } + toep->ofld_rxq->rx_aio_ddp_octets += placed; if (!aio_clear_cancel_function(job)) { /* * Update the copied length for when @@ -560,6 +563,8 @@ handle_ddp_data(struct toepcb *toep, __be32 ddp_report, __be32 rcv_nxt, int len) CURVNET_RESTORE(); job->msgrcv = 1; + toep->ofld_rxq->rx_aio_ddp_jobs++; + toep->ofld_rxq->rx_aio_ddp_octets += len; if (db->cancel_pending) { /* * Update the job's length but defer completion to the @@ -724,8 +729,11 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, __be32 rcv_nxt) placed = len; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; - if (placed > 0) + if (placed > 0) { job->msgrcv = 1; + toep->ofld_rxq->rx_aio_ddp_jobs++; + } + toep->ofld_rxq->rx_aio_ddp_octets += placed; if (!aio_clear_cancel_function(job)) { /* * Update the copied length for when