aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-04-12 20:56:04 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-04-26 19:02:16 +0000
commitc2e295647ea5da560f68462c4924cbb7e9414b3e (patch)
tree6210802ae7f487496194c1ba12afd57a75e386b6
parent27395a69d10063fe604576daa491e64d95c209fc (diff)
downloadsrc-c2e295647ea5da560f68462c4924cbb7e9414b3e.tar.gz
src-c2e295647ea5da560f68462c4924cbb7e9414b3e.zip
cxgbe: Add counters for iSCSI PDUs transmitted via TOE.
Sponsored by: Chelsio Communications (cherry picked from commit 568e69e4eb0ad1a5c69d8ea4592a4314bd6b6679)
-rw-r--r--sys/dev/cxgbe/adapter.h2
-rw-r--r--sys/dev/cxgbe/t4_main.c2
-rw-r--r--sys/dev/cxgbe/t4_sge.c10
-rw-r--r--sys/dev/cxgbe/tom/t4_cpl_io.c3
4 files changed, 17 insertions, 0 deletions
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,9 +4505,17 @@ 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");
SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO,
@@ -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);
}