git: c3d4aea6c5be - main - cxgbe: Add counters for POSIX async I/O requests handled by the driver
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 31 Jan 2024 00:42:10 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=c3d4aea6c5bef0dcdc5194d4a828625f4d34a1dc
commit c3d4aea6c5bef0dcdc5194d4a828625f4d34a1dc
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-01-31 00:40:31 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
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