All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
	Woojung Huh <woojung.huh@microchip.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Lukas Wunner <lukas@wunner.de>,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net-next v1 2/3] net: dsa: ar9331: add support for pause stats
Date: Mon, 27 Jun 2022 20:09:59 -0700	[thread overview]
Message-ID: <20220627200959.683de11b@kernel.org> (raw)
In-Reply-To: <20220627200238.en2b5zij4sakau2t@skbuf>

On Mon, 27 Jun 2022 23:02:38 +0300 Vladimir Oltean wrote:
> > > Yes, it will be interesting to know how to proceed with it.  
> > 
> > I'm curious as well, AFAIK most drivers do not count pause to ifc stats.  
> 
> How do you know? Just because they manually bump stats->tx_bytes and
> stats->tx_packets during ndo_start_xmit?
> 
> That would be a good assumption, but what if a network driver populates
> struct rtnl_link_stats64 entirely based on counters reported by hardware,
> including {rx,tx}_{packets,bytes}?

Yeah, a lot of drivers use SW stats. What matters is where the packets
get counted, even if device does the counting it may be in/before or
after the MAC. Modern NICs generally don't use MAC-level stats for the
interface because of virtualization.

> Personally I can't really find a reason why not count pause frames if
> you can. And in the same note, why go to the extra lengths of hiding
> them as Oleksij does. For example, the ocelot/felix switches do count
> PAUSE frames as packets/bytes, both on rx and tx.

Yeah, the corrections are always iffy. I understand the doubts, and we
can probably leave things "under-specified" until someone with a strong
preference comes along. But I hope that the virt example makes it clear
that neither of the choices is better (SR-IOV NICs would have to start
adding the pause if we declare rtnl stats as inclusive).

I can see advantages to both counting (they are packets) and not
counting those frames (Linux doesn't see them, they get "invented" 
by HW).

Stats are hard.

  reply	other threads:[~2022-06-28  3:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 12:59 [PATCH net-next v1 1/3] net: dsa: add get_pause_stats support Oleksij Rempel
2022-06-24 12:59 ` [PATCH net-next v1 2/3] net: dsa: ar9331: add support for pause stats Oleksij Rempel
2022-06-24 22:03   ` Vladimir Oltean
2022-06-26 17:10     ` Oleksij Rempel
2022-06-27 16:15       ` Jakub Kicinski
2022-06-27 20:02         ` Vladimir Oltean
2022-06-28  3:09           ` Jakub Kicinski [this message]
2022-06-28  7:22             ` Andrew Lunn
2022-06-28  8:45               ` Oleksij Rempel
2022-06-28 16:10                 ` Jakub Kicinski
2022-06-29  7:07                   ` Oleksij Rempel
2022-06-24 12:59 ` [PATCH net-next v1 3/3] net: dsa: microchip: add pause stats support Oleksij Rempel
2022-06-24 21:52   ` Vladimir Oltean
2022-06-24 22:03 ` [PATCH net-next v1 1/3] net: dsa: add get_pause_stats support Vladimir Oltean

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=20220627200959.683de11b@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=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=vivien.didelot@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.