]> Git Repo - J-linux.git/blob - drivers/infiniband/hw/mlx5/devx.h
Merge tag 'vfs-6.13-rc7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[J-linux.git] / drivers / infiniband / hw / mlx5 / devx.h
1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /*
3  * Copyright (c) 2019-2020, Mellanox Technologies inc. All rights reserved.
4  */
5
6 #ifndef _MLX5_IB_DEVX_H
7 #define _MLX5_IB_DEVX_H
8
9 #include "mlx5_ib.h"
10
11 #define MLX5_MAX_DESTROY_INBOX_SIZE_DW MLX5_ST_SZ_DW(delete_fte_in)
12 struct devx_obj {
13         struct mlx5_ib_dev      *ib_dev;
14         u64                     obj_id;
15         u32                     dinlen; /* destroy inbox length */
16         u32                     dinbox[MLX5_MAX_DESTROY_INBOX_SIZE_DW];
17         u32                     flags;
18         union {
19                 struct mlx5_ib_mkey     mkey;
20                 struct mlx5_core_dct    core_dct;
21                 struct mlx5_core_cq     core_cq;
22                 u32                     flow_counter_bulk_size;
23         };
24         struct list_head event_sub; /* holds devx_event_subscription entries */
25 };
26 #if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
27 int mlx5_ib_devx_create(struct mlx5_ib_dev *dev, bool is_user);
28 void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev, u16 uid);
29 int mlx5_ib_devx_init(struct mlx5_ib_dev *dev);
30 void mlx5_ib_devx_cleanup(struct mlx5_ib_dev *dev);
31 void mlx5_ib_ufile_hw_cleanup(struct ib_uverbs_file *ufile);
32 #else
33 static inline int mlx5_ib_devx_create(struct mlx5_ib_dev *dev, bool is_user)
34 {
35         return -EOPNOTSUPP;
36 }
37 static inline void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev, u16 uid) {}
38 static inline int mlx5_ib_devx_init(struct mlx5_ib_dev *dev)
39 {
40         return 0;
41 }
42 static inline void mlx5_ib_devx_cleanup(struct mlx5_ib_dev *dev)
43 {
44 }
45 static inline void mlx5_ib_ufile_hw_cleanup(struct ib_uverbs_file *ufile)
46 {
47 }
48 #endif
49 #endif /* _MLX5_IB_DEVX_H */
This page took 0.028772 seconds and 4 git commands to generate.