Lines Matching refs:tgt
45 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_cmd_timeout() local
51 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_cmd_timeout()
58 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_cmd_timeout()
87 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_cmd_timeout()
108 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_cmd_timeout()
125 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_cmd_timeout()
159 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_cmd_timeout()
394 struct bnx2fc_cmd *bnx2fc_elstm_alloc(struct bnx2fc_rport *tgt, int type) in bnx2fc_elstm_alloc() argument
396 struct fcoe_port *port = tgt->port; in bnx2fc_elstm_alloc()
407 max_sqes = tgt->max_sqes; in bnx2fc_elstm_alloc()
424 free_sqes = atomic_read(&tgt->free_sqes); in bnx2fc_elstm_alloc()
426 (tgt->num_active_ios.counter >= max_sqes) || in bnx2fc_elstm_alloc()
428 BNX2FC_TGT_DBG(tgt, "No free els_tm cmds available " in bnx2fc_elstm_alloc()
430 tgt->num_active_ios.counter, tgt->max_sqes); in bnx2fc_elstm_alloc()
443 atomic_inc(&tgt->num_active_ios); in bnx2fc_elstm_alloc()
444 atomic_dec(&tgt->free_sqes); in bnx2fc_elstm_alloc()
464 struct bnx2fc_cmd *bnx2fc_cmd_alloc(struct bnx2fc_rport *tgt) in bnx2fc_cmd_alloc() argument
466 struct fcoe_port *port = tgt->port; in bnx2fc_cmd_alloc()
483 free_sqes = atomic_read(&tgt->free_sqes); in bnx2fc_cmd_alloc()
485 (tgt->num_active_ios.counter >= max_sqes) || in bnx2fc_cmd_alloc()
497 atomic_inc(&tgt->num_active_ios); in bnx2fc_cmd_alloc()
498 atomic_dec(&tgt->free_sqes); in bnx2fc_cmd_alloc()
539 atomic_dec(&io_req->tgt->num_active_ios); in bnx2fc_cmd_release()
666 struct bnx2fc_rport *tgt; in bnx2fc_initiate_tmf() local
702 tgt = (struct bnx2fc_rport *)&rp[1]; in bnx2fc_initiate_tmf()
704 if (!(test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags))) { in bnx2fc_initiate_tmf()
710 io_req = bnx2fc_elstm_alloc(tgt, BNX2FC_TASK_MGMT_CMD); in bnx2fc_initiate_tmf()
723 io_req->tgt = tgt; in bnx2fc_initiate_tmf()
730 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_initiate_tmf()
732 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_initiate_tmf()
748 sid = tgt->sid; in bnx2fc_initiate_tmf()
756 BNX2FC_TGT_DBG(tgt, "Initiate TMF - xid = 0x%x\n", xid); in bnx2fc_initiate_tmf()
769 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_initiate_tmf()
770 bnx2fc_add_2_sq(tgt, xid); in bnx2fc_initiate_tmf()
774 list_add_tail(&io_req->link, &tgt->active_tm_queue); in bnx2fc_initiate_tmf()
780 bnx2fc_ring_doorbell(tgt); in bnx2fc_initiate_tmf()
781 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_initiate_tmf()
785 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_initiate_tmf()
797 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_initiate_tmf()
800 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_initiate_tmf()
806 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_initiate_tmf()
809 BNX2FC_TGT_DBG(tgt, "task mgmt command failed...\n"); in bnx2fc_initiate_tmf()
812 BNX2FC_TGT_DBG(tgt, "task mgmt command success...\n"); in bnx2fc_initiate_tmf()
822 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_initiate_abts() local
823 struct fc_rport *rport = tgt->rport; in bnx2fc_initiate_abts()
824 struct fc_rport_priv *rdata = tgt->rdata; in bnx2fc_initiate_abts()
845 if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) { in bnx2fc_initiate_abts()
863 abts_io_req = bnx2fc_elstm_alloc(tgt, BNX2FC_ABTS); in bnx2fc_initiate_abts()
873 abts_io_req->tgt = tgt; in bnx2fc_initiate_abts()
886 sid = tgt->sid; in bnx2fc_initiate_abts()
919 bnx2fc_add_2_sq(tgt, xid); in bnx2fc_initiate_abts()
922 bnx2fc_ring_doorbell(tgt); in bnx2fc_initiate_abts()
931 struct bnx2fc_rport *tgt = orig_io_req->tgt; in bnx2fc_initiate_seq_cleanup() local
956 seq_clnp_req = bnx2fc_elstm_alloc(tgt, BNX2FC_SEQ_CLEANUP); in bnx2fc_initiate_seq_cleanup()
966 seq_clnp_req->tgt = tgt; in bnx2fc_initiate_seq_cleanup()
988 bnx2fc_add_2_sq(tgt, xid); in bnx2fc_initiate_seq_cleanup()
991 bnx2fc_ring_doorbell(tgt); in bnx2fc_initiate_seq_cleanup()
998 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_initiate_cleanup() local
1014 cleanup_io_req = bnx2fc_elstm_alloc(tgt, BNX2FC_CLEANUP); in bnx2fc_initiate_cleanup()
1024 cleanup_io_req->tgt = tgt; in bnx2fc_initiate_cleanup()
1043 bnx2fc_add_2_sq(tgt, xid); in bnx2fc_initiate_cleanup()
1049 bnx2fc_ring_doorbell(tgt); in bnx2fc_initiate_cleanup()
1082 __must_hold(&tgt->tgt_lock) in bnx2fc_abts_cleanup()
1084 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_abts_cleanup() local
1091 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_abts_cleanup()
1110 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_abts_cleanup()
1129 struct bnx2fc_rport *tgt; in bnx2fc_eh_abort() local
1143 tgt = (struct bnx2fc_rport *)&rp[1]; in bnx2fc_eh_abort()
1145 BNX2FC_TGT_DBG(tgt, "Entered bnx2fc_eh_abort\n"); in bnx2fc_eh_abort()
1147 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_eh_abort()
1152 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_eh_abort()
1161 BUG_ON(tgt != io_req->tgt); in bnx2fc_eh_abort()
1169 if (tgt->flush_in_prog) { in bnx2fc_eh_abort()
1173 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_eh_abort()
1184 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_eh_abort()
1198 list_add_tail(&io_req->link, &tgt->io_retire_queue); in bnx2fc_eh_abort()
1235 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_eh_abort()
1237 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_eh_abort()
1241 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_eh_abort()
1250 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_eh_abort()
1280 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_eh_abort()
1293 struct bnx2fc_rport *tgt = orig_io_req->tgt; in bnx2fc_process_seq_cleanup_compl() local
1305 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_seq_cleanup_compl()
1307 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_seq_cleanup_compl()
1358 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_process_abts_compl() local
1444 list_add_tail(&io_req->link, &tgt->io_retire_queue); in bnx2fc_process_abts_compl()
1454 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_lun_reset_cmpl() local
1466 list_for_each_entry_safe(cmd, tmp, &tgt->active_cmd_queue, link) { in bnx2fc_lun_reset_cmpl()
1467 BNX2FC_TGT_DBG(tgt, "LUN RST cmpl: scan for pending IOs\n"); in bnx2fc_lun_reset_cmpl()
1491 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_tgt_reset_cmpl() local
1501 list_for_each_entry_safe(cmd, tmp, &tgt->active_cmd_queue, link) { in bnx2fc_tgt_reset_cmpl()
1502 BNX2FC_TGT_DBG(tgt, "TGT RST cmpl: scan for pending IOs\n"); in bnx2fc_tgt_reset_cmpl()
1845 struct bnx2fc_rport *tgt; in bnx2fc_queuecommand() local
1863 tgt = (struct bnx2fc_rport *)&rp[1]; in bnx2fc_queuecommand()
1865 if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) { in bnx2fc_queuecommand()
1873 if (tgt->retry_delay_timestamp) { in bnx2fc_queuecommand()
1874 if (time_after(jiffies, tgt->retry_delay_timestamp)) { in bnx2fc_queuecommand()
1875 tgt->retry_delay_timestamp = 0; in bnx2fc_queuecommand()
1883 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_queuecommand()
1885 io_req = bnx2fc_cmd_alloc(tgt); in bnx2fc_queuecommand()
1892 if (bnx2fc_post_io_req(tgt, io_req)) { in bnx2fc_queuecommand()
1899 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_queuecommand()
1909 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_process_scsi_cmd_compl() local
1955 list_add_tail(&io_req->link, &tgt->io_retire_queue); in bnx2fc_process_scsi_cmd_compl()
2005 tgt->retry_delay_timestamp = jiffies + in bnx2fc_process_scsi_cmd_compl()
2023 int bnx2fc_post_io_req(struct bnx2fc_rport *tgt, in bnx2fc_post_io_req() argument
2029 struct fcoe_port *port = tgt->port; in bnx2fc_post_io_req()
2041 io_req->tgt = tgt; in bnx2fc_post_io_req()
2075 if (tgt->flush_in_prog) { in bnx2fc_post_io_req()
2081 if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) { in bnx2fc_post_io_req()
2088 if (tgt->io_timeout) in bnx2fc_post_io_req()
2091 bnx2fc_add_2_sq(tgt, xid); in bnx2fc_post_io_req()
2097 list_add_tail(&io_req->link, &tgt->active_cmd_queue); in bnx2fc_post_io_req()
2100 bnx2fc_ring_doorbell(tgt); in bnx2fc_post_io_req()