Lines Matching refs:scm
111 * @scm: SCSI module
118 csio_scsi_gather_active_ios(struct csio_scsim *scm,
124 if (list_empty(&scm->active_q))
129 list_splice_tail_init(&scm->active_q, dest);
133 list_for_each_safe(tmp, next, &scm->active_q) {
776 struct csio_scsim *scm = csio_hw_to_scsim(hw);
781 CSIO_DEC_STATS(scm, n_active);
834 CSIO_DEC_STATS(scm, n_active);
848 struct csio_scsim *scm = csio_hw_to_scsim(hw);
852 CSIO_DEC_STATS(scm, n_tm_active);
877 CSIO_DEC_STATS(scm, n_tm_active);
891 struct csio_scsim *scm = csio_hw_to_scsim(hw);
911 CSIO_INC_STATS(scm, n_abrt_dups);
957 CSIO_DEC_STATS(scm, n_active);
964 CSIO_DEC_STATS(scm, n_active);
988 struct csio_scsim *scm = csio_hw_to_scsim(hw);
1028 CSIO_DEC_STATS(scm, n_active);
1038 CSIO_DEC_STATS(scm, n_active);
1109 struct csio_scsim *scm = csio_hw_to_scsim(hw);
1117 CSIO_INC_STATS(scm, n_inval_cplop);
1147 CSIO_INC_STATS(scm, n_inval_scsiop);
1153 * @scm: SCSI module.
1159 csio_scsi_cleanup_io_q(struct csio_scsim *scm, struct list_head *q)
1161 struct csio_hw *hw = scm->hw;
1181 spin_lock_irq(&scm->freelist_lock);
1182 csio_put_scsi_ioreq(scm, ioreq);
1183 spin_unlock_irq(&scm->freelist_lock);
1218 * @scm: SCSI module.
1233 csio_scsi_abort_io_q(struct csio_scsim *scm, struct list_head *q, uint32_t tmo)
1235 struct csio_hw *hw = scm->hw;
1267 * @scm: SCSI module.
1273 csio_scsim_cleanup_io(struct csio_scsim *scm, bool abort)
1275 struct csio_hw *hw = scm->hw;
1280 if (list_empty(&scm->active_q))
1284 while (!list_empty(&scm->active_q) && count--) {
1291 if (list_empty(&scm->active_q))
1296 rv = csio_scsi_abort_io_q(scm, &scm->active_q, 30000);
1302 csio_scsi_cleanup_io_q(scm, &scm->active_q);
1304 CSIO_DB_ASSERT(list_empty(&scm->active_q));
1311 * @scm: SCSI module.
1318 csio_scsim_cleanup_io_lnode(struct csio_scsim *scm, struct csio_lnode *ln)
1320 struct csio_hw *hw = scm->hw;
1330 csio_scsi_gather_active_ios(scm, &sld, &ln->cmpl_q);
1350 rv = csio_scsi_abort_io_q(scm, &ln->cmpl_q, 30000);
1353 csio_scsi_cleanup_io_q(scm, &ln->cmpl_q);
1561 struct csio_scsim *scm = csio_hw_to_scsim(hw);
1577 CSIO_INC_STATS(scm, n_hosterror);
1603 CSIO_INC_STATS(scm, n_autosense);
1621 CSIO_INC_STATS(scm, n_rsperror);
1630 CSIO_INC_STATS(scm, n_ovflerror);
1641 CSIO_INC_STATS(scm, n_unflerror);
1657 CSIO_INC_STATS(scm, n_closed);
1659 CSIO_INC_STATS(scm, n_aborted);
1667 CSIO_INC_STATS(scm, n_abrt_timedout);
1677 CSIO_INC_STATS(scm, n_rdev_nr_error);
1682 CSIO_INC_STATS(scm, n_rdev_lost_error);
1687 CSIO_INC_STATS(scm, n_rdev_logo_error);
1696 CSIO_INC_STATS(scm, n_link_down_error);
1701 CSIO_INC_STATS(scm, n_no_xchg_error);
1710 CSIO_INC_STATS(scm, n_unknown_error);
2305 * @scm: SCSI Module
2315 csio_scsi_alloc_ddp_bufs(struct csio_scsim *scm, struct csio_hw *hw,
2329 INIT_LIST_HEAD(&scm->ddp_freelist);
2342 scm->stats.n_free_ddp);
2360 list_add_tail(&ddp_desc->list, &scm->ddp_freelist);
2361 CSIO_INC_STATS(scm, n_free_ddp);
2367 list_for_each(tmp, &scm->ddp_freelist) {
2375 scm->stats.n_free_ddp = 0;
2382 * @scm: SCSI Module
2388 csio_scsi_free_ddp_bufs(struct csio_scsim *scm, struct csio_hw *hw)
2394 list_for_each(tmp, &scm->ddp_freelist) {
2402 scm->stats.n_free_ddp = 0;
2407 * @scm: SCSI Module
2412 csio_scsim_init(struct csio_scsim *scm, struct csio_hw *hw)
2418 INIT_LIST_HEAD(&scm->active_q);
2419 scm->hw = hw;
2421 scm->proto_cmd_len = sizeof(struct fcp_cmnd);
2422 scm->proto_rsp_len = CSIO_SCSI_RSP_LEN;
2423 scm->max_sge = CSIO_SCSI_MAX_SGE;
2425 spin_lock_init(&scm->freelist_lock);
2428 INIT_LIST_HEAD(&scm->ioreq_freelist);
2436 scm->stats.n_free_ioreq);
2453 dma_buf->len = scm->proto_rsp_len;
2460 list_add_tail(&ioreq->sm.sm_list, &scm->ioreq_freelist);
2461 CSIO_INC_STATS(scm, n_free_ioreq);
2464 if (csio_scsi_alloc_ddp_bufs(scm, hw, PAGE_SIZE, csio_ddp_descs))
2474 while (!list_empty(&scm->ioreq_freelist)) {
2477 tmp = list_first_entry(&scm->ioreq_freelist,
2489 scm->stats.n_free_ioreq = 0;
2496 * @scm: SCSI Module
2500 csio_scsim_exit(struct csio_scsim *scm)
2505 while (!list_empty(&scm->ioreq_freelist)) {
2508 tmp = list_first_entry(&scm->ioreq_freelist,
2514 dma_pool_free(scm->hw->scsi_dma_pool, dma_buf->vaddr,
2520 scm->stats.n_free_ioreq = 0;
2522 csio_scsi_free_ddp_bufs(scm, scm->hw);