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
485 io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC); in fnic_queuecommand_lck()
486 if (!io_req) { in fnic_queuecommand_lck()
491 memset(io_req, 0, sizeof(*io_req)); in fnic_queuecommand_lck()
499 mempool_free(io_req, fnic->io_req_pool); in fnic_queuecommand_lck()
504 io_req->sgl_cnt = sg_count; in fnic_queuecommand_lck()
505 io_req->sgl_type = FNIC_SGL_CACHE_DFLT; in fnic_queuecommand_lck()
507 io_req->sgl_type = FNIC_SGL_CACHE_MAX; in fnic_queuecommand_lck()
510 io_req->sgl_list = in fnic_queuecommand_lck()
511 mempool_alloc(fnic->io_sgl_pool[io_req->sgl_type], in fnic_queuecommand_lck()
513 if (!io_req->sgl_list) { in fnic_queuecommand_lck()
517 mempool_free(io_req, fnic->io_req_pool); in fnic_queuecommand_lck()
522 io_req->sgl_list_alloc = io_req->sgl_list; in fnic_queuecommand_lck()
523 ptr = (unsigned long) io_req->sgl_list; in fnic_queuecommand_lck()
525 io_req->sgl_list = (struct host_sg_desc *) in fnic_queuecommand_lck()
541 io_req->port_id = rport->port_id; in fnic_queuecommand_lck()
542 io_req->start_time = jiffies; in fnic_queuecommand_lck()
544 CMD_SP(sc) = (char *)io_req; in fnic_queuecommand_lck()
550 ret = fnic_queue_wq_copy_desc(fnic, wq, io_req, sc, sg_count); in fnic_queuecommand_lck()
559 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_queuecommand_lck()
563 if (io_req) { in fnic_queuecommand_lck()
564 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_queuecommand_lck()
565 mempool_free(io_req, fnic->io_req_pool); in fnic_queuecommand_lck()
589 sc->request->tag, sc, io_req, in fnic_queuecommand_lck()
811 struct fnic_io_req *io_req; in fnic_fcpio_icmnd_cmpl_handler() local
852 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_fcpio_icmnd_cmpl_handler()
853 WARN_ON_ONCE(!io_req); in fnic_fcpio_icmnd_cmpl_handler()
854 if (!io_req) { in fnic_fcpio_icmnd_cmpl_handler()
864 start_time = io_req->start_time; in fnic_fcpio_icmnd_cmpl_handler()
867 io_req->io_completed = 1; in fnic_fcpio_icmnd_cmpl_handler()
979 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_fcpio_icmnd_cmpl_handler()
981 mempool_free(io_req, fnic->io_req_pool); in fnic_fcpio_icmnd_cmpl_handler()
1028 struct fnic_io_req *io_req; in fnic_fcpio_itmf_cmpl_handler() local
1058 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_fcpio_itmf_cmpl_handler()
1059 WARN_ON_ONCE(!io_req); in fnic_fcpio_itmf_cmpl_handler()
1060 if (!io_req) { in fnic_fcpio_itmf_cmpl_handler()
1070 start_time = io_req->start_time; in fnic_fcpio_itmf_cmpl_handler()
1081 if (io_req->abts_done) in fnic_fcpio_itmf_cmpl_handler()
1082 complete(io_req->abts_done); in fnic_fcpio_itmf_cmpl_handler()
1143 if (io_req->abts_done) { in fnic_fcpio_itmf_cmpl_handler()
1144 complete(io_req->abts_done); in fnic_fcpio_itmf_cmpl_handler()
1154 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_fcpio_itmf_cmpl_handler()
1155 mempool_free(io_req, fnic->io_req_pool); in fnic_fcpio_itmf_cmpl_handler()
1217 if (io_req->dr_done) in fnic_fcpio_itmf_cmpl_handler()
1218 complete(io_req->dr_done); in fnic_fcpio_itmf_cmpl_handler()
1307 struct fnic_io_req *io_req; in fnic_cleanup_io() local
1326 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_cleanup_io()
1334 if (io_req && io_req->dr_done) in fnic_cleanup_io()
1335 complete(io_req->dr_done); in fnic_cleanup_io()
1336 else if (io_req && io_req->abts_done) in fnic_cleanup_io()
1337 complete(io_req->abts_done); in fnic_cleanup_io()
1344 if (!io_req) { in fnic_cleanup_io()
1357 start_time = io_req->start_time; in fnic_cleanup_io()
1358 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_cleanup_io()
1359 mempool_free(io_req, fnic->io_req_pool); in fnic_cleanup_io()
1393 struct fnic_io_req *io_req; in fnic_wq_copy_cleanup_handler() local
1414 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_wq_copy_cleanup_handler()
1418 if (!io_req) { in fnic_wq_copy_cleanup_handler()
1427 start_time = io_req->start_time; in fnic_wq_copy_cleanup_handler()
1428 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_wq_copy_cleanup_handler()
1429 mempool_free(io_req, fnic->io_req_pool); in fnic_wq_copy_cleanup_handler()
1451 struct fnic_io_req *io_req) in fnic_queue_abort_io_req() argument
1481 0, task_req, tag, fc_lun, io_req->port_id, in fnic_queue_abort_io_req()
1501 struct fnic_io_req *io_req; in fnic_rport_exch_reset() local
1528 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_rport_exch_reset()
1530 if (!io_req || io_req->port_id != port_id) { in fnic_rport_exch_reset()
1552 if (io_req->abts_done) { in fnic_rport_exch_reset()
1577 BUG_ON(io_req->abts_done); in fnic_rport_exch_reset()
1589 fc_lun.scsi_lun, io_req)) { in fnic_rport_exch_reset()
1621 struct fnic_io_req *io_req; in fnic_terminate_rport_io() local
1679 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_terminate_rport_io()
1681 if (!io_req || rport != cmd_rport) { in fnic_terminate_rport_io()
1702 if (io_req->abts_done) { in fnic_terminate_rport_io()
1725 BUG_ON(io_req->abts_done); in fnic_terminate_rport_io()
1738 fc_lun.scsi_lun, io_req)) { in fnic_terminate_rport_io()
1774 struct fnic_io_req *io_req = NULL; in fnic_abort_cmd() local
1828 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_abort_cmd()
1829 if (!io_req) { in fnic_abort_cmd()
1834 io_req->abts_done = &tm_done; in fnic_abort_cmd()
1868 fc_lun.scsi_lun, io_req)) { in fnic_abort_cmd()
1872 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_abort_cmd()
1873 if (io_req) in fnic_abort_cmd()
1874 io_req->abts_done = NULL; in fnic_abort_cmd()
1901 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_abort_cmd()
1902 if (!io_req) { in fnic_abort_cmd()
1909 io_req->abts_done = NULL; in fnic_abort_cmd()
1941 start_time = io_req->start_time; in fnic_abort_cmd()
1957 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_abort_cmd()
1958 mempool_free(io_req, fnic->io_req_pool); in fnic_abort_cmd()
1989 struct fnic_io_req *io_req) in fnic_queue_dr_io_req() argument
2025 fc_lun.scsi_lun, io_req->port_id, in fnic_queue_dr_io_req()
2053 struct fnic_io_req *io_req; in fnic_clean_pending_aborts() local
2076 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_clean_pending_aborts()
2078 if (!io_req || sc->device != lun_dev) { in fnic_clean_pending_aborts()
2104 if (io_req->abts_done) in fnic_clean_pending_aborts()
2118 BUG_ON(io_req->abts_done); in fnic_clean_pending_aborts()
2128 io_req->abts_done = &tm_done; in fnic_clean_pending_aborts()
2136 fc_lun.scsi_lun, io_req)) { in fnic_clean_pending_aborts()
2138 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_clean_pending_aborts()
2139 if (io_req) in fnic_clean_pending_aborts()
2140 io_req->abts_done = NULL; in fnic_clean_pending_aborts()
2160 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_clean_pending_aborts()
2161 if (!io_req) { in fnic_clean_pending_aborts()
2167 io_req->abts_done = NULL; in fnic_clean_pending_aborts()
2185 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_clean_pending_aborts()
2186 mempool_free(io_req, fnic->io_req_pool); in fnic_clean_pending_aborts()
2278 struct fnic_io_req *io_req = NULL; in fnic_device_reset() local
2346 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2352 if (!io_req) { in fnic_device_reset()
2353 io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC); in fnic_device_reset()
2354 if (!io_req) { in fnic_device_reset()
2358 memset(io_req, 0, sizeof(*io_req)); in fnic_device_reset()
2359 io_req->port_id = rport->port_id; in fnic_device_reset()
2360 CMD_SP(sc) = (char *)io_req; in fnic_device_reset()
2362 io_req->dr_done = &tm_done; in fnic_device_reset()
2373 if (fnic_queue_dr_io_req(fnic, sc, io_req)) { in fnic_device_reset()
2375 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2376 if (io_req) in fnic_device_reset()
2377 io_req->dr_done = NULL; in fnic_device_reset()
2392 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2393 if (!io_req) { in fnic_device_reset()
2399 io_req->dr_done = NULL; in fnic_device_reset()
2428 fc_lun.scsi_lun, io_req)) { in fnic_device_reset()
2435 io_req->abts_done = &tm_done; in fnic_device_reset()
2451 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2452 io_req->abts_done = NULL; in fnic_device_reset()
2466 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2479 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2488 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_device_reset()
2489 if (io_req) in fnic_device_reset()
2494 if (io_req) in fnic_device_reset()
2499 if (io_req) { in fnic_device_reset()
2500 start_time = io_req->start_time; in fnic_device_reset()
2501 fnic_release_ioreq_buf(fnic, io_req, sc); in fnic_device_reset()
2502 mempool_free(io_req, fnic->io_req_pool); in fnic_device_reset()
2744 struct fnic_io_req *io_req; in fnic_is_abts_pending() local
2767 io_req = (struct fnic_io_req *)CMD_SP(sc); in fnic_is_abts_pending()
2769 if (!io_req || sc->device != lun_dev) { in fnic_is_abts_pending()