summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/devx.h
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2020-07-02 10:18:08 +0200
committerJason Gunthorpe <jgg@nvidia.com>2020-07-07 19:05:51 +0200
commitd8b7515e25ec0a294c18e366f98e85fcb4a035e3 (patch)
tree598f9c5907c7a95c95e1d6a646f27bf50f4c148b /drivers/infiniband/hw/mlx5/devx.h
parentRDMA/mlx5: Separate flow steering logic from main.c (diff)
downloadlinux-d8b7515e25ec0a294c18e366f98e85fcb4a035e3.tar.xz
linux-d8b7515e25ec0a294c18e366f98e85fcb4a035e3.zip
RDMA/mlx5: Cleanup DEVX initialization flow
Move DEVX initialization and cleanup flows to the devx.c instead of having almost empty functions in main.c Link: https://lore.kernel.org/r/20200702081809.423482-6-leon@kernel.org Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/devx.h')
-rw-r--r--drivers/infiniband/hw/mlx5/devx.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/devx.h b/drivers/infiniband/hw/mlx5/devx.h
index 9afaa5d22797..1f69866aed16 100644
--- a/drivers/infiniband/hw/mlx5/devx.h
+++ b/drivers/infiniband/hw/mlx5/devx.h
@@ -23,4 +23,23 @@ struct devx_obj {
};
struct list_head event_sub; /* holds devx_event_subscription entries */
};
+#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
+int mlx5_ib_devx_create(struct mlx5_ib_dev *dev, bool is_user);
+void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev, u16 uid);
+int mlx5_ib_devx_init(struct mlx5_ib_dev *dev);
+void mlx5_ib_devx_cleanup(struct mlx5_ib_dev *dev);
+#else
+static inline int mlx5_ib_devx_create(struct mlx5_ib_dev *dev, bool is_user)
+{
+ return -EOPNOTSUPP;
+}
+static inline void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev, u16 uid) {}
+static inline int mlx5_ib_devx_init(struct mlx5_ib_dev *dev)
+{
+ return 0;
+}
+static inline void mlx5_ib_devx_cleanup(struct mlx5_ib_dev *dev)
+{
+}
+#endif
#endif /* _MLX5_IB_DEVX_H */