From patchwork Sun Oct 4 19:22:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 289008 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A7CEC46466 for ; Sun, 4 Oct 2020 19:23:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D9C5205ED for ; Sun, 4 Oct 2020 19:23:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="VpbcE42T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbgJDTXn (ORCPT ); Sun, 4 Oct 2020 15:23:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbgJDTXe (ORCPT ); Sun, 4 Oct 2020 15:23:34 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0939C0613E7 for ; Sun, 4 Oct 2020 12:23:34 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id p21so4201212pju.0 for ; Sun, 04 Oct 2020 12:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bz1ObFGroPNJPOkFzm3prgC3DgC9aWseEOSrrX81+CY=; b=VpbcE42Td1DIq4HH38b2bqcCFchip1YFaOaP6M1JRtLAPLztZBuTzR9aIB+SR0gv6n 8B4RqSDRGyWl2bBfmalaPPV8s6zDJvOG3vt/in+vPtAt8nL0pmQ5cbAK1MmzG2e4rYFh LQ7Vb5R+KkVxlU8npMPY2ePPnS3kG96Z/Deak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bz1ObFGroPNJPOkFzm3prgC3DgC9aWseEOSrrX81+CY=; b=ugeb6Sh+cTj2AcTctbidpeobruGb3FZ2njtVgrw8xqLjptr8tPW67F4VrPI4QjadmN 54u1f3iRmcZY/zZ63Gk5phPyjeQJ8Cn2Cb6E0SAzQY4mRasSdl9shE5z7cTDxSht/ie5 RatMQoaLHsy7QrPNsCL24tXF3q95wXdKk4P38sqQcUb/LbgHnay63xymEAZfYClyFYl8 Bz+ownVfqCMrGy2IMbPbD9ENsHJrsnStfvTHxIjiux7FKvqQe1rDiHNMja7W7koVWv0R mNaBTLweZ5U7R0NmCIDAeJS0qot/kKI+vzrFPMdAPc0VHmNsXd69FUjL9H2w3w9ZD40w 5H3A== X-Gm-Message-State: AOAM532f45nkS1azmsddVEivQP+pfyLoe3WH6tE5eb6gw3nN6bVB5Ewi YahDRB/7LzXmvOEuxnl6FWncoQ== X-Google-Smtp-Source: ABdhPJxAXWvtb7XsYpaCVUyVpOjOGR9V/jm0Ow6PnmnEr1ESkrgxFR4QCI8iY9XklnXuGYkF5KQjqw== X-Received: by 2002:a17:90a:ead1:: with SMTP id ev17mr3387446pjb.36.1601839414095; Sun, 04 Oct 2020 12:23:34 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 138sm9824234pfu.180.2020.10.04.12.23.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Oct 2020 12:23:33 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com Subject: [PATCH net-next 09/11] bnxt_en: Add a software counter for RX ring reset. Date: Sun, 4 Oct 2020 15:22:59 -0400 Message-Id: <1601839381-10446-10-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1601839381-10446-1-git-send-email-michael.chan@broadcom.com> References: <1601839381-10446-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add a per ring rx_resets counter to count these RX resets. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 14 ++++++++++---- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 31877fb4ddd9..084588436b66 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -8770,14 +8770,19 @@ static void bnxt_enable_napi(struct bnxt *bp) int i; for (i = 0; i < bp->cp_nr_rings; i++) { - struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; - bp->bnapi[i]->in_reset = false; + struct bnxt_napi *bnapi = bp->bnapi[i]; + struct bnxt_cp_ring_info *cpr; + + cpr = &bnapi->cp_ring; + if (bnapi->in_reset) + cpr->sw_stats.rx.rx_resets++; + bnapi->in_reset = false; - if (bp->bnapi[i]->rx_ring) { + if (bnapi->rx_ring) { INIT_WORK(&cpr->dim.work, bnxt_dim_work); cpr->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE; } - napi_enable(&bp->bnapi[i]->napi); + napi_enable(&bnapi->napi); } } @@ -10704,6 +10709,7 @@ static void bnxt_rx_ring_reset(struct bnxt *bp) rxr->bnapi->in_reset = false; bnxt_alloc_one_rx_ring(bp, i); cpr = &rxr->bnapi->cp_ring; + cpr->sw_stats.rx.rx_resets++; if (bp->flags & BNXT_FLAG_AGG_RINGS) bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod); bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod); diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index e940a242d958..7d0e6022dc19 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -907,6 +907,7 @@ struct bnxt_rx_ring_info { struct bnxt_rx_sw_stats { u64 rx_l4_csum_errors; + u64 rx_resets; u64 rx_buf_errors; }; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 19b8e3e822f1..52b4ea6ef8c9 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -178,6 +178,7 @@ static const char * const bnxt_ring_tpa2_stats_str[] = { static const char * const bnxt_rx_sw_stats_str[] = { "rx_l4_csum_errors", + "rx_resets", "rx_buf_errors", };