Lines Matching refs:iod
107 struct nvmet_fc_ls_iod *iod; member
161 return (iodptr - iodptr->tgtport->iod); in nvmet_fc_iodnum()
336 struct nvmet_fc_ls_iod *iod; in nvmet_fc_alloc_ls_iodlist() local
339 iod = kcalloc(NVMET_LS_CTX_COUNT, sizeof(struct nvmet_fc_ls_iod), in nvmet_fc_alloc_ls_iodlist()
341 if (!iod) in nvmet_fc_alloc_ls_iodlist()
344 tgtport->iod = iod; in nvmet_fc_alloc_ls_iodlist()
346 for (i = 0; i < NVMET_LS_CTX_COUNT; iod++, i++) { in nvmet_fc_alloc_ls_iodlist()
347 INIT_WORK(&iod->work, nvmet_fc_handle_ls_rqst_work); in nvmet_fc_alloc_ls_iodlist()
348 iod->tgtport = tgtport; in nvmet_fc_alloc_ls_iodlist()
349 list_add_tail(&iod->ls_list, &tgtport->ls_list); in nvmet_fc_alloc_ls_iodlist()
351 iod->rqstbuf = kcalloc(2, NVME_FC_MAX_LS_BUFFER_SIZE, in nvmet_fc_alloc_ls_iodlist()
353 if (!iod->rqstbuf) in nvmet_fc_alloc_ls_iodlist()
356 iod->rspbuf = iod->rqstbuf + NVME_FC_MAX_LS_BUFFER_SIZE; in nvmet_fc_alloc_ls_iodlist()
358 iod->rspdma = fc_dma_map_single(tgtport->dev, iod->rspbuf, in nvmet_fc_alloc_ls_iodlist()
361 if (fc_dma_mapping_error(tgtport->dev, iod->rspdma)) in nvmet_fc_alloc_ls_iodlist()
368 kfree(iod->rqstbuf); in nvmet_fc_alloc_ls_iodlist()
369 list_del(&iod->ls_list); in nvmet_fc_alloc_ls_iodlist()
370 for (iod--, i--; i >= 0; iod--, i--) { in nvmet_fc_alloc_ls_iodlist()
371 fc_dma_unmap_single(tgtport->dev, iod->rspdma, in nvmet_fc_alloc_ls_iodlist()
373 kfree(iod->rqstbuf); in nvmet_fc_alloc_ls_iodlist()
374 list_del(&iod->ls_list); in nvmet_fc_alloc_ls_iodlist()
377 kfree(iod); in nvmet_fc_alloc_ls_iodlist()
385 struct nvmet_fc_ls_iod *iod = tgtport->iod; in nvmet_fc_free_ls_iodlist() local
388 for (i = 0; i < NVMET_LS_CTX_COUNT; iod++, i++) { in nvmet_fc_free_ls_iodlist()
390 iod->rspdma, NVME_FC_MAX_LS_BUFFER_SIZE, in nvmet_fc_free_ls_iodlist()
392 kfree(iod->rqstbuf); in nvmet_fc_free_ls_iodlist()
393 list_del(&iod->ls_list); in nvmet_fc_free_ls_iodlist()
395 kfree(tgtport->iod); in nvmet_fc_free_ls_iodlist()
401 struct nvmet_fc_ls_iod *iod; in nvmet_fc_alloc_ls_iod() local
405 iod = list_first_entry_or_null(&tgtport->ls_list, in nvmet_fc_alloc_ls_iod()
407 if (iod) in nvmet_fc_alloc_ls_iod()
408 list_move_tail(&iod->ls_list, &tgtport->ls_busylist); in nvmet_fc_alloc_ls_iod()
410 return iod; in nvmet_fc_alloc_ls_iod()
416 struct nvmet_fc_ls_iod *iod) in nvmet_fc_free_ls_iod() argument
421 list_move(&iod->ls_list, &tgtport->ls_list); in nvmet_fc_free_ls_iod()
1285 struct nvmet_fc_ls_iod *iod) in nvmet_fc_ls_create_association() argument
1288 (struct fcnvme_ls_cr_assoc_rqst *)iod->rqstbuf; in nvmet_fc_ls_create_association()
1290 (struct fcnvme_ls_cr_assoc_acc *)iod->rspbuf; in nvmet_fc_ls_create_association()
1304 if (iod->rqstdatalen < FCNVME_LSDESC_CRA_RQST_MINLEN) in nvmet_fc_ls_create_association()
1322 iod->assoc = nvmet_fc_alloc_target_assoc(tgtport); in nvmet_fc_ls_create_association()
1323 if (!iod->assoc) in nvmet_fc_ls_create_association()
1326 queue = nvmet_fc_alloc_target_queue(iod->assoc, 0, in nvmet_fc_ls_create_association()
1337 iod->lsreq->rsplen = nvmet_fc_format_rjt(acc, in nvmet_fc_ls_create_association()
1350 iod->lsreq->rsplen = sizeof(*acc); in nvmet_fc_ls_create_association()
1361 cpu_to_be64(nvmet_fc_makeconnid(iod->assoc, 0)); in nvmet_fc_ls_create_association()
1371 struct nvmet_fc_ls_iod *iod) in nvmet_fc_ls_create_connection() argument
1374 (struct fcnvme_ls_cr_conn_rqst *)iod->rqstbuf; in nvmet_fc_ls_create_connection()
1376 (struct fcnvme_ls_cr_conn_acc *)iod->rspbuf; in nvmet_fc_ls_create_connection()
1382 if (iod->rqstdatalen < sizeof(struct fcnvme_ls_cr_conn_rqst)) in nvmet_fc_ls_create_connection()
1408 iod->assoc = nvmet_fc_find_target_assoc(tgtport, in nvmet_fc_ls_create_connection()
1410 if (!iod->assoc) in nvmet_fc_ls_create_connection()
1413 queue = nvmet_fc_alloc_target_queue(iod->assoc, in nvmet_fc_ls_create_connection()
1420 nvmet_fc_tgt_a_put(iod->assoc); in nvmet_fc_ls_create_connection()
1428 iod->lsreq->rsplen = nvmet_fc_format_rjt(acc, in nvmet_fc_ls_create_connection()
1443 iod->lsreq->rsplen = sizeof(*acc); in nvmet_fc_ls_create_connection()
1453 cpu_to_be64(nvmet_fc_makeconnid(iod->assoc, in nvmet_fc_ls_create_connection()
1459 struct nvmet_fc_ls_iod *iod) in nvmet_fc_ls_disconnect() argument
1462 (struct fcnvme_ls_disconnect_rqst *)iod->rqstbuf; in nvmet_fc_ls_disconnect()
1464 (struct fcnvme_ls_disconnect_acc *)iod->rspbuf; in nvmet_fc_ls_disconnect()
1472 if (iod->rqstdatalen < sizeof(struct fcnvme_ls_disconnect_rqst)) in nvmet_fc_ls_disconnect()
1498 iod->assoc = assoc; in nvmet_fc_ls_disconnect()
1518 iod->lsreq->rsplen = nvmet_fc_format_rjt(acc, in nvmet_fc_ls_disconnect()
1531 iod->lsreq->rsplen = sizeof(*acc); in nvmet_fc_ls_disconnect()
1554 nvmet_fc_tgt_a_put(iod->assoc); in nvmet_fc_ls_disconnect()
1557 nvmet_fc_delete_target_assoc(iod->assoc); in nvmet_fc_ls_disconnect()
1571 struct nvmet_fc_ls_iod *iod = lsreq->nvmet_fc_private; in nvmet_fc_xmt_ls_rsp_done() local
1572 struct nvmet_fc_tgtport *tgtport = iod->tgtport; in nvmet_fc_xmt_ls_rsp_done()
1574 fc_dma_sync_single_for_cpu(tgtport->dev, iod->rspdma, in nvmet_fc_xmt_ls_rsp_done()
1576 nvmet_fc_free_ls_iod(tgtport, iod); in nvmet_fc_xmt_ls_rsp_done()
1582 struct nvmet_fc_ls_iod *iod) in nvmet_fc_xmt_ls_rsp() argument
1586 fc_dma_sync_single_for_device(tgtport->dev, iod->rspdma, in nvmet_fc_xmt_ls_rsp()
1589 ret = tgtport->ops->xmt_ls_rsp(&tgtport->fc_target_port, iod->lsreq); in nvmet_fc_xmt_ls_rsp()
1591 nvmet_fc_xmt_ls_rsp_done(iod->lsreq); in nvmet_fc_xmt_ls_rsp()
1599 struct nvmet_fc_ls_iod *iod) in nvmet_fc_handle_ls_rqst() argument
1602 (struct fcnvme_ls_rqst_w0 *)iod->rqstbuf; in nvmet_fc_handle_ls_rqst()
1604 iod->lsreq->nvmet_fc_private = iod; in nvmet_fc_handle_ls_rqst()
1605 iod->lsreq->rspbuf = iod->rspbuf; in nvmet_fc_handle_ls_rqst()
1606 iod->lsreq->rspdma = iod->rspdma; in nvmet_fc_handle_ls_rqst()
1607 iod->lsreq->done = nvmet_fc_xmt_ls_rsp_done; in nvmet_fc_handle_ls_rqst()
1609 iod->lsreq->rsplen = 0; in nvmet_fc_handle_ls_rqst()
1611 iod->assoc = NULL; in nvmet_fc_handle_ls_rqst()
1621 nvmet_fc_ls_create_association(tgtport, iod); in nvmet_fc_handle_ls_rqst()
1625 nvmet_fc_ls_create_connection(tgtport, iod); in nvmet_fc_handle_ls_rqst()
1629 nvmet_fc_ls_disconnect(tgtport, iod); in nvmet_fc_handle_ls_rqst()
1632 iod->lsreq->rsplen = nvmet_fc_format_rjt(iod->rspbuf, in nvmet_fc_handle_ls_rqst()
1637 nvmet_fc_xmt_ls_rsp(tgtport, iod); in nvmet_fc_handle_ls_rqst()
1646 struct nvmet_fc_ls_iod *iod = in nvmet_fc_handle_ls_rqst_work() local
1648 struct nvmet_fc_tgtport *tgtport = iod->tgtport; in nvmet_fc_handle_ls_rqst_work()
1650 nvmet_fc_handle_ls_rqst(tgtport, iod); in nvmet_fc_handle_ls_rqst_work()
1677 struct nvmet_fc_ls_iod *iod; in nvmet_fc_rcv_ls_req() local
1685 iod = nvmet_fc_alloc_ls_iod(tgtport); in nvmet_fc_rcv_ls_req()
1686 if (!iod) { in nvmet_fc_rcv_ls_req()
1691 iod->lsreq = lsreq; in nvmet_fc_rcv_ls_req()
1692 iod->fcpreq = NULL; in nvmet_fc_rcv_ls_req()
1693 memcpy(iod->rqstbuf, lsreqbuf, lsreqbuf_len); in nvmet_fc_rcv_ls_req()
1694 iod->rqstdatalen = lsreqbuf_len; in nvmet_fc_rcv_ls_req()
1696 schedule_work(&iod->work); in nvmet_fc_rcv_ls_req()