• Home
  • Raw
  • Download

Lines Matching refs:io

327 efct_hw_init_free_io(struct efct_hw_io *io)  in efct_hw_init_free_io()  argument
333 io->done = NULL; in efct_hw_init_free_io()
334 io->abort_done = NULL; in efct_hw_init_free_io()
335 io->status_saved = false; in efct_hw_init_free_io()
336 io->abort_in_progress = false; in efct_hw_init_free_io()
337 io->type = 0xFFFF; in efct_hw_init_free_io()
338 io->wq = NULL; in efct_hw_init_free_io()
353 efct_hw_io_restore_sgl(struct efct_hw *hw, struct efct_hw_io *io) in efct_hw_io_restore_sgl() argument
356 io->sgl = &io->def_sgl; in efct_hw_io_restore_sgl()
357 io->sgl_count = io->def_sgl_count; in efct_hw_io_restore_sgl()
363 struct efct_hw_io *io = arg; in efct_hw_wq_process_io() local
364 struct efct_hw *hw = io->hw; in efct_hw_wq_process_io()
370 if (io->xbusy && (wcqe->flags & SLI4_WCQE_XB) == 0) in efct_hw_wq_process_io()
371 io->xbusy = false; in efct_hw_wq_process_io()
374 switch (io->type) { in efct_hw_wq_process_io()
402 io->type, io->indicator); in efct_hw_wq_process_io()
411 if (efct_hw_iotype_is_originator(io->type) && in efct_hw_wq_process_io()
416 io->indicator, io->reqtag); in efct_hw_wq_process_io()
423 rc = efct_hw_io_abort(hw, io, false, NULL, NULL); in efct_hw_wq_process_io()
429 io->status_saved = true; in efct_hw_wq_process_io()
430 io->saved_status = status; in efct_hw_wq_process_io()
431 io->saved_ext = ext; in efct_hw_wq_process_io()
432 io->saved_len = len; in efct_hw_wq_process_io()
442 io->indicator, io->reqtag); in efct_hw_wq_process_io()
450 io->indicator, io->reqtag, rc); in efct_hw_wq_process_io()
455 if (io->done) { in efct_hw_wq_process_io()
456 efct_hw_done_t done = io->done; in efct_hw_wq_process_io()
458 io->done = NULL; in efct_hw_wq_process_io()
460 if (io->status_saved) { in efct_hw_wq_process_io()
462 status = io->saved_status; in efct_hw_wq_process_io()
463 len = io->saved_len; in efct_hw_wq_process_io()
464 ext = io->saved_ext; in efct_hw_wq_process_io()
465 io->status_saved = false; in efct_hw_wq_process_io()
469 efct_hw_io_restore_sgl(hw, io); in efct_hw_wq_process_io()
470 done(io, len, status, ext, io->arg); in efct_hw_wq_process_io()
481 struct efct_hw_io *io = NULL; in efct_hw_setup_io() local
489 if (!hw->io) { in efct_hw_setup_io()
490 hw->io = kmalloc_array(hw->config.n_io, sizeof(io), GFP_KERNEL); in efct_hw_setup_io()
491 if (!hw->io) in efct_hw_setup_io()
494 memset(hw->io, 0, hw->config.n_io * sizeof(io)); in efct_hw_setup_io()
497 hw->io[i] = kzalloc(sizeof(*io), GFP_KERNEL); in efct_hw_setup_io()
498 if (!hw->io[i]) in efct_hw_setup_io()
506 kfree(hw->io); in efct_hw_setup_io()
530 io = hw->io[i]; in efct_hw_setup_io()
533 io->hw = hw; in efct_hw_setup_io()
536 io->wqe.wqebuf = &hw->wqe_buffs[i * hw->sli.wqe_size]; in efct_hw_setup_io()
539 wqcb = efct_hw_reqtag_alloc(hw, efct_hw_wq_process_io, io); in efct_hw_setup_io()
544 io->reqtag = wqcb->instance_index; in efct_hw_setup_io()
547 efct_hw_init_free_io(io); in efct_hw_setup_io()
550 io->xbusy = 0; in efct_hw_setup_io()
553 &io->indicator, &index)) { in efct_hw_setup_io()
560 dma = &io->def_sgl; in efct_hw_setup_io()
568 memset(&io->def_sgl, 0, in efct_hw_setup_io()
573 io->def_sgl_count = hw->config.n_sgl; in efct_hw_setup_io()
574 io->sgl = &io->def_sgl; in efct_hw_setup_io()
575 io->sgl_count = io->def_sgl_count; in efct_hw_setup_io()
578 io->xfer_rdy.virt = (void *)xfer_virt; in efct_hw_setup_io()
579 io->xfer_rdy.phys = xfer_phys; in efct_hw_setup_io()
580 io->xfer_rdy.size = sizeof(struct fcp_txrdy); in efct_hw_setup_io()
589 for (i = 0; i < hw->config.n_io && hw->io[i]; i++) { in efct_hw_setup_io()
590 kfree(hw->io[i]); in efct_hw_setup_io()
591 hw->io[i] = NULL; in efct_hw_setup_io()
594 kfree(hw->io); in efct_hw_setup_io()
595 hw->io = NULL; in efct_hw_setup_io()
604 struct efct_hw_io *io = NULL; in efct_hw_init_prereg_io() local
636 if (hw->io[idx + n]->indicator != in efct_hw_init_prereg_io()
637 hw->io[idx + n - 1]->indicator + 1) in efct_hw_init_prereg_io()
641 sgls[n] = hw->io[idx + n]->sgl; in efct_hw_init_prereg_io()
645 hw->io[idx]->indicator, n, sgls, NULL, &req)) { in efct_hw_init_prereg_io()
658 io = hw->io[idx]; in efct_hw_init_prereg_io()
659 io->state = EFCT_HW_IO_STATE_FREE; in efct_hw_init_prereg_io()
660 INIT_LIST_HEAD(&io->list_entry); in efct_hw_init_prereg_io()
661 list_add_tail(&io->list_entry, &hw->io_free); in efct_hw_init_prereg_io()
677 struct efct_hw_io *io = NULL; in efct_hw_init_io() local
686 io = hw->io[idx]; in efct_hw_init_io()
687 io->state = EFCT_HW_IO_STATE_FREE; in efct_hw_init_io()
688 INIT_LIST_HEAD(&io->list_entry); in efct_hw_init_io()
689 list_add_tail(&io->list_entry, &hw->io_free); in efct_hw_init_io()
1580 struct efct_hw_io *io = NULL; in _efct_hw_io_alloc() local
1583 io = list_first_entry(&hw->io_free, struct efct_hw_io, in _efct_hw_io_alloc()
1585 list_del(&io->list_entry); in _efct_hw_io_alloc()
1587 if (io) { in _efct_hw_io_alloc()
1588 INIT_LIST_HEAD(&io->list_entry); in _efct_hw_io_alloc()
1589 list_add_tail(&io->list_entry, &hw->io_inuse); in _efct_hw_io_alloc()
1590 io->state = EFCT_HW_IO_STATE_INUSE; in _efct_hw_io_alloc()
1591 io->abort_reqtag = U32_MAX; in _efct_hw_io_alloc()
1592 io->wq = hw->wq_cpu_array[raw_smp_processor_id()]; in _efct_hw_io_alloc()
1593 if (!io->wq) { in _efct_hw_io_alloc()
1596 io->wq = hw->hw_wq[0]; in _efct_hw_io_alloc()
1598 kref_init(&io->ref); in _efct_hw_io_alloc()
1599 io->release = efct_hw_io_free_internal; in _efct_hw_io_alloc()
1604 return io; in _efct_hw_io_alloc()
1610 struct efct_hw_io *io = NULL; in efct_hw_io_alloc() local
1614 io = _efct_hw_io_alloc(hw); in efct_hw_io_alloc()
1617 return io; in efct_hw_io_alloc()
1622 struct efct_hw_io *io) in efct_hw_io_free_move_correct_list() argument
1628 if (io->xbusy) { in efct_hw_io_free_move_correct_list()
1633 INIT_LIST_HEAD(&io->list_entry); in efct_hw_io_free_move_correct_list()
1634 list_add_tail(&io->list_entry, &hw->io_wait_free); in efct_hw_io_free_move_correct_list()
1635 io->state = EFCT_HW_IO_STATE_WAIT_FREE; in efct_hw_io_free_move_correct_list()
1638 INIT_LIST_HEAD(&io->list_entry); in efct_hw_io_free_move_correct_list()
1639 list_add_tail(&io->list_entry, &hw->io_free); in efct_hw_io_free_move_correct_list()
1640 io->state = EFCT_HW_IO_STATE_FREE; in efct_hw_io_free_move_correct_list()
1645 efct_hw_io_free_common(struct efct_hw *hw, struct efct_hw_io *io) in efct_hw_io_free_common() argument
1648 efct_hw_init_free_io(io); in efct_hw_io_free_common()
1651 efct_hw_io_restore_sgl(hw, io); in efct_hw_io_free_common()
1658 struct efct_hw_io *io = container_of(arg, struct efct_hw_io, ref); in efct_hw_io_free_internal() local
1659 struct efct_hw *hw = io->hw; in efct_hw_io_free_internal()
1662 efct_hw_io_free_common(hw, io); in efct_hw_io_free_internal()
1666 if (!list_empty(&io->list_entry) && !list_empty(&hw->io_inuse)) { in efct_hw_io_free_internal()
1667 list_del_init(&io->list_entry); in efct_hw_io_free_internal()
1668 efct_hw_io_free_move_correct_list(hw, io); in efct_hw_io_free_internal()
1674 efct_hw_io_free(struct efct_hw *hw, struct efct_hw_io *io) in efct_hw_io_free() argument
1676 return kref_put(&io->ref, io->release); in efct_hw_io_free()
1685 return hw->io[ioindex]; in efct_hw_io_lookup()
1689 efct_hw_io_init_sges(struct efct_hw *hw, struct efct_hw_io *io, in efct_hw_io_init_sges() argument
1697 if (!io) { in efct_hw_io_init_sges()
1698 efc_log_err(hw->os, "bad parameter hw=%p io=%p\n", hw, io); in efct_hw_io_init_sges()
1703 io->sgl = &io->def_sgl; in efct_hw_io_init_sges()
1704 io->sgl_count = io->def_sgl_count; in efct_hw_io_init_sges()
1705 io->first_data_sge = 0; in efct_hw_io_init_sges()
1707 memset(io->sgl->virt, 0, 2 * sizeof(struct sli4_sge)); in efct_hw_io_init_sges()
1708 io->n_sge = 0; in efct_hw_io_init_sges()
1709 io->sge_offset = 0; in efct_hw_io_init_sges()
1711 io->type = type; in efct_hw_io_init_sges()
1713 data = io->sgl->virt; in efct_hw_io_init_sges()
1727 cpu_to_le32(upper_32_bits(io->xfer_rdy.phys)); in efct_hw_io_init_sges()
1729 cpu_to_le32(lower_32_bits(io->xfer_rdy.phys)); in efct_hw_io_init_sges()
1730 data->buffer_length = cpu_to_le32(io->xfer_rdy.size); in efct_hw_io_init_sges()
1736 io->n_sge = 1; in efct_hw_io_init_sges()
1765 io->n_sge += skips; in efct_hw_io_init_sges()
1778 efct_hw_io_add_sge(struct efct_hw *hw, struct efct_hw_io *io, in efct_hw_io_add_sge() argument
1784 if (!io || !addr || !length) { in efct_hw_io_add_sge()
1787 hw, io, addr, length); in efct_hw_io_add_sge()
1798 data = io->sgl->virt; in efct_hw_io_add_sge()
1799 data += io->n_sge; in efct_hw_io_add_sge()
1805 sge_flags |= SLI4_SGE_DATA_OFFSET_MASK & io->sge_offset; in efct_hw_io_add_sge()
1819 if (io->n_sge) { in efct_hw_io_add_sge()
1826 if (io->first_data_sge == 0) in efct_hw_io_add_sge()
1827 io->first_data_sge = io->n_sge; in efct_hw_io_add_sge()
1829 io->sge_offset += length; in efct_hw_io_add_sge()
1830 io->n_sge++; in efct_hw_io_add_sge()
1850 struct efct_hw_io *io = arg; in efct_hw_wq_process_abort() local
1851 struct efct_hw *hw = io->hw; in efct_hw_wq_process_abort()
1864 ext == SLI4_FC_LOCAL_REJECT_NO_XRI && io->done) { in efct_hw_wq_process_abort()
1865 efct_hw_done_t done = io->done; in efct_hw_wq_process_abort()
1867 io->done = NULL; in efct_hw_wq_process_abort()
1875 status = io->saved_status; in efct_hw_wq_process_abort()
1876 len = io->saved_len; in efct_hw_wq_process_abort()
1877 ext = io->saved_ext; in efct_hw_wq_process_abort()
1878 io->status_saved = false; in efct_hw_wq_process_abort()
1879 done(io, len, status, ext, io->arg); in efct_hw_wq_process_abort()
1882 if (io->abort_done) { in efct_hw_wq_process_abort()
1883 efct_hw_done_t done = io->abort_done; in efct_hw_wq_process_abort()
1885 io->abort_done = NULL; in efct_hw_wq_process_abort()
1886 done(io, len, status, ext, io->abort_arg); in efct_hw_wq_process_abort()
1890 io->abort_in_progress = false; in efct_hw_wq_process_abort()
1893 if (io->abort_reqtag == U32_MAX) { in efct_hw_wq_process_abort()
1898 wqcb = efct_hw_reqtag_get_instance(hw, io->abort_reqtag); in efct_hw_wq_process_abort()
1905 (void)efct_hw_io_free(hw, io); in efct_hw_wq_process_abort()
2444 struct efct_hw_io *io = NULL; in efct_hw_xabt_process() local
2447 io = efct_hw_io_lookup(hw, rid); in efct_hw_xabt_process()
2448 if (!io) { in efct_hw_xabt_process()
2454 if (!io->xbusy) in efct_hw_xabt_process()
2458 io->xbusy = false; in efct_hw_xabt_process()
2464 if (io->done) { in efct_hw_xabt_process()
2465 efct_hw_done_t done = io->done; in efct_hw_xabt_process()
2466 void *arg = io->arg; in efct_hw_xabt_process()
2472 int status = io->saved_status; in efct_hw_xabt_process()
2473 u32 len = io->saved_len; in efct_hw_xabt_process()
2474 u32 ext = io->saved_ext; in efct_hw_xabt_process()
2476 io->done = NULL; in efct_hw_xabt_process()
2477 io->status_saved = false; in efct_hw_xabt_process()
2479 done(io, len, status, ext, arg); in efct_hw_xabt_process()
2483 if (io->state == EFCT_HW_IO_STATE_INUSE || in efct_hw_xabt_process()
2484 io->state == EFCT_HW_IO_STATE_WAIT_FREE) { in efct_hw_xabt_process()
2490 if (io->state == EFCT_HW_IO_STATE_WAIT_FREE) { in efct_hw_xabt_process()
2491 io->state = EFCT_HW_IO_STATE_FREE; in efct_hw_xabt_process()
2492 list_del_init(&io->list_entry); in efct_hw_xabt_process()
2493 efct_hw_io_free_move_correct_list(hw, io); in efct_hw_xabt_process()
2639 struct efc_disc_io *io = arg; in efct_els_ssrs_send_cb() local
2641 efc_disc_io_complete(io, length, status, ext_status); in efct_els_ssrs_send_cb()
2646 efct_fill_els_params(struct efc_disc_io *io, struct sli_els_params *params) in efct_fill_els_params() argument
2648 u8 *cmd = io->req.virt; in efct_fill_els_params()
2651 params->s_id = io->s_id; in efct_fill_els_params()
2652 params->d_id = io->d_id; in efct_fill_els_params()
2653 params->ox_id = io->iparam.els.ox_id; in efct_fill_els_params()
2654 params->rpi = io->rpi; in efct_fill_els_params()
2655 params->vpi = io->vpi; in efct_fill_els_params()
2656 params->rpi_registered = io->rpi_registered; in efct_fill_els_params()
2657 params->xmit_len = io->xmit_len; in efct_fill_els_params()
2658 params->rsp_len = io->rsp_len; in efct_fill_els_params()
2659 params->timeout = io->iparam.els.timeout; in efct_fill_els_params()
2663 efct_fill_ct_params(struct efc_disc_io *io, struct sli_ct_params *params) in efct_fill_ct_params() argument
2665 params->r_ctl = io->iparam.ct.r_ctl; in efct_fill_ct_params()
2666 params->type = io->iparam.ct.type; in efct_fill_ct_params()
2667 params->df_ctl = io->iparam.ct.df_ctl; in efct_fill_ct_params()
2668 params->d_id = io->d_id; in efct_fill_ct_params()
2669 params->ox_id = io->iparam.ct.ox_id; in efct_fill_ct_params()
2670 params->rpi = io->rpi; in efct_fill_ct_params()
2671 params->vpi = io->vpi; in efct_fill_ct_params()
2672 params->rpi_registered = io->rpi_registered; in efct_fill_ct_params()
2673 params->xmit_len = io->xmit_len; in efct_fill_ct_params()
2674 params->rsp_len = io->rsp_len; in efct_fill_ct_params()
2675 params->timeout = io->iparam.ct.timeout; in efct_fill_ct_params()
2695 efct_els_hw_srrs_send(struct efc *efc, struct efc_disc_io *io) in efct_els_hw_srrs_send() argument
2700 struct efc_dma *send = &io->req; in efct_els_hw_srrs_send()
2701 struct efc_dma *receive = &io->rsp; in efct_els_hw_srrs_send()
2704 u32 len = io->xmit_len; in efct_els_hw_srrs_send()
2721 hio->arg = io; in efct_els_hw_srrs_send()
2741 if (io->io_type == EFC_DISC_IO_ELS_REQ || in efct_els_hw_srrs_send()
2742 io->io_type == EFC_DISC_IO_CT_REQ) { in efct_els_hw_srrs_send()
2759 switch (io->io_type) { in efct_els_hw_srrs_send()
2764 efct_fill_els_params(io, &els_params); in efct_els_hw_srrs_send()
2779 efct_fill_els_params(io, &els_params); in efct_els_hw_srrs_send()
2793 efct_fill_ct_params(io, &ct_params); in efct_els_hw_srrs_send()
2807 efct_fill_ct_params(io, &ct_params); in efct_els_hw_srrs_send()
2818 efc_log_err(hw->os, "bad SRRS type %#x\n", io->io_type); in efct_els_hw_srrs_send()
2847 struct efct_hw_io *io, union efct_hw_io_param_u *iparam, in efct_hw_io_send() argument
2853 if (!io) { in efct_hw_io_send()
2854 pr_err("bad parm hw=%p io=%p\n", hw, io); in efct_hw_io_send()
2866 io->type = type; in efct_hw_io_send()
2867 io->done = cb; in efct_hw_io_send()
2868 io->arg = arg; in efct_hw_io_send()
2876 struct fcp_txrdy *xfer = io->xfer_rdy.virt; in efct_hw_io_send()
2884 if (io->xbusy) in efct_hw_io_send()
2888 iparam->fcp_tgt.xri = io->indicator; in efct_hw_io_send()
2889 iparam->fcp_tgt.tag = io->reqtag; in efct_hw_io_send()
2891 if (sli_fcp_treceive64_wqe(&hw->sli, io->wqe.wqebuf, in efct_hw_io_send()
2892 &io->def_sgl, io->first_data_sge, in efct_hw_io_send()
2903 if (io->xbusy) in efct_hw_io_send()
2908 iparam->fcp_tgt.xri = io->indicator; in efct_hw_io_send()
2909 iparam->fcp_tgt.tag = io->reqtag; in efct_hw_io_send()
2911 if (sli_fcp_tsend64_wqe(&hw->sli, io->wqe.wqebuf, in efct_hw_io_send()
2912 &io->def_sgl, io->first_data_sge, in efct_hw_io_send()
2923 if (io->xbusy) in efct_hw_io_send()
2928 iparam->fcp_tgt.xri = io->indicator; in efct_hw_io_send()
2929 iparam->fcp_tgt.tag = io->reqtag; in efct_hw_io_send()
2931 if (sli_fcp_trsp64_wqe(&hw->sli, io->wqe.wqebuf, in efct_hw_io_send()
2932 &io->def_sgl, SLI4_CQ_DEFAULT, in efct_hw_io_send()
2946 io->xbusy = true; in efct_hw_io_send()
2952 hw->tcmd_wq_submit[io->wq->instance]++; in efct_hw_io_send()
2953 io->wq->use_count++; in efct_hw_io_send()
2954 rc = efct_hw_wq_write(io->wq, &io->wqe); in efct_hw_io_send()
2962 io->xbusy = false; in efct_hw_io_send()
3430 if (hw->io) { in efct_hw_teardown()
3432 if (hw->io[i] && hw->io[i]->sgl && in efct_hw_teardown()
3433 hw->io[i]->sgl->virt) { in efct_hw_teardown()
3435 hw->io[i]->sgl->size, in efct_hw_teardown()
3436 hw->io[i]->sgl->virt, in efct_hw_teardown()
3437 hw->io[i]->sgl->phys); in efct_hw_teardown()
3439 kfree(hw->io[i]); in efct_hw_teardown()
3440 hw->io[i] = NULL; in efct_hw_teardown()
3442 kfree(hw->io); in efct_hw_teardown()
3443 hw->io = NULL; in efct_hw_teardown()