git: c2e295647ea5 - stable/13 - cxgbe: Add counters for iSCSI PDUs transmitted via TOE.
John Baldwin
jhb at FreeBSD.org
Mon Apr 26 19:04:02 UTC 2021
The branch stable/13 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=c2e295647ea5da560f68462c4924cbb7e9414b3e
commit c2e295647ea5da560f68462c4924cbb7e9414b3e
Author: John Baldwin <jhb at FreeBSD.org>
AuthorDate: 2021-04-12 20:56:04 +0000
Commit: John Baldwin <jhb at FreeBSD.org>
CommitDate: 2021-04-26 19:02:16 +0000
cxgbe: Add counters for iSCSI PDUs transmitted via TOE.
Sponsored by: Chelsio Communications
(cherry picked from commit 568e69e4eb0ad1a5c69d8ea4592a4314bd6b6679)
---
sys/dev/cxgbe/adapter.h | 2 ++
sys/dev/cxgbe/t4_main.c | 2 ++
sys/dev/cxgbe/t4_sge.c | 10 ++++++++++
sys/dev/cxgbe/tom/t4_cpl_io.c | 3 +++
4 files changed, 17 insertions(+)
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index d9a23009a156..7bf4efae09c0 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -714,6 +714,8 @@ struct sge_wrq {
/* ofld_txq: SGE egress queue + miscellaneous items */
struct sge_ofld_txq {
struct sge_wrq wrq;
+ counter_u64_t tx_iscsi_pdus;
+ counter_u64_t tx_iscsi_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 06188187f9dc..3fde57786d13 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -10733,6 +10733,8 @@ clear_stats(struct adapter *sc, u_int port_id)
for_each_ofld_txq(vi, i, ofld_txq) {
ofld_txq->wrq.tx_wrs_direct = 0;
ofld_txq->wrq.tx_wrs_copied = 0;
+ counter_u64_zero(ofld_txq->tx_iscsi_pdus);
+ counter_u64_zero(ofld_txq->tx_iscsi_octets);
counter_u64_zero(ofld_txq->tx_toe_tls_records);
counter_u64_zero(ofld_txq->tx_toe_tls_octets);
}
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 5015d3b63a63..a8d16352268e 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -4505,8 +4505,16 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx,
if (rc != 0)
return (rc);
+ ofld_txq->tx_iscsi_pdus = counter_u64_alloc(M_WAITOK);
+ ofld_txq->tx_iscsi_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);
+ SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO,
+ "tx_iscsi_pdus", CTLFLAG_RD, &ofld_txq->tx_iscsi_pdus,
+ "# of iSCSI PDUs transmitted");
+ SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO,
+ "tx_iscsi_octets", CTLFLAG_RD, &ofld_txq->tx_iscsi_octets,
+ "# of payload octets in transmitted iSCSI PDUs");
SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO,
"tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records,
"# of TOE TLS records transmitted");
@@ -4527,6 +4535,8 @@ free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq)
if (rc != 0)
return (rc);
+ counter_u64_free(ofld_txq->tx_iscsi_pdus);
+ counter_u64_free(ofld_txq->tx_iscsi_octets);
counter_u64_free(ofld_txq->tx_toe_tls_records);
counter_u64_free(ofld_txq->tx_toe_tls_octets);
diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
index 14a8181b57ef..e12354a0b1eb 100644
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -1092,6 +1092,9 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop)
}
toep->txsd_avail--;
+ counter_u64_add(toep->ofld_txq->tx_iscsi_pdus, 1);
+ counter_u64_add(toep->ofld_txq->tx_iscsi_octets, plen);
+
t4_l2t_send(sc, wr, toep->l2te);
}
More information about the dev-commits-src-branches
mailing list