diff mbox series

[SRU,F:linux-bluefield,v1,1/1] UBUNTU: SAUCE: mlxbf_gige: add interrupt counts to "ethtool -S"

Message ID 73fae5e781b26c7076f94d760f374019bc371c2b.1631043315.git.davthompson@nvidia.com
State New
Headers show
Series UBUNTU: SAUCE: mlxbf_gige: add interrupt counts to "ethtool -S" | expand

Commit Message

David Thompson Sept. 7, 2021, 7:59 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1942931

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

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

Comments

Kleber Sacilotto de Souza Sept. 8, 2021, 8:28 a.m. UTC | #1
On 07.09.21 21:59, David Thompson wrote:
> BugLink: https://bugs.launchpad.net/bugs/1942931
> 
> This patch extends the output of "ethtool -S oob_net0",
> adding interrupt counts for the three interrupt types.
> 
> Reviewed-by: Asmaa Mnebhi <asmaa@nvidia.com>
> Signed-off-by: David Thompson <davthompson@nvidia.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

Thanks

> ---
>   .../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 24a32ffee4e4..972c202a9081 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);
>   }
> @@ -96,6 +94,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)
> @@ -150,6 +151,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,
>
Tim Gardner Sept. 8, 2021, 11:49 a.m. UTC | #2
Acked-by: Tim Gardner <tim.gardner@canonical.com>

On 9/7/21 1:59 PM, David Thompson wrote:
> BugLink: https://bugs.launchpad.net/bugs/1942931
> 
> This patch extends the output of "ethtool -S oob_net0",
> adding interrupt counts for the three interrupt types.
> 
> Reviewed-by: Asmaa Mnebhi <asmaa@nvidia.com>
> Signed-off-by: David Thompson <davthompson@nvidia.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 24a32ffee4e4..972c202a9081 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);
>   }
> @@ -96,6 +94,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)
> @@ -150,6 +151,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,
>
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 24a32ffee4e4..972c202a9081 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);
 }
@@ -96,6 +94,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)
@@ -150,6 +151,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,