netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<woojung.huh@microchip.com>, <UNGLinuxDriver@microchip.com>,
	<andrew@lunn.ch>, <f.fainelli@gmail.com>, <olteanv@gmail.com>,
	<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>
Subject: Re: [RFC Patch net-next 3/5] net: dsa: microchip: add eth mac grouping for ethtool statistics
Date: Thu, 1 Dec 2022 20:02:30 -0800	[thread overview]
Message-ID: <20221201200230.0f1054fe@kernel.org> (raw)
In-Reply-To: <20221130132902.2984580-4-rakesh.sankaranarayanan@microchip.com>

On Wed, 30 Nov 2022 18:59:00 +0530 Rakesh Sankaranarayanan wrote:
> +	mac_stats->FramesTransmittedOK = ctr[ksz9477_tx_mcast] +
> +					 ctr[ksz9477_tx_bcast] +
> +					 ctr[ksz9477_tx_ucast] +
> +					 ctr[ksz9477_tx_pause];

do control frames count towards FramesTransmittedOK?
Please check the standard I don't recall.

> +	mac_stats->SingleCollisionFrames = ctr[ksz9477_tx_single_col];
> +	mac_stats->MultipleCollisionFrames = ctr[ksz9477_tx_mult_col];
> +	mac_stats->FramesReceivedOK = ctr[ksz9477_rx_mcast] +
> +				      ctr[ksz9477_rx_bcast] +
> +				      ctr[ksz9477_rx_ucast] +
> +				      ctr[ksz9477_rx_pause];
> +	mac_stats->FrameCheckSequenceErrors = ctr[ksz9477_rx_crc_err];
> +	mac_stats->AlignmentErrors = ctr[ksz9477_rx_align_err];
> +	mac_stats->OctetsTransmittedOK = ctr[ksz9477_tx_total_col];

OctetsTransmittedOK = ksz9477_tx_total_col[lisons] ?

> +	mac_stats->InRangeLengthErrors = ctr[ksz9477_rx_oversize];

You use the same counter for RMON oversize statistic, the two
definitely have different semantics, please check the standard
and the datasheet.

Remember that you don't have to fill in all the stats, if the HW does
not maintain a matching statistic - leave the field be. Kernel will
not report to user space unset fields.

  reply	other threads:[~2022-12-02  4:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 13:28 [RFC Patch net-next 0/5] add ethtool categorized statistics Rakesh Sankaranarayanan
2022-11-30 13:28 ` [RFC Patch net-next 1/5] net: dsa: microchip: add rmon grouping for ethtool statistics Rakesh Sankaranarayanan
2022-12-07 13:23   ` Vladimir Oltean
2022-11-30 13:28 ` [RFC Patch net-next 2/5] net: dsa: microchip: add eth ctrl " Rakesh Sankaranarayanan
2022-11-30 13:29 ` [RFC Patch net-next 3/5] net: dsa: microchip: add eth mac " Rakesh Sankaranarayanan
2022-12-02  4:02   ` Jakub Kicinski [this message]
2022-12-02 11:53     ` Rakesh.Sankaranarayanan
2022-12-07 13:21       ` Vladimir Oltean
2022-11-30 13:29 ` [RFC Patch net-next 4/5] net: dsa: microchip: add eth phy " Rakesh Sankaranarayanan
2022-11-30 13:29 ` [RFC Patch net-next 5/5] net: dsa: microchip: remove num_alus variable Rakesh Sankaranarayanan

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=20221201200230.0f1054fe@kernel.org \
    --to=kuba@kernel.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=rakesh.sankaranarayanan@microchip.com \
    --cc=woojung.huh@microchip.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;
as well as URLs for NNTP newsgroup(s).