[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d459d0a7-750a-4cd2-9c68-8031a55f9e9f@blackwall.org>
Date: Thu, 27 Jun 2024 17:12:30 +0300
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Hangbin Liu <liuhangbin@...il.com>,
Jay Vosburgh <jay.vosburgh@...onical.com>
Cc: Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
Andy Gospodarek <andy@...yhouse.net>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Ido Schimmel <idosch@...dia.com>,
Jiri Pirko <jiri@...nulli.us>, Amit Cohen <amcohen@...dia.com>
Subject: Re: [PATCHv3 net-next] bonding: 3ad: send ifinfo notify when mux
state changed
On 27/06/2024 16:17, Hangbin Liu wrote:
> On Thu, Jun 27, 2024 at 01:33:10PM +0300, Nikolay Aleksandrov wrote:
>>> Yes, but at least the admin could get the latest state. With the following
>>> code the admin may not get the latest update if lock rtnl failed.
>>>
>>> if (should_notify_rtnl && rtnl_trylock()) {
>>> bond_slave_lacp_notify(bond);
>>> rtnl_unlock();
>>> }
>>>
>> Well, you mentioned administrators want to see the state changes, please
>> better clarify the exact end goal. Note that technically may even not be
>> the last state as the state change itself happens in parallel (different
>> locks) and any update could be delayed depending on rtnl availability
>> and workqueue re-scheduling. But sure, they will get some update at some point. :)
>
> Ah.. Yes, that's a sad fact :(
>>
>> It all depends on what are the requirements.
>>
>> An uglier but lockless alternative would be to poll the slave's sysfs oper state,
>> that doesn't require any locks and would be up-to-date.
>
> Hmm, that's a workaround, but the admin need to poll the state frequently as
> they don't know when the state will change.
>
Oh wait, that wasn't what I was proposing, I was thinking about the port's oper state
which is already available via a sysfs attribute. Generally sysfs is getting deprecated.
> Hi Jay, are you OK to add this sysfs in bonding?
>
> Thanks
> Hangbin
Powered by blists - more mailing lists