netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>, davem@davemloft.net
Cc: netdev@vger.kernel.org, michael.chan@broadcom.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
Subject: Re: [PATCH net-next 6/6] mlx5: implement ethtool::get_fec_stats
Date: Wed, 14 Apr 2021 23:37:59 -0700	[thread overview]
Message-ID: <89cfa28751667cbebf32ec0e0ecb864fe5d570e9.camel@kernel.org> (raw)
In-Reply-To: <20210414034454.1970967-7-kuba@kernel.org>

On Tue, 2021-04-13 at 20:44 -0700, Jakub Kicinski wrote:
> Report corrected bits.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>  .../ethernet/mellanox/mlx5/core/en_ethtool.c  |  9 ++++++
>  .../ethernet/mellanox/mlx5/core/en_stats.c    | 28
> +++++++++++++++++--
>  
> -#define MLX5E_READ_CTR64_BE_F(ptr, c)                  \
> +#define MLX5E_READ_CTR64_BE_F(ptr, set, c)             \
>         be64_to_cpu(*(__be64 *)((char *)ptr +           \
>                 MLX5_BYTE_OFF(ppcnt_reg,                \
> -
>                        counter_set.eth_802_3_cntrs_grp_data_layout.c##
> _high)))
> +                             counter_set.set.c##_high)))

squint...... looks fine :) 

>  
>  void mlx5e_stats_pause_get(struct mlx5e_priv *priv,
>                            struct ethtool_pause_stats *pause_stats)
> @@ -791,9 +791,11 @@ void mlx5e_stats_pause_get(struct mlx5e_priv
> *priv,
>  
>         pause_stats->tx_pause_frames =
>                 MLX5E_READ_CTR64_BE_F(ppcnt_ieee_802_3,
> +                                    
> eth_802_3_cntrs_grp_data_layout,
>                                      
> a_pause_mac_ctrl_frames_transmitted);
>         pause_stats->rx_pause_frames =
>                 MLX5E_READ_CTR64_BE_F(ppcnt_ieee_802_3,
> +                                    
> eth_802_3_cntrs_grp_data_layout,
>                                      
> a_pause_mac_ctrl_frames_received);
>  }
>  
> @@ -1015,6 +1017,28 @@ static
> MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(phy)
>         mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT,
> 0, 0);
>  }
>  
> +void mlx5e_stats_fec_get(struct mlx5e_priv *priv,
> +                        struct ethtool_fec_stats *fec_stats)
> +{
> +       u32 ppcnt_phy_statistical[MLX5_ST_SZ_DW(ppcnt_reg)];
> +       struct mlx5_core_dev *mdev = priv->mdev;
> +       u32 in[MLX5_ST_SZ_DW(ppcnt_reg)] = {0};
> +       int sz = MLX5_ST_SZ_BYTES(ppcnt_reg);
> +
> +       if (!MLX5_CAP_PCAM_FEATURE(mdev, ppcnt_statistical_group))
> +               return;
> +
> +       MLX5_SET(ppcnt_reg, in, local_port, 1);
> +       MLX5_SET(ppcnt_reg, in, grp,
> MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP);
> +       mlx5_core_access_reg(mdev, in, sz, ppcnt_phy_statistical,
> +                            sz, MLX5_REG_PPCNT, 0, 0);
> +

other than that the FW might fail us here, LGTM.

Acked-by: Saeed Mahameed <saeedm@nvidia.com>





      reply	other threads:[~2021-04-15  6:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  3:44 [PATCH net-next 0/6] ethtool: add standard FEC statistics Jakub Kicinski
2021-04-14  3:44 ` [PATCH net-next 1/6] ethtool: move ethtool_stats_init Jakub Kicinski
2021-04-14  3:44 ` [PATCH net-next 2/6] ethtool: fec_prepare_data() - jump to error handling Jakub Kicinski
2021-04-14  3:44 ` [PATCH net-next 3/6] ethtool: add FEC statistics Jakub Kicinski
2021-04-15  6:25   ` Saeed Mahameed
2021-04-15 15:21     ` Jakub Kicinski
2021-04-15 22:33       ` Saeed Mahameed
2021-04-14  3:44 ` [PATCH net-next 4/6] bnxt: implement ethtool::get_fec_stats Jakub Kicinski
2021-04-15 20:58   ` Michael Chan
2021-04-14  3:44 ` [PATCH net-next 5/6] sfc: ef10: " Jakub Kicinski
2021-04-19 12:39   ` Edward Cree
2021-04-14  3:44 ` [PATCH net-next 6/6] mlx5: " Jakub Kicinski
2021-04-15  6:37   ` Saeed Mahameed [this message]

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=89cfa28751667cbebf32ec0e0ecb864fe5d570e9.camel@kernel.org \
    --to=saeed@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=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /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).