Netdev Archive on
help / color / mirror / Atom feed
From: Stefan Assmann <>
To: Jakub Kicinski <>,
	Tony Nguyen <>
	Konrad Jankowski <>
Subject: Re: [PATCH net-next 3/3] iavf: fix locking of critical sections
Date: Tue, 20 Jul 2021 14:03:09 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20210720133153.0f13c92a@cakuba>

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.



  reply	other threads:[~2021-07-20 12:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 16:31 [PATCH net-next 0/3][pull request] 40GbE Intel Wired LAN Driver Updates 2021-07-19 Tony Nguyen
2021-07-19 16:31 ` [PATCH net-next 1/3] i40e: improve locking of mac_filter_hash Tony Nguyen
2021-07-19 16:31 ` [PATCH net-next 2/3] iavf: do not override the adapter state in the watchdog task Tony Nguyen
2021-07-19 16:31 ` [PATCH net-next 3/3] iavf: fix locking of critical sections Tony Nguyen
2021-07-20 11:31   ` Jakub Kicinski
2021-07-20 12:03     ` Stefan Assmann [this message]
2021-07-20 13:30 ` [PATCH net-next 0/3][pull request] 40GbE Intel Wired LAN Driver Updates 2021-07-19 patchwork-bot+netdevbpf

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH net-next 3/3] iavf: fix locking of critical sections' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).