[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fbcc1ec3-7ff6-4891-97e3-9763355326f7@iscas.ac.cn>
Date: Sun, 7 Sep 2025 16:22:44 +0800
From: Vivian Wang <wangruikang@...as.ac.cn>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Simon Horman <horms@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Yixun Lan <dlan@...too.org>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Philipp Zabel <p.zabel@...gutronix.de>,
Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt
<palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>, Vadim Fedorenko
<vadim.fedorenko@...ux.dev>, Junhui Liu <junhui.liu@...moral.tech>,
Maxime Chevallier <maxime.chevallier@...tlin.com>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-riscv@...ts.infradead.org,
spacemit@...ts.linux.dev, linux-kernel@...r.kernel.org,
Troy Mitchell <troy.mitchell@...ux.spacemit.com>, Vivian Wang <uwu@...m.page>
Subject: Re: [PATCH net-next v9 2/5] net: spacemit: Add K1 Ethernet MAC
On 9/6/25 07:59, Jakub Kicinski wrote:
> On Sat, 6 Sep 2025 00:35:37 +0800 Vivian Wang wrote:
>>>> On a closer look, these counters in ndev->stats seems to be redundant
>>>> with the hardware-tracked statistics, so maybe I should just not bother
>>>> with updating ndev->stats. Does that make sense?
>>> For rx/tx packets/bytes I think that makes sense.
>>> But what about rx/tx drops?
>> Right... but tstats doesn't have *_dropped. It seems that tx_dropped and
>> rx_dropped are considered "slow path" for real devices. It makes sense
>> to me that those should be very rare.
> Pretty sure Simon meant the per-cpu netdev stats in general.
> There are three types of them, if you need drops I think you
> probably want dstats. Take a look.
According to this comment in net/core/dev.c dev_get_stats():
/*
* IPv{4,6} and udp tunnels share common stat helpers and use
* different stat type (NETDEV_PCPU_STAT_TSTATS vs
* NETDEV_PCPU_STAT_DSTATS). Ensure the accounting is consistent.
*/
"dstats" is meant for tunnels. This doesn't look like the right thing to
use, and no other pcpu_stat_type gives me tx_dropped. Do you think I
should use dstats anyway?
(And yes the only software-tracked one should be tx_dropped. Since we
pre-allocate the RX buffers, there is no opportunity to drop on RX in
software.)
Powered by blists - more mailing lists