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()
336 struct efct *efct = io->efct; in efct_lio_release_cmd() local
341 atomic_sub_return(1, &efct->tgt_efct.ios_in_use); in efct_lio_release_cmd()
385 ocp->seg_map_cnt = dma_map_sg(&io->efct->pci->dev, cmd->t_data_sg, in efct_lio_sg_map()
401 dma_unmap_sg(&io->efct->pci->dev, cmd->t_data_sg, in efct_lio_sg_unmap()
731 static struct efct *efct_find_wwpn(u64 wwpn) in efct_find_wwpn()
733 struct efct *efct; in efct_find_wwpn() local
736 list_for_each_entry(efct, &efct_devices, list_entry) { in efct_find_wwpn()
738 if (wwpn == efct_get_wwpn(&efct->hw)) in efct_find_wwpn()
739 return efct; in efct_find_wwpn()
750 struct efct *efct; in efct_lio_make_nport() local
758 efct = efct_find_wwpn(wwpn); in efct_lio_make_nport()
759 if (!efct) { in efct_lio_make_nport()
768 lio_nport->efct = efct; in efct_lio_make_nport()
772 efct->tgt_efct.lio_nport = lio_nport; in efct_lio_make_nport()
782 struct efct *efct; in efct_lio_npiv_make_nport() local
810 efct = efct_find_wwpn(p_wwpn); in efct_lio_npiv_make_nport()
811 if (!efct) { in efct_lio_npiv_make_nport()
820 lio_vport->efct = efct; in efct_lio_npiv_make_nport()
843 new_fc_vport = fc_vport_create(efct->shost, 0, &vport_id); in efct_lio_npiv_make_nport()
845 efc_log_err(efct, "fc_vport_create failed\n"); in efct_lio_npiv_make_nport()
852 spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_make_nport()
854 list_add_tail(&vport_list->list_entry, &efct->tgt_efct.vport_list); in efct_lio_npiv_make_nport()
855 spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_make_nport()
865 struct efct *efct = lio_nport->efct; in efct_lio_drop_nport() local
870 kfree(efct->tgt_efct.lio_nport); in efct_lio_drop_nport()
871 efct->tgt_efct.lio_nport = NULL; in efct_lio_drop_nport()
880 struct efct *efct = lio_vport->efct; in efct_lio_npiv_drop_nport() local
886 spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_drop_nport()
888 list_for_each_entry_safe(vport, next_vport, &efct->tgt_efct.vport_list, in efct_lio_npiv_drop_nport()
897 spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_drop_nport()
906 struct efct *efct; in efct_lio_make_tpg() local
934 efct = lio_nport->efct; in efct_lio_make_tpg()
935 efct->tgt_efct.tpg = tpg; in efct_lio_make_tpg()
936 efc_log_debug(efct, "create portal group %d\n", tpg->tpgt); in efct_lio_make_tpg()
938 xa_init(&efct->lookup); in efct_lio_make_tpg()
948 struct efct *efct = tpg->nport->efct; in efct_lio_drop_tpg() local
950 efc_log_debug(efct, "drop portal group %d\n", tpg->tpgt); in efct_lio_drop_tpg()
951 tpg->nport->efct->tgt_efct.tpg = NULL; in efct_lio_drop_tpg()
953 xa_destroy(&efct->lookup); in efct_lio_drop_tpg()
963 struct efct *efct; in efct_lio_npiv_make_tpg() local
967 efct = lio_vport->efct; in efct_lio_npiv_make_tpg()
974 efc_log_err(efct, "Invalid tpgt index: %ld provided\n", n); in efct_lio_npiv_make_tpg()
999 efc_log_debug(efct, "create vport portal group %d\n", tpg->tpgt); in efct_lio_npiv_make_tpg()
1010 efc_log_debug(tpg->vport->efct, "drop npiv portal group %d\n", in efct_lio_npiv_drop_tpg()
1050 struct efct *efct; in efct_get_vport_tpg() local
1057 efct = node->efc->base; in efct_get_vport_tpg()
1058 spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); in efct_get_vport_tpg()
1059 list_for_each_entry_safe(vport, next, &efct->tgt_efct.vport_list, in efct_get_vport_tpg()
1063 efc_log_debug(efct, "found tpg on vport\n"); in efct_get_vport_tpg()
1068 spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); in efct_get_vport_tpg()
1087 struct efct *efct = node->efc->base; in efct_session_cb() local
1098 tgt_node->efct = efct; in efct_session_cb()
1113 int efct_scsi_tgt_new_device(struct efct *efct) in efct_scsi_tgt_new_device() argument
1118 efct->tgt_efct.max_sge = sli_get_max_sge(&efct->hw.sli); in efct_scsi_tgt_new_device()
1119 efct->tgt_efct.max_sgl = sli_get_max_sgl(&efct->hw.sli); in efct_scsi_tgt_new_device()
1122 atomic_set(&efct->tgt_efct.ios_in_use, 0); in efct_scsi_tgt_new_device()
1123 total_ios = efct->hw.config.n_io; in efct_scsi_tgt_new_device()
1124 efc_log_debug(efct, "total_ios=%d\n", total_ios); in efct_scsi_tgt_new_device()
1125 efct->tgt_efct.watermark_min = in efct_scsi_tgt_new_device()
1127 efct->tgt_efct.watermark_max = in efct_scsi_tgt_new_device()
1129 atomic_set(&efct->tgt_efct.io_high_watermark, in efct_scsi_tgt_new_device()
1130 efct->tgt_efct.watermark_max); in efct_scsi_tgt_new_device()
1131 atomic_set(&efct->tgt_efct.watermark_hit, 0); in efct_scsi_tgt_new_device()
1132 atomic_set(&efct->tgt_efct.initiator_count, 0); in efct_scsi_tgt_new_device()
1136 efc_log_err(efct, "workqueue create failed\n"); in efct_scsi_tgt_new_device()
1140 spin_lock_init(&efct->tgt_efct.efct_lio_lock); in efct_scsi_tgt_new_device()
1141 INIT_LIST_HEAD(&efct->tgt_efct.vport_list); in efct_scsi_tgt_new_device()
1146 int efct_scsi_tgt_del_device(struct efct *efct) in efct_scsi_tgt_del_device() argument
1156 struct efct *efct = nport->efc->base; in efct_scsi_tgt_new_nport() local
1158 efc_log_debug(efct, "New SPORT: %s bound to %s\n", nport->display_name, in efct_scsi_tgt_new_nport()
1159 efct->tgt_efct.lio_nport->wwpn_str); in efct_scsi_tgt_new_nport()
1174 struct efct *efct = wq_data->efct; in efct_lio_setup_session() local
1191 } else if (efct->tgt_efct.tpg) { in efct_lio_setup_session()
1192 tpg = efct->tgt_efct.tpg; in efct_lio_setup_session()
1195 efc_log_err(efct, "failed to init session\n"); in efct_lio_setup_session()
1209 efc_log_err(efct, "failed to setup session\n"); in efct_lio_setup_session()
1218 efc_log_debug(efct, "new initiator sess=%p node=%p id: %llx\n", in efct_lio_setup_session()
1221 if (xa_err(xa_store(&efct->lookup, id, tgt_node, GFP_KERNEL))) in efct_lio_setup_session()
1222 efc_log_err(efct, "Node lookup store failed\n"); in efct_lio_setup_session()
1227 ini_count = atomic_add_return(1, &efct->tgt_efct.initiator_count); in efct_lio_setup_session()
1228 watermark = efct->tgt_efct.watermark_max - in efct_lio_setup_session()
1230 watermark = (efct->tgt_efct.watermark_min > watermark) ? in efct_lio_setup_session()
1231 efct->tgt_efct.watermark_min : watermark; in efct_lio_setup_session()
1232 atomic_set(&efct->tgt_efct.io_high_watermark, watermark); in efct_lio_setup_session()
1239 struct efct *efct = node->efc->base; in efct_scsi_new_initiator() local
1251 wq_data->efct = efct; in efct_scsi_new_initiator()
1261 struct efct *efct = wq_data->efct; in efct_lio_remove_session() local
1272 efc_log_err(efct, "unreg session for NULL session\n"); in efct_lio_remove_session()
1278 efc_log_debug(efct, "unreg session se_sess=%p node=%p\n", in efct_lio_remove_session()
1296 struct efct *efct = node->efc->base; in efct_scsi_del_initiator() local
1307 efc_log_err(efct, "tgt_node is NULL\n"); in efct_scsi_del_initiator()
1316 xa_erase(&efct->lookup, id); in efct_scsi_del_initiator()
1319 wq_data->efct = efct; in efct_scsi_del_initiator()
1326 ini_count = atomic_sub_return(1, &efct->tgt_efct.initiator_count); in efct_scsi_del_initiator()
1328 watermark = efct->tgt_efct.watermark_max - in efct_scsi_del_initiator()
1330 watermark = (efct->tgt_efct.watermark_min > watermark) ? in efct_scsi_del_initiator()
1331 efct->tgt_efct.watermark_min : watermark; in efct_scsi_del_initiator()
1332 atomic_set(&efct->tgt_efct.io_high_watermark, watermark); in efct_scsi_del_initiator()
1342 struct efct *efct = io->efct; in efct_scsi_recv_cmd() local
1350 atomic_add_return(1, &efct->tgt_efct.ios_in_use); in efct_scsi_recv_cmd()
1353 io->timeout = efct->target_io_timer_sec; in efct_scsi_recv_cmd()
1390 efc_log_err(efct, "No session found to submit IO se_cmd: %p\n", in efct_scsi_recv_cmd()
1401 efc_log_err(efct, "failed to init cmd se_cmd: %p\n", se_cmd); in efct_scsi_recv_cmd()
1418 struct efct *efct = tmfio->efct; in efct_scsi_recv_tmf() local
1426 atomic_add_return(1, &efct->tgt_efct.ios_in_use); in efct_scsi_recv_tmf()