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()
382 ocp->seg_map_cnt = dma_map_sg(&io->efct->pci->dev, cmd->t_data_sg, in efct_lio_sg_map()
398 dma_unmap_sg(&io->efct->pci->dev, cmd->t_data_sg, in efct_lio_sg_unmap()
728 static struct efct *efct_find_wwpn(u64 wwpn) in efct_find_wwpn()
730 struct efct *efct; in efct_find_wwpn() local
733 list_for_each_entry(efct, &efct_devices, list_entry) { in efct_find_wwpn()
735 if (wwpn == efct_get_wwpn(&efct->hw)) in efct_find_wwpn()
736 return efct; in efct_find_wwpn()
747 struct efct *efct; in efct_lio_make_nport() local
755 efct = efct_find_wwpn(wwpn); in efct_lio_make_nport()
756 if (!efct) { in efct_lio_make_nport()
765 lio_nport->efct = efct; in efct_lio_make_nport()
769 efct->tgt_efct.lio_nport = lio_nport; in efct_lio_make_nport()
779 struct efct *efct; in efct_lio_npiv_make_nport() local
807 efct = efct_find_wwpn(p_wwpn); in efct_lio_npiv_make_nport()
808 if (!efct) { in efct_lio_npiv_make_nport()
817 lio_vport->efct = efct; in efct_lio_npiv_make_nport()
840 new_fc_vport = fc_vport_create(efct->shost, 0, &vport_id); in efct_lio_npiv_make_nport()
842 efc_log_err(efct, "fc_vport_create failed\n"); in efct_lio_npiv_make_nport()
849 spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_make_nport()
851 list_add_tail(&vport_list->list_entry, &efct->tgt_efct.vport_list); in efct_lio_npiv_make_nport()
852 spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_make_nport()
862 struct efct *efct = lio_nport->efct; in efct_lio_drop_nport() local
867 kfree(efct->tgt_efct.lio_nport); in efct_lio_drop_nport()
868 efct->tgt_efct.lio_nport = NULL; in efct_lio_drop_nport()
877 struct efct *efct = lio_vport->efct; in efct_lio_npiv_drop_nport() local
883 spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_drop_nport()
885 list_for_each_entry_safe(vport, next_vport, &efct->tgt_efct.vport_list, in efct_lio_npiv_drop_nport()
894 spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); in efct_lio_npiv_drop_nport()
903 struct efct *efct; in efct_lio_make_tpg() local
931 efct = lio_nport->efct; in efct_lio_make_tpg()
932 efct->tgt_efct.tpg = tpg; in efct_lio_make_tpg()
933 efc_log_debug(efct, "create portal group %d\n", tpg->tpgt); in efct_lio_make_tpg()
935 xa_init(&efct->lookup); in efct_lio_make_tpg()
945 struct efct *efct = tpg->nport->efct; in efct_lio_drop_tpg() local
947 efc_log_debug(efct, "drop portal group %d\n", tpg->tpgt); in efct_lio_drop_tpg()
948 tpg->nport->efct->tgt_efct.tpg = NULL; in efct_lio_drop_tpg()
950 xa_destroy(&efct->lookup); in efct_lio_drop_tpg()
960 struct efct *efct; in efct_lio_npiv_make_tpg() local
964 efct = lio_vport->efct; in efct_lio_npiv_make_tpg()
971 efc_log_err(efct, "Invalid tpgt index: %ld provided\n", n); in efct_lio_npiv_make_tpg()
996 efc_log_debug(efct, "create vport portal group %d\n", tpg->tpgt); in efct_lio_npiv_make_tpg()
1007 efc_log_debug(tpg->vport->efct, "drop npiv portal group %d\n", in efct_lio_npiv_drop_tpg()
1047 struct efct *efct; in efct_get_vport_tpg() local
1054 efct = node->efc->base; in efct_get_vport_tpg()
1055 spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); in efct_get_vport_tpg()
1056 list_for_each_entry_safe(vport, next, &efct->tgt_efct.vport_list, in efct_get_vport_tpg()
1060 efc_log_debug(efct, "found tpg on vport\n"); in efct_get_vport_tpg()
1065 spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); in efct_get_vport_tpg()
1084 struct efct *efct = node->efc->base; in efct_session_cb() local
1095 tgt_node->efct = efct; in efct_session_cb()
1110 int efct_scsi_tgt_new_device(struct efct *efct) in efct_scsi_tgt_new_device() argument
1115 efct->tgt_efct.max_sge = sli_get_max_sge(&efct->hw.sli); in efct_scsi_tgt_new_device()
1116 efct->tgt_efct.max_sgl = sli_get_max_sgl(&efct->hw.sli); in efct_scsi_tgt_new_device()
1119 atomic_set(&efct->tgt_efct.ios_in_use, 0); in efct_scsi_tgt_new_device()
1120 total_ios = efct->hw.config.n_io; in efct_scsi_tgt_new_device()
1121 efc_log_debug(efct, "total_ios=%d\n", total_ios); in efct_scsi_tgt_new_device()
1122 efct->tgt_efct.watermark_min = in efct_scsi_tgt_new_device()
1124 efct->tgt_efct.watermark_max = in efct_scsi_tgt_new_device()
1126 atomic_set(&efct->tgt_efct.io_high_watermark, in efct_scsi_tgt_new_device()
1127 efct->tgt_efct.watermark_max); in efct_scsi_tgt_new_device()
1128 atomic_set(&efct->tgt_efct.watermark_hit, 0); in efct_scsi_tgt_new_device()
1129 atomic_set(&efct->tgt_efct.initiator_count, 0); in efct_scsi_tgt_new_device()
1133 efc_log_err(efct, "workqueue create failed\n"); in efct_scsi_tgt_new_device()
1137 spin_lock_init(&efct->tgt_efct.efct_lio_lock); in efct_scsi_tgt_new_device()
1138 INIT_LIST_HEAD(&efct->tgt_efct.vport_list); in efct_scsi_tgt_new_device()
1143 int efct_scsi_tgt_del_device(struct efct *efct) in efct_scsi_tgt_del_device() argument
1153 struct efct *efct = nport->efc->base; in efct_scsi_tgt_new_nport() local
1155 efc_log_debug(efct, "New SPORT: %s bound to %s\n", nport->display_name, in efct_scsi_tgt_new_nport()
1156 efct->tgt_efct.lio_nport->wwpn_str); in efct_scsi_tgt_new_nport()
1171 struct efct *efct = wq_data->efct; in efct_lio_setup_session() local
1188 } else if (efct->tgt_efct.tpg) { in efct_lio_setup_session()
1189 tpg = efct->tgt_efct.tpg; in efct_lio_setup_session()
1192 efc_log_err(efct, "failed to init session\n"); in efct_lio_setup_session()
1206 efc_log_err(efct, "failed to setup session\n"); in efct_lio_setup_session()
1215 efc_log_debug(efct, "new initiator sess=%p node=%p id: %llx\n", in efct_lio_setup_session()
1218 if (xa_err(xa_store(&efct->lookup, id, tgt_node, GFP_KERNEL))) in efct_lio_setup_session()
1219 efc_log_err(efct, "Node lookup store failed\n"); in efct_lio_setup_session()
1224 ini_count = atomic_add_return(1, &efct->tgt_efct.initiator_count); in efct_lio_setup_session()
1225 watermark = efct->tgt_efct.watermark_max - in efct_lio_setup_session()
1227 watermark = (efct->tgt_efct.watermark_min > watermark) ? in efct_lio_setup_session()
1228 efct->tgt_efct.watermark_min : watermark; in efct_lio_setup_session()
1229 atomic_set(&efct->tgt_efct.io_high_watermark, watermark); in efct_lio_setup_session()
1236 struct efct *efct = node->efc->base; in efct_scsi_new_initiator() local
1248 wq_data->efct = efct; in efct_scsi_new_initiator()
1258 struct efct *efct = wq_data->efct; in efct_lio_remove_session() local
1269 efc_log_err(efct, "unreg session for NULL session\n"); in efct_lio_remove_session()
1275 efc_log_debug(efct, "unreg session se_sess=%p node=%p\n", in efct_lio_remove_session()
1293 struct efct *efct = node->efc->base; in efct_scsi_del_initiator() local
1304 efc_log_err(efct, "tgt_node is NULL\n"); in efct_scsi_del_initiator()
1313 xa_erase(&efct->lookup, id); in efct_scsi_del_initiator()
1316 wq_data->efct = efct; in efct_scsi_del_initiator()
1323 ini_count = atomic_sub_return(1, &efct->tgt_efct.initiator_count); in efct_scsi_del_initiator()
1325 watermark = efct->tgt_efct.watermark_max - in efct_scsi_del_initiator()
1327 watermark = (efct->tgt_efct.watermark_min > watermark) ? in efct_scsi_del_initiator()
1328 efct->tgt_efct.watermark_min : watermark; in efct_scsi_del_initiator()
1329 atomic_set(&efct->tgt_efct.io_high_watermark, watermark); in efct_scsi_del_initiator()
1339 struct efct *efct = io->efct; in efct_scsi_recv_cmd() local
1347 atomic_add_return(1, &efct->tgt_efct.ios_in_use); in efct_scsi_recv_cmd()
1350 io->timeout = efct->target_io_timer_sec; in efct_scsi_recv_cmd()
1387 efc_log_err(efct, "No session found to submit IO se_cmd: %p\n", in efct_scsi_recv_cmd()
1398 efc_log_err(efct, "failed to init cmd se_cmd: %p\n", se_cmd); in efct_scsi_recv_cmd()
1415 struct efct *efct = tmfio->efct; in efct_scsi_recv_tmf() local
1423 atomic_add_return(1, &efct->tgt_efct.ios_in_use); in efct_scsi_recv_tmf()