[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e1121302-9e06-0f16-de72-a782aceabda7@kpanic.de>
Date: Tue, 20 Jul 2021 14:03:09 +0200
From: Stefan Assmann <sassmann@...nic.de>
To: Jakub Kicinski <kuba@...nel.org>,
Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
Konrad Jankowski <konrad0.jankowski@...el.com>
Subject: Re: [PATCH net-next 3/3] iavf: fix locking of critical sections
On 20.07.21 13:31, Jakub Kicinski wrote:
> On Mon, 19 Jul 2021 09:31:54 -0700, Tony Nguyen wrote:
>> To avoid races between iavf_init_task(), iavf_reset_task(),
>> iavf_watchdog_task(), iavf_adminq_task() as well as the shutdown and
>> remove functions more locking is required.
>> The current protection by __IAVF_IN_CRITICAL_TASK is needed in
>> additional places.
>>
>> - The reset task performs state transitions, therefore needs locking.
>> - The adminq task acts on replies from the PF in
>> iavf_virtchnl_completion() which may alter the states.
>> - The init task is not only run during probe but also if a VF gets stuck
>> to reinitialize it.
>> - The shutdown function performs a state transition.
>> - The remove function performs a state transition and also free's
>> resources.
>>
>> iavf_lock_timeout() is introduced to avoid waiting infinitely
>> and cause a deadlock. Rather unlock and print a warning.
>
> I have a vague recollection of complaining about something like this
> previously. Why not use a normal lock? Please at the very least include
> an explanation in the commit message.
>
> If you use bit locks you should use the _lock and _unlock flavours of
> the bitops.
>
Hi Jakub,
yes you remember correctly, back then we agreed to fix this afterwards.
It's not been forgotten, working on the conversion is the next step.
Thanks!
Stefan
Powered by blists - more mailing lists