[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <81f76aa1-bcdf-f38c-615e-2aa6ed57581b@gmail.com>
Date: Tue, 10 Sep 2024 16:03:04 +0100
From: Edward Cree <ecree.xilinx@...il.com>
To: Jakub Kicinski <kuba@...nel.org>, edward.cree@....com
Cc: linux-net-drivers@....com, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, netdev@...r.kernel.org, habetsm.xilinx@...il.com,
jacob.e.keller@...el.com
Subject: Re: [PATCH v2 net-next 6/6] sfc: add per-queue RX and TX bytes stats
On 07/09/2024 03:03, Jakub Kicinski wrote:
> On Thu, 5 Sep 2024 16:41:35 +0100 edward.cree@....com wrote:
>> * @tx_packets: Number of packets sent since this struct was created
>
> I think it's number of packets "enqueued",
You're correct.
> but the doc says:
>
> name: tx-packets
> doc: |
> Number of wire packets successfully sent. Packet is considered to be
> successfully sent once it is in device memory (usually this means
> the device has issued a DMA completion for the packet).
Fair point. We *do* have tx_queue->pkts_compl but that's reset every
NAPI poll — it exists for BQL's sake. That said, if it's the
completions you want to count why isn't there just a hook in BQL to
provide those stats automatically without driver involvement?
> Not the end of the world if you prefer to keep as is, but if so maybe
> just acknowledge in commit message or a code comment that this is not
> 100% in line with the definition?
I think it's probably better if I change the code to match the doc.
>> + * @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.
Powered by blists - more mailing lists