diff mbox series

[net-next,v1] mlxbf_gige: add interrupt counts to "ethtool -S"

Message ID 20220106172910.26431-1-davthompson@nvidia.com (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v1] mlxbf_gige: add interrupt counts to "ethtool -S" | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 1 maintainers not CCed: limings@nvidia.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 32 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

David Thompson Jan. 6, 2022, 5:29 p.m. UTC
This patch extends the output of "ethtool -S", adding
interrupt counts for the three mlxbf_gige interrupt types.

Signed-off-by: David Thompson <davthompson@nvidia.com>
Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
---
 .../mellanox/mlxbf_gige/mlxbf_gige_ethtool.c       | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Comments

Jakub Kicinski Jan. 7, 2022, 3:05 a.m. UTC | #1
On Thu, 6 Jan 2022 12:29:10 -0500 David Thompson wrote:
> This patch extends the output of "ethtool -S", adding
> interrupt counts for the three mlxbf_gige interrupt types.

Why? These count separate, non-shared interrupts. You get the same
stats from /proc/interrupts with per-cpu break down.

Since core already has this information rather than reporting those
via ethtool you should remove the counters from the driver.
David Thompson Jan. 7, 2022, 5:41 p.m. UTC | #2
Thanks for the review Jakub.  Will look into removing the counters.

- Dave

> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Thursday, January 6, 2022 10:05 PM
> To: David Thompson <davthompson@nvidia.com>
> Cc: davem@davemloft.net; netdev@vger.kernel.org;
> chenhao288@hisilicon.com; Asmaa Mnebhi <asmaa@nvidia.com>
> Subject: Re: [PATCH net-next v1] mlxbf_gige: add interrupt counts to "ethtool -
> S"
> 
> On Thu, 6 Jan 2022 12:29:10 -0500 David Thompson wrote:
> > This patch extends the output of "ethtool -S", adding interrupt counts
> > for the three mlxbf_gige interrupt types.
> 
> Why? These count separate, non-shared interrupts. You get the same stats from
> /proc/interrupts with per-cpu break down.
> 
> Since core already has this information rather than reporting those via ethtool
> you should remove the counters from the driver.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c
index ceeb7f4c3f6c..e421e7fa9d7a 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c
@@ -24,11 +24,9 @@  static void mlxbf_gige_get_regs(struct net_device *netdev,
 	regs->version = MLXBF_GIGE_REGS_VERSION;
 
 	/* Read entire MMIO register space and store results
-	 * into the provided buffer. Each 64-bit word is converted
-	 * to big-endian to make the output more readable.
-	 *
-	 * NOTE: by design, a read to an offset without an existing
-	 *       register will be acknowledged and return zero.
+	 * into the provided buffer. By design, a read to an
+	 * offset without an existing register will be
+	 * acknowledged and return zero.
 	 */
 	memcpy_fromio(p, priv->base, MLXBF_GIGE_MMIO_REG_SZ);
 }
@@ -62,6 +60,9 @@  static const struct {
 	{ "tx_fifo_full" },
 	{ "rx_filter_passed_pkts" },
 	{ "rx_filter_discard_pkts" },
+	{ "mac_intr_count" },
+	{ "rx_intr_count" },
+	{ "llu_plu_intr_count" },
 };
 
 static int mlxbf_gige_get_sset_count(struct net_device *netdev, int stringset)
@@ -116,6 +117,9 @@  static void mlxbf_gige_get_ethtool_stats(struct net_device *netdev,
 		   readq(priv->base + MLXBF_GIGE_RX_PASS_COUNTER_ALL));
 	*data++ = (priv->stats.rx_filter_discard_pkts +
 		   readq(priv->base + MLXBF_GIGE_RX_DISC_COUNTER_ALL));
+	*data++ = priv->error_intr_count;
+	*data++ = priv->rx_intr_count;
+	*data++ = priv->llu_plu_intr_count;
 }
 
 static void mlxbf_gige_get_pauseparam(struct net_device *netdev,