linux/net/devlink
Shay Drory d7d7512496 devlink: Fix devlink parallel commands processing
Commit 870c7ad4a5 ("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
a380687200 ("devlink: take device reference for devlink object").
Without this commit, it would not be safe to access devlink->dev
lockless.

Fixes: 870c7ad4a5 ("devlink: protect devlink->dev by the instance lock")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-13 08:31:40 +00:00
..
core.c devlink: fix possible use-after-free and memory leaks in devlink_init() 2024-02-20 10:17:46 +01:00
dev.c devlink: introduce a helper for netlink multicast send 2023-12-19 15:31:40 +01:00
devl_internal.h devlink: extend multicast filtering by port index 2023-12-19 15:31:40 +01:00
dpipe.c devlink: rename netlink callback to be aligned with the generated ones 2023-10-23 16:12:47 -07:00
health.c devlink: extend multicast filtering by port index 2023-12-19 15:31:40 +01:00
linecard.c devlink: introduce a helper for netlink multicast send 2023-12-19 15:31:40 +01:00
Makefile devlink: move devlink_notify_register/unregister() to dev.c 2023-08-28 08:02:24 -07:00
netlink_gen.c devlink: Fix length of eswitch inline-mode 2024-03-11 13:13:53 -07:00
netlink_gen.h devlink: add a command to set notification filter and use it for multicasts 2023-12-19 15:31:40 +01:00
netlink.c devlink: Fix devlink parallel commands processing 2024-03-13 08:31:40 +00:00
param.c devlink: introduce a helper for netlink multicast send 2023-12-19 15:31:40 +01:00
port.c devlink: fix port dump cmd type 2024-02-21 17:11:04 -08:00
rate.c devlink: introduce a helper for netlink multicast send 2023-12-19 15:31:40 +01:00
region.c devlink: introduce a helper for netlink multicast send 2023-12-19 15:31:40 +01:00
resource.c devlink: rename netlink callback to be aligned with the generated ones 2023-10-23 16:12:47 -07:00
sb.c devlink: rename netlink callback to be aligned with the generated ones 2023-10-23 16:12:47 -07:00
trap.c devlink: introduce a helper for netlink multicast send 2023-12-19 15:31:40 +01:00