Lines Matching refs:ioim
160 static bfa_boolean_t bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim);
161 static bfa_boolean_t bfa_ioim_sgpg_alloc(struct bfa_ioim_s *ioim);
162 static bfa_boolean_t bfa_ioim_send_abort(struct bfa_ioim_s *ioim);
163 static void bfa_ioim_notify_cleanup(struct bfa_ioim_s *ioim);
169 static bfa_boolean_t bfa_ioim_is_abortable(struct bfa_ioim_s *ioim);
174 static void bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim,
176 static void bfa_ioim_sm_sgalloc(struct bfa_ioim_s *ioim,
178 static void bfa_ioim_sm_active(struct bfa_ioim_s *ioim,
180 static void bfa_ioim_sm_abort(struct bfa_ioim_s *ioim,
182 static void bfa_ioim_sm_cleanup(struct bfa_ioim_s *ioim,
184 static void bfa_ioim_sm_qfull(struct bfa_ioim_s *ioim,
186 static void bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim,
188 static void bfa_ioim_sm_cleanup_qfull(struct bfa_ioim_s *ioim,
190 static void bfa_ioim_sm_hcb(struct bfa_ioim_s *ioim,
192 static void bfa_ioim_sm_hcb_free(struct bfa_ioim_s *ioim,
194 static void bfa_ioim_sm_resfree(struct bfa_ioim_s *ioim,
196 static void bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim,
389 bfa_ioim_profile_comp(struct bfa_ioim_s *ioim) in bfa_ioim_profile_comp() argument
392 &(ioim->itnim->ioprofile.io_latency); in bfa_ioim_profile_comp()
395 val = (u32)(jiffies - ioim->start_time); in bfa_ioim_profile_comp()
396 idx = bfa_ioim_get_index(scsi_bufflen((struct scsi_cmnd *)ioim->dio)); in bfa_ioim_profile_comp()
397 bfa_itnim_ioprofile_update(ioim->itnim, idx); in bfa_ioim_profile_comp()
406 bfa_ioim_profile_start(struct bfa_ioim_s *ioim) in bfa_ioim_profile_start() argument
408 ioim->start_time = jiffies; in bfa_ioim_profile_start()
917 struct bfa_ioim_s *ioim; in bfa_itnim_iocdisable_cleanup() local
926 ioim = (struct bfa_ioim_s *) qe; in bfa_itnim_iocdisable_cleanup()
927 bfa_ioim_iocdisable(ioim); in bfa_itnim_iocdisable_cleanup()
934 ioim = (struct bfa_ioim_s *) qe; in bfa_itnim_iocdisable_cleanup()
935 bfa_ioim_tov(ioim); in bfa_itnim_iocdisable_cleanup()
939 ioim = (struct bfa_ioim_s *) qe; in bfa_itnim_iocdisable_cleanup()
940 bfa_ioim_iocdisable(ioim); in bfa_itnim_iocdisable_cleanup()
962 struct bfa_ioim_s *ioim; in bfa_itnim_cleanup() local
969 ioim = (struct bfa_ioim_s *) qe; in bfa_itnim_cleanup()
975 list_del(&ioim->qe); in bfa_itnim_cleanup()
976 list_add_tail(&ioim->qe, &itnim->io_cleanup_q); in bfa_itnim_cleanup()
979 bfa_ioim_cleanup(ioim); in bfa_itnim_cleanup()
1159 struct bfa_ioim_s *ioim; in bfa_itnim_delayed_comp() local
1163 ioim = (struct bfa_ioim_s *)qe; in bfa_itnim_delayed_comp()
1164 bfa_ioim_delayed_comp(ioim, iotov); in bfa_itnim_delayed_comp()
1174 struct bfa_ioim_s *ioim; in bfa_itnim_iotov_online() local
1187 bfa_q_deq(&itnim->pending_q, &ioim); in bfa_itnim_iotov_online()
1188 list_add_tail(&ioim->qe, &itnim->io_q); in bfa_itnim_iotov_online()
1189 bfa_ioim_start(ioim); in bfa_itnim_iotov_online()
1199 struct bfa_ioim_s *ioim; in bfa_itnim_iotov_cleanup() local
1210 bfa_q_deq(&itnim->pending_q, &ioim); in bfa_itnim_iotov_cleanup()
1211 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); in bfa_itnim_iotov_cleanup()
1212 bfa_ioim_tov(ioim); in bfa_itnim_iotov_cleanup()
1454 bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_uninit() argument
1458 if (!bfa_itnim_is_online(ioim->itnim)) { in bfa_ioim_sm_uninit()
1459 if (!bfa_itnim_hold_io(ioim->itnim)) { in bfa_ioim_sm_uninit()
1460 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_uninit()
1461 list_del(&ioim->qe); in bfa_ioim_sm_uninit()
1462 list_add_tail(&ioim->qe, in bfa_ioim_sm_uninit()
1463 &ioim->fcpim->ioim_comp_q); in bfa_ioim_sm_uninit()
1464 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_uninit()
1465 __bfa_cb_ioim_pathtov, ioim); in bfa_ioim_sm_uninit()
1467 list_del(&ioim->qe); in bfa_ioim_sm_uninit()
1468 list_add_tail(&ioim->qe, in bfa_ioim_sm_uninit()
1469 &ioim->itnim->pending_q); in bfa_ioim_sm_uninit()
1474 if (ioim->nsges > BFI_SGE_INLINE) { in bfa_ioim_sm_uninit()
1475 if (!bfa_ioim_sgpg_alloc(ioim)) { in bfa_ioim_sm_uninit()
1476 bfa_sm_set_state(ioim, bfa_ioim_sm_sgalloc); in bfa_ioim_sm_uninit()
1481 if (!bfa_ioim_send_ioreq(ioim)) { in bfa_ioim_sm_uninit()
1482 bfa_sm_set_state(ioim, bfa_ioim_sm_qfull); in bfa_ioim_sm_uninit()
1486 bfa_sm_set_state(ioim, bfa_ioim_sm_active); in bfa_ioim_sm_uninit()
1490 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_uninit()
1491 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_uninit()
1492 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_uninit()
1493 __bfa_cb_ioim_pathtov, ioim); in bfa_ioim_sm_uninit()
1501 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_uninit()
1502 WARN_ON(!bfa_q_is_on_q(&ioim->itnim->pending_q, ioim)); in bfa_ioim_sm_uninit()
1503 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_uninit()
1504 __bfa_cb_ioim_abort, ioim); in bfa_ioim_sm_uninit()
1508 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_uninit()
1516 bfa_ioim_sm_sgalloc(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_sgalloc() argument
1518 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_sgalloc()
1519 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_sgalloc()
1523 if (!bfa_ioim_send_ioreq(ioim)) { in bfa_ioim_sm_sgalloc()
1524 bfa_sm_set_state(ioim, bfa_ioim_sm_qfull); in bfa_ioim_sm_sgalloc()
1527 bfa_sm_set_state(ioim, bfa_ioim_sm_active); in bfa_ioim_sm_sgalloc()
1531 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_sgalloc()
1532 bfa_sgpg_wcancel(ioim->bfa, &ioim->iosp->sgpg_wqe); in bfa_ioim_sm_sgalloc()
1533 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_sgalloc()
1534 ioim); in bfa_ioim_sm_sgalloc()
1535 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_sgalloc()
1539 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_sgalloc()
1540 bfa_sgpg_wcancel(ioim->bfa, &ioim->iosp->sgpg_wqe); in bfa_ioim_sm_sgalloc()
1541 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_sgalloc()
1542 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_sgalloc()
1543 ioim); in bfa_ioim_sm_sgalloc()
1547 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_sgalloc()
1548 bfa_sgpg_wcancel(ioim->bfa, &ioim->iosp->sgpg_wqe); in bfa_ioim_sm_sgalloc()
1549 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_sgalloc()
1550 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_sgalloc()
1551 ioim); in bfa_ioim_sm_sgalloc()
1555 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_sgalloc()
1563 bfa_ioim_sm_active(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_active() argument
1567 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_active()
1568 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_active()
1569 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_active()
1570 __bfa_cb_ioim_good_comp, ioim); in bfa_ioim_sm_active()
1574 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_active()
1575 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_active()
1576 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_comp, in bfa_ioim_sm_active()
1577 ioim); in bfa_ioim_sm_active()
1581 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_active()
1582 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_active()
1583 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_comp, in bfa_ioim_sm_active()
1584 ioim); in bfa_ioim_sm_active()
1588 ioim->iosp->abort_explicit = BFA_TRUE; in bfa_ioim_sm_active()
1589 ioim->io_cbfn = __bfa_cb_ioim_abort; in bfa_ioim_sm_active()
1591 if (bfa_ioim_send_abort(ioim)) in bfa_ioim_sm_active()
1592 bfa_sm_set_state(ioim, bfa_ioim_sm_abort); in bfa_ioim_sm_active()
1594 bfa_sm_set_state(ioim, bfa_ioim_sm_abort_qfull); in bfa_ioim_sm_active()
1595 bfa_stats(ioim->itnim, qwait); in bfa_ioim_sm_active()
1596 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_sm_active()
1597 &ioim->iosp->reqq_wait); in bfa_ioim_sm_active()
1602 ioim->iosp->abort_explicit = BFA_FALSE; in bfa_ioim_sm_active()
1603 ioim->io_cbfn = __bfa_cb_ioim_failed; in bfa_ioim_sm_active()
1605 if (bfa_ioim_send_abort(ioim)) in bfa_ioim_sm_active()
1606 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup); in bfa_ioim_sm_active()
1608 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); in bfa_ioim_sm_active()
1609 bfa_stats(ioim->itnim, qwait); in bfa_ioim_sm_active()
1610 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_sm_active()
1611 &ioim->iosp->reqq_wait); in bfa_ioim_sm_active()
1616 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_active()
1617 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_active()
1618 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_active()
1619 ioim); in bfa_ioim_sm_active()
1623 if (bfa_ioim_maxretry_reached(ioim)) { in bfa_ioim_sm_active()
1625 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); 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_failed, ioim); in bfa_ioim_sm_active()
1632 bfa_sm_set_state(ioim, bfa_ioim_sm_cmnd_retry); in bfa_ioim_sm_active()
1636 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_active()
1644 bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_cmnd_retry() argument
1649 bfa_ioim_update_iotag(ioim); in bfa_ioim_sm_cmnd_retry()
1650 if (!bfa_ioim_send_ioreq(ioim)) { in bfa_ioim_sm_cmnd_retry()
1651 bfa_sm_set_state(ioim, bfa_ioim_sm_qfull); in bfa_ioim_sm_cmnd_retry()
1654 bfa_sm_set_state(ioim, bfa_ioim_sm_active); in bfa_ioim_sm_cmnd_retry()
1658 ioim->iosp->abort_explicit = BFA_FALSE; in bfa_ioim_sm_cmnd_retry()
1659 ioim->io_cbfn = __bfa_cb_ioim_failed; in bfa_ioim_sm_cmnd_retry()
1661 if (bfa_ioim_send_abort(ioim)) in bfa_ioim_sm_cmnd_retry()
1662 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup); in bfa_ioim_sm_cmnd_retry()
1664 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); in bfa_ioim_sm_cmnd_retry()
1665 bfa_stats(ioim->itnim, qwait); in bfa_ioim_sm_cmnd_retry()
1666 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_sm_cmnd_retry()
1667 &ioim->iosp->reqq_wait); in bfa_ioim_sm_cmnd_retry()
1672 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cmnd_retry()
1673 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_cmnd_retry()
1674 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, in bfa_ioim_sm_cmnd_retry()
1675 __bfa_cb_ioim_failed, ioim); in bfa_ioim_sm_cmnd_retry()
1682 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_cmnd_retry()
1683 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_cmnd_retry()
1684 ioim); in bfa_ioim_sm_cmnd_retry()
1688 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_cmnd_retry()
1696 bfa_ioim_sm_abort(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_abort() argument
1698 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_abort()
1699 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_abort()
1709 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_abort()
1710 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort()
1711 ioim); in bfa_ioim_sm_abort()
1715 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort()
1716 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort()
1717 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort()
1718 ioim); in bfa_ioim_sm_abort()
1722 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort()
1723 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort()
1724 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort()
1725 ioim); in bfa_ioim_sm_abort()
1729 WARN_ON(ioim->iosp->abort_explicit != BFA_TRUE); in bfa_ioim_sm_abort()
1730 ioim->iosp->abort_explicit = BFA_FALSE; in bfa_ioim_sm_abort()
1732 if (bfa_ioim_send_abort(ioim)) in bfa_ioim_sm_abort()
1733 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup); in bfa_ioim_sm_abort()
1735 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); in bfa_ioim_sm_abort()
1736 bfa_stats(ioim->itnim, qwait); in bfa_ioim_sm_abort()
1737 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_sm_abort()
1738 &ioim->iosp->reqq_wait); in bfa_ioim_sm_abort()
1743 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort()
1744 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort()
1745 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_abort()
1746 ioim); in bfa_ioim_sm_abort()
1750 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_abort()
1759 bfa_ioim_sm_cleanup(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_cleanup() argument
1761 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_cleanup()
1762 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_cleanup()
1775 ioim->io_cbfn = __bfa_cb_ioim_abort; in bfa_ioim_sm_cleanup()
1779 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_cleanup()
1780 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup()
1781 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup()
1785 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup()
1786 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup()
1787 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup()
1791 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup()
1792 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup()
1793 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup()
1797 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup()
1798 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_cleanup()
1799 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_cleanup()
1800 ioim); in bfa_ioim_sm_cleanup()
1811 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_cleanup()
1819 bfa_ioim_sm_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_qfull() argument
1821 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_qfull()
1822 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_qfull()
1826 bfa_sm_set_state(ioim, bfa_ioim_sm_active); in bfa_ioim_sm_qfull()
1827 bfa_ioim_send_ioreq(ioim); in bfa_ioim_sm_qfull()
1831 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_qfull()
1832 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_qfull()
1833 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_qfull()
1834 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_qfull()
1835 ioim); in bfa_ioim_sm_qfull()
1839 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_qfull()
1840 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_qfull()
1841 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_qfull()
1842 ioim); in bfa_ioim_sm_qfull()
1843 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_qfull()
1847 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_qfull()
1848 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_qfull()
1849 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_qfull()
1850 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_qfull()
1851 ioim); in bfa_ioim_sm_qfull()
1855 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_qfull()
1863 bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_abort_qfull() argument
1865 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_abort_qfull()
1866 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_abort_qfull()
1870 bfa_sm_set_state(ioim, bfa_ioim_sm_abort); in bfa_ioim_sm_abort_qfull()
1871 bfa_ioim_send_abort(ioim); in bfa_ioim_sm_abort_qfull()
1875 WARN_ON(ioim->iosp->abort_explicit != BFA_TRUE); in bfa_ioim_sm_abort_qfull()
1876 ioim->iosp->abort_explicit = BFA_FALSE; in bfa_ioim_sm_abort_qfull()
1877 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup_qfull); in bfa_ioim_sm_abort_qfull()
1882 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort_qfull()
1883 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_abort_qfull()
1884 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort_qfull()
1885 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort_qfull()
1886 ioim); in bfa_ioim_sm_abort_qfull()
1890 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_abort_qfull()
1891 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_abort_qfull()
1892 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort_qfull()
1893 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_abort, in bfa_ioim_sm_abort_qfull()
1894 ioim); in bfa_ioim_sm_abort_qfull()
1898 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_abort_qfull()
1899 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_abort_qfull()
1900 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_abort_qfull()
1901 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_abort_qfull()
1902 ioim); in bfa_ioim_sm_abort_qfull()
1906 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_abort_qfull()
1914 bfa_ioim_sm_cleanup_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_cleanup_qfull() argument
1916 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_cleanup_qfull()
1917 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_cleanup_qfull()
1921 bfa_sm_set_state(ioim, bfa_ioim_sm_cleanup); in bfa_ioim_sm_cleanup_qfull()
1922 bfa_ioim_send_abort(ioim); in bfa_ioim_sm_cleanup_qfull()
1929 ioim->io_cbfn = __bfa_cb_ioim_abort; in bfa_ioim_sm_cleanup_qfull()
1934 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup_qfull()
1935 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_cleanup_qfull()
1936 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup_qfull()
1937 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup_qfull()
1941 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); in bfa_ioim_sm_cleanup_qfull()
1942 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_cleanup_qfull()
1943 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_sm_cleanup_qfull()
1944 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_cleanup_qfull()
1948 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_cleanup_qfull()
1949 bfa_reqq_wcancel(&ioim->iosp->reqq_wait); in bfa_ioim_sm_cleanup_qfull()
1950 bfa_ioim_move_to_comp_q(ioim); in bfa_ioim_sm_cleanup_qfull()
1951 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, __bfa_cb_ioim_failed, in bfa_ioim_sm_cleanup_qfull()
1952 ioim); in bfa_ioim_sm_cleanup_qfull()
1956 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_cleanup_qfull()
1964 bfa_ioim_sm_hcb(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_hcb() argument
1968 bfa_sm_set_state(ioim, bfa_ioim_sm_uninit); in bfa_ioim_sm_hcb()
1969 bfa_ioim_free(ioim); in bfa_ioim_sm_hcb()
1973 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_hcb()
1980 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_hcb()
1988 bfa_ioim_sm_hcb_free(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_hcb_free() argument
1990 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_hcb_free()
1991 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_hcb_free()
1995 bfa_sm_set_state(ioim, bfa_ioim_sm_resfree); in bfa_ioim_sm_hcb_free()
1996 list_del(&ioim->qe); in bfa_ioim_sm_hcb_free()
1997 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_resfree_q); in bfa_ioim_sm_hcb_free()
2001 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_hcb_free()
2005 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_hcb_free()
2009 bfa_sm_set_state(ioim, bfa_ioim_sm_hcb); in bfa_ioim_sm_hcb_free()
2013 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_hcb_free()
2021 bfa_ioim_sm_resfree(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) in bfa_ioim_sm_resfree() argument
2023 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_sm_resfree()
2024 bfa_trc(ioim->bfa, event); in bfa_ioim_sm_resfree()
2028 bfa_sm_set_state(ioim, bfa_ioim_sm_uninit); in bfa_ioim_sm_resfree()
2029 bfa_ioim_free(ioim); in bfa_ioim_sm_resfree()
2033 bfa_ioim_notify_cleanup(ioim); in bfa_ioim_sm_resfree()
2040 bfa_sm_fault(ioim->bfa, event); in bfa_ioim_sm_resfree()
2069 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_good_comp() local
2072 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_good_comp()
2076 bfa_cb_ioim_good_comp(ioim->bfa->bfad, ioim->dio); in __bfa_cb_ioim_good_comp()
2082 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_comp() local
2089 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_comp()
2093 m = (struct bfi_ioim_rsp_s *) &ioim->iosp->comp_rspmsg; in __bfa_cb_ioim_comp()
2101 snsinfo = BFA_SNSINFO_FROM_TAG(ioim->fcpim->fcp, in __bfa_cb_ioim_comp()
2102 ioim->iotag); in __bfa_cb_ioim_comp()
2110 bfa_stats(ioim->itnim, iocomp_underrun); in __bfa_cb_ioim_comp()
2115 bfa_stats(ioim->itnim, iocomp_overrun); in __bfa_cb_ioim_comp()
2119 bfa_cb_ioim_done(ioim->bfa->bfad, ioim->dio, m->io_status, in __bfa_cb_ioim_comp()
2338 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_failed() local
2341 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_failed()
2345 bfa_cb_ioim_done(ioim->bfa->bfad, ioim->dio, BFI_IOIM_STS_ABORTED, in __bfa_cb_ioim_failed()
2352 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_pathtov() local
2354 bfa_stats(ioim->itnim, path_tov_expired); in __bfa_cb_ioim_pathtov()
2356 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_pathtov()
2360 bfa_cb_ioim_done(ioim->bfa->bfad, ioim->dio, BFI_IOIM_STS_PATHTOV, in __bfa_cb_ioim_pathtov()
2367 struct bfa_ioim_s *ioim = cbarg; in __bfa_cb_ioim_abort() local
2370 bfa_sm_send_event(ioim, BFA_IOIM_SM_HCB); in __bfa_cb_ioim_abort()
2374 bfa_cb_ioim_abort(ioim->bfa->bfad, ioim->dio); in __bfa_cb_ioim_abort()
2380 struct bfa_ioim_s *ioim = cbarg; in bfa_ioim_sgpg_alloced() local
2382 ioim->nsgpgs = BFA_SGPG_NPAGE(ioim->nsges); in bfa_ioim_sgpg_alloced()
2383 list_splice_tail_init(&ioim->iosp->sgpg_wqe.sgpg_q, &ioim->sgpg_q); in bfa_ioim_sgpg_alloced()
2384 ioim->sgpg = bfa_q_first(&ioim->sgpg_q); in bfa_ioim_sgpg_alloced()
2385 bfa_sm_send_event(ioim, BFA_IOIM_SM_SGALLOCED); in bfa_ioim_sgpg_alloced()
2392 bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) in bfa_ioim_send_ioreq() argument
2394 struct bfa_itnim_s *itnim = ioim->itnim; in bfa_ioim_send_ioreq()
2403 struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio; in bfa_ioim_send_ioreq()
2410 m = bfa_reqq_next(ioim->bfa, ioim->reqq); in bfa_ioim_send_ioreq()
2412 bfa_stats(ioim->itnim, qwait); in bfa_ioim_send_ioreq()
2413 bfa_reqq_wait(ioim->bfa, ioim->reqq, in bfa_ioim_send_ioreq()
2414 &ioim->iosp->reqq_wait); in bfa_ioim_send_ioreq()
2421 m->io_tag = cpu_to_be16(ioim->iotag); in bfa_ioim_send_ioreq()
2422 m->rport_hdl = ioim->itnim->rport->fw_handle; in bfa_ioim_send_ioreq()
2426 sgpg = ioim->sgpg; in bfa_ioim_send_ioreq()
2430 scsi_for_each_sg(cmnd, sg, ioim->nsges, i) { in bfa_ioim_send_ioreq()
2437 sge->flags = (ioim->nsges > BFI_SGE_INLINE) ? in bfa_ioim_send_ioreq()
2451 if (i < (ioim->nsges - 1) && in bfa_ioim_send_ioreq()
2454 else if (i < (ioim->nsges - 1)) in bfa_ioim_send_ioreq()
2462 if (i == (ioim->nsges - 1)) { in bfa_ioim_send_ioreq()
2480 if (ioim->nsges > BFI_SGE_INLINE) { in bfa_ioim_send_ioreq()
2481 sge->sga = ioim->sgpg->sgpg_pa; in bfa_ioim_send_ioreq()
2512 bfi_h2i_set(m->mh, BFI_MC_IOIM_READ, 0, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_ioreq()
2514 ioim->itnim->stats.rd_throughput += fcp_dl; in bfa_ioim_send_ioreq()
2517 bfi_h2i_set(m->mh, BFI_MC_IOIM_WRITE, 0, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_ioreq()
2519 ioim->itnim->stats.wr_throughput += fcp_dl; in bfa_ioim_send_ioreq()
2526 bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_ioreq()
2530 bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_ioreq()
2535 bfa_reqq_produce(ioim->bfa, ioim->reqq, m->mh); in bfa_ioim_send_ioreq()
2544 bfa_ioim_sgpg_alloc(struct bfa_ioim_s *ioim) in bfa_ioim_sgpg_alloc() argument
2548 WARN_ON(ioim->nsges <= BFI_SGE_INLINE); in bfa_ioim_sgpg_alloc()
2553 nsgpgs = BFA_SGPG_NPAGE(ioim->nsges); in bfa_ioim_sgpg_alloc()
2557 if (bfa_sgpg_malloc(ioim->bfa, &ioim->sgpg_q, nsgpgs) in bfa_ioim_sgpg_alloc()
2559 bfa_sgpg_wait(ioim->bfa, &ioim->iosp->sgpg_wqe, nsgpgs); in bfa_ioim_sgpg_alloc()
2563 ioim->nsgpgs = nsgpgs; in bfa_ioim_sgpg_alloc()
2564 ioim->sgpg = bfa_q_first(&ioim->sgpg_q); in bfa_ioim_sgpg_alloc()
2573 bfa_ioim_send_abort(struct bfa_ioim_s *ioim) in bfa_ioim_send_abort() argument
2581 m = bfa_reqq_next(ioim->bfa, ioim->reqq); in bfa_ioim_send_abort()
2588 if (ioim->iosp->abort_explicit) in bfa_ioim_send_abort()
2593 bfi_h2i_set(m->mh, BFI_MC_IOIM, msgop, bfa_fn_lpu(ioim->bfa)); in bfa_ioim_send_abort()
2594 m->io_tag = cpu_to_be16(ioim->iotag); in bfa_ioim_send_abort()
2595 m->abort_tag = ++ioim->abort_tag; in bfa_ioim_send_abort()
2600 bfa_reqq_produce(ioim->bfa, ioim->reqq, m->mh); in bfa_ioim_send_abort()
2610 struct bfa_ioim_s *ioim = cbarg; in bfa_ioim_qresume() local
2612 bfa_stats(ioim->itnim, qresumes); in bfa_ioim_qresume()
2613 bfa_sm_send_event(ioim, BFA_IOIM_SM_QRESUME); in bfa_ioim_qresume()
2618 bfa_ioim_notify_cleanup(struct bfa_ioim_s *ioim) in bfa_ioim_notify_cleanup() argument
2624 list_del(&ioim->qe); in bfa_ioim_notify_cleanup()
2625 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); in bfa_ioim_notify_cleanup()
2627 if (!ioim->iosp->tskim) { in bfa_ioim_notify_cleanup()
2628 if (ioim->fcpim->delay_comp && ioim->itnim->iotov_active) { in bfa_ioim_notify_cleanup()
2629 bfa_cb_dequeue(&ioim->hcb_qe); in bfa_ioim_notify_cleanup()
2630 list_del(&ioim->qe); in bfa_ioim_notify_cleanup()
2631 list_add_tail(&ioim->qe, &ioim->itnim->delay_comp_q); in bfa_ioim_notify_cleanup()
2633 bfa_itnim_iodone(ioim->itnim); in bfa_ioim_notify_cleanup()
2635 bfa_wc_down(&ioim->iosp->tskim->wc); in bfa_ioim_notify_cleanup()
2639 bfa_ioim_is_abortable(struct bfa_ioim_s *ioim) in bfa_ioim_is_abortable() argument
2641 if ((bfa_sm_cmp_state(ioim, bfa_ioim_sm_uninit) && in bfa_ioim_is_abortable()
2642 (!bfa_q_is_on_q(&ioim->itnim->pending_q, ioim))) || in bfa_ioim_is_abortable()
2643 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_abort)) || in bfa_ioim_is_abortable()
2644 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_abort_qfull)) || in bfa_ioim_is_abortable()
2645 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_hcb)) || in bfa_ioim_is_abortable()
2646 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_hcb_free)) || in bfa_ioim_is_abortable()
2647 (bfa_sm_cmp_state(ioim, bfa_ioim_sm_resfree))) in bfa_ioim_is_abortable()
2654 bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, bfa_boolean_t iotov) in bfa_ioim_delayed_comp() argument
2664 ioim->io_cbfn = __bfa_cb_ioim_pathtov; in bfa_ioim_delayed_comp()
2666 ioim->io_cbfn = __bfa_cb_ioim_failed; in bfa_ioim_delayed_comp()
2667 bfa_stats(ioim->itnim, iocom_nexus_abort); in bfa_ioim_delayed_comp()
2669 bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, ioim->io_cbfn, ioim); in bfa_ioim_delayed_comp()
2675 list_del(&ioim->qe); in bfa_ioim_delayed_comp()
2676 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); in bfa_ioim_delayed_comp()
2686 struct bfa_ioim_s *ioim; in bfa_ioim_attach() local
2694 ioim = (struct bfa_ioim_s *) bfa_mem_kva_curp(fcp); in bfa_ioim_attach()
2695 fcpim->ioim_arr = ioim; in bfa_ioim_attach()
2696 bfa_mem_kva_curp(fcp) = (u8 *) (ioim + fcpim->fcp->num_ioim_reqs); in bfa_ioim_attach()
2709 i++, ioim++, iosp++) { in bfa_ioim_attach()
2713 memset(ioim, 0, sizeof(struct bfa_ioim_s)); in bfa_ioim_attach()
2714 ioim->iotag = i; in bfa_ioim_attach()
2715 ioim->bfa = fcpim->bfa; in bfa_ioim_attach()
2716 ioim->fcpim = fcpim; in bfa_ioim_attach()
2717 ioim->iosp = iosp; in bfa_ioim_attach()
2718 INIT_LIST_HEAD(&ioim->sgpg_q); in bfa_ioim_attach()
2719 bfa_reqq_winit(&ioim->iosp->reqq_wait, in bfa_ioim_attach()
2720 bfa_ioim_qresume, ioim); in bfa_ioim_attach()
2721 bfa_sgpg_winit(&ioim->iosp->sgpg_wqe, in bfa_ioim_attach()
2722 bfa_ioim_sgpg_alloced, ioim); in bfa_ioim_attach()
2723 bfa_sm_set_state(ioim, bfa_ioim_sm_uninit); in bfa_ioim_attach()
2732 struct bfa_ioim_s *ioim; in bfa_ioim_isr() local
2738 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); in bfa_ioim_isr()
2739 WARN_ON(ioim->iotag != iotag); in bfa_ioim_isr()
2741 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_isr()
2742 bfa_trc(ioim->bfa, rsp->io_status); in bfa_ioim_isr()
2743 bfa_trc(ioim->bfa, rsp->reuse_io_tag); in bfa_ioim_isr()
2745 if (bfa_sm_cmp_state(ioim, bfa_ioim_sm_active)) in bfa_ioim_isr()
2746 ioim->iosp->comp_rspmsg = *m; in bfa_ioim_isr()
2750 bfa_stats(ioim->itnim, iocomp_ok); in bfa_ioim_isr()
2758 bfa_stats(ioim->itnim, iocomp_timedout); in bfa_ioim_isr()
2762 bfa_stats(ioim->itnim, iocomp_aborted); in bfa_ioim_isr()
2770 bfa_stats(ioim->itnim, iocom_proto_err); in bfa_ioim_isr()
2776 bfa_stats(ioim->itnim, iocom_sqer_needed); in bfa_ioim_isr()
2782 bfa_stats(ioim->itnim, iocom_res_free); in bfa_ioim_isr()
2787 bfa_stats(ioim->itnim, iocom_hostabrts); in bfa_ioim_isr()
2788 if (rsp->abort_tag != ioim->abort_tag) { in bfa_ioim_isr()
2789 bfa_trc(ioim->bfa, rsp->abort_tag); in bfa_ioim_isr()
2790 bfa_trc(ioim->bfa, ioim->abort_tag); in bfa_ioim_isr()
2801 bfa_stats(ioim->itnim, iocom_utags); in bfa_ioim_isr()
2809 bfa_sm_send_event(ioim, evt); in bfa_ioim_isr()
2817 struct bfa_ioim_s *ioim; in bfa_ioim_good_comp_isr() local
2822 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); in bfa_ioim_good_comp_isr()
2823 WARN_ON(ioim->iotag != iotag); in bfa_ioim_good_comp_isr()
2825 bfa_ioim_cb_profile_comp(fcpim, ioim); in bfa_ioim_good_comp_isr()
2827 bfa_sm_send_event(ioim, BFA_IOIM_SM_COMP_GOOD); in bfa_ioim_good_comp_isr()
2834 bfa_ioim_cleanup(struct bfa_ioim_s *ioim) in bfa_ioim_cleanup() argument
2836 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_cleanup()
2837 bfa_stats(ioim->itnim, io_cleanups); in bfa_ioim_cleanup()
2839 ioim->iosp->tskim = NULL; in bfa_ioim_cleanup()
2840 bfa_sm_send_event(ioim, BFA_IOIM_SM_CLEANUP); in bfa_ioim_cleanup()
2844 bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim, struct bfa_tskim_s *tskim) in bfa_ioim_cleanup_tm() argument
2846 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_cleanup_tm()
2847 bfa_stats(ioim->itnim, io_tmaborts); in bfa_ioim_cleanup_tm()
2849 ioim->iosp->tskim = tskim; in bfa_ioim_cleanup_tm()
2850 bfa_sm_send_event(ioim, BFA_IOIM_SM_CLEANUP); in bfa_ioim_cleanup_tm()
2857 bfa_ioim_iocdisable(struct bfa_ioim_s *ioim) in bfa_ioim_iocdisable() argument
2859 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_iocdisable()
2860 bfa_stats(ioim->itnim, io_iocdowns); in bfa_ioim_iocdisable()
2861 bfa_sm_send_event(ioim, BFA_IOIM_SM_HWFAIL); in bfa_ioim_iocdisable()
2868 bfa_ioim_tov(struct bfa_ioim_s *ioim) in bfa_ioim_tov() argument
2870 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_tov()
2871 bfa_sm_send_event(ioim, BFA_IOIM_SM_IOTOV); in bfa_ioim_tov()
2883 struct bfa_ioim_s *ioim; in bfa_ioim_alloc() local
2895 ioim = BFA_IOIM_FROM_TAG(fcpim, iotag->tag); in bfa_ioim_alloc()
2897 ioim->dio = dio; in bfa_ioim_alloc()
2898 ioim->itnim = itnim; in bfa_ioim_alloc()
2899 ioim->nsges = nsges; in bfa_ioim_alloc()
2900 ioim->nsgpgs = 0; in bfa_ioim_alloc()
2905 list_add_tail(&ioim->qe, &itnim->io_q); in bfa_ioim_alloc()
2907 return ioim; in bfa_ioim_alloc()
2911 bfa_ioim_free(struct bfa_ioim_s *ioim) in bfa_ioim_free() argument
2913 struct bfa_fcpim_s *fcpim = ioim->fcpim; in bfa_ioim_free()
2916 if (ioim->nsgpgs > 0) in bfa_ioim_free()
2917 bfa_sgpg_mfree(ioim->bfa, &ioim->sgpg_q, ioim->nsgpgs); in bfa_ioim_free()
2919 bfa_stats(ioim->itnim, io_comps); in bfa_ioim_free()
2922 ioim->iotag &= BFA_IOIM_IOTAG_MASK; in bfa_ioim_free()
2924 WARN_ON(!(ioim->iotag < in bfa_ioim_free()
2926 iotag = BFA_IOTAG_FROM_TAG(fcpim->fcp, ioim->iotag); in bfa_ioim_free()
2928 if (ioim->iotag < fcpim->fcp->num_ioim_reqs) in bfa_ioim_free()
2933 list_del(&ioim->qe); in bfa_ioim_free()
2937 bfa_ioim_start(struct bfa_ioim_s *ioim) in bfa_ioim_start() argument
2939 bfa_ioim_cb_profile_start(ioim->fcpim, ioim); in bfa_ioim_start()
2944 ioim->reqq = bfa_fcpim_ioredirect_enabled(ioim->bfa) ? in bfa_ioim_start()
2945 BFA_FALSE : bfa_itnim_get_reqq(ioim); in bfa_ioim_start()
2947 bfa_sm_send_event(ioim, BFA_IOIM_SM_START); in bfa_ioim_start()
2954 bfa_ioim_abort(struct bfa_ioim_s *ioim) in bfa_ioim_abort() argument
2957 bfa_trc(ioim->bfa, ioim->iotag); in bfa_ioim_abort()
2959 if (!bfa_ioim_is_abortable(ioim)) in bfa_ioim_abort()
2962 bfa_stats(ioim->itnim, io_aborts); in bfa_ioim_abort()
2963 bfa_sm_send_event(ioim, BFA_IOIM_SM_ABORT); in bfa_ioim_abort()
3255 struct bfa_ioim_s *ioim; in bfa_tskim_gather_ios() local
3266 ioim = (struct bfa_ioim_s *) qe; in bfa_tskim_gather_ios()
3267 cmnd = (struct scsi_cmnd *) ioim->dio; in bfa_tskim_gather_ios()
3270 list_del(&ioim->qe); in bfa_tskim_gather_ios()
3271 list_add_tail(&ioim->qe, &tskim->io_q); in bfa_tskim_gather_ios()
3279 ioim = (struct bfa_ioim_s *) qe; in bfa_tskim_gather_ios()
3280 cmnd = (struct scsi_cmnd *) ioim->dio; in bfa_tskim_gather_ios()
3283 list_del(&ioim->qe); in bfa_tskim_gather_ios()
3284 list_add_tail(&ioim->qe, &ioim->fcpim->ioim_comp_q); in bfa_tskim_gather_ios()
3285 bfa_ioim_tov(ioim); in bfa_tskim_gather_ios()
3308 struct bfa_ioim_s *ioim; in bfa_tskim_cleanup_ios() local
3314 ioim = (struct bfa_ioim_s *) qe; in bfa_tskim_cleanup_ios()
3316 bfa_ioim_cleanup_tm(ioim, tskim); in bfa_tskim_cleanup_ios()
3406 struct bfa_ioim_s *ioim; in bfa_tskim_iocdisable_ios() local
3410 ioim = (struct bfa_ioim_s *) qe; in bfa_tskim_iocdisable_ios()
3411 bfa_ioim_iocdisable(ioim); in bfa_tskim_iocdisable_ios()