linux/net/devlink
Ido Schimmel 527a07e176 devlink: Add device lock assert in reload operation
Add an assert to verify that the device lock is always held throughout
reload operations.

Tested the following flows with netdevsim and mlxsw while lockdep is
enabled:

netdevsim:

 # echo "10 1" > /sys/bus/netdevsim/new_device
 # devlink dev reload netdevsim/netdevsim10
 # ip netns add bla
 # devlink dev reload netdevsim/netdevsim10 netns bla
 # ip netns del bla
 # echo 10 > /sys/bus/netdevsim/del_device

mlxsw:

 # devlink dev reload pci/0000:01:00.0
 # ip netns add bla
 # devlink dev reload pci/0000:01:00.0 netns bla
 # ip netns del bla
 # echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/remove
 # echo 1 > /sys/bus/pci/rescan

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-18 17:38:50 +00:00
..
core.c devlink: Acquire device lock during netns dismantle 2023-11-18 17:38:50 +00:00
dev.c devlink: Add device lock assert in reload operation 2023-11-18 17:38:50 +00:00
devl_internal.h devlink: Allow taking device lock in pre_doit operations 2023-11-18 17:38:50 +00: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: Allow taking device lock in pre_doit operations 2023-11-18 17:38:50 +00:00
linecard.c devlink: rename netlink callback to be aligned with the generated ones 2023-10-23 16:12:47 -07:00
Makefile devlink: move devlink_notify_register/unregister() to dev.c 2023-08-28 08:02:24 -07:00
netlink_gen.c devlink: Acquire device lock during reload command 2023-11-18 17:38:50 +00:00
netlink_gen.h devlink: Acquire device lock during reload command 2023-11-18 17:38:50 +00:00
netlink.c devlink: Acquire device lock during reload command 2023-11-18 17:38:50 +00:00
param.c devlink: rename netlink callback to be aligned with the generated ones 2023-10-23 16:12:47 -07:00
port.c devlink: rename netlink callback to be aligned with the generated ones 2023-10-23 16:12:47 -07:00
rate.c devlink: rename netlink callback to be aligned with the generated ones 2023-10-23 16:12:47 -07:00
region.c devlink: Allow taking device lock in pre_doit operations 2023-11-18 17:38:50 +00: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: rename netlink callback to be aligned with the generated ones 2023-10-23 16:12:47 -07:00