Re: [PATCH net-next v3 2/2] net: dsa: yt921x: Add port TBF support
From: Simon Horman
Date: Fri May 15 2026 - 13:41:15 EST
On Fri, May 15, 2026 at 01:55:58AM +0800, David Yang wrote:
> 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/
Sorry for not noticing that earlier.
> 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.
Maybe adding a comment is sufficient.
> (also trying to address that in
> https://lore.kernel.org/r/20260509122238.2792915-1-mmyangfl@xxxxxxxxx)
Nice, thanks.
>
> > 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)
Ack.