Lines Matching refs:efct
95 struct efct *efct; in efct_lio_tpg_enable_store() local
99 if (!tpg->nport || !tpg->nport->efct) { in efct_lio_tpg_enable_store()
104 efct = tpg->nport->efct; in efct_lio_tpg_enable_store()
105 efc = efct->efcport; in efct_lio_tpg_enable_store()
114 efc_log_debug(efct, "enable portal group %d\n", tpg->tpgt); in efct_lio_tpg_enable_store()
116 ret = efct_xport_control(efct->xport, EFCT_XPORT_PORT_ONLINE); in efct_lio_tpg_enable_store()
118 efct->tgt_efct.lio_nport = NULL; in efct_lio_tpg_enable_store()
119 efc_log_debug(efct, "cannot bring port online\n"); in efct_lio_tpg_enable_store()
123 efc_log_debug(efct, "disable portal group %d\n", tpg->tpgt); in efct_lio_tpg_enable_store()
154 struct efct *efct; in efct_lio_npiv_tpg_enable_store() local
166 efct = lio_vport->efct; in efct_lio_npiv_tpg_enable_store()
167 efc = efct->efcport; in efct_lio_npiv_tpg_enable_store()
171 efc_log_debug(efct, "enable portal group %d\n", tpg->tpgt); in efct_lio_npiv_tpg_enable_store()
182 efc_log_err(efct, "Failed to create Vport\n"); in efct_lio_npiv_tpg_enable_store()
194 efc_log_debug(efct, "disable portal group %d\n", tpg->tpgt); in efct_lio_npiv_tpg_enable_store()
201 efc_nport_vport_del(efct->efcport, efc->domain, in efct_lio_npiv_tpg_enable_store()
331 struct efct *efct = io->efct; in efct_lio_release_cmd() local
336 atomic_sub_return(1, &efct->tgt_efct.ios_in_use); in efct_lio_release_cmd()
368 ocp->seg_map_cnt = dma_map_sg(&io->efct->pci->dev, cmd->t_data_sg, in efct_lio_sg_map()
384 dma_unmap_sg(&io->efct->pci->dev, cmd->t_data_sg, in efct_lio_sg_unmap()
714 static struct efct *efct_find_wwpn(u64 wwpn) in efct_find_wwpn()
716 struct efct *efct; in efct_find_wwpn() local
719 list_for_each_entry(efct, &efct_devices, list_entry) { in efct_find_wwpn()
721 if (wwpn == efct_get_wwpn(&efct->hw)) in efct_find_wwpn()
722 return efct; in efct_find_wwpn()
733 struct efct *efct; in efct_lio_make_nport() local
741 efct = efct_find_wwpn(wwpn); in efct_lio_make_nport()
742 if (!efct) { in efct_lio_make_nport()
751 lio_nport->efct = efct; in efct_lio_make_nport()
755 efct->tgt_efct.lio_nport = lio_nport; in efct_lio_make_nport()
765 struct efct *efct; in efct_lio_npiv_make_nport() local
793 efct = efct_find_wwpn(p_wwpn); in efct_lio_npiv_make_nport()
794 if (!efct) { in efct_lio_npiv_make_nport()
803 lio_vport->efct = efct; in efct_lio_npiv_make_nport()
826 new_fc_vport = fc_vport_create(efct->shost, 0, &vport_id); in efct_lio_npiv_make_nport()
828 efc_log_err(efct, "fc_vport_create failed\n"); in efct_lio_npiv_make_nport()
835 spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_make_nport()
837 list_add_tail(&vport_list->list_entry, &efct->tgt_efct.vport_list); in efct_lio_npiv_make_nport()
838 spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_make_nport()
848 struct efct *efct = lio_nport->efct; in efct_lio_drop_nport() local
853 kfree(efct->tgt_efct.lio_nport); in efct_lio_drop_nport()
854 efct->tgt_efct.lio_nport = NULL; in efct_lio_drop_nport()
863 struct efct *efct = lio_vport->efct; in efct_lio_npiv_drop_nport() local
869 spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_drop_nport()
871 list_for_each_entry_safe(vport, next_vport, &efct->tgt_efct.vport_list, in efct_lio_npiv_drop_nport()
880 spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_drop_nport()
889 struct efct *efct; in efct_lio_make_tpg() local
917 efct = lio_nport->efct; in efct_lio_make_tpg()
918 efct->tgt_efct.tpg = tpg; in efct_lio_make_tpg()
919 efc_log_debug(efct, "create portal group %d\n", tpg->tpgt); in efct_lio_make_tpg()
921 xa_init(&efct->lookup); in efct_lio_make_tpg()
931 struct efct *efct = tpg->nport->efct; in efct_lio_drop_tpg() local
933 efc_log_debug(efct, "drop portal group %d\n", tpg->tpgt); in efct_lio_drop_tpg()
934 tpg->nport->efct->tgt_efct.tpg = NULL; in efct_lio_drop_tpg()
936 xa_destroy(&efct->lookup); in efct_lio_drop_tpg()
946 struct efct *efct; in efct_lio_npiv_make_tpg() local
950 efct = lio_vport->efct; in efct_lio_npiv_make_tpg()
957 efc_log_err(efct, "Invalid tpgt index: %ld provided\n", n); in efct_lio_npiv_make_tpg()
982 efc_log_debug(efct, "create vport portal group %d\n", tpg->tpgt); in efct_lio_npiv_make_tpg()
993 efc_log_debug(tpg->vport->efct, "drop npiv portal group %d\n", in efct_lio_npiv_drop_tpg()
1033 struct efct *efct; in efct_get_vport_tpg() local
1040 efct = node->efc->base; in efct_get_vport_tpg()
1041 spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); in efct_get_vport_tpg()
1042 list_for_each_entry_safe(vport, next, &efct->tgt_efct.vport_list, in efct_get_vport_tpg()
1046 efc_log_debug(efct, "found tpg on vport\n"); in efct_get_vport_tpg()
1051 spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); in efct_get_vport_tpg()
1070 struct efct *efct = node->efc->base; in efct_session_cb() local
1081 tgt_node->efct = efct; in efct_session_cb()
1096 int efct_scsi_tgt_new_device(struct efct *efct) in efct_scsi_tgt_new_device() argument
1101 efct->tgt_efct.max_sge = sli_get_max_sge(&efct->hw.sli); in efct_scsi_tgt_new_device()
1102 efct->tgt_efct.max_sgl = sli_get_max_sgl(&efct->hw.sli); in efct_scsi_tgt_new_device()
1105 atomic_set(&efct->tgt_efct.ios_in_use, 0); in efct_scsi_tgt_new_device()
1106 total_ios = efct->hw.config.n_io; in efct_scsi_tgt_new_device()
1107 efc_log_debug(efct, "total_ios=%d\n", total_ios); in efct_scsi_tgt_new_device()
1108 efct->tgt_efct.watermark_min = in efct_scsi_tgt_new_device()
1110 efct->tgt_efct.watermark_max = in efct_scsi_tgt_new_device()
1112 atomic_set(&efct->tgt_efct.io_high_watermark, in efct_scsi_tgt_new_device()
1113 efct->tgt_efct.watermark_max); in efct_scsi_tgt_new_device()
1114 atomic_set(&efct->tgt_efct.watermark_hit, 0); in efct_scsi_tgt_new_device()
1115 atomic_set(&efct->tgt_efct.initiator_count, 0); in efct_scsi_tgt_new_device()
1119 efc_log_err(efct, "workqueue create failed\n"); in efct_scsi_tgt_new_device()
1123 spin_lock_init(&efct->tgt_efct.efct_lio_lock); in efct_scsi_tgt_new_device()
1124 INIT_LIST_HEAD(&efct->tgt_efct.vport_list); in efct_scsi_tgt_new_device()
1129 int efct_scsi_tgt_del_device(struct efct *efct) in efct_scsi_tgt_del_device() argument
1139 struct efct *efct = nport->efc->base; in efct_scsi_tgt_new_nport() local
1141 efc_log_debug(efct, "New SPORT: %s bound to %s\n", nport->display_name, in efct_scsi_tgt_new_nport()
1142 efct->tgt_efct.lio_nport->wwpn_str); in efct_scsi_tgt_new_nport()
1157 struct efct *efct = wq_data->efct; in efct_lio_setup_session() local
1174 } else if (efct->tgt_efct.tpg) { in efct_lio_setup_session()
1175 tpg = efct->tgt_efct.tpg; in efct_lio_setup_session()
1178 efc_log_err(efct, "failed to init session\n"); in efct_lio_setup_session()
1192 efc_log_err(efct, "failed to setup session\n"); in efct_lio_setup_session()
1201 efc_log_debug(efct, "new initiator sess=%p node=%p id: %llx\n", in efct_lio_setup_session()
1204 if (xa_err(xa_store(&efct->lookup, id, tgt_node, GFP_KERNEL))) in efct_lio_setup_session()
1205 efc_log_err(efct, "Node lookup store failed\n"); in efct_lio_setup_session()
1210 ini_count = atomic_add_return(1, &efct->tgt_efct.initiator_count); in efct_lio_setup_session()
1211 watermark = efct->tgt_efct.watermark_max - in efct_lio_setup_session()
1213 watermark = (efct->tgt_efct.watermark_min > watermark) ? in efct_lio_setup_session()
1214 efct->tgt_efct.watermark_min : watermark; in efct_lio_setup_session()
1215 atomic_set(&efct->tgt_efct.io_high_watermark, watermark); in efct_lio_setup_session()
1222 struct efct *efct = node->efc->base; in efct_scsi_new_initiator() local
1234 wq_data->efct = efct; in efct_scsi_new_initiator()
1244 struct efct *efct = wq_data->efct; in efct_lio_remove_session() local
1255 efc_log_err(efct, "unreg session for NULL session\n"); in efct_lio_remove_session()
1261 efc_log_debug(efct, "unreg session se_sess=%p node=%p\n", in efct_lio_remove_session()
1279 struct efct *efct = node->efc->base; in efct_scsi_del_initiator() local
1290 efc_log_err(efct, "tgt_node is NULL\n"); in efct_scsi_del_initiator()
1299 xa_erase(&efct->lookup, id); in efct_scsi_del_initiator()
1302 wq_data->efct = efct; in efct_scsi_del_initiator()
1309 ini_count = atomic_sub_return(1, &efct->tgt_efct.initiator_count); in efct_scsi_del_initiator()
1311 watermark = efct->tgt_efct.watermark_max - in efct_scsi_del_initiator()
1313 watermark = (efct->tgt_efct.watermark_min > watermark) ? in efct_scsi_del_initiator()
1314 efct->tgt_efct.watermark_min : watermark; in efct_scsi_del_initiator()
1315 atomic_set(&efct->tgt_efct.io_high_watermark, watermark); in efct_scsi_del_initiator()
1325 struct efct *efct = io->efct; in efct_scsi_recv_cmd() local
1333 atomic_add_return(1, &efct->tgt_efct.ios_in_use); in efct_scsi_recv_cmd()
1336 io->timeout = efct->target_io_timer_sec; in efct_scsi_recv_cmd()
1373 efc_log_err(efct, "No session found to submit IO se_cmd: %p\n", in efct_scsi_recv_cmd()
1384 efc_log_err(efct, "failed to init cmd se_cmd: %p\n", se_cmd); in efct_scsi_recv_cmd()
1401 struct efct *efct = tmfio->efct; in efct_scsi_recv_tmf() local
1409 atomic_add_return(1, &efct->tgt_efct.ios_in_use); in efct_scsi_recv_tmf()