mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 18:11:20 +00:00
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>
This commit is contained in:
parent
85bf490af1
commit
71c6eaebf0
3 changed files with 9 additions and 0 deletions
|
@ -63,6 +63,7 @@
|
||||||
#include "en/xsk/rx.h"
|
#include "en/xsk/rx.h"
|
||||||
#include "en/xsk/tx.h"
|
#include "en/xsk/tx.h"
|
||||||
#include "en/hv_vhca_stats.h"
|
#include "en/hv_vhca_stats.h"
|
||||||
|
#include "lib/mlx5.h"
|
||||||
|
|
||||||
|
|
||||||
bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev)
|
bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev)
|
||||||
|
@ -5427,6 +5428,7 @@ static void *mlx5e_add(struct mlx5_core_dev *mdev)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dev_net_set(netdev, mlx5_core_net(mdev));
|
||||||
priv = netdev_priv(netdev);
|
priv = netdev_priv(netdev);
|
||||||
|
|
||||||
err = mlx5e_attach(mdev, priv);
|
err = mlx5e_attach(mdev, priv);
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#include "en/tc_tun.h"
|
#include "en/tc_tun.h"
|
||||||
#include "fs_core.h"
|
#include "fs_core.h"
|
||||||
#include "lib/port_tun.h"
|
#include "lib/port_tun.h"
|
||||||
|
#include "lib/mlx5.h"
|
||||||
#define CREATE_TRACE_POINTS
|
#define CREATE_TRACE_POINTS
|
||||||
#include "diag/en_rep_tracepoint.h"
|
#include "diag/en_rep_tracepoint.h"
|
||||||
|
|
||||||
|
@ -1877,6 +1878,7 @@ mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dev_net_set(netdev, mlx5_core_net(dev));
|
||||||
rpriv->netdev = netdev;
|
rpriv->netdev = netdev;
|
||||||
rep->rep_data[REP_ETH].priv = rpriv;
|
rep->rep_data[REP_ETH].priv = rpriv;
|
||||||
INIT_LIST_HEAD(&rpriv->vport_sqs_list);
|
INIT_LIST_HEAD(&rpriv->vport_sqs_list);
|
||||||
|
|
|
@ -84,4 +84,9 @@ int mlx5_create_encryption_key(struct mlx5_core_dev *mdev,
|
||||||
void *key, u32 sz_bytes, u32 *p_key_id);
|
void *key, u32 sz_bytes, u32 *p_key_id);
|
||||||
void mlx5_destroy_encryption_key(struct mlx5_core_dev *mdev, u32 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
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue