[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240305103443.70e1f619@kernel.org>
Date: Tue, 5 Mar 2024 10:34:43 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: David Thompson <davthompson@...dia.com>
Cc: <davem@...emloft.net>, <edumazet@...gle.com>, <pabeni@...hat.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Asmaa Mnebhi
<asmaa@...dia.com>
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
Powered by blists - more mailing lists