From nobody Mon Apr 08 20:25:47 2024 X-Original-To: dev-commits-src-all@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 4VD0wC58xZz5Hj1l; Mon, 8 Apr 2024 20:25:47 +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 4VD0wC1xkcz3xXG; Mon, 8 Apr 2024 20:25:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607947; 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=182bSwF/SA0PmO8KqJ/OBMyfa6tbzdvNDH5e1Pdg50g=; b=a/vshnY3KSF0N0SbqrDanmS+2Jb+bU45dAX8bfSpYMzMBTuwT7/DASul2NMmwO3hH/JyRR V69LgK9W3Vxbet8eL8HP13NaNFwdg/W6vm8//XF4eDtSTtyvSOaGmP8AzU/Lx7h/1Lq4rb DGrxxx+yrGmXEUKLYUqnpyACCZhFGVQikd8Q+q3Pyfrg4cJONuBU1n3uDdnDRYEcUOmDDH m0Pyrraac+B7cAQTSwbPqgk0BPNXRR1g9E7rlUhLqfrBJyWkyPb79XAwICtu56kxUTcxP7 pSeHt2XU03Sixrvi0AtVCAE8nB6Jx93n+moeNN9Uh0NReCFeWO6pTPHsVRDyxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607947; a=rsa-sha256; cv=none; b=LH82W05r62lITNYg51WsOjkWPQu+KLirIpYluq3i6/m499R6lfQP5eTXQ01L53cLm/mie5 VbcEt2HGTcv0zQ9NbNMM50G4jIle1bTvc4kUkG5R+TGvgkFGywhTHQFNkSgw52yv/ywV8o jaxvlqUHf8swfq4Jz+X3IsHHcikSMk4MnEhKrlyx1F67ie/oZu+/OnaIMAJ5dz4B0H1X7O PZh9aXh2RphGEmk4Uqa7nyNfBGe5G2O1/7isCRo/gAIUZgSUHZuPZf2VmMros1je4p5rL0 yCEXt0cddMunO46QETiBEMkJNI76My5ID/Y3YW+S3NHI9O+KnHc0uWqXBE5VFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607947; 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=182bSwF/SA0PmO8KqJ/OBMyfa6tbzdvNDH5e1Pdg50g=; b=XgEhgI62FLha1IHd3p8diaWNa+ZuAZN9nfxA/R5Y11Twl4/+TQ5S9R1iSbHdRy6Koml/1f 4Y80hYgF12LTxFEiRRMGWvnJQ7KRm9xCpWY2tyfIq+J1zG3vToMybN2vaBf69D+My8f5eT 5dhecFt9WNfI57hxaIVLJlMfWxVPZVvqhXPxtQ8Bu9jVYG5Cy+KnHtOINwEEKHyahMQG72 K/NcVg/qA9ynDP8FjGe5TOzR+U246EK4eh3NZKTVDB/vxYNmdVZwp5JqI2vJWao5a3h8bu UGDvxU59/irNxuHofYhIwXIDEi6VWCn7ez50LfHuIpVIxlrJmUDvCBzjP4AFMw== 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 4VD0wC1YnNzQc1; Mon, 8 Apr 2024 20:25:47 +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 438KPlqL039724; Mon, 8 Apr 2024 20:25:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPlJe039721; Mon, 8 Apr 2024 20:25:47 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:47 GMT Message-Id: <202404082025.438KPlJe039721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d50a1d0ace9d - stable/13 - cxgbe: Add counters for POSIX async I/O requests handled by the driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: d50a1d0ace9def06df655189c4030d77aec976cf Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d50a1d0ace9def06df655189c4030d77aec976cf commit d50a1d0ace9def06df655189c4030d77aec976cf Author: John Baldwin AuthorDate: 2024-01-31 00:40:31 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:39:21 +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 (cherry picked from commit c3d4aea6c5bef0dcdc5194d4a828625f4d34a1dc) --- 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 1896596df737..f6e58dc976c1 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -690,6 +690,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); @@ -756,6 +758,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 cbf15b5270ff..98f27c466bdc 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -12190,6 +12190,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); } @@ -12207,6 +12209,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 3e15e1507f68..a6f77a2b7430 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4217,6 +4217,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"); @@ -4880,6 +4886,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); @@ -4918,6 +4926,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); @@ -4945,6 +4955,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 fe9dd4477ab3..e8a78b5f6c1b 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2189,6 +2189,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; @@ -2292,7 +2293,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; @@ -2339,6 +2342,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 9ed71ebcde79..ff63b25c4db0 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