net/mlx5: SF, Implement peer devlink set for SF representor devlink port
authorJiri Pirko <jiri@nvidia.com>
Wed, 13 Sep 2023 07:12:40 +0000 (09:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Sep 2023 13:01:47 +0000 (14:01 +0100)
commitac5f395685bd16ca30c1c834dcbf8b555605ccae
tree35dc4c58879e2726ed8b4d382b9cf9b633729a56
parent0b7a2721e36c11313f8b0f251a508d25a872cd28
net/mlx5: SF, Implement peer devlink set for SF representor devlink port

Benefit from the existence of internal mlx5 notifier and extend it by
event MLX5_DRIVER_EVENT_SF_PEER_DEVLINK. Use this event from SF
auxiliary device probe/remove functions to pass the registered SF
devlink instance to the SF representor.

Process the new event in SF representor code and call
devl_port_fn_devlink_set() to do the assignments. Implement this in work
to avoid possible deadlock when probe/remove function of SF may be
called with devlink instance lock held during devlink reload.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.h
drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c
drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c
include/linux/mlx5/device.h