diff options
author | Jiri Pirko <jiri@nvidia.com> | 2023-09-13 09:12:43 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-09-17 15:01:47 +0200 |
commit | 6c75258cc220eb11c31ec8cd23ddf7e1232077bd (patch) | |
tree | 43ec3ceceeae9501db8a9c0bc1de437c1272a335 | |
parent | devlink: introduce possibility to expose info about nested devlinks (diff) | |
download | linux-6c75258cc220eb11c31ec8cd23ddf7e1232077bd.tar.xz linux-6c75258cc220eb11c31ec8cd23ddf7e1232077bd.zip |
net/mlx5e: Set en auxiliary devlink instance as nested
Benefit from the previous commit introducing exposure of devlink
instances relationship and set the nested instance for en auxiliary
device.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c index c6b6e290fd79..0b1ac6e5c890 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c @@ -12,11 +12,19 @@ struct mlx5e_dev *mlx5e_create_devlink(struct device *dev, { struct mlx5e_dev *mlx5e_dev; struct devlink *devlink; + int err; devlink = devlink_alloc_ns(&mlx5e_devlink_ops, sizeof(*mlx5e_dev), devlink_net(priv_to_devlink(mdev)), dev); if (!devlink) return ERR_PTR(-ENOMEM); + + err = devl_nested_devlink_set(priv_to_devlink(mdev), devlink); + if (err) { + devlink_free(devlink); + return ERR_PTR(err); + } + devlink_register(devlink); return devlink_priv(devlink); } |