From a9f0cf4838cb1991707fa32e1cf363ea18076249 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 19 May 2021 15:56:31 -0700 Subject: [PATCH] cxgbe: Fix some merge-o's for the per-rxq iSCSI counters. I botched a few of the changes when rebasing the changes in 4b6ed0758dc6fad17081d7bd791cb0edbddbddb8 across the changes in 43bbae19483fbde0a91e61acad8a6e71e334c8b8. - Move the counter allocations into alloc_ofld_rxq(). - Free the counters freeing an ofld rxq. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D30267 --- sys/dev/cxgbe/t4_sge.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index ac79d8002784..8a5dc6acc745 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4070,6 +4070,9 @@ alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq, int idx, return (rc); } MPASS(ofld_rxq->iq.flags & IQ_SW_ALLOCATED); + ofld_rxq->rx_iscsi_ddp_setup_ok = counter_u64_alloc(M_WAITOK); + ofld_rxq->rx_iscsi_ddp_setup_error = + counter_u64_alloc(M_WAITOK); add_ofld_rxq_sysctls(&vi->ctx, oid, ofld_rxq); } @@ -4102,6 +4105,8 @@ free_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq) MPASS(!(ofld_rxq->iq.flags & IQ_HW_ALLOCATED)); free_iq_fl(vi->adapter, &ofld_rxq->iq, &ofld_rxq->fl); MPASS(!(ofld_rxq->iq.flags & IQ_SW_ALLOCATED)); + counter_u64_free(ofld_rxq->rx_iscsi_ddp_setup_ok); + counter_u64_free(ofld_rxq->rx_iscsi_ddp_setup_error); bzero(ofld_rxq, sizeof(*ofld_rxq)); } } @@ -4127,8 +4132,6 @@ add_ofld_rxq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TOE iSCSI statistics"); children = SYSCTL_CHILDREN(oid); - ofld_rxq->rx_iscsi_ddp_setup_ok = counter_u64_alloc(M_WAITOK); - ofld_rxq->rx_iscsi_ddp_setup_error = counter_u64_alloc(M_WAITOK); SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "ddp_setup_ok", CTLFLAG_RD, &ofld_rxq->rx_iscsi_ddp_setup_ok, "# of times DDP buffer was setup successfully.");