From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, michael.chan@broadcom.com,
saeedm@nvidia.com, leon@kernel.org, ecree.xilinx@gmail.com,
habetsm.xilinx@gmail.com, f.fainelli@gmail.com, andrew@lunn.ch,
mkubecek@suse.cz, ariela@nvidia.com,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v2 4/6] bnxt: implement ethtool::get_fec_stats
Date: Thu, 15 Apr 2021 15:53:16 -0700 [thread overview]
Message-ID: <20210415225318.2726095-5-kuba@kernel.org> (raw)
In-Reply-To: <20210415225318.2726095-1-kuba@kernel.org>
Report corrected bits.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 2f8b193a772d..7b90357daba1 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1930,6 +1930,20 @@ static int bnxt_get_fecparam(struct net_device *dev,
return 0;
}
+static void bnxt_get_fec_stats(struct net_device *dev,
+ struct ethtool_fec_stats *fec_stats)
+{
+ struct bnxt *bp = netdev_priv(dev);
+ u64 *rx;
+
+ if (BNXT_VF(bp) || !(bp->flags & BNXT_FLAG_PORT_STATS_EXT))
+ return;
+
+ rx = bp->rx_port_stats_ext.sw_stats;
+ fec_stats->corrected_bits.total =
+ *(rx + BNXT_RX_STATS_EXT_OFFSET(rx_corrected_bits));
+}
+
static u32 bnxt_ethtool_forced_fec_to_fw(struct bnxt_link_info *link_info,
u32 fec)
{
@@ -3991,6 +4005,7 @@ const struct ethtool_ops bnxt_ethtool_ops = {
ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
.get_link_ksettings = bnxt_get_link_ksettings,
.set_link_ksettings = bnxt_set_link_ksettings,
+ .get_fec_stats = bnxt_get_fec_stats,
.get_fecparam = bnxt_get_fecparam,
.set_fecparam = bnxt_set_fecparam,
.get_pause_stats = bnxt_get_pause_stats,
--
2.30.2
next prev parent reply other threads:[~2021-04-15 22:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 22:53 [PATCH net-next v2 0/6] ethtool: add standard FEC statistics Jakub Kicinski
2021-04-15 22:53 ` [PATCH net-next v2 1/6] ethtool: move ethtool_stats_init Jakub Kicinski
2021-04-15 22:53 ` [PATCH net-next v2 2/6] ethtool: fec_prepare_data() - jump to error handling Jakub Kicinski
2021-04-15 22:53 ` [PATCH net-next v2 3/6] ethtool: add FEC statistics Jakub Kicinski
2021-04-15 22:53 ` Jakub Kicinski [this message]
2021-04-15 22:53 ` [PATCH net-next v2 5/6] sfc: ef10: implement ethtool::get_fec_stats Jakub Kicinski
2021-04-20 15:13 ` Edward Cree
2021-04-20 18:24 ` Jakub Kicinski
2021-04-15 22:53 ` [PATCH net-next v2 6/6] mlx5: " Jakub Kicinski
2021-04-15 23:51 ` [PATCH net-next v2 0/6] ethtool: add standard FEC statistics Saeed Mahameed
2021-04-16 0:20 ` patchwork-bot+netdevbpf
2021-05-18 6:48 ` huangguangbin (A)
2021-05-18 17:30 ` Jakub Kicinski
2021-07-01 12:18 ` huangguangbin (A)
2021-07-01 15:42 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210415225318.2726095-5-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=ariela@nvidia.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=habetsm.xilinx@gmail.com \
--cc=leon@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).