From: Jakub Kicinski <kuba@kernel.org>
To: David Thompson <davthompson@nvidia.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Asmaa Mnebhi <asmaa@nvidia.com>
Subject: Re: [PATCH net-next v1] mlxbf_gige: add support to display pause frame counters
Date: Tue, 5 Mar 2024 10:34:43 -0800 [thread overview]
Message-ID: <20240305103443.70e1f619@kernel.org> (raw)
In-Reply-To: <20240305151851.533-1-davthompson@nvidia.com>
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
next prev parent reply other threads:[~2024-03-05 18:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 15:18 [PATCH net-next v1] mlxbf_gige: add support to display pause frame counters David Thompson
2024-03-05 18:34 ` Jakub Kicinski [this message]
2024-03-05 20:40 ` David Thompson
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=20240305103443.70e1f619@kernel.org \
--to=kuba@kernel.org \
--cc=asmaa@nvidia.com \
--cc=davem@davemloft.net \
--cc=davthompson@nvidia.com \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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