From: Roger Quadros <rogerq@kernel•org>
To: Jakub Kicinski <kuba@kernel•org>,
Vladimir Oltean <vladimir.oltean@nxp•com>,
Ido Schimmel <idosch@idosch•org>,
Nikolay Aleksandrov <razor@blackwall•org>
Cc: davem@davemloft•net, edumazet@google•com, pabeni@redhat•com,
vigneshr@ti•com, srk@ti•com, linux-omap@vger•kernel.org,
netdev@vger•kernel.org, linux-kernel@vger•kernel.org
Subject: Re: [PATCH] net: ethernet: ti: cpsw_ale: optimize cpsw_ale_restore()
Date: Fri, 11 Nov 2022 12:25:50 +0200 [thread overview]
Message-ID: <48804ac2-e5aa-bb48-3a44-922e0bd3b688@kernel.org> (raw)
In-Reply-To: <20221110123249.5f0e19df@kernel.org>
Hi Jakub,
On 10/11/2022 22:32, Jakub Kicinski wrote:
> On Thu, 10 Nov 2022 11:39:47 +0200 Roger Quadros wrote:
>>> Maybe my tree is old but I see we clear only if there is a netdev that
>>
>> This patch depends on this series
>> https://lore.kernel.org/netdev/20221104132310.31577-3-rogerq@kernel.org/T/
>
> I do have those in my tree.
>
>>> needs to be opened but then always call ale_restore(). Is that okay?
>>
>> If netdev is closed and opened ale_restore() is not called.
>> ale_restore() is only called during system suspend/resume path
>> since CPSW-ALE might have lost context during suspend and we want to restore
>> all valid ALE entries.
>
> Ack, what I'm referring to is the contents of am65_cpsw_nuss_resume().
>
> I'm guessing that ALE_CLEAR is expected to be triggered by
> cpsw_ale_start().
>
> Assuming above is true and that ALE_CLEAR comes from cpsw_ale_start(),
> the call stack is:
>
> cpsw_ale_start()
> am65_cpsw_nuss_common_open()
> am65_cpsw_nuss_ndo_slave_open()
> am65_cpsw_nuss_resume()
>
> but resume() only calls ndo_slave_open under certain conditions:
>
> for (i = 0; i < common->port_num; i++) {
> if (netif_running(ndev)) {
> rtnl_lock();
> ret = am65_cpsw_nuss_ndo_slave_open(ndev);
>
> Is there another path? Or perhaps there's nothing to restore
> if all netdevs are down?
I see your point now. We are missing a ALE_CLEAR if all interfaces were
down during suspend/resume.
In this case the call to cpsw_ale_restore() is pointless as ALE will be
cleared again when one of the interfaces is brought up.
I'll revise the patch to call cpsw_ale_restore only if any interface
was running.
>
>> I have a question here. How should ageable entries be treated in this case?
>
> Ah, no idea :) Let's me add experts to To:
Thanks.
cheers,
-roger
next prev parent reply other threads:[~2022-11-11 10:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 13:56 [PATCH] net: ethernet: ti: cpsw_ale: optimize cpsw_ale_restore() Roger Quadros
2022-11-10 3:19 ` Jakub Kicinski
2022-11-10 9:39 ` Roger Quadros
2022-11-10 20:32 ` Jakub Kicinski
2022-11-11 10:25 ` Roger Quadros [this message]
2022-11-11 12:03 ` Vladimir Oltean
2022-11-11 13:35 ` Roger Quadros
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=48804ac2-e5aa-bb48-3a44-922e0bd3b688@kernel.org \
--to=rogerq@kernel$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=idosch@idosch$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-omap@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=razor@blackwall$(echo .)org \
--cc=srk@ti$(echo .)com \
--cc=vigneshr@ti$(echo .)com \
--cc=vladimir.oltean@nxp$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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