@@ -1242,31 +1242,29 @@ bool fdls_delete_tport(struct fnic_iport_s *iport, struct fnic_tport_s *tport)
12421242 tport -> timer_pending = 0 ;
12431243 }
12441244
1245- if (IS_FNIC_FCP_INITIATOR (fnic )) {
1246- spin_unlock_irqrestore (& fnic -> fnic_lock , fnic -> lock_flags );
1247- fnic_rport_exch_reset (iport -> fnic , tport -> fcid );
1248- spin_lock_irqsave (& fnic -> fnic_lock , fnic -> lock_flags );
1245+ spin_unlock_irqrestore (& fnic -> fnic_lock , fnic -> lock_flags );
1246+ fnic_rport_exch_reset (iport -> fnic , tport -> fcid );
1247+ spin_lock_irqsave (& fnic -> fnic_lock , fnic -> lock_flags );
12491248
1250- if (tport -> flags & FNIC_FDLS_SCSI_REGISTERED ) {
1251- tport_del_evt =
1252- kzalloc (sizeof (struct fnic_tport_event_s ), GFP_ATOMIC );
1253- if (!tport_del_evt ) {
1254- FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
1255- "Failed to allocate memory for tport fcid: 0x%0x\n" ,
1256- tport -> fcid );
1257- return false;
1258- }
1259- tport_del_evt -> event = TGT_EV_RPORT_DEL ;
1260- tport_del_evt -> arg1 = (void * ) tport ;
1261- list_add_tail (& tport_del_evt -> links , & fnic -> tport_event_list );
1262- queue_work (fnic_event_queue , & fnic -> tport_work );
1263- } else {
1249+ if (tport -> flags & FNIC_FDLS_SCSI_REGISTERED ) {
1250+ tport_del_evt =
1251+ kzalloc (sizeof (struct fnic_tport_event_s ), GFP_ATOMIC );
1252+ if (!tport_del_evt ) {
12641253 FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
1265- "tport 0x%x not reg with scsi_transport. Freeing locally " ,
1254+ "Failed to allocate memory for tport fcid: 0x%0x\n " ,
12661255 tport -> fcid );
1267- list_del (& tport -> links );
1268- kfree (tport );
1256+ return false;
12691257 }
1258+ tport_del_evt -> event = TGT_EV_RPORT_DEL ;
1259+ tport_del_evt -> arg1 = (void * ) tport ;
1260+ list_add_tail (& tport_del_evt -> links , & fnic -> tport_event_list );
1261+ queue_work (fnic_event_queue , & fnic -> tport_work );
1262+ } else {
1263+ FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
1264+ "tport 0x%x not reg with scsi_transport. Freeing locally" ,
1265+ tport -> fcid );
1266+ list_del (& tport -> links );
1267+ kfree (tport );
12701268 }
12711269 return true;
12721270}
@@ -1388,8 +1386,7 @@ static void fdls_send_register_fc4_types(struct fnic_iport_s *iport)
13881386 "0x%x: FDLS send RFT with oxid: 0x%x" , iport -> fcid ,
13891387 oxid );
13901388
1391- if (IS_FNIC_FCP_INITIATOR (fnic ))
1392- prft_id -> rft_id .fr_fts .ff_type_map [0 ] =
1389+ prft_id -> rft_id .fr_fts .ff_type_map [0 ] =
13931390 cpu_to_be32 (1 << FC_TYPE_FCP );
13941391
13951392 prft_id -> rft_id .fr_fts .ff_type_map [1 ] =
@@ -1451,12 +1448,7 @@ static void fdls_send_register_fc4_features(struct fnic_iport_s *iport)
14511448 "0x%x: FDLS send RFF with oxid: 0x%x" , iport -> fcid ,
14521449 oxid );
14531450
1454- if (IS_FNIC_FCP_INITIATOR (fnic )) {
1455- prff_id -> rff_id .fr_type = FC_TYPE_FCP ;
1456- } else {
1457- FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
1458- "0x%x: Unknown type" , iport -> fcid );
1459- }
1451+ prff_id -> rff_id .fr_type = FC_TYPE_FCP ;
14601452
14611453 fnic_send_fcoe_frame (iport , frame , frame_size );
14621454
@@ -2333,9 +2325,6 @@ static void fdls_send_delete_tport_msg(struct fnic_tport_s *tport)
23332325 struct fnic * fnic = iport -> fnic ;
23342326 struct fnic_tport_event_s * tport_del_evt ;
23352327
2336- if (!IS_FNIC_FCP_INITIATOR (fnic ))
2337- return ;
2338-
23392328 tport_del_evt = kzalloc (sizeof (struct fnic_tport_event_s ), GFP_ATOMIC );
23402329 if (!tport_del_evt ) {
23412330 FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
@@ -3485,11 +3474,9 @@ fdls_process_flogi_rsp(struct fnic_iport_s *iport,
34853474 "From fabric: R_A_TOV: %d E_D_TOV: %d" ,
34863475 iport -> r_a_tov , iport -> e_d_tov );
34873476
3488- if (IS_FNIC_FCP_INITIATOR (fnic )) {
3489- fc_host_fabric_name (iport -> fnic -> host ) =
3490- get_unaligned_be64 (& FNIC_LOGI_NODE_NAME (flogi_rsp -> els ));
3491- fc_host_port_id (iport -> fnic -> host ) = iport -> fcid ;
3492- }
3477+ fc_host_fabric_name (iport -> fnic -> host ) =
3478+ get_unaligned_be64 (& FNIC_LOGI_NODE_NAME (flogi_rsp -> els ));
3479+ fc_host_port_id (iport -> fnic -> host ) = iport -> fcid ;
34933480
34943481 fnic_fdls_learn_fcoe_macs (iport , rx_frame , fcid );
34953482
@@ -4526,11 +4513,9 @@ void fnic_fdls_disc_start(struct fnic_iport_s *iport)
45264513{
45274514 struct fnic * fnic = iport -> fnic ;
45284515
4529- if (IS_FNIC_FCP_INITIATOR (fnic )) {
4530- fc_host_fabric_name (iport -> fnic -> host ) = 0 ;
4531- fc_host_post_event (iport -> fnic -> host , fc_get_event_number (),
4532- FCH_EVT_LIPRESET , 0 );
4533- }
4516+ fc_host_fabric_name (iport -> fnic -> host ) = 0 ;
4517+ fc_host_post_event (iport -> fnic -> host , fc_get_event_number (),
4518+ FCH_EVT_LIPRESET , 0 );
45344519
45354520 if (!iport -> usefip ) {
45364521 if (iport -> flags & FNIC_FIRST_LINK_UP ) {
@@ -4993,15 +4978,13 @@ void fnic_fdls_link_down(struct fnic_iport_s *iport)
49934978 fdls_set_state ((& iport -> fabric ), FDLS_STATE_LINKDOWN );
49944979 iport -> fabric .flags = 0 ;
49954980
4996- if (IS_FNIC_FCP_INITIATOR (fnic )) {
4997- spin_unlock_irqrestore (& fnic -> fnic_lock , fnic -> lock_flags );
4998- fnic_scsi_fcpio_reset (iport -> fnic );
4999- spin_lock_irqsave (& fnic -> fnic_lock , fnic -> lock_flags );
5000- list_for_each_entry_safe (tport , next , & iport -> tport_list , links ) {
5001- FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
5002- "removing rport: 0x%x" , tport -> fcid );
5003- fdls_delete_tport (iport , tport );
5004- }
4981+ spin_unlock_irqrestore (& fnic -> fnic_lock , fnic -> lock_flags );
4982+ fnic_scsi_fcpio_reset (iport -> fnic );
4983+ spin_lock_irqsave (& fnic -> fnic_lock , fnic -> lock_flags );
4984+ list_for_each_entry_safe (tport , next , & iport -> tport_list , links ) {
4985+ FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
4986+ "removing rport: 0x%x" , tport -> fcid );
4987+ fdls_delete_tport (iport , tport );
50054988 }
50064989
50074990 if ((fnic_fdmi_support == 1 ) && (iport -> fabric .fdmi_pending > 0 )) {
0 commit comments