cxgbe: Add counters for iSCSI PDUs transmitted via TOE.

Reviewed by:	np
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D29297
This commit is contained in:
John Baldwin 2021-04-12 13:56:04 -07:00
parent 662053e8dc
commit 568e69e4eb
4 changed files with 17 additions and 0 deletions

View File

@ -712,6 +712,8 @@ struct sge_wrq {
/* ofld_txq: SGE egress queue + miscellaneous items */ /* ofld_txq: SGE egress queue + miscellaneous items */
struct sge_ofld_txq { struct sge_ofld_txq {
struct sge_wrq wrq; 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_records;
counter_u64_t tx_toe_tls_octets; counter_u64_t tx_toe_tls_octets;
} __aligned(CACHE_LINE_SIZE); } __aligned(CACHE_LINE_SIZE);

View File

@ -10756,6 +10756,8 @@ clear_stats(struct adapter *sc, u_int port_id)
for_each_ofld_txq(vi, i, ofld_txq) { for_each_ofld_txq(vi, i, ofld_txq) {
ofld_txq->wrq.tx_wrs_direct = 0; ofld_txq->wrq.tx_wrs_direct = 0;
ofld_txq->wrq.tx_wrs_copied = 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_records);
counter_u64_zero(ofld_txq->tx_toe_tls_octets); counter_u64_zero(ofld_txq->tx_toe_tls_octets);
} }

View File

@ -4507,8 +4507,16 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx,
if (rc != 0) if (rc != 0)
return (rc); 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_records = counter_u64_alloc(M_WAITOK);
ofld_txq->tx_toe_tls_octets = 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, SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO,
"tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records, "tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records,
"# of TOE TLS records transmitted"); "# of TOE TLS records transmitted");
@ -4529,6 +4537,8 @@ free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq)
if (rc != 0) if (rc != 0)
return (rc); 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_records);
counter_u64_free(ofld_txq->tx_toe_tls_octets); counter_u64_free(ofld_txq->tx_toe_tls_octets);

View File

@ -1092,6 +1092,9 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop)
} }
toep->txsd_avail--; 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); t4_l2t_send(sc, wr, toep->l2te);
} }