Lines Matching refs:tgt

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