aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-29 04:34:56 -0400
committerJason Gunthorpe <jgg@mellanox.com>2018-08-02 22:27:43 -0400
commit9f49a5b5c21d58aa84e16cfdc5e99e49faefcb7a (patch)
treec2c4b7a369b6c4b2690e31d2a8c1b3c0f8023076 /include/linux/mlx5
parenteaeb398425089cb3c8edc81a406109db94b2705c (diff)
RDMA/netdev: Use priv_destructor for netdev cleanup
Now that the unregister_netdev flow for IPoIB no longer relies on external code we can now introduce the use of priv_destructor and needs_free_netdev. The rdma_netdev flow is switched to use the netdev common priv_destructor instead of the special free_rdma_netdev and the IPOIB ULP adjusted: - priv_destructor needs to switch to point to the ULP's destructor which will then call the rdma_ndev's in the right order - We need to be careful around the error unwind of register_netdev as it sometimes calls priv_destructor on failure - ULPs need to use ndo_init/uninit to ensure proper ordering of failures around register_netdev Switching to priv_destructor is a necessary pre-requisite to using the rtnl new_link mechanism. The VNIC user for rdma_netdev should also be revised, but that is left for another patch. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Denis Drozdov <denisd@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r--include/linux/mlx5/driver.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 957199c20a0f..96498ff6beb6 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -1218,14 +1218,11 @@ struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,
1218{ 1218{
1219 return ERR_PTR(-EOPNOTSUPP); 1219 return ERR_PTR(-EOPNOTSUPP);
1220} 1220}
1221
1222static inline void mlx5_rdma_netdev_free(struct net_device *netdev) {}
1223#else 1221#else
1224struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev, 1222struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,
1225 struct ib_device *ibdev, 1223 struct ib_device *ibdev,
1226 const char *name, 1224 const char *name,
1227 void (*setup)(struct net_device *)); 1225 void (*setup)(struct net_device *));
1228void mlx5_rdma_netdev_free(struct net_device *netdev);
1229#endif /* CONFIG_MLX5_CORE_IPOIB */ 1226#endif /* CONFIG_MLX5_CORE_IPOIB */
1230 1227
1231struct mlx5_profile { 1228struct mlx5_profile {