Skip to content

Commit

Permalink
[SCSI] bnx2fc: Enable REC & CONF support for the session
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bhanu Prakash Gollapudi authored and James Bottomley committed Jul 27, 2011
1 parent aea71a0 commit b252f4c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions drivers/scsi/bnx2fc/bnx2fc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions drivers/scsi/bnx2fc/bnx2fc_hwi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion drivers/scsi/bnx2fc/bnx2fc_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 8 additions & 0 deletions drivers/scsi/bnx2fc/bnx2fc_tgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<
Expand Down

0 comments on commit b252f4c

Please sign in to comment.