Lines Matching refs:scm
118 csio_scsi_gather_active_ios(struct csio_scsim *scm, in csio_scsi_gather_active_ios() argument
124 if (list_empty(&scm->active_q)) in csio_scsi_gather_active_ios()
129 list_splice_tail_init(&scm->active_q, dest); in csio_scsi_gather_active_ios()
133 list_for_each_safe(tmp, next, &scm->active_q) { in csio_scsi_gather_active_ios()
776 struct csio_scsim *scm = csio_hw_to_scsim(hw); in csio_scsis_io_active() local
781 CSIO_DEC_STATS(scm, n_active); in csio_scsis_io_active()
834 CSIO_DEC_STATS(scm, n_active); in csio_scsis_io_active()
848 struct csio_scsim *scm = csio_hw_to_scsim(hw); in csio_scsis_tm_active() local
852 CSIO_DEC_STATS(scm, n_tm_active); in csio_scsis_tm_active()
877 CSIO_DEC_STATS(scm, n_tm_active); in csio_scsis_tm_active()
891 struct csio_scsim *scm = csio_hw_to_scsim(hw); in csio_scsis_aborting() local
911 CSIO_INC_STATS(scm, n_abrt_dups); in csio_scsis_aborting()
957 CSIO_DEC_STATS(scm, n_active); in csio_scsis_aborting()
964 CSIO_DEC_STATS(scm, n_active); in csio_scsis_aborting()
988 struct csio_scsim *scm = csio_hw_to_scsim(hw); in csio_scsis_closing() local
1028 CSIO_DEC_STATS(scm, n_active); in csio_scsis_closing()
1038 CSIO_DEC_STATS(scm, n_active); in csio_scsis_closing()
1109 struct csio_scsim *scm = csio_hw_to_scsim(hw); in csio_scsi_cmpl_handler() local
1117 CSIO_INC_STATS(scm, n_inval_cplop); in csio_scsi_cmpl_handler()
1147 CSIO_INC_STATS(scm, n_inval_scsiop); in csio_scsi_cmpl_handler()
1159 csio_scsi_cleanup_io_q(struct csio_scsim *scm, struct list_head *q) in csio_scsi_cleanup_io_q() argument
1161 struct csio_hw *hw = scm->hw; in csio_scsi_cleanup_io_q()
1181 spin_lock_irq(&scm->freelist_lock); in csio_scsi_cleanup_io_q()
1182 csio_put_scsi_ioreq(scm, ioreq); in csio_scsi_cleanup_io_q()
1183 spin_unlock_irq(&scm->freelist_lock); in csio_scsi_cleanup_io_q()
1233 csio_scsi_abort_io_q(struct csio_scsim *scm, struct list_head *q, uint32_t tmo) in csio_scsi_abort_io_q() argument
1235 struct csio_hw *hw = scm->hw; in csio_scsi_abort_io_q()
1273 csio_scsim_cleanup_io(struct csio_scsim *scm, bool abort) in csio_scsim_cleanup_io() argument
1275 struct csio_hw *hw = scm->hw; in csio_scsim_cleanup_io()
1280 if (list_empty(&scm->active_q)) in csio_scsim_cleanup_io()
1284 while (!list_empty(&scm->active_q) && count--) { in csio_scsim_cleanup_io()
1291 if (list_empty(&scm->active_q)) in csio_scsim_cleanup_io()
1296 rv = csio_scsi_abort_io_q(scm, &scm->active_q, 30000); in csio_scsim_cleanup_io()
1302 csio_scsi_cleanup_io_q(scm, &scm->active_q); in csio_scsim_cleanup_io()
1304 CSIO_DB_ASSERT(list_empty(&scm->active_q)); in csio_scsim_cleanup_io()
1318 csio_scsim_cleanup_io_lnode(struct csio_scsim *scm, struct csio_lnode *ln) in csio_scsim_cleanup_io_lnode() argument
1320 struct csio_hw *hw = scm->hw; in csio_scsim_cleanup_io_lnode()
1330 csio_scsi_gather_active_ios(scm, &sld, &ln->cmpl_q); in csio_scsim_cleanup_io_lnode()
1350 rv = csio_scsi_abort_io_q(scm, &ln->cmpl_q, 30000); in csio_scsim_cleanup_io_lnode()
1353 csio_scsi_cleanup_io_q(scm, &ln->cmpl_q); in csio_scsim_cleanup_io_lnode()
1565 struct csio_scsim *scm = csio_hw_to_scsim(hw); in csio_scsi_err_handler() local
1581 CSIO_INC_STATS(scm, n_hosterror); in csio_scsi_err_handler()
1607 CSIO_INC_STATS(scm, n_autosense); in csio_scsi_err_handler()
1625 CSIO_INC_STATS(scm, n_rsperror); in csio_scsi_err_handler()
1634 CSIO_INC_STATS(scm, n_ovflerror); in csio_scsi_err_handler()
1645 CSIO_INC_STATS(scm, n_unflerror); in csio_scsi_err_handler()
1661 CSIO_INC_STATS(scm, n_closed); in csio_scsi_err_handler()
1663 CSIO_INC_STATS(scm, n_aborted); in csio_scsi_err_handler()
1671 CSIO_INC_STATS(scm, n_abrt_timedout); in csio_scsi_err_handler()
1681 CSIO_INC_STATS(scm, n_rdev_nr_error); in csio_scsi_err_handler()
1686 CSIO_INC_STATS(scm, n_rdev_lost_error); in csio_scsi_err_handler()
1691 CSIO_INC_STATS(scm, n_rdev_logo_error); in csio_scsi_err_handler()
1700 CSIO_INC_STATS(scm, n_link_down_error); in csio_scsi_err_handler()
1705 CSIO_INC_STATS(scm, n_no_xchg_error); in csio_scsi_err_handler()
1714 CSIO_INC_STATS(scm, n_unknown_error); in csio_scsi_err_handler()
2321 csio_scsi_alloc_ddp_bufs(struct csio_scsim *scm, struct csio_hw *hw, in csio_scsi_alloc_ddp_bufs() argument
2335 INIT_LIST_HEAD(&scm->ddp_freelist); in csio_scsi_alloc_ddp_bufs()
2348 scm->stats.n_free_ddp); in csio_scsi_alloc_ddp_bufs()
2366 list_add_tail(&ddp_desc->list, &scm->ddp_freelist); in csio_scsi_alloc_ddp_bufs()
2367 CSIO_INC_STATS(scm, n_free_ddp); in csio_scsi_alloc_ddp_bufs()
2373 list_for_each(tmp, &scm->ddp_freelist) { in csio_scsi_alloc_ddp_bufs()
2381 scm->stats.n_free_ddp = 0; in csio_scsi_alloc_ddp_bufs()
2394 csio_scsi_free_ddp_bufs(struct csio_scsim *scm, struct csio_hw *hw) in csio_scsi_free_ddp_bufs() argument
2400 list_for_each(tmp, &scm->ddp_freelist) { in csio_scsi_free_ddp_bufs()
2408 scm->stats.n_free_ddp = 0; in csio_scsi_free_ddp_bufs()
2418 csio_scsim_init(struct csio_scsim *scm, struct csio_hw *hw) in csio_scsim_init() argument
2424 INIT_LIST_HEAD(&scm->active_q); in csio_scsim_init()
2425 scm->hw = hw; in csio_scsim_init()
2427 scm->proto_cmd_len = sizeof(struct fcp_cmnd); in csio_scsim_init()
2428 scm->proto_rsp_len = CSIO_SCSI_RSP_LEN; in csio_scsim_init()
2429 scm->max_sge = CSIO_SCSI_MAX_SGE; in csio_scsim_init()
2431 spin_lock_init(&scm->freelist_lock); in csio_scsim_init()
2434 INIT_LIST_HEAD(&scm->ioreq_freelist); in csio_scsim_init()
2442 scm->stats.n_free_ioreq); in csio_scsim_init()
2459 dma_buf->len = scm->proto_rsp_len; in csio_scsim_init()
2466 list_add_tail(&ioreq->sm.sm_list, &scm->ioreq_freelist); in csio_scsim_init()
2467 CSIO_INC_STATS(scm, n_free_ioreq); in csio_scsim_init()
2470 if (csio_scsi_alloc_ddp_bufs(scm, hw, PAGE_SIZE, csio_ddp_descs)) in csio_scsim_init()
2480 while (!list_empty(&scm->ioreq_freelist)) { in csio_scsim_init()
2483 tmp = list_first_entry(&scm->ioreq_freelist, in csio_scsim_init()
2495 scm->stats.n_free_ioreq = 0; in csio_scsim_init()
2506 csio_scsim_exit(struct csio_scsim *scm) in csio_scsim_exit() argument
2511 while (!list_empty(&scm->ioreq_freelist)) { in csio_scsim_exit()
2514 tmp = list_first_entry(&scm->ioreq_freelist, in csio_scsim_exit()
2520 dma_pool_free(scm->hw->scsi_dma_pool, dma_buf->vaddr, in csio_scsim_exit()
2526 scm->stats.n_free_ioreq = 0; in csio_scsim_exit()
2528 csio_scsi_free_ddp_bufs(scm, scm->hw); in csio_scsim_exit()