lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220106172910.26431-1-davthompson@nvidia.com>
Date:   Thu, 6 Jan 2022 12:29:10 -0500
From:   David Thompson <davthompson@...dia.com>
To:     <davem@...emloft.net>, <kuba@...nel.org>
CC:     <netdev@...r.kernel.org>, <chenhao288@...ilicon.com>,
        David Thompson <davthompson@...dia.com>,
        Asmaa Mnebhi <asmaa@...dia.com>
Subject: [PATCH net-next v1] mlxbf_gige: add interrupt counts to "ethtool -S"

This patch extends the output of "ethtool -S", adding
interrupt counts for the three mlxbf_gige interrupt types.

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

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,
-- 
2.30.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ