[SCSI] bnx2fc: Enable REC & CONF support for the session
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>
Tue, 26 Jul 2011 21:51:40 +0000 (14:51 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 27 Jul 2011 11:38:12 +0000 (15:38 +0400)
Based on PRLI response, identify if the target is FCP-2 (seq level error
recovery) capable, and appropriately set the corresponding CONF, REC flags when
offloading the session.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/bnx2fc/bnx2fc.h
drivers/scsi/bnx2fc/bnx2fc_hwi.c
drivers/scsi/bnx2fc/bnx2fc_io.c
drivers/scsi/bnx2fc/bnx2fc_tgt.c

index 6012317c1f2fefcbe7f0234d71d7255ff1e51ca6..d38dcc7f104715d4060e50be80fb834ddda76ff3 100644 (file)
@@ -244,9 +244,11 @@ struct bnx2fc_rport {
        struct fc_rport_priv *rdata;
        void __iomem *ctx_base;
 #define DPM_TRIGER_TYPE                0x40
+       u32 io_timeout;
        u32 fcoe_conn_id;
        u32 context_id;
        u32 sid;
+       int dev_type;
 
        unsigned long flags;
 #define BNX2FC_FLAG_SESSION_READY      0x1
index ee1674b794b1b30beeedff93c8ea5da106c73427..fa263b5902e1563be70351f4250bef5d309d2713 100644 (file)
@@ -279,6 +279,18 @@ int bnx2fc_send_session_ofld_req(struct fcoe_port *port,
        ofld_req3.flags |= (((rdata->sp_features & FC_SP_FT_SEQC) ? 1 : 0) <<
                             FCOE_KWQE_CONN_OFFLOAD3_B_CONT_INCR_SEQ_CNT_SHIFT);
 
+       /*
+        * Info from PRLI response, this info is used for sequence level error
+        * recovery support
+        */
+       if (tgt->dev_type == TYPE_TAPE) {
+               ofld_req3.flags |= 1 <<
+                                   FCOE_KWQE_CONN_OFFLOAD3_B_CONF_REQ_SHIFT;
+               ofld_req3.flags |= (((rdata->flags & FC_RP_FLAGS_REC_SUPPORTED)
+                                   ? 1 : 0) <<
+                                   FCOE_KWQE_CONN_OFFLOAD3_B_REC_VALID_SHIFT);
+       }
+
        /* vlan flag */
        ofld_req3.flags |= (interface->vlan_enabled <<
                            FCOE_KWQE_CONN_OFFLOAD3_B_VLAN_FLAG_SHIFT);
index e711ea3dd9004ccfbce00e96f5d7e7640d5d69de..72940b8625bd0435cd1a0cff80b80a9aae2f845e 100644 (file)
@@ -1862,7 +1862,8 @@ static int bnx2fc_post_io_req(struct bnx2fc_rport *tgt,
        }
 
        /* Time IO req */
-       bnx2fc_cmd_timer_set(io_req, BNX2FC_IO_TIMEOUT);
+       if (tgt->io_timeout)
+               bnx2fc_cmd_timer_set(io_req, BNX2FC_IO_TIMEOUT);
        /* Obtain free SQ entry */
        bnx2fc_add_2_sq(tgt, xid);
 
index 263c2678ff6295432cfb7aac0541ee3d0039ec93..7eff269d4c41edf72396ad90aa6d2076b35835bc 100644 (file)
@@ -353,6 +353,14 @@ static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt,
        tgt->rq_cons_idx = 0;
        atomic_set(&tgt->num_active_ios, 0);
 
+       if (rdata->flags & FC_RP_FLAGS_RETRY) {
+               tgt->dev_type = TYPE_TAPE;
+               tgt->io_timeout = 0; /* use default ULP timeout */
+       } else {
+               tgt->dev_type = TYPE_DISK;
+               tgt->io_timeout = BNX2FC_IO_TIMEOUT;
+       }
+
        /* initialize sq doorbell */
        sq_db->header.header = B577XX_DOORBELL_HDR_DB_TYPE;
        sq_db->header.header |= B577XX_FCOE_CONNECTION_TYPE <<