Lines Matching refs:comp_ctx

266 					struct efa_comp_ctx *comp_ctx)  in efa_com_put_comp_ctx()  argument
268 u16 cmd_id = EFA_GET(&comp_ctx->user_cqe->acq_common_descriptor.command, in efa_com_put_comp_ctx()
273 comp_ctx->occupied = 0; in efa_com_put_comp_ctx()
282 if (aq->comp_ctx[ctx_id].occupied && capture) { in efa_com_get_comp_ctx()
291 aq->comp_ctx[ctx_id].occupied = 1; in efa_com_get_comp_ctx()
296 return &aq->comp_ctx[ctx_id]; in efa_com_get_comp_ctx()
306 struct efa_comp_ctx *comp_ctx; in __efa_com_submit_admin_cmd() local
326 comp_ctx = efa_com_get_comp_ctx(aq, cmd_id, true); in __efa_com_submit_admin_cmd()
327 if (!comp_ctx) { in __efa_com_submit_admin_cmd()
332 comp_ctx->status = EFA_CMD_SUBMITTED; in __efa_com_submit_admin_cmd()
333 comp_ctx->comp_size = comp_size_in_bytes; in __efa_com_submit_admin_cmd()
334 comp_ctx->user_cqe = comp; in __efa_com_submit_admin_cmd()
335 comp_ctx->cmd_opcode = cmd->aq_common_descriptor.opcode; in __efa_com_submit_admin_cmd()
337 reinit_completion(&comp_ctx->wait_event); in __efa_com_submit_admin_cmd()
352 return comp_ctx; in __efa_com_submit_admin_cmd()
359 struct efa_comp_ctx *comp_ctx; in efa_com_init_comp_ctxt() local
362 aq->comp_ctx = devm_kzalloc(aq->dmadev, size, GFP_KERNEL); in efa_com_init_comp_ctxt()
364 if (!aq->comp_ctx || !aq->comp_ctx_pool) { in efa_com_init_comp_ctxt()
366 devm_kfree(aq->dmadev, aq->comp_ctx); in efa_com_init_comp_ctxt()
371 comp_ctx = efa_com_get_comp_ctx(aq, i, false); in efa_com_init_comp_ctxt()
372 if (comp_ctx) in efa_com_init_comp_ctxt()
373 init_completion(&comp_ctx->wait_event); in efa_com_init_comp_ctxt()
391 struct efa_comp_ctx *comp_ctx; in efa_com_submit_admin_cmd() local
400 comp_ctx = __efa_com_submit_admin_cmd(aq, cmd, cmd_size_in_bytes, comp, in efa_com_submit_admin_cmd()
403 if (IS_ERR(comp_ctx)) in efa_com_submit_admin_cmd()
406 return comp_ctx; in efa_com_submit_admin_cmd()
412 struct efa_comp_ctx *comp_ctx; in efa_com_handle_single_admin_completion() local
418 comp_ctx = efa_com_get_comp_ctx(aq, cmd_id, false); in efa_com_handle_single_admin_completion()
419 if (!comp_ctx) { in efa_com_handle_single_admin_completion()
426 comp_ctx->status = EFA_CMD_COMPLETED; in efa_com_handle_single_admin_completion()
427 memcpy(comp_ctx->user_cqe, cqe, comp_ctx->comp_size); in efa_com_handle_single_admin_completion()
430 complete(&comp_ctx->wait_event); in efa_com_handle_single_admin_completion()
493 static int efa_com_wait_and_process_admin_cq_polling(struct efa_comp_ctx *comp_ctx, in efa_com_wait_and_process_admin_cq_polling() argument
507 if (comp_ctx->status != EFA_CMD_SUBMITTED) in efa_com_wait_and_process_admin_cq_polling()
525 err = efa_com_comp_status_to_errno(comp_ctx->user_cqe->acq_common_descriptor.status); in efa_com_wait_and_process_admin_cq_polling()
527 efa_com_put_comp_ctx(aq, comp_ctx); in efa_com_wait_and_process_admin_cq_polling()
531 static int efa_com_wait_and_process_admin_cq_interrupts(struct efa_comp_ctx *comp_ctx, in efa_com_wait_and_process_admin_cq_interrupts() argument
537 wait_for_completion_timeout(&comp_ctx->wait_event, in efa_com_wait_and_process_admin_cq_interrupts()
546 if (comp_ctx->status == EFA_CMD_SUBMITTED) { in efa_com_wait_and_process_admin_cq_interrupts()
553 if (comp_ctx->status == EFA_CMD_COMPLETED) in efa_com_wait_and_process_admin_cq_interrupts()
557 efa_com_cmd_str(comp_ctx->cmd_opcode), in efa_com_wait_and_process_admin_cq_interrupts()
558 comp_ctx->cmd_opcode, comp_ctx->status, in efa_com_wait_and_process_admin_cq_interrupts()
559 comp_ctx, aq->sq.pc, aq->sq.cc, aq->cq.cc); in efa_com_wait_and_process_admin_cq_interrupts()
564 efa_com_cmd_str(comp_ctx->cmd_opcode), in efa_com_wait_and_process_admin_cq_interrupts()
565 comp_ctx->cmd_opcode, comp_ctx->status, in efa_com_wait_and_process_admin_cq_interrupts()
566 comp_ctx, aq->sq.pc, aq->sq.cc, aq->cq.cc); in efa_com_wait_and_process_admin_cq_interrupts()
573 err = efa_com_comp_status_to_errno(comp_ctx->user_cqe->acq_common_descriptor.status); in efa_com_wait_and_process_admin_cq_interrupts()
575 efa_com_put_comp_ctx(aq, comp_ctx); in efa_com_wait_and_process_admin_cq_interrupts()
587 static int efa_com_wait_and_process_admin_cq(struct efa_comp_ctx *comp_ctx, in efa_com_wait_and_process_admin_cq() argument
591 return efa_com_wait_and_process_admin_cq_polling(comp_ctx, aq); in efa_com_wait_and_process_admin_cq()
593 return efa_com_wait_and_process_admin_cq_interrupts(comp_ctx, aq); in efa_com_wait_and_process_admin_cq()
615 struct efa_comp_ctx *comp_ctx; in efa_com_cmd_exec() local
626 comp_ctx = efa_com_submit_admin_cmd(aq, cmd, cmd_size, comp, comp_size); in efa_com_cmd_exec()
627 if (IS_ERR(comp_ctx)) { in efa_com_cmd_exec()
632 cmd->aq_common_descriptor.opcode, PTR_ERR(comp_ctx)); in efa_com_cmd_exec()
636 return PTR_ERR(comp_ctx); in efa_com_cmd_exec()
639 err = efa_com_wait_and_process_admin_cq(comp_ctx, aq); in efa_com_cmd_exec()
646 comp_ctx->user_cqe->acq_common_descriptor.status, err); in efa_com_cmd_exec()
670 devm_kfree(edev->dmadev, aq->comp_ctx); in efa_com_admin_destroy()
787 devm_kfree(edev->dmadev, aq->comp_ctx); in efa_com_admin_init()