From: Jiri Pirko <jiri@resnulli.us>
To: Shay Drory <shayd@nvidia.com>
Cc: netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
kuba@kernel.org, edumazet@google.com, jiri@nvidia.com
Subject: Re: [PATCH net v2] devlink: Fix devlink parallel commands processing
Date: Tue, 12 Mar 2024 13:13:21 +0100 [thread overview]
Message-ID: <ZfBG4Z8Jd54QJl0G@nanopsycho> (raw)
In-Reply-To: <20240312105238.296278-1-shayd@nvidia.com>
Tue, Mar 12, 2024 at 11:52:38AM CET, shayd@nvidia.com wrote:
>Commit 870c7ad4a52b ("devlink: protect devlink->dev by the instance
>lock") added devlink instance locking inside a loop that iterates over
>all the registered devlink instances on the machine in the pre-doit
>phase. This can lead to serialization of devlink commands over
>different devlink instances.
>
>For example: While the first devlink instance is executing firmware
>flash, all commands to other devlink instances on the machine are
>forced to wait until the first devlink finishes.
>
>Therefore, in the pre-doit phase, take the devlink instance lock only
>for the devlink instance the command is targeting. Devlink layer is
>taking a reference on the devlink instance, ensuring the devlink->dev
>pointer is valid. This reference taking was introduced by commit
>a380687200e0 ("devlink: take device reference for devlink object").
>Without this commit, it would not be safe to access devlink->dev
>lockless.
>
>Fixes: 870c7ad4a52b ("devlink: protect devlink->dev by the instance lock")
>Signed-off-by: Shay Drory <shayd@nvidia.com>
>---
>v1->v2:
> - Simplify the code by removing the goto
Indeed nicer. Thanks!
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
next prev parent reply other threads:[~2024-03-12 12:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 10:52 [PATCH net v2] devlink: Fix devlink parallel commands processing Shay Drory
2024-03-12 12:13 ` Jiri Pirko [this message]
2024-03-13 8:40 ` 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:
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=ZfBG4Z8Jd54QJl0G@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shayd@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.