Re: [PATCH net-next v3 2/2] net: dsa: yt921x: Add port TBF support

From: David Yang

Date: Thu May 14 2026 - 13:56:49 EST


On Tue, May 12, 2026 at 5:12 PM Simon Horman <horms@xxxxxxxxxx> wrote:
> Is it intended to return 0 here without populating the hardware statistics?
>
> When the driver handles this command by returning 0 without modifying
> qopt->stats, it incorrectly signals to the TC core that hardware statistics
> were successfully fetched. As a result, the subsystem will report
> unmodified (typically zeroed) statistics, which hides any packets shaped
> or dropped by the hardware.

https://lore.kernel.org/all/20260507012311.2187979-1-kuba@xxxxxxxxxx/

Would a stub TC_TBF_STATS case that returns 0 (leaving bstats/qstats
untouched) preserve the flag here? mlxsw does this in its
spectrum_qdisc.c.

(also trying to address that in
https://lore.kernel.org/r/20260509122238.2792915-1-mmyangfl@xxxxxxxxx)

> Should this read the hardware statistic registers (like the newly defined
> YT921X_PORTn_SHAPE_STAT) to update qopt->stats, or alternatively return
> -EOPNOTSUPP to indicate a lack of support?

YT921X_PORTn_SHAPE_STAT gives the token bucket statistic, not flow meter.

(Not a real problem, but trying to suppress further AI gossip)