From patchwork Tue Aug 15 04:56:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13353531 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C490F8BEB for ; Tue, 15 Aug 2023 04:57:22 +0000 (UTC) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B35BF for ; Mon, 14 Aug 2023 21:57:19 -0700 (PDT) Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-76ad8892d49so417458085a.1 for ; Mon, 14 Aug 2023 21:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1692075439; x=1692680239; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=jNBOa1nNUo7FYU3UPQvPmKVpKBodh1QQ4ntRQwyAVpo=; b=DUxHweCxf4pOIzncMuHBXqD6/mdHUuK3RKFNQ+V5i+1HOaKj4cVrm87IpGsXV7qIUU vPFdS2C1ADXYg+UJc+IbJNq+mrJbnjlZsREcgB3spP2SiZIGUJkLCSbrGVEtpyAYc2f6 qap3hX0hqt4j56BuBPlvJnZcee0G5RaL2hoKg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692075439; x=1692680239; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jNBOa1nNUo7FYU3UPQvPmKVpKBodh1QQ4ntRQwyAVpo=; b=Dez3I5KVysVIl582bmRxreIE0HkcWKVp2MlB5fWXQr65DsOjWp36uzuPeDWWLS+hXD QYOOuBwPXxMFwkifKz9oqOqEF16VDq+BvdcK4WHJbVIfA4TDUWR5MAB+BrftzFTUNB9Q xhD7+Mg+2b4S5sT+e8I6X3++GupAzL4b29gKfskyWPctiH4Ptq13hZ/Gfj2kuiuCVUMl +y1N3OnSGkCeNWit1rlIxBbFqa1wsUgqZs6/qbUYFBepugAJ33vKo/UDNW70M+Y9AnP6 Ik5HSEKbNMydHHGKWGxmIX3cwUXM0xNVQpIOtdPvq7ggMf+4kQqiONE4gbfjihkJTPwh HMRw== X-Gm-Message-State: AOJu0YyLrAZOq9d9GzEbvw0dRbe4YCrtUzUSiRyuU2XIIRqYeumyyWaR vxJyFEW4dfQ/VgyM5+Lpl7KXPA== X-Google-Smtp-Source: AGHT+IFnsfBmRcBjANtJ0QjFopN6ywPG8Fc4XSSCeE80xNAcS250XG+L5skwDqDAubynLx/uvOS07Q== X-Received: by 2002:a05:620a:c50:b0:76a:eeb6:dd7b with SMTP id u16-20020a05620a0c5000b0076aeeb6dd7bmr12753147qki.75.1692075438118; Mon, 14 Aug 2023 21:57:18 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id k28-20020a05620a143c00b00767cbd5e942sm3516575qkj.72.2023.08.14.21.57.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Aug 2023 21:57:17 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com Subject: [PATCH net-next 06/12] bnxt_en: Add tx_resets ring counter Date: Mon, 14 Aug 2023 21:56:52 -0700 Message-Id: <20230815045658.80494-7-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230815045658.80494-1-michael.chan@broadcom.com> References: <20230815045658.80494-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Add a new tx_resets ring counter. This counter will be saved as tx_total_resets across any reset. Since we currently do a full reset in bnxt_sched_reset_txr(), the per ring counter will always be cleared during reset. Only the tx_total_resets count will be meaningful and we only dispaly this under ethtool -S. Link: https://lore.kernel.org/netdev/CACKFLimD-bKmJ1tGZOLYRjWzEwxkri-Mw7iFme1x2Dr0twdCeg@mail.gmail.com/ Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 6 ++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 1 + 3 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index bea562d08d6c..5d6ea2782c2f 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -9397,6 +9397,8 @@ static void bnxt_disable_napi(struct bnxt *bp) struct bnxt_cp_ring_info *cpr; cpr = &bnapi->cp_ring; + if (bnapi->tx_fault) + cpr->sw_stats.tx.tx_resets++; if (bnapi->in_reset) cpr->sw_stats.rx.rx_resets++; napi_disable(&bnapi->napi); @@ -10951,6 +10953,7 @@ static void bnxt_get_one_ring_err_stats(struct bnxt *bp, stats->rx_total_netpoll_discards += sw_stats->rx.rx_netpoll_discards; stats->rx_total_ring_discards += BNXT_GET_RING_STATS64(hw_stats, rx_discard_pkts); + stats->tx_total_resets += sw_stats->tx.tx_resets; stats->tx_total_ring_discards += BNXT_GET_RING_STATS64(hw_stats, tx_discard_pkts); stats->total_missed_irqs += sw_stats->cmn.missed_irqs; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 7287fd3c0763..84cbcfa61bc1 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -939,12 +939,17 @@ struct bnxt_rx_sw_stats { u64 rx_netpoll_discards; }; +struct bnxt_tx_sw_stats { + u64 tx_resets; +}; + struct bnxt_cmn_sw_stats { u64 missed_irqs; }; struct bnxt_sw_stats { struct bnxt_rx_sw_stats rx; + struct bnxt_tx_sw_stats tx; struct bnxt_cmn_sw_stats cmn; }; @@ -955,6 +960,7 @@ struct bnxt_total_ring_err_stats { u64 rx_total_oom_discards; u64 rx_total_netpoll_discards; u64 rx_total_ring_discards; + u64 tx_total_resets; u64 tx_total_ring_discards; u64 total_missed_irqs; }; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index a9f1eede24e9..547247d98eba 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -346,6 +346,7 @@ static const char *const bnxt_ring_err_stats_arr[] = { "rx_total_oom_discards", "rx_total_netpoll_discards", "rx_total_ring_discards", + "tx_total_resets", "tx_total_ring_discards", "total_missed_irqs", };