Lines Matching +full:in +full:-

1 // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
3 * Copyright (c) 2017-2020, Mellanox Technologies inc. All rights reserved.
11 u32 in[MLX5_ST_SZ_DW(query_special_contexts_in)] = {}; in mlx5_cmd_dump_fill_mkey() local
14 MLX5_SET(query_special_contexts_in, in, opcode, in mlx5_cmd_dump_fill_mkey()
16 err = mlx5_cmd_exec_inout(dev, query_special_contexts, in, out); in mlx5_cmd_dump_fill_mkey()
26 u32 in[MLX5_ST_SZ_DW(query_special_contexts_in)] = {}; in mlx5_cmd_null_mkey() local
29 MLX5_SET(query_special_contexts_in, in, opcode, in mlx5_cmd_null_mkey()
31 err = mlx5_cmd_exec_inout(dev, query_special_contexts, in, out); in mlx5_cmd_null_mkey()
41 u32 in[MLX5_ST_SZ_DW(query_cong_params_in)] = {}; in mlx5_cmd_query_cong_params() local
43 MLX5_SET(query_cong_params_in, in, opcode, in mlx5_cmd_query_cong_params()
45 MLX5_SET(query_cong_params_in, in, cong_protocol, cong_point); in mlx5_cmd_query_cong_params()
47 return mlx5_cmd_exec_inout(dev, query_cong_params, in, out); in mlx5_cmd_query_cong_params()
53 struct mlx5_core_dev *dev = dm->dev; in mlx5_cmd_alloc_memic()
60 u32 in[MLX5_ST_SZ_DW(alloc_memic_in)] = {}; in mlx5_cmd_alloc_memic() local
66 return -EINVAL; in mlx5_cmd_alloc_memic()
72 alignment - MLX5_MEMIC_BASE_ALIGN; in mlx5_cmd_alloc_memic()
74 return -EINVAL; in mlx5_cmd_alloc_memic()
76 MLX5_SET(alloc_memic_in, in, opcode, MLX5_CMD_OP_ALLOC_MEMIC); in mlx5_cmd_alloc_memic()
77 MLX5_SET(alloc_memic_in, in, range_size, num_pages * PAGE_SIZE); in mlx5_cmd_alloc_memic()
78 MLX5_SET(alloc_memic_in, in, memic_size, length); in mlx5_cmd_alloc_memic()
79 MLX5_SET(alloc_memic_in, in, log_memic_addr_alignment, in mlx5_cmd_alloc_memic()
83 spin_lock(&dm->lock); in mlx5_cmd_alloc_memic()
84 page_idx = bitmap_find_next_zero_area(dm->memic_alloc_pages, in mlx5_cmd_alloc_memic()
90 bitmap_set(dm->memic_alloc_pages, in mlx5_cmd_alloc_memic()
93 spin_unlock(&dm->lock); in mlx5_cmd_alloc_memic()
98 MLX5_SET64(alloc_memic_in, in, range_start_addr, in mlx5_cmd_alloc_memic()
101 ret = mlx5_cmd_exec_inout(dev, alloc_memic, in, out); in mlx5_cmd_alloc_memic()
103 spin_lock(&dm->lock); in mlx5_cmd_alloc_memic()
104 bitmap_clear(dm->memic_alloc_pages, in mlx5_cmd_alloc_memic()
106 spin_unlock(&dm->lock); in mlx5_cmd_alloc_memic()
108 if (ret == -EAGAIN) { in mlx5_cmd_alloc_memic()
116 *addr = dev->bar_addr + in mlx5_cmd_alloc_memic()
122 return -ENOMEM; in mlx5_cmd_alloc_memic()
127 struct mlx5_core_dev *dev = dm->dev; in mlx5_cmd_dealloc_memic()
130 u32 in[MLX5_ST_SZ_DW(dealloc_memic_in)] = {}; in mlx5_cmd_dealloc_memic() local
134 addr -= dev->bar_addr; in mlx5_cmd_dealloc_memic()
135 start_page_idx = (addr - hw_start_addr) >> PAGE_SHIFT; in mlx5_cmd_dealloc_memic()
137 MLX5_SET(dealloc_memic_in, in, opcode, MLX5_CMD_OP_DEALLOC_MEMIC); in mlx5_cmd_dealloc_memic()
138 MLX5_SET64(dealloc_memic_in, in, memic_start_addr, addr); in mlx5_cmd_dealloc_memic()
139 MLX5_SET(dealloc_memic_in, in, memic_size, length); in mlx5_cmd_dealloc_memic()
141 err = mlx5_cmd_exec_in(dev, dealloc_memic, in); in mlx5_cmd_dealloc_memic()
145 spin_lock(&dm->lock); in mlx5_cmd_dealloc_memic()
146 bitmap_clear(dm->memic_alloc_pages, in mlx5_cmd_dealloc_memic()
148 spin_unlock(&dm->lock); in mlx5_cmd_dealloc_memic()
153 u32 in[MLX5_ST_SZ_DW(destroy_tir_in)] = {}; in mlx5_cmd_destroy_tir() local
155 MLX5_SET(destroy_tir_in, in, opcode, MLX5_CMD_OP_DESTROY_TIR); in mlx5_cmd_destroy_tir()
156 MLX5_SET(destroy_tir_in, in, tirn, tirn); in mlx5_cmd_destroy_tir()
157 MLX5_SET(destroy_tir_in, in, uid, uid); in mlx5_cmd_destroy_tir()
158 mlx5_cmd_exec_in(dev, destroy_tir, in); in mlx5_cmd_destroy_tir()
163 u32 in[MLX5_ST_SZ_DW(destroy_tis_in)] = {}; in mlx5_cmd_destroy_tis() local
165 MLX5_SET(destroy_tis_in, in, opcode, MLX5_CMD_OP_DESTROY_TIS); in mlx5_cmd_destroy_tis()
166 MLX5_SET(destroy_tis_in, in, tisn, tisn); in mlx5_cmd_destroy_tis()
167 MLX5_SET(destroy_tis_in, in, uid, uid); in mlx5_cmd_destroy_tis()
168 mlx5_cmd_exec_in(dev, destroy_tis, in); in mlx5_cmd_destroy_tis()
173 u32 in[MLX5_ST_SZ_DW(destroy_rqt_in)] = {}; in mlx5_cmd_destroy_rqt() local
175 MLX5_SET(destroy_rqt_in, in, opcode, MLX5_CMD_OP_DESTROY_RQT); in mlx5_cmd_destroy_rqt()
176 MLX5_SET(destroy_rqt_in, in, rqtn, rqtn); in mlx5_cmd_destroy_rqt()
177 MLX5_SET(destroy_rqt_in, in, uid, uid); in mlx5_cmd_destroy_rqt()
178 return mlx5_cmd_exec_in(dev, destroy_rqt, in); in mlx5_cmd_destroy_rqt()
184 u32 in[MLX5_ST_SZ_DW(alloc_transport_domain_in)] = {}; in mlx5_cmd_alloc_transport_domain() local
188 MLX5_SET(alloc_transport_domain_in, in, opcode, in mlx5_cmd_alloc_transport_domain()
190 MLX5_SET(alloc_transport_domain_in, in, uid, uid); in mlx5_cmd_alloc_transport_domain()
192 err = mlx5_cmd_exec_inout(dev, alloc_transport_domain, in, out); in mlx5_cmd_alloc_transport_domain()
203 u32 in[MLX5_ST_SZ_DW(dealloc_transport_domain_in)] = {}; in mlx5_cmd_dealloc_transport_domain() local
205 MLX5_SET(dealloc_transport_domain_in, in, opcode, in mlx5_cmd_dealloc_transport_domain()
207 MLX5_SET(dealloc_transport_domain_in, in, uid, uid); in mlx5_cmd_dealloc_transport_domain()
208 MLX5_SET(dealloc_transport_domain_in, in, transport_domain, tdn); in mlx5_cmd_dealloc_transport_domain()
209 mlx5_cmd_exec_in(dev, dealloc_transport_domain, in); in mlx5_cmd_dealloc_transport_domain()
214 u32 in[MLX5_ST_SZ_DW(dealloc_pd_in)] = {}; in mlx5_cmd_dealloc_pd() local
216 MLX5_SET(dealloc_pd_in, in, opcode, MLX5_CMD_OP_DEALLOC_PD); in mlx5_cmd_dealloc_pd()
217 MLX5_SET(dealloc_pd_in, in, pd, pdn); in mlx5_cmd_dealloc_pd()
218 MLX5_SET(dealloc_pd_in, in, uid, uid); in mlx5_cmd_dealloc_pd()
219 return mlx5_cmd_exec_in(dev, dealloc_pd, in); in mlx5_cmd_dealloc_pd()
225 u32 in[MLX5_ST_SZ_DW(attach_to_mcg_in)] = {}; in mlx5_cmd_attach_mcg() local
228 MLX5_SET(attach_to_mcg_in, in, opcode, MLX5_CMD_OP_ATTACH_TO_MCG); in mlx5_cmd_attach_mcg()
229 MLX5_SET(attach_to_mcg_in, in, qpn, qpn); in mlx5_cmd_attach_mcg()
230 MLX5_SET(attach_to_mcg_in, in, uid, uid); in mlx5_cmd_attach_mcg()
231 gid = MLX5_ADDR_OF(attach_to_mcg_in, in, multicast_gid); in mlx5_cmd_attach_mcg()
233 return mlx5_cmd_exec_in(dev, attach_to_mcg, in); in mlx5_cmd_attach_mcg()
239 u32 in[MLX5_ST_SZ_DW(detach_from_mcg_in)] = {}; in mlx5_cmd_detach_mcg() local
242 MLX5_SET(detach_from_mcg_in, in, opcode, MLX5_CMD_OP_DETACH_FROM_MCG); in mlx5_cmd_detach_mcg()
243 MLX5_SET(detach_from_mcg_in, in, qpn, qpn); in mlx5_cmd_detach_mcg()
244 MLX5_SET(detach_from_mcg_in, in, uid, uid); in mlx5_cmd_detach_mcg()
245 gid = MLX5_ADDR_OF(detach_from_mcg_in, in, multicast_gid); in mlx5_cmd_detach_mcg()
247 return mlx5_cmd_exec_in(dev, detach_from_mcg, in); in mlx5_cmd_detach_mcg()
253 u32 in[MLX5_ST_SZ_DW(alloc_xrcd_in)] = {}; in mlx5_cmd_xrcd_alloc() local
256 MLX5_SET(alloc_xrcd_in, in, opcode, MLX5_CMD_OP_ALLOC_XRCD); in mlx5_cmd_xrcd_alloc()
257 MLX5_SET(alloc_xrcd_in, in, uid, uid); in mlx5_cmd_xrcd_alloc()
258 err = mlx5_cmd_exec_inout(dev, alloc_xrcd, in, out); in mlx5_cmd_xrcd_alloc()
266 u32 in[MLX5_ST_SZ_DW(dealloc_xrcd_in)] = {}; in mlx5_cmd_xrcd_dealloc() local
268 MLX5_SET(dealloc_xrcd_in, in, opcode, MLX5_CMD_OP_DEALLOC_XRCD); in mlx5_cmd_xrcd_dealloc()
269 MLX5_SET(dealloc_xrcd_in, in, xrcd, xrcdn); in mlx5_cmd_xrcd_dealloc()
270 MLX5_SET(dealloc_xrcd_in, in, uid, uid); in mlx5_cmd_xrcd_dealloc()
271 return mlx5_cmd_exec_in(dev, dealloc_xrcd, in); in mlx5_cmd_xrcd_dealloc()
279 int err = -ENOMEM; in mlx5_cmd_mad_ifc()
283 u32 *in; in mlx5_cmd_mad_ifc() local
285 in = kzalloc(inlen, GFP_KERNEL); in mlx5_cmd_mad_ifc()
287 if (!in || !out) in mlx5_cmd_mad_ifc()
290 MLX5_SET(mad_ifc_in, in, opcode, MLX5_CMD_OP_MAD_IFC); in mlx5_cmd_mad_ifc()
291 MLX5_SET(mad_ifc_in, in, op_mod, opmod); in mlx5_cmd_mad_ifc()
292 MLX5_SET(mad_ifc_in, in, port, port); in mlx5_cmd_mad_ifc()
294 data = MLX5_ADDR_OF(mad_ifc_in, in, mad); in mlx5_cmd_mad_ifc()
297 err = mlx5_cmd_exec_inout(dev, mad_ifc, in, out); in mlx5_cmd_mad_ifc()
307 kfree(in); in mlx5_cmd_mad_ifc()