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) ||
498 atomic_inc(&tgt->num_active_ios);
499 atomic_dec(&tgt->free_sqes);
541 atomic_dec(&io_req->tgt->num_active_ios);
668 struct bnx2fc_rport *tgt;
703 /* rport and tgt are allocated together, so tgt should be non-NULL */
704 tgt = (struct bnx2fc_rport *)&rp[1];
706 if (!(test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags))) {
707 printk(KERN_ERR PFX "device_reset: tgt not offloaded\n");
712 io_req = bnx2fc_elstm_alloc(tgt, BNX2FC_TASK_MGMT_CMD);
725 io_req->tgt = tgt;
732 spin_lock_bh(&tgt->tgt_lock);
734 spin_unlock_bh(&tgt->tgt_lock);
750 sid = tgt->sid;
758 BNX2FC_TGT_DBG(tgt, "Initiate TMF - xid = 0x%x\n", xid);
771 spin_lock_bh(&tgt->tgt_lock);
772 bnx2fc_add_2_sq(tgt, xid);
776 list_add_tail(&io_req->link, &tgt->active_tm_queue);
782 bnx2fc_ring_doorbell(tgt);
783 spin_unlock_bh(&tgt->tgt_lock);
787 spin_lock_bh(&tgt->tgt_lock);
799 spin_unlock_bh(&tgt->tgt_lock);
802 spin_lock_bh(&tgt->tgt_lock);
808 spin_unlock_bh(&tgt->tgt_lock);
811 BNX2FC_TGT_DBG(tgt, "task mgmt command failed...\n");
814 BNX2FC_TGT_DBG(tgt, "task mgmt command success...\n");
824 struct bnx2fc_rport *tgt = io_req->tgt;
825 struct fc_rport *rport = tgt->rport;
826 struct fc_rport_priv *rdata = tgt->rdata;
847 if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) {
848 printk(KERN_ERR PFX "initiate_abts: tgt not offloaded\n");
865 abts_io_req = bnx2fc_elstm_alloc(tgt, BNX2FC_ABTS);
875 abts_io_req->tgt = tgt;
888 sid = tgt->sid;
921 bnx2fc_add_2_sq(tgt, xid);
924 bnx2fc_ring_doorbell(tgt);
933 struct bnx2fc_rport *tgt = orig_io_req->tgt;
958 seq_clnp_req = bnx2fc_elstm_alloc(tgt, BNX2FC_SEQ_CLEANUP);
968 seq_clnp_req->tgt = tgt;
990 bnx2fc_add_2_sq(tgt, xid);
993 bnx2fc_ring_doorbell(tgt);
1000 struct bnx2fc_rport *tgt = io_req->tgt;
1016 cleanup_io_req = bnx2fc_elstm_alloc(tgt, BNX2FC_CLEANUP);
1026 cleanup_io_req->tgt = tgt;
1045 bnx2fc_add_2_sq(tgt, xid);
1051 bnx2fc_ring_doorbell(tgt);
1084 __must_hold(&tgt->tgt_lock)
1086 struct bnx2fc_rport *tgt = io_req->tgt;
1093 spin_unlock_bh(&tgt->tgt_lock);
1112 spin_lock_bh(&tgt->tgt_lock);
1131 struct bnx2fc_rport *tgt;
1145 tgt = (struct bnx2fc_rport *)&rp[1];
1147 BNX2FC_TGT_DBG(tgt, "Entered bnx2fc_eh_abort\n");
1149 spin_lock_bh(&tgt->tgt_lock);
1154 spin_unlock_bh(&tgt->tgt_lock);
1163 BUG_ON(tgt != io_req->tgt);
1171 if (tgt->flush_in_prog) {
1175 spin_unlock_bh(&tgt->tgt_lock);
1186 spin_unlock_bh(&tgt->tgt_lock);
1200 list_add_tail(&io_req->link, &tgt->io_retire_queue);
1237 spin_unlock_bh(&tgt->tgt_lock);
1239 spin_lock_bh(&tgt->tgt_lock);
1243 spin_unlock_bh(&tgt->tgt_lock);
1252 spin_lock_bh(&tgt->tgt_lock);
1282 spin_unlock_bh(&tgt->tgt_lock);
1295 struct bnx2fc_rport *tgt = orig_io_req->tgt;
1307 spin_unlock_bh(&tgt->tgt_lock);
1309 spin_lock_bh(&tgt->tgt_lock);
1360 struct bnx2fc_rport *tgt = io_req->tgt;
1446 list_add_tail(&io_req->link, &tgt->io_retire_queue);
1456 struct bnx2fc_rport *tgt = io_req->tgt;
1468 list_for_each_entry_safe(cmd, tmp, &tgt->active_cmd_queue, link) {
1469 BNX2FC_TGT_DBG(tgt, "LUN RST cmpl: scan for pending IOs\n");
1493 struct bnx2fc_rport *tgt = io_req->tgt;
1503 list_for_each_entry_safe(cmd, tmp, &tgt->active_cmd_queue, link) {
1504 BNX2FC_TGT_DBG(tgt, "TGT RST cmpl: scan for pending IOs\n");
1601 /* check if the io_req exists in tgt's tmf_q */
1848 struct bnx2fc_rport *tgt;
1865 /* rport and tgt are allocated together, so tgt should be non-NULL */
1866 tgt = (struct bnx2fc_rport *)&rp[1];
1868 if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) {
1876 if (tgt->retry_delay_timestamp) {
1877 if (time_after(jiffies, tgt->retry_delay_timestamp)) {
1878 tgt->retry_delay_timestamp = 0;
1886 spin_lock_bh(&tgt->tgt_lock);
1888 io_req = bnx2fc_cmd_alloc(tgt);
1895 if (bnx2fc_post_io_req(tgt, io_req)) {
1902 spin_unlock_bh(&tgt->tgt_lock);
1912 struct bnx2fc_rport *tgt = io_req->tgt;
1916 /* scsi_cmd_cmpl is called with tgt lock held */
1958 list_add_tail(&io_req->link, &tgt->io_retire_queue);
2006 * for the rport/tgt
2008 tgt->retry_delay_timestamp = jiffies +
2026 int bnx2fc_post_io_req(struct bnx2fc_rport *tgt,
2032 struct fcoe_port *port = tgt->port;
2045 io_req->tgt = tgt;
2081 if (tgt->flush_in_prog) {
2087 if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) {
2094 if (tgt->io_timeout)
2097 bnx2fc_add_2_sq(tgt, xid);
2103 list_add_tail(&io_req->link, &tgt->active_cmd_queue);
2106 bnx2fc_ring_doorbell(tgt);