Index: sys/dev/cxgbe/adapter.h =================================================================== --- sys/dev/cxgbe/adapter.h +++ sys/dev/cxgbe/adapter.h @@ -316,10 +316,6 @@ u_int tx_parse_error; int fcs_reg; uint64_t fcs_base; - u_long tx_toe_tls_records; - u_long tx_toe_tls_octets; - u_long rx_toe_tls_records; - u_long rx_toe_tls_octets; struct callout tick; }; @@ -654,6 +650,8 @@ struct sge_ofld_rxq { struct sge_iq iq; /* MUST be first */ struct sge_fl fl; /* MUST follow iq */ + u_long rx_toe_tls_records; + u_long rx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); static inline struct sge_ofld_rxq * @@ -715,6 +713,8 @@ /* ofld_txq: SGE egress queue + miscellaneous items */ struct sge_ofld_txq { struct sge_wrq wrq; + counter_u64_t tx_toe_tls_records; + counter_u64_t tx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); #define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) Index: sys/dev/cxgbe/t4_main.c =================================================================== --- sys/dev/cxgbe/t4_main.c +++ sys/dev/cxgbe/t4_main.c @@ -7217,19 +7217,6 @@ #undef T4_REGSTAT #undef T4_PORTSTAT - - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_toe_tls_records", - CTLFLAG_RD, &pi->tx_toe_tls_records, - "# of TOE TLS records transmitted"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_toe_tls_octets", - CTLFLAG_RD, &pi->tx_toe_tls_octets, - "# of payload octets in transmitted TOE TLS records"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_records", - CTLFLAG_RD, &pi->rx_toe_tls_records, - "# of TOE TLS records received"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_octets", - CTLFLAG_RD, &pi->rx_toe_tls_octets, - "# of payload octets in received TOE TLS records"); } static int @@ -10764,6 +10751,8 @@ 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_toe_tls_records); + counter_u64_zero(ofld_txq->tx_toe_tls_octets); } #endif #ifdef TCP_OFFLOAD @@ -10771,6 +10760,8 @@ ofld_rxq->fl.cl_allocated = 0; ofld_rxq->fl.cl_recycled = 0; ofld_rxq->fl.cl_fast_recycled = 0; + ofld_rxq->rx_toe_tls_records = 0; + ofld_rxq->rx_toe_tls_octets = 0; } #endif Index: sys/dev/cxgbe/t4_sge.c =================================================================== --- sys/dev/cxgbe/t4_sge.c +++ sys/dev/cxgbe/t4_sge.c @@ -1250,6 +1250,17 @@ rc = alloc_wrq(sc, vi, &ofld_txq->wrq, oid2); if (rc != 0) goto done; + + 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, SYSCTL_CHILDREN(oid2), + 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, SYSCTL_CHILDREN(oid2), + OID_AUTO, "tx_toe_tls_octets", CTLFLAG_RD, + &ofld_txq->tx_toe_tls_octets, + "# of payload octets in transmitted TOE TLS records"); } #endif done: @@ -1310,6 +1321,8 @@ #if defined(TCP_OFFLOAD) || defined(RATELIMIT) for_each_ofld_txq(vi, i, ofld_txq) { free_wrq(sc, &ofld_txq->wrq); + counter_u64_free(ofld_txq->tx_toe_tls_records); + counter_u64_free(ofld_txq->tx_toe_tls_octets); } #endif @@ -3961,6 +3974,13 @@ add_iq_sysctls(&vi->ctx, oid, &ofld_rxq->iq); add_fl_sysctls(pi->adapter, &vi->ctx, oid, &ofld_rxq->fl); + SYSCTL_ADD_ULONG(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_toe_tls_records", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_records, + "# of TOE TLS records received"); + SYSCTL_ADD_ULONG(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_toe_tls_octets", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_octets, + "# of payload octets in received TOE TLS records"); + return (rc); } Index: sys/dev/cxgbe/tom/t4_tls.c =================================================================== --- sys/dev/cxgbe/tom/t4_tls.c +++ sys/dev/cxgbe/tom/t4_tls.c @@ -1664,8 +1664,8 @@ } toep->txsd_avail--; - atomic_add_long(&toep->vi->pi->tx_toe_tls_records, 1); - atomic_add_long(&toep->vi->pi->tx_toe_tls_octets, plen); + counter_u64_add(toep->ofld_txq->tx_toe_tls_records, 1); + counter_u64_add(toep->ofld_txq->tx_toe_tls_octets, plen); t4_l2t_send(sc, wr, toep->l2te); } @@ -1966,8 +1966,8 @@ } toep->txsd_avail--; - atomic_add_long(&toep->vi->pi->tx_toe_tls_records, 1); - atomic_add_long(&toep->vi->pi->tx_toe_tls_octets, m->m_len); + counter_u64_add(toep->ofld_txq->tx_toe_tls_records, 1); + counter_u64_add(toep->ofld_txq->tx_toe_tls_octets, m->m_len); t4_l2t_send(sc, wr, toep->l2te); } @@ -2003,7 +2003,7 @@ m_adj(m, sizeof(*cpl)); len = m->m_pkthdr.len; - atomic_add_long(&toep->vi->pi->rx_toe_tls_octets, len); + toep->ofld_rxq->rx_toe_tls_octets += len; KASSERT(len == G_CPL_TLS_DATA_LENGTH(be32toh(cpl->length_pkd)), ("%s: payload length mismatch", __func__)); @@ -2070,7 +2070,7 @@ m_adj(m, sizeof(*cpl)); len = m->m_pkthdr.len; - atomic_add_long(&toep->vi->pi->rx_toe_tls_records, 1); + toep->ofld_rxq->rx_toe_tls_records++; KASSERT(len == G_CPL_RX_TLS_CMP_LENGTH(be32toh(cpl->pdulength_length)), ("%s: payload length mismatch", __func__));