Lines Matching refs:io_req
125 struct fnic_io_req *io_req, in fnic_release_ioreq_buf() argument
128 if (io_req->sgl_list_pa) in fnic_release_ioreq_buf()
129 pci_unmap_single(fnic->pdev, io_req->sgl_list_pa, in fnic_release_ioreq_buf()
130 sizeof(io_req->sgl_list[0]) * io_req->sgl_cnt, in fnic_release_ioreq_buf()
134 if (io_req->sgl_cnt) in fnic_release_ioreq_buf()
135 mempool_free(io_req->sgl_list_alloc, in fnic_release_ioreq_buf()
136 fnic->io_sgl_pool[io_req->sgl_type]); in fnic_release_ioreq_buf()
137 if (io_req->sense_buf_pa) in fnic_release_ioreq_buf()
138 pci_unmap_single(fnic->pdev, io_req->sense_buf_pa, in fnic_release_ioreq_buf()
319 struct fnic_io_req *io_req, in fnic_queue_wq_copy_desc() argument
337 desc = io_req->sgl_list; in fnic_queue_wq_copy_desc()
345 io_req->sgl_list_pa = pci_map_single in fnic_queue_wq_copy_desc()
347 io_req->sgl_list, in fnic_queue_wq_copy_desc()
348 sizeof(io_req->sgl_list[0]) * sg_count, in fnic_queue_wq_copy_desc()
351 r = pci_dma_mapping_error(fnic->pdev, io_req->sgl_list_pa); in fnic_queue_wq_copy_desc()
358 io_req->sense_buf_pa = pci_map_single(fnic->pdev, in fnic_queue_wq_copy_desc()
363 r = pci_dma_mapping_error(fnic->pdev, io_req->sense_buf_pa); in fnic_queue_wq_copy_desc()
365 pci_unmap_single(fnic->pdev, io_req->sgl_list_pa, in fnic_queue_wq_copy_desc()
366 sizeof(io_req->sgl_list[0]) * sg_count, in fnic_queue_wq_copy_desc()
400 0, exch_flags, io_req->sgl_cnt, in fnic_queue_wq_copy_desc()
402 io_req->sgl_list_pa, in fnic_queue_wq_copy_desc()
403 io_req->sense_buf_pa, in fnic_queue_wq_copy_desc()
410 fc_lun.scsi_lun, io_req->port_id, in fnic_queue_wq_copy_desc()
433 struct fnic_io_req *io_req = NULL; in fnic_queuecommand_lck() local
486 io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC); in fnic_queuecommand_lck()
487 if (!io_req) { in fnic_queuecommand_lck()
492 memset(io_req, 0, sizeof(*io_req)); in fnic_queuecommand_lck()
500 mempool_free(io_req, fnic->io_req_pool); in fnic_queuecommand_lck()
505 io_req->sgl_cnt = sg_count; in fnic_queuecommand_lck()
506 io_req->sgl_type = FNIC_SGL_CACHE_DFLT; in fnic_queuecommand_lck()
508 io_req->sgl_type = FNIC_SGL_CACHE_MAX; in fnic_queuecommand_lck()
511 io_req->sgl_list = in fnic_queuecommand_lck()
512 mempool_alloc(fnic->io_sgl_pool[io_req->sgl_type], in fnic_queuecommand_lck()
514 if (!io_req->sgl_list) { in fnic_queuecommand_lck()
518 mempool_free(io_req, fnic->io_req_pool); in fnic_queuecommand_lck()
523 io_req->sgl_list_alloc = io_req->sgl_list; in fnic_queuecommand_lck()
524 ptr = (unsigned long) io_req->sgl_list; in fnic_queuecommand_lck()
526 io_req->sgl_list = (struct host_sg_desc *) in fnic_queuecommand_lck()
542 io_req->port_id = rport->port_id; in fnic_queuecommand_lck()
543 io_req->start_time = jiffies; in fnic_queuecommand_lck()
545 CMD_SP(sc) = (char *)io_req; in fnic_queuecommand_lck()
551 ret = fnic_queue_wq_copy_desc(fnic, wq, io_req, sc, sg_count); in fnic_queuecommand_lck()
560 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_queuecommand_lck()
564 if (io_req) { in fnic_queuecommand_lck()
565 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_queuecommand_lck()
566 mempool_free(io_req, fnic->io_req_pool); in fnic_queuecommand_lck()
590 sc->request->tag, sc, io_req, in fnic_queuecommand_lck()
812 struct fnic_io_req *io_req; in fnic_fcpio_icmnd_cmpl_handler() local
853 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_fcpio_icmnd_cmpl_handler()
854 WARN_ON_ONCE(!io_req); in fnic_fcpio_icmnd_cmpl_handler()
855 if (!io_req) { in fnic_fcpio_icmnd_cmpl_handler()
865 start_time = io_req->start_time; in fnic_fcpio_icmnd_cmpl_handler()
868 io_req->io_completed = 1; in fnic_fcpio_icmnd_cmpl_handler()
981 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_fcpio_icmnd_cmpl_handler()
983 mempool_free(io_req, fnic->io_req_pool); in fnic_fcpio_icmnd_cmpl_handler()
1030 struct fnic_io_req *io_req; in fnic_fcpio_itmf_cmpl_handler() local
1060 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_fcpio_itmf_cmpl_handler()
1061 WARN_ON_ONCE(!io_req); in fnic_fcpio_itmf_cmpl_handler()
1062 if (!io_req) { in fnic_fcpio_itmf_cmpl_handler()
1072 start_time = io_req->start_time; in fnic_fcpio_itmf_cmpl_handler()
1083 if (io_req->abts_done) in fnic_fcpio_itmf_cmpl_handler()
1084 complete(io_req->abts_done); in fnic_fcpio_itmf_cmpl_handler()
1140 if (io_req->abts_done) { in fnic_fcpio_itmf_cmpl_handler()
1141 complete(io_req->abts_done); in fnic_fcpio_itmf_cmpl_handler()
1151 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_fcpio_itmf_cmpl_handler()
1152 mempool_free(io_req, fnic->io_req_pool); in fnic_fcpio_itmf_cmpl_handler()
1209 if (io_req->dr_done) in fnic_fcpio_itmf_cmpl_handler()
1210 complete(io_req->dr_done); in fnic_fcpio_itmf_cmpl_handler()
1299 struct fnic_io_req *io_req; in fnic_cleanup_io() local
1318 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_cleanup_io()
1326 if (io_req && io_req->dr_done) in fnic_cleanup_io()
1327 complete(io_req->dr_done); in fnic_cleanup_io()
1328 else if (io_req && io_req->abts_done) in fnic_cleanup_io()
1329 complete(io_req->abts_done); in fnic_cleanup_io()
1336 if (!io_req) { in fnic_cleanup_io()
1349 start_time = io_req->start_time; in fnic_cleanup_io()
1350 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_cleanup_io()
1351 mempool_free(io_req, fnic->io_req_pool); in fnic_cleanup_io()
1385 struct fnic_io_req *io_req; in fnic_wq_copy_cleanup_handler() local
1406 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_wq_copy_cleanup_handler()
1410 if (!io_req) { in fnic_wq_copy_cleanup_handler()
1419 start_time = io_req->start_time; in fnic_wq_copy_cleanup_handler()
1420 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_wq_copy_cleanup_handler()
1421 mempool_free(io_req, fnic->io_req_pool); in fnic_wq_copy_cleanup_handler()
1443 struct fnic_io_req *io_req) in fnic_queue_abort_io_req() argument
1473 0, task_req, tag, fc_lun, io_req->port_id, in fnic_queue_abort_io_req()
1493 struct fnic_io_req *io_req; in fnic_rport_exch_reset() local
1520 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_rport_exch_reset()
1522 if (!io_req || io_req->port_id != port_id) { in fnic_rport_exch_reset()
1544 if (io_req->abts_done) { in fnic_rport_exch_reset()
1569 BUG_ON(io_req->abts_done); in fnic_rport_exch_reset()
1581 fc_lun.scsi_lun, io_req)) { in fnic_rport_exch_reset()
1613 struct fnic_io_req *io_req; in fnic_terminate_rport_io() local
1671 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_terminate_rport_io()
1673 if (!io_req || rport != cmd_rport) { in fnic_terminate_rport_io()
1694 if (io_req->abts_done) { in fnic_terminate_rport_io()
1717 BUG_ON(io_req->abts_done); in fnic_terminate_rport_io()
1730 fc_lun.scsi_lun, io_req)) { in fnic_terminate_rport_io()
1766 struct fnic_io_req *io_req = NULL; in fnic_abort_cmd() local
1820 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_abort_cmd()
1821 if (!io_req) { in fnic_abort_cmd()
1826 io_req->abts_done = &tm_done; in fnic_abort_cmd()
1860 fc_lun.scsi_lun, io_req)) { in fnic_abort_cmd()
1864 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_abort_cmd()
1865 if (io_req) in fnic_abort_cmd()
1866 io_req->abts_done = NULL; in fnic_abort_cmd()
1893 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_abort_cmd()
1894 if (!io_req) { in fnic_abort_cmd()
1901 io_req->abts_done = NULL; in fnic_abort_cmd()
1944 start_time = io_req->start_time; in fnic_abort_cmd()
1945 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_abort_cmd()
1946 mempool_free(io_req, fnic->io_req_pool); in fnic_abort_cmd()
1966 struct fnic_io_req *io_req) in fnic_queue_dr_io_req() argument
2002 fc_lun.scsi_lun, io_req->port_id, in fnic_queue_dr_io_req()
2028 struct fnic_io_req *io_req; in fnic_clean_pending_aborts() local
2051 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_clean_pending_aborts()
2053 if (!io_req || sc->device != lun_dev) { in fnic_clean_pending_aborts()
2079 if (io_req->abts_done) in fnic_clean_pending_aborts()
2093 BUG_ON(io_req->abts_done); in fnic_clean_pending_aborts()
2103 io_req->abts_done = &tm_done; in fnic_clean_pending_aborts()
2111 fc_lun.scsi_lun, io_req)) { in fnic_clean_pending_aborts()
2113 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_clean_pending_aborts()
2114 if (io_req) in fnic_clean_pending_aborts()
2115 io_req->abts_done = NULL; in fnic_clean_pending_aborts()
2135 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_clean_pending_aborts()
2136 if (!io_req) { in fnic_clean_pending_aborts()
2142 io_req->abts_done = NULL; in fnic_clean_pending_aborts()
2155 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_clean_pending_aborts()
2156 mempool_free(io_req, fnic->io_req_pool); in fnic_clean_pending_aborts()
2237 struct fnic_io_req *io_req = NULL; in fnic_device_reset() local
2305 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2311 if (!io_req) { in fnic_device_reset()
2312 io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC); in fnic_device_reset()
2313 if (!io_req) { in fnic_device_reset()
2317 memset(io_req, 0, sizeof(*io_req)); in fnic_device_reset()
2318 io_req->port_id = rport->port_id; in fnic_device_reset()
2319 CMD_SP(sc) = (char *)io_req; in fnic_device_reset()
2321 io_req->dr_done = &tm_done; in fnic_device_reset()
2332 if (fnic_queue_dr_io_req(fnic, sc, io_req)) { in fnic_device_reset()
2334 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2335 if (io_req) in fnic_device_reset()
2336 io_req->dr_done = NULL; in fnic_device_reset()
2351 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2352 if (!io_req) { in fnic_device_reset()
2358 io_req->dr_done = NULL; in fnic_device_reset()
2387 fc_lun.scsi_lun, io_req)) { in fnic_device_reset()
2394 io_req->abts_done = &tm_done; in fnic_device_reset()
2410 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2411 io_req->abts_done = NULL; in fnic_device_reset()
2425 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2438 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2447 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2448 if (io_req) in fnic_device_reset()
2453 if (io_req) in fnic_device_reset()
2458 if (io_req) { in fnic_device_reset()
2459 start_time = io_req->start_time; in fnic_device_reset()
2460 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_device_reset()
2461 mempool_free(io_req, fnic->io_req_pool); in fnic_device_reset()
2703 struct fnic_io_req *io_req; in fnic_is_abts_pending() local
2726 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_is_abts_pending()
2728 if (!io_req || sc->device != lun_dev) { in fnic_is_abts_pending()