Skip to content

Commit 2152862

Browse files
Leon Romanovskyjgunthorpe
authored andcommitted
IB/mlx5: Limit the scope of struct mlx5_bfreg_info to mlx5_ib
struct mlx5_bfreg_info is used by mlx5_ib only but is exposed to both RDMA and netdev parts of mlx5 driver. Move that struct to mlx5_ib namespace, clean vertical space alignment and convert lib_uar_4k from bool to bitfield. Link: https://lore.kernel.org/r/20200324060143.1569116-5-leon@kernel.org Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent ac42a5e commit 2152862

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

‎drivers/infiniband/hw/mlx5/mlx5_ib.h‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,23 @@ enum mlx5_ib_mmap_type {
128128
MLX5_IB_MMAP_TYPE_UAR_NC = 4,
129129
};
130130

131+
struct mlx5_bfreg_info {
132+
u32 *sys_pages;
133+
int num_low_latency_bfregs;
134+
unsigned int *count;
135+
136+
/*
137+
* protect bfreg allocation data structs
138+
*/
139+
struct mutex lock;
140+
u32 ver;
141+
u8 lib_uar_4k : 1;
142+
u32 num_sys_pages;
143+
u32 num_static_sys_pages;
144+
u32 total_num_bfregs;
145+
u32 num_dyn_bfregs;
146+
};
147+
131148
struct mlx5_ib_ucontext {
132149
struct ib_ucontext ibucontext;
133150
struct list_head db_page_list;

‎include/linux/mlx5/driver.h‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,23 +213,6 @@ enum mlx5_port_status {
213213
MLX5_PORT_DOWN = 2,
214214
};
215215

216-
struct mlx5_bfreg_info {
217-
u32 *sys_pages;
218-
int num_low_latency_bfregs;
219-
unsigned int *count;
220-
221-
/*
222-
* protect bfreg allocation data structs
223-
*/
224-
struct mutex lock;
225-
u32 ver;
226-
bool lib_uar_4k;
227-
u32 num_sys_pages;
228-
u32 num_static_sys_pages;
229-
u32 total_num_bfregs;
230-
u32 num_dyn_bfregs;
231-
};
232-
233216
struct mlx5_cmd_first {
234217
__be32 data[4];
235218
};

0 commit comments

Comments
 (0)