netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Edward Cree <ecree.xilinx@gmail.com>
Cc: edward.cree@amd.com, linux-net-drivers@amd.com,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	netdev@vger.kernel.org, habetsm.xilinx@gmail.com,
	jacob.e.keller@intel.com
Subject: Re: [PATCH v2 net-next 6/6] sfc: add per-queue RX and TX bytes stats
Date: Tue, 10 Sep 2024 08:37:40 -0700	[thread overview]
Message-ID: <20240910083740.37d5a305@kernel.org> (raw)
In-Reply-To: <81f76aa1-bcdf-f38c-615e-2aa6ed57581b@gmail.com>

On Tue, 10 Sep 2024 16:03:04 +0100 Edward Cree wrote:
> >> + * @tx_bytes: Number of bytes sent since this struct was created.  For TSO,
> >> + *	counts the superframe size, not the sizes of generated frames on the
> >> + *	wire (i.e. the headers are only counted once)  
> > 
> > Hm. Hm. This is technically not documented but my intuition is that
> > tx_bytes should count wire bytes. tx_packets counts segments / wire
> > packets, looking at ef100_tx.c 
> > qstats "bytes" should be the same kind of bytes as counted by the MAC.  
> 
> Well, even if we calculated the wire bytes, the figures still wouldn't
>  match entirely because the MAC counts the FCS, which isn't included
>  here.  We can add that in too, but then one would expect the same
>  thing on RX, which would require an extra branch in the datapath
>  checking NETIF_F_RXFCS and I didn't want to take that performance hit.
> So my preference here would be to keep this as skb bytes rather than
>  wire bytes, since as you say it's the packet count that really
>  matters here.

Right, that's fine. But just to state the obvious - adding / subtracting
FCS bytes is relatively easy for user space to do (assuming RXFCS
handling is correct, as you mention). Converting from LSO bytes to wire
bytes is impossible, FCS is fixed size while header length varies.

      reply	other threads:[~2024-09-10 15:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 15:41 [PATCH v2 net-next 0/6] sfc: per-queue stats edward.cree
2024-09-05 15:41 ` [PATCH v2 net-next 1/6] sfc: remove obsolete counters from struct efx_channel edward.cree
2024-09-05 15:41 ` [PATCH v2 net-next 2/6] sfc: implement basic per-queue stats edward.cree
2024-09-05 15:41 ` [PATCH v2 net-next 3/6] sfc: add n_rx_overlength to ethtool stats edward.cree
2024-09-05 15:41 ` [PATCH v2 net-next 4/6] sfc: implement per-queue rx drop and overrun stats edward.cree
2024-09-05 15:41 ` [PATCH v2 net-next 5/6] sfc: implement per-queue TSO (hw_gso) stats edward.cree
2024-09-05 15:41 ` [PATCH v2 net-next 6/6] sfc: add per-queue RX and TX bytes stats edward.cree
2024-09-07  2:03   ` Jakub Kicinski
2024-09-10 15:03     ` Edward Cree
2024-09-10 15:37       ` Jakub Kicinski [this message]

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=20240910083740.37d5a305@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=edward.cree@amd.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=jacob.e.keller@intel.com \
    --cc=linux-net-drivers@amd.com \
    --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;
as well as URLs for NNTP newsgroup(s).