Lines Matching full:in

12 static int get_pas_size(struct mlx5_srq_attr *in)  in get_pas_size()  argument
14 u32 log_page_size = in->log_page_size + 12; in get_pas_size()
15 u32 log_srq_size = in->log_size; in get_pas_size()
16 u32 log_rq_stride = in->wqe_shift; in get_pas_size()
17 u32 page_offset = in->page_offset; in get_pas_size()
27 static void set_wq(void *wq, struct mlx5_srq_attr *in) in set_wq() argument
29 MLX5_SET(wq, wq, wq_signature, !!(in->flags in set_wq()
31 MLX5_SET(wq, wq, log_wq_pg_sz, in->log_page_size); in set_wq()
32 MLX5_SET(wq, wq, log_wq_stride, in->wqe_shift + 4); in set_wq()
33 MLX5_SET(wq, wq, log_wq_sz, in->log_size); in set_wq()
34 MLX5_SET(wq, wq, page_offset, in->page_offset); in set_wq()
35 MLX5_SET(wq, wq, lwm, in->lwm); in set_wq()
36 MLX5_SET(wq, wq, pd, in->pd); in set_wq()
37 MLX5_SET64(wq, wq, dbr_addr, in->db_record); in set_wq()
40 static void set_srqc(void *srqc, struct mlx5_srq_attr *in) in set_srqc() argument
42 MLX5_SET(srqc, srqc, wq_signature, !!(in->flags in set_srqc()
44 MLX5_SET(srqc, srqc, log_page_size, in->log_page_size); in set_srqc()
45 MLX5_SET(srqc, srqc, log_rq_stride, in->wqe_shift); in set_srqc()
46 MLX5_SET(srqc, srqc, log_srq_size, in->log_size); in set_srqc()
47 MLX5_SET(srqc, srqc, page_offset, in->page_offset); in set_srqc()
48 MLX5_SET(srqc, srqc, lwm, in->lwm); in set_srqc()
49 MLX5_SET(srqc, srqc, pd, in->pd); in set_srqc()
50 MLX5_SET64(srqc, srqc, dbr_addr, in->db_record); in set_srqc()
51 MLX5_SET(srqc, srqc, xrcd, in->xrcd); in set_srqc()
52 MLX5_SET(srqc, srqc, cqn, in->cqn); in set_srqc()
55 static void get_wq(void *wq, struct mlx5_srq_attr *in) in get_wq() argument
58 in->flags &= MLX5_SRQ_FLAG_WQ_SIG; in get_wq()
59 in->log_page_size = MLX5_GET(wq, wq, log_wq_pg_sz); in get_wq()
60 in->wqe_shift = MLX5_GET(wq, wq, log_wq_stride) - 4; in get_wq()
61 in->log_size = MLX5_GET(wq, wq, log_wq_sz); in get_wq()
62 in->page_offset = MLX5_GET(wq, wq, page_offset); in get_wq()
63 in->lwm = MLX5_GET(wq, wq, lwm); in get_wq()
64 in->pd = MLX5_GET(wq, wq, pd); in get_wq()
65 in->db_record = MLX5_GET64(wq, wq, dbr_addr); in get_wq()
68 static void get_srqc(void *srqc, struct mlx5_srq_attr *in) in get_srqc() argument
71 in->flags &= MLX5_SRQ_FLAG_WQ_SIG; in get_srqc()
72 in->log_page_size = MLX5_GET(srqc, srqc, log_page_size); in get_srqc()
73 in->wqe_shift = MLX5_GET(srqc, srqc, log_rq_stride); in get_srqc()
74 in->log_size = MLX5_GET(srqc, srqc, log_srq_size); in get_srqc()
75 in->page_offset = MLX5_GET(srqc, srqc, page_offset); in get_srqc()
76 in->lwm = MLX5_GET(srqc, srqc, lwm); in get_srqc()
77 in->pd = MLX5_GET(srqc, srqc, pd); in get_srqc()
78 in->db_record = MLX5_GET64(srqc, srqc, dbr_addr); in get_srqc()
96 struct mlx5_srq_attr *in) in create_srq_cmd() argument
106 pas_size = get_pas_size(in); in create_srq_cmd()
112 MLX5_SET(create_srq_in, create_in, uid, in->uid); in create_srq_cmd()
116 set_srqc(srqc, in); in create_srq_cmd()
117 memcpy(pas, in->pas, pas_size); in create_srq_cmd()
127 srq->uid = in->uid; in create_srq_cmd()
135 u32 in[MLX5_ST_SZ_DW(destroy_srq_in)] = {}; in destroy_srq_cmd() local
137 MLX5_SET(destroy_srq_in, in, opcode, MLX5_CMD_OP_DESTROY_SRQ); in destroy_srq_cmd()
138 MLX5_SET(destroy_srq_in, in, srqn, srq->srqn); in destroy_srq_cmd()
139 MLX5_SET(destroy_srq_in, in, uid, srq->uid); in destroy_srq_cmd()
141 return mlx5_cmd_exec_in(dev->mdev, destroy_srq, in); in destroy_srq_cmd()
147 u32 in[MLX5_ST_SZ_DW(arm_rq_in)] = {}; in arm_srq_cmd() local
149 MLX5_SET(arm_rq_in, in, opcode, MLX5_CMD_OP_ARM_RQ); in arm_srq_cmd()
150 MLX5_SET(arm_rq_in, in, op_mod, MLX5_ARM_RQ_IN_OP_MOD_SRQ); in arm_srq_cmd()
151 MLX5_SET(arm_rq_in, in, srq_number, srq->srqn); in arm_srq_cmd()
152 MLX5_SET(arm_rq_in, in, lwm, lwm); in arm_srq_cmd()
153 MLX5_SET(arm_rq_in, in, uid, srq->uid); in arm_srq_cmd()
155 return mlx5_cmd_exec_in(dev->mdev, arm_rq, in); in arm_srq_cmd()
161 u32 in[MLX5_ST_SZ_DW(query_srq_in)] = {}; in query_srq_cmd() local
170 MLX5_SET(query_srq_in, in, opcode, MLX5_CMD_OP_QUERY_SRQ); in query_srq_cmd()
171 MLX5_SET(query_srq_in, in, srqn, srq->srqn); in query_srq_cmd()
172 err = mlx5_cmd_exec_inout(dev->mdev, query_srq, in, srq_out); in query_srq_cmd()
187 struct mlx5_srq_attr *in) in create_xrc_srq_cmd() argument
197 pas_size = get_pas_size(in); in create_xrc_srq_cmd()
203 MLX5_SET(create_xrc_srq_in, create_in, uid, in->uid); in create_xrc_srq_cmd()
208 set_srqc(xrc_srqc, in); in create_xrc_srq_cmd()
209 MLX5_SET(xrc_srqc, xrc_srqc, user_index, in->user_index); in create_xrc_srq_cmd()
210 memcpy(pas, in->pas, pas_size); in create_xrc_srq_cmd()
221 srq->uid = in->uid; in create_xrc_srq_cmd()
230 u32 in[MLX5_ST_SZ_DW(destroy_xrc_srq_in)] = {}; in destroy_xrc_srq_cmd() local
232 MLX5_SET(destroy_xrc_srq_in, in, opcode, MLX5_CMD_OP_DESTROY_XRC_SRQ); in destroy_xrc_srq_cmd()
233 MLX5_SET(destroy_xrc_srq_in, in, xrc_srqn, srq->srqn); in destroy_xrc_srq_cmd()
234 MLX5_SET(destroy_xrc_srq_in, in, uid, srq->uid); in destroy_xrc_srq_cmd()
236 return mlx5_cmd_exec_in(dev->mdev, destroy_xrc_srq, in); in destroy_xrc_srq_cmd()
242 u32 in[MLX5_ST_SZ_DW(arm_xrc_srq_in)] = {}; in arm_xrc_srq_cmd() local
244 MLX5_SET(arm_xrc_srq_in, in, opcode, MLX5_CMD_OP_ARM_XRC_SRQ); in arm_xrc_srq_cmd()
245 MLX5_SET(arm_xrc_srq_in, in, op_mod, in arm_xrc_srq_cmd()
247 MLX5_SET(arm_xrc_srq_in, in, xrc_srqn, srq->srqn); in arm_xrc_srq_cmd()
248 MLX5_SET(arm_xrc_srq_in, in, lwm, lwm); in arm_xrc_srq_cmd()
249 MLX5_SET(arm_xrc_srq_in, in, uid, srq->uid); in arm_xrc_srq_cmd()
251 return mlx5_cmd_exec_in(dev->mdev, arm_xrc_srq, in); in arm_xrc_srq_cmd()
258 u32 in[MLX5_ST_SZ_DW(query_xrc_srq_in)] = {}; in query_xrc_srq_cmd() local
267 MLX5_SET(query_xrc_srq_in, in, opcode, MLX5_CMD_OP_QUERY_XRC_SRQ); in query_xrc_srq_cmd()
268 MLX5_SET(query_xrc_srq_in, in, xrc_srqn, srq->srqn); in query_xrc_srq_cmd()
270 err = mlx5_cmd_exec_inout(dev->mdev, query_xrc_srq, in, xrcsrq_out); in query_xrc_srq_cmd()
286 struct mlx5_srq_attr *in) in create_rmp_cmd() argument
297 pas_size = get_pas_size(in); in create_rmp_cmd()
311 MLX5_SET(create_rmp_in, create_in, uid, in->uid); in create_rmp_cmd()
312 set_wq(wq, in); in create_rmp_cmd()
313 memcpy(MLX5_ADDR_OF(rmpc, rmpc, wq.pas), in->pas, pas_size); in create_rmp_cmd()
319 srq->uid = in->uid; in create_rmp_cmd()
330 u32 in[MLX5_ST_SZ_DW(destroy_rmp_in)] = {}; in destroy_rmp_cmd() local
332 MLX5_SET(destroy_rmp_in, in, opcode, MLX5_CMD_OP_DESTROY_RMP); in destroy_rmp_cmd()
333 MLX5_SET(destroy_rmp_in, in, rmpn, srq->srqn); in destroy_rmp_cmd()
334 MLX5_SET(destroy_rmp_in, in, uid, srq->uid); in destroy_rmp_cmd()
335 return mlx5_cmd_exec_in(dev->mdev, destroy_rmp, in); in destroy_rmp_cmd()
342 void *in = NULL; in arm_rmp_cmd() local
353 in = kvzalloc(inlen, GFP_KERNEL); in arm_rmp_cmd()
355 if (!in || !out) { in arm_rmp_cmd()
360 rmpc = MLX5_ADDR_OF(modify_rmp_in, in, ctx); in arm_rmp_cmd()
361 bitmask = MLX5_ADDR_OF(modify_rmp_in, in, bitmask); in arm_rmp_cmd()
364 MLX5_SET(modify_rmp_in, in, rmp_state, MLX5_RMPC_STATE_RDY); in arm_rmp_cmd()
365 MLX5_SET(modify_rmp_in, in, rmpn, srq->srqn); in arm_rmp_cmd()
366 MLX5_SET(modify_rmp_in, in, uid, srq->uid); in arm_rmp_cmd()
370 MLX5_SET(modify_rmp_in, in, opcode, MLX5_CMD_OP_MODIFY_RMP); in arm_rmp_cmd()
372 err = mlx5_cmd_exec_inout(dev->mdev, modify_rmp, in, out); in arm_rmp_cmd()
375 kvfree(in); in arm_rmp_cmd()
418 struct mlx5_srq_attr *in) in create_xrq_cmd() argument
428 pas_size = get_pas_size(in); in create_xrq_cmd()
437 set_wq(wq, in); in create_xrq_cmd()
438 memcpy(MLX5_ADDR_OF(xrqc, xrqc, wq.pas), in->pas, pas_size); in create_xrq_cmd()
440 if (in->type == IB_SRQT_TM) { in create_xrq_cmd()
442 if (in->flags & MLX5_SRQ_FLAG_RNDV) in create_xrq_cmd()
446 in->tm_log_list_size); in create_xrq_cmd()
448 MLX5_SET(xrqc, xrqc, user_index, in->user_index); in create_xrq_cmd()
449 MLX5_SET(xrqc, xrqc, cqn, in->cqn); in create_xrq_cmd()
451 MLX5_SET(create_xrq_in, create_in, uid, in->uid); in create_xrq_cmd()
457 srq->uid = in->uid; in create_xrq_cmd()
465 u32 in[MLX5_ST_SZ_DW(destroy_xrq_in)] = {}; in destroy_xrq_cmd() local
467 MLX5_SET(destroy_xrq_in, in, opcode, MLX5_CMD_OP_DESTROY_XRQ); in destroy_xrq_cmd()
468 MLX5_SET(destroy_xrq_in, in, xrqn, srq->srqn); in destroy_xrq_cmd()
469 MLX5_SET(destroy_xrq_in, in, uid, srq->uid); in destroy_xrq_cmd()
471 return mlx5_cmd_exec_in(dev->mdev, destroy_xrq, in); in destroy_xrq_cmd()
478 u32 in[MLX5_ST_SZ_DW(arm_rq_in)] = {}; in arm_xrq_cmd() local
480 MLX5_SET(arm_rq_in, in, opcode, MLX5_CMD_OP_ARM_RQ); in arm_xrq_cmd()
481 MLX5_SET(arm_rq_in, in, op_mod, MLX5_ARM_RQ_IN_OP_MOD_XRQ); in arm_xrq_cmd()
482 MLX5_SET(arm_rq_in, in, srq_number, srq->srqn); in arm_xrq_cmd()
483 MLX5_SET(arm_rq_in, in, lwm, lwm); in arm_xrq_cmd()
484 MLX5_SET(arm_rq_in, in, uid, srq->uid); in arm_xrq_cmd()
486 return mlx5_cmd_exec_in(dev->mdev, arm_rq, in); in arm_xrq_cmd()
492 u32 in[MLX5_ST_SZ_DW(query_xrq_in)] = {}; in query_xrq_cmd() local
502 MLX5_SET(query_xrq_in, in, opcode, MLX5_CMD_OP_QUERY_XRQ); in query_xrq_cmd()
503 MLX5_SET(query_xrq_in, in, xrqn, srq->srqn); in query_xrq_cmd()
505 err = mlx5_cmd_exec_inout(dev->mdev, query_xrq, in, xrq_out); in query_xrq_cmd()
529 struct mlx5_srq_attr *in) in create_srq_split() argument
532 return create_srq_cmd(dev, srq, in); in create_srq_split()
535 return create_xrc_srq_cmd(dev, srq, in); in create_srq_split()
537 return create_xrq_cmd(dev, srq, in); in create_srq_split()
539 return create_rmp_cmd(dev, srq, in); in create_srq_split()
558 struct mlx5_srq_attr *in) in mlx5_cmd_create_srq() argument
563 switch (in->type) { in mlx5_cmd_create_srq()
574 err = create_srq_split(dev, srq, in); in mlx5_cmd_create_srq()
608 * because we are storing in pre-allocated space xarray in mlx5_cmd_destroy_srq()