Lines Matching refs:io_req
110 * Unmap the data buffer and sense buffer for an io_req,
114 struct fnic_io_req *io_req,
117 if (io_req->sgl_list_pa)
118 dma_unmap_single(&fnic->pdev->dev, io_req->sgl_list_pa,
119 sizeof(io_req->sgl_list[0]) * io_req->sgl_cnt,
123 if (io_req->sgl_cnt)
124 mempool_free(io_req->sgl_list_alloc,
125 fnic->io_sgl_pool[io_req->sgl_type]);
126 if (io_req->sense_buf_pa)
127 dma_unmap_single(&fnic->pdev->dev, io_req->sense_buf_pa,
307 struct fnic_io_req *io_req,
324 desc = io_req->sgl_list;
332 io_req->sgl_list_pa = dma_map_single(&fnic->pdev->dev,
333 io_req->sgl_list,
334 sizeof(io_req->sgl_list[0]) * sg_count,
336 if (dma_mapping_error(&fnic->pdev->dev, io_req->sgl_list_pa)) {
342 io_req->sense_buf_pa = dma_map_single(&fnic->pdev->dev,
346 if (dma_mapping_error(&fnic->pdev->dev, io_req->sense_buf_pa)) {
347 dma_unmap_single(&fnic->pdev->dev, io_req->sgl_list_pa,
348 sizeof(io_req->sgl_list[0]) * sg_count,
382 0, exch_flags, io_req->sgl_cnt,
384 io_req->sgl_list_pa,
385 io_req->sense_buf_pa,
392 fc_lun.scsi_lun, io_req->port_id,
417 struct fnic_io_req *io_req = NULL;
491 /* Get a new io_req for this SCSI IO */
492 io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC);
493 if (!io_req) {
498 memset(io_req, 0, sizeof(*io_req));
505 mempool_free(io_req, fnic->io_req_pool);
510 io_req->sgl_cnt = sg_count;
511 io_req->sgl_type = FNIC_SGL_CACHE_DFLT;
513 io_req->sgl_type = FNIC_SGL_CACHE_MAX;
516 io_req->sgl_list =
517 mempool_alloc(fnic->io_sgl_pool[io_req->sgl_type],
519 if (!io_req->sgl_list) {
523 mempool_free(io_req, fnic->io_req_pool);
528 io_req->sgl_list_alloc = io_req->sgl_list;
529 ptr = (unsigned long) io_req->sgl_list;
531 io_req->sgl_list = (struct host_sg_desc *)
545 /* initialize rest of io_req */
547 io_req->port_id = rport->port_id;
548 io_req->start_time = jiffies;
550 fnic_priv(sc)->io_req = io_req;
555 ret = fnic_queue_wq_copy_desc(fnic, wq, io_req, sc, sg_count);
563 io_req = fnic_priv(sc)->io_req;
564 fnic_priv(sc)->io_req = NULL;
567 if (io_req) {
568 fnic_release_ioreq_buf(fnic, io_req, sc);
569 mempool_free(io_req, fnic->io_req_pool);
593 tag, sc, io_req, sg_count, cmd_trace,
815 struct fnic_io_req *io_req;
824 /* Decode the cmpl description to get the io_req id */
857 io_req = fnic_priv(sc)->io_req;
858 WARN_ON_ONCE(!io_req);
859 if (!io_req) {
864 "icmnd_cmpl io_req is null - "
869 start_time = io_req->start_time;
872 io_req->io_completed = 1;
973 fnic_priv(sc)->io_req = NULL;
982 fnic_release_ioreq_buf(fnic, io_req, sc);
1010 mempool_free(io_req, fnic->io_req_pool);
1053 struct fnic_io_req *io_req;
1099 io_req = fnic_priv(sc)->io_req;
1100 WARN_ON_ONCE(!io_req);
1101 if (!io_req) {
1106 "itmf_cmpl io_req is null - "
1111 start_time = io_req->start_time;
1122 if (io_req->abts_done)
1123 complete(io_req->abts_done);
1183 if (io_req->abts_done) {
1184 complete(io_req->abts_done);
1189 fnic_priv(sc)->io_req = NULL;
1194 fnic_release_ioreq_buf(fnic, io_req, sc);
1195 mempool_free(io_req, fnic->io_req_pool);
1251 if (io_req->dr_done)
1252 complete(io_req->dr_done);
1361 struct fnic_io_req *io_req;
1370 io_req = fnic_priv(sc)->io_req;
1378 if (io_req && io_req->dr_done)
1379 complete(io_req->dr_done);
1380 else if (io_req && io_req->abts_done)
1381 complete(io_req->abts_done);
1388 if (!io_req) {
1393 fnic_priv(sc)->io_req = NULL;
1398 * If there is a scsi_cmnd associated with this io_req, then
1401 start_time = io_req->start_time;
1402 fnic_release_ioreq_buf(fnic, io_req, sc);
1403 mempool_free(io_req, fnic->io_req_pool);
1447 struct fnic_io_req *io_req;
1468 io_req = fnic_priv(sc)->io_req;
1472 if (!io_req) {
1477 fnic_priv(sc)->io_req = NULL;
1481 start_time = io_req->start_time;
1482 fnic_release_ioreq_buf(fnic, io_req, sc);
1483 mempool_free(io_req, fnic->io_req_pool);
1503 struct fnic_io_req *io_req)
1533 0, task_req, tag, fc_lun, io_req->port_id,
1559 struct fnic_io_req *io_req;
1570 io_req = fnic_priv(sc)->io_req;
1572 if (!io_req || io_req->port_id != iter_data->port_id) {
1594 if (io_req->abts_done) {
1596 "fnic_rport_exch_reset: io_req->abts_done is set "
1617 BUG_ON(io_req->abts_done);
1629 fc_lun.scsi_lun, io_req)) {
1714 * A SCSI IO is represented by a io_req in the driver.
1722 struct fnic_io_req *io_req = NULL;
1772 * .io_req will not be cleared except while holding io_req_lock.
1776 io_req = fnic_priv(sc)->io_req;
1777 if (!io_req) {
1782 io_req->abts_done = &tm_done;
1789 abt_issued_time = jiffies_to_msecs(jiffies) - jiffies_to_msecs(io_req->start_time);
1835 io_req)) {
1839 io_req = fnic_priv(sc)->io_req;
1840 if (io_req)
1841 io_req->abts_done = NULL;
1868 io_req = fnic_priv(sc)->io_req;
1869 if (!io_req) {
1876 io_req->abts_done = NULL;
1904 start_time = io_req->start_time;
1907 * free the io_req if successful. If abort fails,
1911 fnic_priv(sc)->io_req = NULL;
1920 fnic_release_ioreq_buf(fnic, io_req, sc);
1921 mempool_free(io_req, fnic->io_req_pool);
1949 struct fnic_io_req *io_req)
1960 tag = io_req->tag;
1990 fc_lun.scsi_lun, io_req->port_id,
2019 struct fnic_io_req *io_req;
2031 io_req = fnic_priv(sc)->io_req;
2032 if (!io_req) {
2058 if (io_req->abts_done)
2060 "%s: io_req->abts_done is set state is %s\n",
2072 BUG_ON(io_req->abts_done);
2081 io_req->abts_done = &tm_done;
2089 fc_lun.scsi_lun, io_req)) {
2091 io_req = fnic_priv(sc)->io_req;
2092 if (io_req)
2093 io_req->abts_done = NULL;
2112 io_req = fnic_priv(sc)->io_req;
2113 if (!io_req) {
2119 io_req->abts_done = NULL;
2132 fnic_priv(sc)->io_req = NULL;
2137 fnic_release_ioreq_buf(fnic, io_req, sc);
2138 mempool_free(io_req, fnic->io_req_pool);
2200 struct fnic_io_req *io_req = NULL;
2262 io_req = fnic_priv(sc)->io_req;
2265 * If there is a io_req attached to this command, then use it,
2268 if (!io_req) {
2269 io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC);
2270 if (!io_req) {
2274 memset(io_req, 0, sizeof(*io_req));
2275 io_req->port_id = rport->port_id;
2276 io_req->tag = tag;
2277 io_req->sc = sc;
2278 fnic_priv(sc)->io_req = io_req;
2280 io_req->dr_done = &tm_done;
2291 if (fnic_queue_dr_io_req(fnic, sc, io_req)) {
2293 io_req = fnic_priv(sc)->io_req;
2294 if (io_req)
2295 io_req->dr_done = NULL;
2303 * Wait on the local completion for LUN reset. The io_req may be
2310 io_req = fnic_priv(sc)->io_req;
2311 if (!io_req) {
2314 "io_req is null tag 0x%x sc 0x%p\n", tag, sc);
2317 io_req->dr_done = NULL;
2322 * If lun reset not completed, bail out with failed. io_req
2346 fc_lun.scsi_lun, io_req)) {
2353 io_req->abts_done = &tm_done;
2369 io_req = fnic_priv(sc)->io_req;
2370 io_req->abts_done = NULL;
2378 /* Completed, but not successful, clean up the io_req, return fail */
2384 io_req = fnic_priv(sc)->io_req;
2397 io_req = fnic_priv(sc)->io_req;
2406 io_req = fnic_priv(sc)->io_req;
2407 if (io_req)
2412 if (io_req)
2413 fnic_priv(sc)->io_req = NULL;
2417 if (io_req) {
2418 start_time = io_req->start_time;
2419 fnic_release_ioreq_buf(fnic, io_req, sc);
2420 mempool_free(io_req, fnic->io_req_pool);
2658 struct fnic_io_req *io_req;
2674 io_req = fnic_priv(sc)->io_req;
2675 if (!io_req) {