From: xiaolei wang <xiaolei.wang@windriver.com>
To: Vladimir Oltean <olteanv@gmail.com>,
"Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
alexandre.torgue@foss.st.com, joabreu@synopsys.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, mcoquelin.stm32@gmail.com,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [net v2 PATCH] net: stmmac: Update CBS parameters when speed changes after linking up
Date: Fri, 31 May 2024 16:23:19 +0800 [thread overview]
Message-ID: <f01f3be2-5185-49e0-91ab-cf3ffabdf9d0@windriver.com> (raw)
In-Reply-To: <20240530143522.32c5lhkg42yiggob@skbuf>
On 5/30/24 22:35, Vladimir Oltean wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Thu, May 30, 2024 at 03:14:48PM +0100, Russell King (Oracle) wrote:
>>> 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?
>> If the driver is having to do computation on the parameters based on
>> the link speed, then when the link speed changes, the parameters
>> no longer match what the kernel _thinks_ those parameters were
>> programmed with.
>>
>> What I'm trying to get over to you is that what you propose causes
>> an inconsistency between how the hardware is _programmed_ to behave
>> for CBS and what the kernel reports the CBS settings are if the
>> link speed changes.
>>
>> It's all very well saying that userspace should basically reconstruct
>> the tc settings when the link changes, but not everyone is aware of
>> that. I'm saying it's a problem if one isn't aware of this issue with
>> this hardware, and one looks at tc qdisc show output, and assumes
>> that reflects what is actually being used when it isn't.
>>
>> It's quality of implmentation - as far as I'm concerned, the kernel
>> should *not* mislead the user like this.
> I was saying that the tc-cbs parameters input into the kernel should
> already have the link speed baked into them:
> portTransmitRate = idleSlope - sendSlope. In theory one could feed any
> data into the kernel, but this is based on the IEEE 802.1Q formulas.
>
> I had missed the fact that there is a calculation dependent on
> priv->speed within tc_setup_cbs(), and I'm sorry for that. I thought
> that the values were passed unaltered down to stmmac_config_cbs(). So
> "make no change to the driver" is no longer my recommendation.
>
> In that case, my recommendation is to do as sja1105_setup_tc_cbs() does:
> replace priv->speed with the portTransmitRate recovered from the tc-cbs
> parameters, and fully expect that when the link speed changes, user
> space comes along and changes those parameters.
I will try it
thanks
xiaolei
next prev parent reply other threads:[~2024-05-31 8:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-30 6:14 [net v2 PATCH] net: stmmac: Update CBS parameters when speed changes after linking up Xiaolei Wang
2024-05-30 12:50 ` Andrew Lunn
2024-05-30 13:28 ` Vladimir Oltean
2024-05-30 13:40 ` Russell King (Oracle)
2024-05-30 13:53 ` Vladimir Oltean
2024-05-30 14:14 ` Russell King (Oracle)
2024-05-30 14:35 ` Vladimir Oltean
2024-05-31 8:23 ` xiaolei wang [this message]
2024-05-30 16:13 ` Jakub Kicinski
2024-06-05 5:26 ` Dan Carpenter
2024-06-05 5:30 ` xiaolei wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f01f3be2-5185-49e0-91ab-cf3ffabdf9d0@windriver.com \
--to=xiaolei.wang@windriver.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox