Lines Matching defs:io_req

108  * Unmap the data buffer and sense buffer for an io_req,
112 struct fnic_io_req *io_req,
115 if (io_req->sgl_list_pa)
116 dma_unmap_single(&fnic->pdev->dev, io_req->sgl_list_pa,
117 sizeof(io_req->sgl_list[0]) * io_req->sgl_cnt,
121 if (io_req->sgl_cnt)
122 mempool_free(io_req->sgl_list_alloc,
123 fnic->io_sgl_pool[io_req->sgl_type]);
124 if (io_req->sense_buf_pa)
125 dma_unmap_single(&fnic->pdev->dev, io_req->sense_buf_pa,
135 struct fnic_io_req *io_req = fnic_priv(sc)->io_req;
137 if (!io_req || (*portid && (io_req->port_id != *portid)))
168 if (sc->device != scsi_device || !fnic_priv(sc)->io_req)
357 struct fnic_io_req *io_req,
379 desc = io_req->sgl_list;
387 io_req->sgl_list_pa = dma_map_single(&fnic->pdev->dev,
388 io_req->sgl_list,
389 sizeof(io_req->sgl_list[0]) * sg_count,
391 if (dma_mapping_error(&fnic->pdev->dev, io_req->sgl_list_pa)) {
397 io_req->sense_buf_pa = dma_map_single(&fnic->pdev->dev,
401 if (dma_mapping_error(&fnic->pdev->dev, io_req->sense_buf_pa)) {
402 dma_unmap_single(&fnic->pdev->dev, io_req->sgl_list_pa,
403 sizeof(io_req->sgl_list[0]) * sg_count,
434 0, exch_flags, io_req->sgl_cnt,
436 io_req->sgl_list_pa,
437 io_req->sense_buf_pa,
444 fc_lun.scsi_lun, io_req->port_id,
463 struct fnic_io_req *io_req = NULL;
583 /* Get a new io_req for this SCSI IO */
584 io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC);
585 if (!io_req) {
590 memset(io_req, 0, sizeof(*io_req));
597 mempool_free(io_req, fnic->io_req_pool);
601 io_req->tport = tport;
603 io_req->sgl_cnt = sg_count;
604 io_req->sgl_type = FNIC_SGL_CACHE_DFLT;
606 io_req->sgl_type = FNIC_SGL_CACHE_MAX;
609 io_req->sgl_list =
610 mempool_alloc(fnic->io_sgl_pool[io_req->sgl_type],
612 if (!io_req->sgl_list) {
616 mempool_free(io_req, fnic->io_req_pool);
621 io_req->sgl_list_alloc = io_req->sgl_list;
622 ptr = (unsigned long) io_req->sgl_list;
624 io_req->sgl_list = (struct host_sg_desc *)
637 /* initialize rest of io_req */
639 io_req->port_id = rport->port_id;
640 io_req->start_time = jiffies;
642 fnic_priv(sc)->io_req = io_req;
644 io_req->sc = sc;
653 fnic->sw_copy_wq[hwq].io_req_table[blk_mq_unique_tag_to_tag(mqtag)] = io_req;
654 io_req->tag = mqtag;
659 ret = fnic_queue_wq_copy_desc(fnic, wq, io_req, sc, sg_count, mqtag, hwq);
667 io_req = fnic_priv(sc)->io_req;
668 fnic_priv(sc)->io_req = NULL;
669 if (io_req)
673 if (io_req) {
674 fnic_release_ioreq_buf(fnic, io_req, sc);
675 mempool_free(io_req, fnic->io_req_pool);
698 mqtag, sc, io_req, sg_count, cmd_trace,
917 struct fnic_io_req *io_req;
928 /* Decode the cmpl description to get the io_req id */
977 io_req = fnic_priv(sc)->io_req;
978 if (fnic->sw_copy_wq[hwq].io_req_table[tag] != io_req) {
979 WARN(1, "%s: %d: hwq: %d mqtag: 0x%x tag: 0x%x io_req tag mismatch\n",
985 WARN_ON_ONCE(!io_req);
986 if (!io_req) {
991 "icmnd_cmpl io_req is null - "
996 start_time = io_req->start_time;
999 io_req->io_completed = 1;
1103 fnic_priv(sc)->io_req = NULL;
1104 io_req->sc = NULL;
1116 fnic_release_ioreq_buf(fnic, io_req, sc);
1143 mempool_free(io_req, fnic->io_req_pool);
1186 struct fnic_io_req *io_req;
1234 * is max_tag_id and SC is retrieved from io_req
1237 io_req = fnic->sw_copy_wq[hwq].io_req_table[tag];
1238 if (io_req)
1239 sc = io_req->sc;
1254 io_req = fnic_priv(sc)->io_req;
1255 WARN_ON_ONCE(!io_req);
1256 if (!io_req) {
1261 "itmf_cmpl io_req is null - "
1266 start_time = io_req->start_time;
1278 if (io_req->abts_done)
1279 complete(io_req->abts_done);
1343 if (io_req->abts_done) {
1344 complete(io_req->abts_done);
1354 fnic_priv(sc)->io_req = NULL;
1359 fnic_release_ioreq_buf(fnic, io_req, sc);
1360 mempool_free(io_req, fnic->io_req_pool);
1419 if (io_req->dr_done)
1420 complete(io_req->dr_done);
1521 struct fnic_io_req *io_req;
1537 io_req = fnic_priv(sc)->io_req;
1538 if (!io_req) {
1553 if (io_req && io_req->dr_done)
1554 complete(io_req->dr_done);
1555 else if (io_req && io_req->abts_done)
1556 complete(io_req->abts_done);
1565 fnic_priv(sc)->io_req = NULL;
1566 io_req->sc = NULL;
1567 start_time = io_req->start_time;
1571 * If there is a scsi_cmnd associated with this io_req, then
1574 fnic_release_ioreq_buf(fnic, io_req, sc);
1575 mempool_free(io_req, fnic->io_req_pool);
1606 struct fnic_io_req *io_req = NULL;
1620 io_req = fnic->sw_copy_wq[0].io_req_table[fnic->fnic_max_tag_id];
1621 if (io_req) {
1622 sc = io_req->sc;
1627 if (io_req && io_req->dr_done)
1628 complete(io_req->dr_done);
1649 struct fnic_io_req *io_req;
1670 io_req = fnic_priv(sc)->io_req;
1674 if (!io_req) {
1679 fnic_priv(sc)->io_req = NULL;
1680 io_req->sc = NULL;
1685 start_time = io_req->start_time;
1686 fnic_release_ioreq_buf(fnic, io_req, sc);
1687 mempool_free(io_req, fnic->io_req_pool);
1707 struct fnic_io_req *io_req,
1713 struct fnic_tport_s *tport = io_req->tport;
1741 0, task_req, tag, fc_lun, io_req->port_id,
1768 struct fnic_io_req *io_req;
1786 io_req = fnic_priv(sc)->io_req;
1787 if (!io_req || io_req->port_id != iter_data->port_id) {
1810 if (io_req->abts_done) {
1812 "fnic_rport_exch_reset: io_req->abts_done is set state is %s\n",
1836 WARN_ON_ONCE(io_req->abts_done);
1847 fc_lun.scsi_lun, io_req, hwq)) {
1999 * A SCSI IO is represented by a io_req in the driver.
2008 struct fnic_io_req *io_req = NULL;
2099 * .io_req will not be cleared except while holding io_req_lock.
2102 io_req = fnic_priv(sc)->io_req;
2103 if (!io_req) {
2109 io_req->abts_done = &tm_done;
2116 abt_issued_time = jiffies_to_msecs(jiffies) - jiffies_to_msecs(io_req->start_time);
2163 io_req, hwq)) {
2167 io_req = fnic_priv(sc)->io_req;
2168 if (io_req)
2169 io_req->abts_done = NULL;
2196 io_req = fnic_priv(sc)->io_req;
2197 if (!io_req) {
2204 io_req->abts_done = NULL;
2232 start_time = io_req->start_time;
2235 * free the io_req if successful. If abort fails,
2240 fnic_priv(sc)->io_req = NULL;
2241 io_req->sc = NULL;
2251 fnic_release_ioreq_buf(fnic, io_req, sc);
2252 mempool_free(io_req, fnic->io_req_pool);
2280 struct fnic_io_req *io_req)
2289 struct fnic_tport_s *tport = io_req->tport;
2291 tag = io_req->tag;
2325 fc_lun.scsi_lun, io_req->port_id,
2357 struct fnic_io_req *io_req;
2370 io_req = fnic_priv(sc)->io_req;
2371 if (!io_req) {
2396 if (io_req->abts_done)
2398 "%s: io_req->abts_done is set state is %s\n",
2410 BUG_ON(io_req->abts_done);
2418 io_req->abts_done = &tm_done;
2426 fc_lun.scsi_lun, io_req, hwq)) {
2428 io_req = fnic_priv(sc)->io_req;
2429 if (io_req)
2430 io_req->abts_done = NULL;
2452 io_req = fnic_priv(sc)->io_req;
2453 if (!io_req) {
2459 io_req->abts_done = NULL;
2472 fnic_priv(sc)->io_req = NULL;
2479 fnic_release_ioreq_buf(fnic, io_req, sc);
2480 mempool_free(io_req, fnic->io_req_pool);
2541 struct fnic_io_req *io_req = NULL;
2634 io_req = fnic_priv(sc)->io_req;
2637 * If there is a io_req attached to this command, then use it,
2640 if (!io_req) {
2641 io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC);
2642 if (!io_req) {
2646 memset(io_req, 0, sizeof(*io_req));
2647 io_req->port_id = rport->port_id;
2648 io_req->tag = mqtag;
2649 fnic_priv(sc)->io_req = io_req;
2650 io_req->tport = tport;
2651 io_req->sc = sc;
2658 io_req;
2660 io_req->dr_done = &tm_done;
2671 if (fnic_queue_dr_io_req(fnic, sc, io_req)) {
2673 io_req = fnic_priv(sc)->io_req;
2674 if (io_req)
2675 io_req->dr_done = NULL;
2688 * Wait on the local completion for LUN reset. The io_req may be
2699 * 4) The device reset was aborted and io_req->dr_done was called.
2713 io_req = fnic_priv(sc)->io_req;
2714 if (!io_req) {
2717 "io_req is null mqtag 0x%x sc 0x%p\n", mqtag, sc);
2724 io_req->dr_done = NULL;
2727 io_req->dr_done = NULL;
2732 * If lun reset not completed, bail out with failed. io_req
2746 /* Completed, but not successful, clean up the io_req, return fail */
2752 io_req = fnic_priv(sc)->io_req;
2765 io_req = fnic_priv(sc)->io_req;
2773 io_req = fnic_priv(sc)->io_req;
2774 if (io_req)
2779 if (io_req) {
2780 fnic_priv(sc)->io_req = NULL;
2781 io_req->sc = NULL;
2782 fnic->sw_copy_wq[hwq].io_req_table[blk_mq_unique_tag_to_tag(io_req->tag)] = NULL;
2787 if (io_req) {
2788 start_time = io_req->start_time;
2789 fnic_release_ioreq_buf(fnic, io_req, sc);
2790 mempool_free(io_req, fnic->io_req_pool);
2953 struct fnic_io_req *io_req;
2972 io_req = fnic_priv(sc)->io_req;
2973 if (!io_req) {