[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240530135335.yanffjb3ketmoo7u@skbuf>
Date: Thu, 30 May 2024 16:53:35 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Xiaolei Wang <xiaolei.wang@...driver.com>, Andrew Lunn <andrew@...n.ch>,
alexandre.torgue@...s.st.com, joabreu@...opsys.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, mcoquelin.stm32@...il.com,
netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [net v2 PATCH] net: stmmac: Update CBS parameters when speed
changes after linking up
On Thu, May 30, 2024 at 02:40:30PM +0100, Russell King (Oracle) wrote:
> On Thu, May 30, 2024 at 04:28:22PM +0300, Vladimir Oltean wrote:
> > On Thu, May 30, 2024 at 02:50:52PM +0200, Xiaolei Wang wrote:
> > > When the port is relinked, if the speed changes, the CBS parameters
> > > should be updated, so saving the user transmission parameters so
> > > that idle_slope and send_slope can be recalculated after the speed
> > > changes after linking up can help reconfigure CBS after the speed
> > > changes.
> > >
> > > Fixes: 1f705bc61aee ("net: stmmac: Add support for CBS QDISC")
> > > Signed-off-by: Xiaolei Wang <xiaolei.wang@...driver.com>
> > > ---
> > > v1 -> v2
> > > - Update CBS parameters when speed changes
> >
> > May I ask what is the point of this patch? The bandwidth fraction, as
> > IEEE 802.1Q defines it, it a function of idleSlope / portTransmitRate,
> > the latter of which is a runtime variant. If the link speed changes at
> > runtime, which is entirely possible, I see no alternative than to let
> > user space figure out that this happened, and decide what to do. This is
> > a consequence of the fact that the tc-cbs UAPI takes the raw idleSlope
> > as direct input, rather than something more high level like the desired
> > bandwidth for the stream itself, which could be dynamically computed by
> > the kernel.
>
> So what should be the behaviour here? Refuse setting CBS parameters if
> the link is down, and clear the hardware configuration of the CBS
> parameters each and every time there is a link-down event? Isn't that
> going to make the driver's in-use settings inconsistent with what the
> kernel thinks have been set? AFAIK, tc qdisc's don't vanish from the
> kernel just because the link went down.
>
> I think what you're proposing leads to the hardware being effectively
> "de-programmed" for CBS while "tc qdisc show" will probably report
> that CBS is active on the interface - which clearly would be absurd.
No, just program to hardware right away the idleSlope, sendSlope,
loCredit and hiCredit that were communicated by user space. Those were
computed for a specific link speed and it is user space's business to
monitor that this link speed is maintained for as long as the streams
are necessary (otherwise those parameters are no longer valid).
One could even recover the portTransmitRate that the parameters were
computed for (it should be idleSlope - sendSlope, in Kbps).
AKA keep the driver as it is.
I don't see why the CBS parameters would need to be de-programmed from
hardware on a link down event. Is that some stmmac specific thing?
Xiaolei may have a bone to pick with the fact that tc-cbs takes its
input the way it does, but that's an entirely different matter..
Powered by blists - more mailing lists