aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h
diff options
context:
space:
mode:
authorMichael Guralnik <michaelgur@mellanox.com>2019-10-29 17:04:30 +0200
committerSaeed Mahameed <saeedm@mellanox.com>2019-11-13 14:25:04 -0800
commit71c6eaebf06aa8353b0dcd57786b801b96fe2c08 (patch)
tree18a9765b0b7844cd26af4451eb8702cf7585afbc /drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h
parentnet/mlx5e: Fix error flow cleanup in mlx5e_tc_tun_create_header_ipv4/6 (diff)
downloadlinux-dev-71c6eaebf06aa8353b0dcd57786b801b96fe2c08.tar.xz
linux-dev-71c6eaebf06aa8353b0dcd57786b801b96fe2c08.zip
net/mlx5e: Set netdev name space on creation
Use devlink instance name space to set the netdev net namespace. Preparation patch for devlink reload implementation. Signed-off-by: Michael Guralnik <michaelgur@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h
index b99d469e4e64..249539247e2e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h
@@ -84,4 +84,9 @@ int mlx5_create_encryption_key(struct mlx5_core_dev *mdev,
void *key, u32 sz_bytes, u32 *p_key_id);
void mlx5_destroy_encryption_key(struct mlx5_core_dev *mdev, u32 key_id);
+static inline struct net *mlx5_core_net(struct mlx5_core_dev *dev)
+{
+ return devlink_net(priv_to_devlink(dev));
+}
+
#endif