RE: [PATCH net-next v1] mlxbf_gige: add support to display pause frame counters

From: David Thompson
Date: Tue Mar 05 2024 - 15:40:26 EST


> -----Original Message-----
> From: Jakub Kicinski <kuba@xxxxxxxxxx>
> Sent: Tuesday, March 5, 2024 1:35 PM
> To: David Thompson <davthompson@xxxxxxxxxx>
> Cc: davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; pabeni@xxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Asmaa Mnebhi
> <asmaa@xxxxxxxxxx>
> Subject: Re: [PATCH net-next v1] mlxbf_gige: add support to display pause frame
> counters
>
> On Tue, 5 Mar 2024 10:18:51 -0500 David Thompson wrote:
> > + /* Read LLU counters only if they are enabled */
> > + if (mlxbf_gige_llu_counters_enabled(priv)) {
> > + data_lo = readl(priv->llu_base +
> MLXBF_GIGE_TX_PAUSE_CNT_LO);
> > + data_hi = readl(priv->llu_base +
> MLXBF_GIGE_TX_PAUSE_CNT_HI);
> > + pause_stats->tx_pause_frames = (data_hi << 32) | data_lo;
> > +
> > + data_lo = readl(priv->llu_base +
> MLXBF_GIGE_RX_PAUSE_CNT_LO);
> > + data_hi = readl(priv->llu_base +
> MLXBF_GIGE_RX_PAUSE_CNT_HI);
> > + pause_stats->rx_pause_frames = (data_hi << 32) | data_lo;
> > + } else {
> > + pause_stats->tx_pause_frames = 0;
> > + pause_stats->rx_pause_frames = 0;
>
> Counters are not enabled, meaning we don't know how many frames were sent?
> Or pause frames are not enabled, therefore we know it's 0?
>
> If the latter we should add a comment clarifying that, if the former:
>
> * @get_pause_stats: Report pause frame statistics. Drivers must not zero
> * statistics which they don't report. The stats structure is initialized
> * to ETHTOOL_STAT_NOT_SET indicating driver does not report statistics.
> --
> pw-bot: cr

Hi Jakub, thank you for your comments.

In this case it's the former, so pause frames are enabled we just don't know how
many are sent or received. I will update the driver patch accordingly and send v2.

Regards, Dave