Lines Matching refs:ioim
219 static bfa_boolean_t bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim);
220 static bfa_boolean_t bfa_ioim_sgpg_alloc(struct bfa_ioim_s *ioim);
221 static bfa_boolean_t bfa_ioim_send_abort(struct bfa_ioim_s *ioim);
222 static void bfa_ioim_notify_cleanup(struct bfa_ioim_s *ioim);
228 static bfa_boolean_t bfa_ioim_is_abortable(struct bfa_ioim_s *ioim);
233 static void bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim,
235 static void bfa_ioim_sm_sgalloc(struct bfa_ioim_s *ioim,
237 static void bfa_ioim_sm_active(struct bfa_ioim_s *ioim,
239 static void bfa_ioim_sm_abort(struct bfa_ioim_s *ioim,
241 static void bfa_ioim_sm_cleanup(struct bfa_ioim_s *ioim,
243 static void bfa_ioim_sm_qfull(struct bfa_ioim_s *ioim,
245 static void bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim,
247 static void bfa_ioim_sm_cleanup_qfull(struct bfa_ioim_s *ioim,
249 static void bfa_ioim_sm_hcb(struct bfa_ioim_s *ioim,
251 static void bfa_ioim_sm_hcb_free(struct bfa_ioim_s *ioim,
253 static void bfa_ioim_sm_resfree(struct bfa_ioim_s *ioim,
255 static void bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim,
448 bfa_ioim_profile_comp(struct bfa_ioim_s *ioim) in bfa_ioim_profile_comp() argument
451 &(ioim->itnim->ioprofile.io_latency); in bfa_ioim_profile_comp()
454 val = (u32)(jiffies - ioim->start_time); in bfa_ioim_profile_comp()
455 idx = bfa_ioim_get_index(scsi_bufflen((struct scsi_cmnd *)ioim->dio)); in bfa_ioim_profile_comp()
456 bfa_itnim_ioprofile_update(ioim->itnim, idx); in bfa_ioim_profile_comp()
465 bfa_ioim_profile_start(struct bfa_ioim_s *ioim) in bfa_ioim_profile_start() argument
467 ioim->start_time = jiffies; in bfa_ioim_profile_start()
976 struct bfa_ioim_s *ioim; in bfa_itnim_iocdisable_cleanup() local
985 ioim = (struct bfa_ioim_s *) qe; in bfa_itnim_iocdisable_cleanup()
986 bfa_ioim_iocdisable(ioim); in bfa_itnim_iocdisable_cleanup()
993 ioim = (struct bfa_ioim_s *) qe; in bfa_itnim_iocdisable_cleanup()
994 bfa_ioim_tov(ioim); in bfa_itnim_iocdisable_cleanup()
998 ioim = (struct bfa_ioim_s *) qe; in bfa_itnim_iocdisable_cleanup()
999 bfa_ioim_iocdisable(ioim); in bfa_itnim_iocdisable_cleanup()
1021 struct bfa_ioim_s *ioim; in bfa_itnim_cleanup() local
1028 ioim = (struct bfa_ioim_s *) qe; in bfa_itnim_cleanup()
1034 list_del(&ioim->qe); in bfa_itnim_cleanup()
1035 list_add_tail(&ioim->qe, &itnim->io_cleanup_q); in bfa_itnim_cleanup()
1038 bfa_ioim_cleanup(ioim); in bfa_itnim_cleanup()
1218 struct bfa_ioim_s *ioim; in bfa_itnim_delayed_comp() local
1222 ioim = (struct bfa_ioim_s *)qe; in bfa_itnim_delayed_comp()
1223 bfa_ioim_delayed_comp(ioim, iotov); in bfa_itnim_delayed_comp()
1233 struct bfa_ioim_s *ioim; in bfa_itnim_iotov_online() local
1246 bfa_q_deq(&itnim->pending_q, &ioim); in bfa_itnim_iotov_online()
1247 list_add_tail(&ioim->qe, &itnim->io_q); in bfa_itnim_iotov_online()
1248 bfa_ioim_start(ioim); in bfa_itnim_iotov_online()
1258 struct bfa_ioim_s *ioim; in bfa_itnim_iotov_cleanup() local
1269 bfa_q_deq(&itnim->pending_q, &ioim); in bfa_itnim_iotov_cleanup()
1270 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); in bfa_itnim_iotov_cleanup()
1271 bfa_ioim_tov(ioim); in bfa_itnim_iotov_cleanup()
1512 bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_uninit() argument
1516 if (!bfa_itnim_is_online(ioim->itnim)) { in bfa_ioim_sm_uninit()
1517 if (!bfa_itnim_hold_io(ioim->itnim)) { in bfa_ioim_sm_uninit()
1518 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_uninit()
1519 list_del(&ioim->qe); in bfa_ioim_sm_uninit()
1520 list_add_tail(&ioim->qe, in bfa_ioim_sm_uninit()
1521 &ioim->fcpim->ioim_comp_q); in bfa_ioim_sm_uninit()
1522 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_uninit()
1523 __bfa_cb_ioim_pathtov, ioim); in bfa_ioim_sm_uninit()
1525 list_del(&ioim->qe); in bfa_ioim_sm_uninit()
1526 list_add_tail(&ioim->qe, in bfa_ioim_sm_uninit()
1527 &ioim->itnim->pending_q); in bfa_ioim_sm_uninit()
1532 if (ioim->nsges > BFI_SGE_INLINE) { in bfa_ioim_sm_uninit()
1533 if (!bfa_ioim_sgpg_alloc(ioim)) { in bfa_ioim_sm_uninit()
1534 bfa_sm_set_state(ioim, bfa_ioim_sm_sgalloc); in bfa_ioim_sm_uninit()
1539 if (!bfa_ioim_send_ioreq(ioim)) { in bfa_ioim_sm_uninit()
1540 bfa_sm_set_state(ioim, bfa_ioim_sm_qfull); in bfa_ioim_sm_uninit()
1544 bfa_sm_set_state(ioim, bfa_ioim_sm_active); in bfa_ioim_sm_uninit()
1548 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_uninit()
1549 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_uninit()
1550 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_uninit()
1551 __bfa_cb_ioim_pathtov, ioim); in bfa_ioim_sm_uninit()
1559 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_uninit()
1560 WARN_ON(!bfa_q_is_on_q(&ioim->itnim->pending_q, ioim)); in bfa_ioim_sm_uninit()
1561 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_uninit()
1562 __bfa_cb_ioim_abort, ioim); in bfa_ioim_sm_uninit()
1566 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_uninit()
1574 bfa_ioim_sm_sgalloc(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_sgalloc() argument
1576 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_sgalloc()
1577 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_sgalloc()
1581 if (!bfa_ioim_send_ioreq(ioim)) { in bfa_ioim_sm_sgalloc()
1582 bfa_sm_set_state(ioim, bfa_ioim_sm_qfull); in bfa_ioim_sm_sgalloc()
1585 bfa_sm_set_state(ioim, bfa_ioim_sm_active); in bfa_ioim_sm_sgalloc()
1589 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_sgalloc()
1590 bfa_sgpg_wcancel(ioim->bfa, &ioim->iosp->sgpg_wqe); in bfa_ioim_sm_sgalloc()
1591 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_sgalloc()
1592 ioim); in bfa_ioim_sm_sgalloc()
1593 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_sgalloc()
1597 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_sgalloc()
1598 bfa_sgpg_wcancel(ioim->bfa, &ioim->iosp->sgpg_wqe); in bfa_ioim_sm_sgalloc()
1599 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_sgalloc()
1600 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_sgalloc()
1601 ioim); in bfa_ioim_sm_sgalloc()
1605 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_sgalloc()
1606 bfa_sgpg_wcancel(ioim->bfa, &ioim->iosp->sgpg_wqe); in bfa_ioim_sm_sgalloc()
1607 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_sgalloc()
1608 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_sgalloc()
1609 ioim); in bfa_ioim_sm_sgalloc()
1613 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_sgalloc()
1621 bfa_ioim_sm_active(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_active() argument
1625 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_active()
1626 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_active()
1627 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_active()
1628 __bfa_cb_ioim_good_comp, ioim); in bfa_ioim_sm_active()
1632 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_active()
1633 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_active()
1634 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_comp, in bfa_ioim_sm_active()
1635 ioim); in bfa_ioim_sm_active()
1639 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_active()
1640 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_active()
1641 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_comp, in bfa_ioim_sm_active()
1642 ioim); in bfa_ioim_sm_active()
1646 ioim->iosp->abort_explicit = BFA_TRUE; in bfa_ioim_sm_active()
1647 ioim->io_cbfn = __bfa_cb_ioim_abort; in bfa_ioim_sm_active()
1649 if (bfa_ioim_send_abort(ioim)) in bfa_ioim_sm_active()
1650 bfa_sm_set_state(ioim, bfa_ioim_sm_abort); in bfa_ioim_sm_active()
1652 bfa_sm_set_state(ioim, bfa_ioim_sm_abort_qfull); in bfa_ioim_sm_active()
1653 bfa_stats(ioim->itnim, qwait); in bfa_ioim_sm_active()
1654 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_sm_active()
1655 &ioim->iosp->reqq_wait); in bfa_ioim_sm_active()
1660 ioim->iosp->abort_explicit = BFA_FALSE; in bfa_ioim_sm_active()
1661 ioim->io_cbfn = __bfa_cb_ioim_failed; in bfa_ioim_sm_active()
1663 if (bfa_ioim_send_abort(ioim)) in bfa_ioim_sm_active()
1664 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup); in bfa_ioim_sm_active()
1666 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); in bfa_ioim_sm_active()
1667 bfa_stats(ioim->itnim, qwait); in bfa_ioim_sm_active()
1668 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_sm_active()
1669 &ioim->iosp->reqq_wait); in bfa_ioim_sm_active()
1674 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_active()
1675 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_active()
1676 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_active()
1677 ioim); in bfa_ioim_sm_active()
1681 if (bfa_ioim_maxretry_reached(ioim)) { in bfa_ioim_sm_active()
1683 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_active()
1684 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_active()
1685 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_active()
1686 __bfa_cb_ioim_failed, ioim); in bfa_ioim_sm_active()
1690 bfa_sm_set_state(ioim, bfa_ioim_sm_cmnd_retry); in bfa_ioim_sm_active()
1694 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_active()
1702 bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_cmnd_retry() argument
1707 bfa_ioim_update_iotag(ioim); in bfa_ioim_sm_cmnd_retry()
1708 if (!bfa_ioim_send_ioreq(ioim)) { in bfa_ioim_sm_cmnd_retry()
1709 bfa_sm_set_state(ioim, bfa_ioim_sm_qfull); in bfa_ioim_sm_cmnd_retry()
1712 bfa_sm_set_state(ioim, bfa_ioim_sm_active); in bfa_ioim_sm_cmnd_retry()
1716 ioim->iosp->abort_explicit = BFA_FALSE; in bfa_ioim_sm_cmnd_retry()
1717 ioim->io_cbfn = __bfa_cb_ioim_failed; in bfa_ioim_sm_cmnd_retry()
1719 if (bfa_ioim_send_abort(ioim)) in bfa_ioim_sm_cmnd_retry()
1720 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup); in bfa_ioim_sm_cmnd_retry()
1722 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); in bfa_ioim_sm_cmnd_retry()
1723 bfa_stats(ioim->itnim, qwait); in bfa_ioim_sm_cmnd_retry()
1724 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_sm_cmnd_retry()
1725 &ioim->iosp->reqq_wait); in bfa_ioim_sm_cmnd_retry()
1730 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cmnd_retry()
1731 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_cmnd_retry()
1732 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_cmnd_retry()
1733 __bfa_cb_ioim_failed, ioim); in bfa_ioim_sm_cmnd_retry()
1740 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_cmnd_retry()
1741 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_cmnd_retry()
1742 ioim); in bfa_ioim_sm_cmnd_retry()
1746 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_cmnd_retry()
1754 bfa_ioim_sm_abort(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_abort() argument
1756 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_abort()
1757 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_abort()
1767 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_abort()
1768 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort()
1769 ioim); in bfa_ioim_sm_abort()
1773 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort()
1774 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort()
1775 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort()
1776 ioim); in bfa_ioim_sm_abort()
1780 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort()
1781 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort()
1782 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort()
1783 ioim); in bfa_ioim_sm_abort()
1787 WARN_ON(ioim->iosp->abort_explicit != BFA_TRUE); in bfa_ioim_sm_abort()
1788 ioim->iosp->abort_explicit = BFA_FALSE; in bfa_ioim_sm_abort()
1790 if (bfa_ioim_send_abort(ioim)) in bfa_ioim_sm_abort()
1791 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup); in bfa_ioim_sm_abort()
1793 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); in bfa_ioim_sm_abort()
1794 bfa_stats(ioim->itnim, qwait); in bfa_ioim_sm_abort()
1795 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_sm_abort()
1796 &ioim->iosp->reqq_wait); in bfa_ioim_sm_abort()
1801 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort()
1802 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort()
1803 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_abort()
1804 ioim); in bfa_ioim_sm_abort()
1808 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_abort()
1817 bfa_ioim_sm_cleanup(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_cleanup() argument
1819 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_cleanup()
1820 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_cleanup()
1833 ioim->io_cbfn = __bfa_cb_ioim_abort; in bfa_ioim_sm_cleanup()
1837 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_cleanup()
1838 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup()
1839 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup()
1843 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup()
1844 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup()
1845 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup()
1849 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup()
1850 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup()
1851 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup()
1855 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup()
1856 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_cleanup()
1857 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_cleanup()
1858 ioim); in bfa_ioim_sm_cleanup()
1869 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_cleanup()
1877 bfa_ioim_sm_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_qfull() argument
1879 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_qfull()
1880 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_qfull()
1884 bfa_sm_set_state(ioim, bfa_ioim_sm_active); in bfa_ioim_sm_qfull()
1885 bfa_ioim_send_ioreq(ioim); in bfa_ioim_sm_qfull()
1889 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_qfull()
1890 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_qfull()
1891 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_qfull()
1892 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_qfull()
1893 ioim); in bfa_ioim_sm_qfull()
1897 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_qfull()
1898 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_qfull()
1899 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_qfull()
1900 ioim); in bfa_ioim_sm_qfull()
1901 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_qfull()
1905 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_qfull()
1906 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_qfull()
1907 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_qfull()
1908 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_qfull()
1909 ioim); in bfa_ioim_sm_qfull()
1913 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_qfull()
1921 bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_abort_qfull() argument
1923 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_abort_qfull()
1924 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_abort_qfull()
1928 bfa_sm_set_state(ioim, bfa_ioim_sm_abort); in bfa_ioim_sm_abort_qfull()
1929 bfa_ioim_send_abort(ioim); in bfa_ioim_sm_abort_qfull()
1933 WARN_ON(ioim->iosp->abort_explicit != BFA_TRUE); in bfa_ioim_sm_abort_qfull()
1934 ioim->iosp->abort_explicit = BFA_FALSE; in bfa_ioim_sm_abort_qfull()
1935 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); in bfa_ioim_sm_abort_qfull()
1940 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort_qfull()
1941 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_abort_qfull()
1942 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort_qfull()
1943 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort_qfull()
1944 ioim); in bfa_ioim_sm_abort_qfull()
1948 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_abort_qfull()
1949 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_abort_qfull()
1950 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort_qfull()
1951 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort_qfull()
1952 ioim); in bfa_ioim_sm_abort_qfull()
1956 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort_qfull()
1957 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_abort_qfull()
1958 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort_qfull()
1959 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_abort_qfull()
1960 ioim); in bfa_ioim_sm_abort_qfull()
1964 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_abort_qfull()
1972 bfa_ioim_sm_cleanup_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_cleanup_qfull() argument
1974 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_cleanup_qfull()
1975 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_cleanup_qfull()
1979 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup); in bfa_ioim_sm_cleanup_qfull()
1980 bfa_ioim_send_abort(ioim); in bfa_ioim_sm_cleanup_qfull()
1987 ioim->io_cbfn = __bfa_cb_ioim_abort; in bfa_ioim_sm_cleanup_qfull()
1992 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup_qfull()
1993 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_cleanup_qfull()
1994 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup_qfull()
1995 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup_qfull()
1999 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_cleanup_qfull()
2000 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_cleanup_qfull()
2001 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup_qfull()
2002 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup_qfull()
2006 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup_qfull()
2007 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_cleanup_qfull()
2008 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_cleanup_qfull()
2009 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_cleanup_qfull()
2010 ioim); in bfa_ioim_sm_cleanup_qfull()
2014 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_cleanup_qfull()
2022 bfa_ioim_sm_hcb(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_hcb() argument
2026 bfa_sm_set_state(ioim, bfa_ioim_sm_uninit); in bfa_ioim_sm_hcb()
2027 bfa_ioim_free(ioim); in bfa_ioim_sm_hcb()
2031 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_hcb()
2038 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_hcb()
2046 bfa_ioim_sm_hcb_free(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_hcb_free() argument
2048 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_hcb_free()
2049 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_hcb_free()
2053 bfa_sm_set_state(ioim, bfa_ioim_sm_resfree); in bfa_ioim_sm_hcb_free()
2054 list_del(&ioim->qe); in bfa_ioim_sm_hcb_free()
2055 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_resfree_q); in bfa_ioim_sm_hcb_free()
2059 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_hcb_free()
2063 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_hcb_free()
2067 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_hcb_free()
2071 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_hcb_free()
2079 bfa_ioim_sm_resfree(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_resfree() argument
2081 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_resfree()
2082 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_resfree()
2086 bfa_sm_set_state(ioim, bfa_ioim_sm_uninit); in bfa_ioim_sm_resfree()
2087 bfa_ioim_free(ioim); in bfa_ioim_sm_resfree()
2091 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_resfree()
2098 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_resfree()
2127 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_good_comp() local
2130 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_good_comp()
2134 bfa_cb_ioim_good_comp(ioim->bfa->bfad, ioim->dio); in __bfa_cb_ioim_good_comp()
2140 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_comp() local
2147 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_comp()
2151 m = (struct bfi_ioim_rsp_s *) &ioim->iosp->comp_rspmsg; in __bfa_cb_ioim_comp()
2159 snsinfo = BFA_SNSINFO_FROM_TAG(ioim->fcpim->fcp, in __bfa_cb_ioim_comp()
2160 ioim->iotag); in __bfa_cb_ioim_comp()
2168 bfa_stats(ioim->itnim, iocomp_underrun); in __bfa_cb_ioim_comp()
2173 bfa_stats(ioim->itnim, iocomp_overrun); in __bfa_cb_ioim_comp()
2177 bfa_cb_ioim_done(ioim->bfa->bfad, ioim->dio, m->io_status, in __bfa_cb_ioim_comp()
2402 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_failed() local
2405 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_failed()
2409 bfa_cb_ioim_done(ioim->bfa->bfad, ioim->dio, BFI_IOIM_STS_ABORTED, in __bfa_cb_ioim_failed()
2416 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_pathtov() local
2418 bfa_stats(ioim->itnim, path_tov_expired); in __bfa_cb_ioim_pathtov()
2420 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_pathtov()
2424 bfa_cb_ioim_done(ioim->bfa->bfad, ioim->dio, BFI_IOIM_STS_PATHTOV, in __bfa_cb_ioim_pathtov()
2431 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_abort() local
2434 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_abort()
2438 bfa_cb_ioim_abort(ioim->bfa->bfad, ioim->dio); in __bfa_cb_ioim_abort()
2444 struct bfa_ioim_s *ioim = cbarg; in bfa_ioim_sgpg_alloced() local
2446 ioim->nsgpgs = BFA_SGPG_NPAGE(ioim->nsges); in bfa_ioim_sgpg_alloced()
2447 list_splice_tail_init(&ioim->iosp->sgpg_wqe.sgpg_q, &ioim->sgpg_q); in bfa_ioim_sgpg_alloced()
2448 ioim->sgpg = bfa_q_first(&ioim->sgpg_q); in bfa_ioim_sgpg_alloced()
2449 bfa_sm_send_event(ioim, BFA_IOIM_SM_SGALLOCED); in bfa_ioim_sgpg_alloced()
2456 bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) in bfa_ioim_send_ioreq() argument
2458 struct bfa_itnim_s *itnim = ioim->itnim; in bfa_ioim_send_ioreq()
2467 struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio; in bfa_ioim_send_ioreq()
2474 m = bfa_reqq_next(ioim->bfa, ioim->reqq); in bfa_ioim_send_ioreq()
2476 bfa_stats(ioim->itnim, qwait); in bfa_ioim_send_ioreq()
2477 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_send_ioreq()
2478 &ioim->iosp->reqq_wait); in bfa_ioim_send_ioreq()
2485 m->io_tag = cpu_to_be16(ioim->iotag); in bfa_ioim_send_ioreq()
2486 m->rport_hdl = ioim->itnim->rport->fw_handle; in bfa_ioim_send_ioreq()
2490 sgpg = ioim->sgpg; in bfa_ioim_send_ioreq()
2494 scsi_for_each_sg(cmnd, sg, ioim->nsges, i) { in bfa_ioim_send_ioreq()
2501 sge->flags = (ioim->nsges > BFI_SGE_INLINE) ? in bfa_ioim_send_ioreq()
2515 if (i < (ioim->nsges - 1) && in bfa_ioim_send_ioreq()
2518 else if (i < (ioim->nsges - 1)) in bfa_ioim_send_ioreq()
2526 if (i == (ioim->nsges - 1)) { in bfa_ioim_send_ioreq()
2544 if (ioim->nsges > BFI_SGE_INLINE) { in bfa_ioim_send_ioreq()
2545 sge->sga = ioim->sgpg->sgpg_pa; in bfa_ioim_send_ioreq()
2576 bfi_h2i_set(m->mh, BFI_MC_IOIM_READ, 0, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_ioreq()
2578 ioim->itnim->stats.rd_throughput += fcp_dl; in bfa_ioim_send_ioreq()
2581 bfi_h2i_set(m->mh, BFI_MC_IOIM_WRITE, 0, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_ioreq()
2583 ioim->itnim->stats.wr_throughput += fcp_dl; in bfa_ioim_send_ioreq()
2589 bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_ioreq()
2593 bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_ioreq()
2598 bfa_reqq_produce(ioim->bfa, ioim->reqq, m->mh); in bfa_ioim_send_ioreq()
2607 bfa_ioim_sgpg_alloc(struct bfa_ioim_s *ioim) in bfa_ioim_sgpg_alloc() argument
2611 WARN_ON(ioim->nsges <= BFI_SGE_INLINE); in bfa_ioim_sgpg_alloc()
2616 nsgpgs = BFA_SGPG_NPAGE(ioim->nsges); in bfa_ioim_sgpg_alloc()
2620 if (bfa_sgpg_malloc(ioim->bfa, &ioim->sgpg_q, nsgpgs) in bfa_ioim_sgpg_alloc()
2622 bfa_sgpg_wait(ioim->bfa, &ioim->iosp->sgpg_wqe, nsgpgs); in bfa_ioim_sgpg_alloc()
2626 ioim->nsgpgs = nsgpgs; in bfa_ioim_sgpg_alloc()
2627 ioim->sgpg = bfa_q_first(&ioim->sgpg_q); in bfa_ioim_sgpg_alloc()
2636 bfa_ioim_send_abort(struct bfa_ioim_s *ioim) in bfa_ioim_send_abort() argument
2644 m = bfa_reqq_next(ioim->bfa, ioim->reqq); in bfa_ioim_send_abort()
2651 if (ioim->iosp->abort_explicit) in bfa_ioim_send_abort()
2656 bfi_h2i_set(m->mh, BFI_MC_IOIM, msgop, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_abort()
2657 m->io_tag = cpu_to_be16(ioim->iotag); in bfa_ioim_send_abort()
2658 m->abort_tag = ++ioim->abort_tag; in bfa_ioim_send_abort()
2663 bfa_reqq_produce(ioim->bfa, ioim->reqq, m->mh); in bfa_ioim_send_abort()
2673 struct bfa_ioim_s *ioim = cbarg; in bfa_ioim_qresume() local
2675 bfa_stats(ioim->itnim, qresumes); in bfa_ioim_qresume()
2676 bfa_sm_send_event(ioim, BFA_IOIM_SM_QRESUME); in bfa_ioim_qresume()
2681 bfa_ioim_notify_cleanup(struct bfa_ioim_s *ioim) in bfa_ioim_notify_cleanup() argument
2687 list_del(&ioim->qe); in bfa_ioim_notify_cleanup()
2688 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); in bfa_ioim_notify_cleanup()
2690 if (!ioim->iosp->tskim) { in bfa_ioim_notify_cleanup()
2691 if (ioim->fcpim->delay_comp && ioim->itnim->iotov_active) { in bfa_ioim_notify_cleanup()
2692 bfa_cb_dequeue(&ioim->hcb_qe); in bfa_ioim_notify_cleanup()
2693 list_del(&ioim->qe); in bfa_ioim_notify_cleanup()
2694 list_add_tail(&ioim->qe, &ioim->itnim->delay_comp_q); in bfa_ioim_notify_cleanup()
2696 bfa_itnim_iodone(ioim->itnim); in bfa_ioim_notify_cleanup()
2698 bfa_wc_down(&ioim->iosp->tskim->wc); in bfa_ioim_notify_cleanup()
2702 bfa_ioim_is_abortable(struct bfa_ioim_s *ioim) in bfa_ioim_is_abortable() argument
2704 if ((bfa_sm_cmp_state(ioim, bfa_ioim_sm_uninit) && in bfa_ioim_is_abortable()
2705 (!bfa_q_is_on_q(&ioim->itnim->pending_q, ioim))) || in bfa_ioim_is_abortable()
2706 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_abort)) || in bfa_ioim_is_abortable()
2707 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_abort_qfull)) || in bfa_ioim_is_abortable()
2708 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_hcb)) || in bfa_ioim_is_abortable()
2709 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_hcb_free)) || in bfa_ioim_is_abortable()
2710 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_resfree))) in bfa_ioim_is_abortable()
2717 bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, bfa_boolean_t iotov) in bfa_ioim_delayed_comp() argument
2727 ioim->io_cbfn = __bfa_cb_ioim_pathtov; in bfa_ioim_delayed_comp()
2729 ioim->io_cbfn = __bfa_cb_ioim_failed; in bfa_ioim_delayed_comp()
2730 bfa_stats(ioim->itnim, iocom_nexus_abort); in bfa_ioim_delayed_comp()
2732 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_delayed_comp()
2738 list_del(&ioim->qe); in bfa_ioim_delayed_comp()
2739 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); in bfa_ioim_delayed_comp()
2749 struct bfa_ioim_s *ioim; in bfa_ioim_attach() local
2757 ioim = (struct bfa_ioim_s *) bfa_mem_kva_curp(fcp); in bfa_ioim_attach()
2758 fcpim->ioim_arr = ioim; in bfa_ioim_attach()
2759 bfa_mem_kva_curp(fcp) = (u8 *) (ioim + fcpim->fcp->num_ioim_reqs); in bfa_ioim_attach()
2772 i++, ioim++, iosp++) { in bfa_ioim_attach()
2776 memset(ioim, 0, sizeof(struct bfa_ioim_s)); in bfa_ioim_attach()
2777 ioim->iotag = i; in bfa_ioim_attach()
2778 ioim->bfa = fcpim->bfa; in bfa_ioim_attach()
2779 ioim->fcpim = fcpim; in bfa_ioim_attach()
2780 ioim->iosp = iosp; in bfa_ioim_attach()
2781 INIT_LIST_HEAD(&ioim->sgpg_q); in bfa_ioim_attach()
2782 bfa_reqq_winit(&ioim->iosp->reqq_wait, in bfa_ioim_attach()
2783 bfa_ioim_qresume, ioim); in bfa_ioim_attach()
2784 bfa_sgpg_winit(&ioim->iosp->sgpg_wqe, in bfa_ioim_attach()
2785 bfa_ioim_sgpg_alloced, ioim); in bfa_ioim_attach()
2786 bfa_sm_set_state(ioim, bfa_ioim_sm_uninit); in bfa_ioim_attach()
2795 struct bfa_ioim_s *ioim; in bfa_ioim_isr() local
2801 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); in bfa_ioim_isr()
2802 WARN_ON(ioim->iotag != iotag); in bfa_ioim_isr()
2804 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_isr()
2805 bfa_trc(ioim->bfa, rsp->io_status); in bfa_ioim_isr()
2806 bfa_trc(ioim->bfa, rsp->reuse_io_tag); in bfa_ioim_isr()
2808 if (bfa_sm_cmp_state(ioim, bfa_ioim_sm_active)) in bfa_ioim_isr()
2809 ioim->iosp->comp_rspmsg = *m; in bfa_ioim_isr()
2813 bfa_stats(ioim->itnim, iocomp_ok); in bfa_ioim_isr()
2821 bfa_stats(ioim->itnim, iocomp_timedout); in bfa_ioim_isr()
2824 bfa_stats(ioim->itnim, iocomp_aborted); in bfa_ioim_isr()
2832 bfa_stats(ioim->itnim, iocom_proto_err); in bfa_ioim_isr()
2838 bfa_stats(ioim->itnim, iocom_sqer_needed); in bfa_ioim_isr()
2844 bfa_stats(ioim->itnim, iocom_res_free); in bfa_ioim_isr()
2849 bfa_stats(ioim->itnim, iocom_hostabrts); in bfa_ioim_isr()
2850 if (rsp->abort_tag != ioim->abort_tag) { in bfa_ioim_isr()
2851 bfa_trc(ioim->bfa, rsp->abort_tag); in bfa_ioim_isr()
2852 bfa_trc(ioim->bfa, ioim->abort_tag); in bfa_ioim_isr()
2863 bfa_stats(ioim->itnim, iocom_utags); in bfa_ioim_isr()
2871 bfa_sm_send_event(ioim, evt); in bfa_ioim_isr()
2879 struct bfa_ioim_s *ioim; in bfa_ioim_good_comp_isr() local
2884 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); in bfa_ioim_good_comp_isr()
2885 WARN_ON(ioim->iotag != iotag); in bfa_ioim_good_comp_isr()
2887 bfa_ioim_cb_profile_comp(fcpim, ioim); in bfa_ioim_good_comp_isr()
2889 bfa_sm_send_event(ioim, BFA_IOIM_SM_COMP_GOOD); in bfa_ioim_good_comp_isr()
2896 bfa_ioim_cleanup(struct bfa_ioim_s *ioim) in bfa_ioim_cleanup() argument
2898 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_cleanup()
2899 bfa_stats(ioim->itnim, io_cleanups); in bfa_ioim_cleanup()
2901 ioim->iosp->tskim = NULL; in bfa_ioim_cleanup()
2902 bfa_sm_send_event(ioim, BFA_IOIM_SM_CLEANUP); in bfa_ioim_cleanup()
2906 bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim, struct bfa_tskim_s *tskim) in bfa_ioim_cleanup_tm() argument
2908 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_cleanup_tm()
2909 bfa_stats(ioim->itnim, io_tmaborts); in bfa_ioim_cleanup_tm()
2911 ioim->iosp->tskim = tskim; in bfa_ioim_cleanup_tm()
2912 bfa_sm_send_event(ioim, BFA_IOIM_SM_CLEANUP); in bfa_ioim_cleanup_tm()
2919 bfa_ioim_iocdisable(struct bfa_ioim_s *ioim) in bfa_ioim_iocdisable() argument
2921 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_iocdisable()
2922 bfa_stats(ioim->itnim, io_iocdowns); in bfa_ioim_iocdisable()
2923 bfa_sm_send_event(ioim, BFA_IOIM_SM_HWFAIL); in bfa_ioim_iocdisable()
2930 bfa_ioim_tov(struct bfa_ioim_s *ioim) in bfa_ioim_tov() argument
2932 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_tov()
2933 bfa_sm_send_event(ioim, BFA_IOIM_SM_IOTOV); in bfa_ioim_tov()
2945 struct bfa_ioim_s *ioim; in bfa_ioim_alloc() local
2957 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag->tag); in bfa_ioim_alloc()
2959 ioim->dio = dio; in bfa_ioim_alloc()
2960 ioim->itnim = itnim; in bfa_ioim_alloc()
2961 ioim->nsges = nsges; in bfa_ioim_alloc()
2962 ioim->nsgpgs = 0; in bfa_ioim_alloc()
2967 list_add_tail(&ioim->qe, &itnim->io_q); in bfa_ioim_alloc()
2969 return ioim; in bfa_ioim_alloc()
2973 bfa_ioim_free(struct bfa_ioim_s *ioim) in bfa_ioim_free() argument
2975 struct bfa_fcpim_s *fcpim = ioim->fcpim; in bfa_ioim_free()
2978 if (ioim->nsgpgs > 0) in bfa_ioim_free()
2979 bfa_sgpg_mfree(ioim->bfa, &ioim->sgpg_q, ioim->nsgpgs); in bfa_ioim_free()
2981 bfa_stats(ioim->itnim, io_comps); in bfa_ioim_free()
2984 ioim->iotag &= BFA_IOIM_IOTAG_MASK; in bfa_ioim_free()
2986 WARN_ON(!(ioim->iotag < in bfa_ioim_free()
2988 iotag = BFA_IOTAG_FROM_TAG(fcpim->fcp, ioim->iotag); in bfa_ioim_free()
2990 if (ioim->iotag < fcpim->fcp->num_ioim_reqs) in bfa_ioim_free()
2995 list_del(&ioim->qe); in bfa_ioim_free()
2999 bfa_ioim_start(struct bfa_ioim_s *ioim) in bfa_ioim_start() argument
3001 bfa_ioim_cb_profile_start(ioim->fcpim, ioim); in bfa_ioim_start()
3006 ioim->reqq = bfa_fcpim_ioredirect_enabled(ioim->bfa) ? in bfa_ioim_start()
3007 BFA_FALSE : bfa_itnim_get_reqq(ioim); in bfa_ioim_start()
3009 bfa_sm_send_event(ioim, BFA_IOIM_SM_START); in bfa_ioim_start()
3016 bfa_ioim_abort(struct bfa_ioim_s *ioim) in bfa_ioim_abort() argument
3019 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_abort()
3021 if (!bfa_ioim_is_abortable(ioim)) in bfa_ioim_abort()
3024 bfa_stats(ioim->itnim, io_aborts); in bfa_ioim_abort()
3025 bfa_sm_send_event(ioim, BFA_IOIM_SM_ABORT); in bfa_ioim_abort()
3319 struct bfa_ioim_s *ioim; in bfa_tskim_gather_ios() local
3330 ioim = (struct bfa_ioim_s *) qe; in bfa_tskim_gather_ios()
3331 cmnd = (struct scsi_cmnd *) ioim->dio; in bfa_tskim_gather_ios()
3334 list_del(&ioim->qe); in bfa_tskim_gather_ios()
3335 list_add_tail(&ioim->qe, &tskim->io_q); in bfa_tskim_gather_ios()
3343 ioim = (struct bfa_ioim_s *) qe; in bfa_tskim_gather_ios()
3344 cmnd = (struct scsi_cmnd *) ioim->dio; in bfa_tskim_gather_ios()
3347 list_del(&ioim->qe); in bfa_tskim_gather_ios()
3348 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); in bfa_tskim_gather_ios()
3349 bfa_ioim_tov(ioim); in bfa_tskim_gather_ios()
3372 struct bfa_ioim_s *ioim; in bfa_tskim_cleanup_ios() local
3378 ioim = (struct bfa_ioim_s *) qe; in bfa_tskim_cleanup_ios()
3380 bfa_ioim_cleanup_tm(ioim, tskim); in bfa_tskim_cleanup_ios()
3470 struct bfa_ioim_s *ioim; in bfa_tskim_iocdisable_ios() local
3474 ioim = (struct bfa_ioim_s *) qe; in bfa_tskim_iocdisable_ios()
3475 bfa_ioim_iocdisable(ioim); in bfa_tskim_iocdisable_ios()