Commit 74446954 authored by Bhanu Prakash Gollapudi's avatar Bhanu Prakash Gollapudi Committed by James Bottomley

[SCSI] bnx2fc: REC/SRR link service request and response handling

Signed-off-by: default avatarBhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 6c5a7ce4
...@@ -141,6 +141,9 @@ ...@@ -141,6 +141,9 @@
#define BNX2FC_RNID_HBA 0x7 #define BNX2FC_RNID_HBA 0x7
#define SRR_RETRY_COUNT 5
#define REC_RETRY_COUNT 1
/* bnx2fc driver uses only one instance of fcoe_percpu_s */ /* bnx2fc driver uses only one instance of fcoe_percpu_s */
extern struct fcoe_percpu_s bnx2fc_global; extern struct fcoe_percpu_s bnx2fc_global;
...@@ -386,6 +389,7 @@ struct bnx2fc_cmd { ...@@ -386,6 +389,7 @@ struct bnx2fc_cmd {
struct completion tm_done; struct completion tm_done;
int wait_for_comp; int wait_for_comp;
u16 xid; u16 xid;
struct fcoe_err_report_entry err_entry;
struct fcoe_task_ctx_entry *task; struct fcoe_task_ctx_entry *task;
struct io_bdt *bd_tbl; struct io_bdt *bd_tbl;
struct fcp_rsp *rsp; struct fcp_rsp *rsp;
...@@ -402,6 +406,12 @@ struct bnx2fc_cmd { ...@@ -402,6 +406,12 @@ struct bnx2fc_cmd {
#define BNX2FC_FLAG_IO_COMPL 0x9 #define BNX2FC_FLAG_IO_COMPL 0x9
#define BNX2FC_FLAG_ELS_DONE 0xa #define BNX2FC_FLAG_ELS_DONE 0xa
#define BNX2FC_FLAG_ELS_TIMEOUT 0xb #define BNX2FC_FLAG_ELS_TIMEOUT 0xb
#define BNX2FC_FLAG_CMD_LOST 0xc
#define BNX2FC_FLAG_SRR_SENT 0xd
u8 rec_retry;
u8 srr_retry;
u32 srr_offset;
u8 srr_rctl;
u32 fcp_resid; u32 fcp_resid;
u32 fcp_rsp_len; u32 fcp_rsp_len;
u32 fcp_sns_len; u32 fcp_sns_len;
...@@ -432,6 +442,7 @@ struct bnx2fc_unsol_els { ...@@ -432,6 +442,7 @@ struct bnx2fc_unsol_els {
struct bnx2fc_cmd *bnx2fc_cmd_alloc(struct bnx2fc_rport *tgt);
struct bnx2fc_cmd *bnx2fc_elstm_alloc(struct bnx2fc_rport *tgt, int type); struct bnx2fc_cmd *bnx2fc_elstm_alloc(struct bnx2fc_rport *tgt, int type);
void bnx2fc_cmd_release(struct kref *ref); void bnx2fc_cmd_release(struct kref *ref);
int bnx2fc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd); int bnx2fc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd);
...@@ -522,6 +533,7 @@ void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt, ...@@ -522,6 +533,7 @@ void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt,
unsigned char *buf, unsigned char *buf,
u32 frame_len, u16 l2_oxid); u32 frame_len, u16 l2_oxid);
int bnx2fc_send_stat_req(struct bnx2fc_hba *hba); int bnx2fc_send_stat_req(struct bnx2fc_hba *hba);
int bnx2fc_post_io_req(struct bnx2fc_rport *tgt, struct bnx2fc_cmd *io_req);
int bnx2fc_send_rec(struct bnx2fc_cmd *orig_io_req); int bnx2fc_send_rec(struct bnx2fc_cmd *orig_io_req);
int bnx2fc_send_srr(struct bnx2fc_cmd *orig_io_req, u32 offset, u8 r_ctl); int bnx2fc_send_srr(struct bnx2fc_cmd *orig_io_req, u32 offset, u8 r_ctl);
void bnx2fc_process_seq_cleanup_compl(struct bnx2fc_cmd *seq_clnup_req, void bnx2fc_process_seq_cleanup_compl(struct bnx2fc_cmd *seq_clnup_req,
......
This diff is collapsed.
...@@ -18,8 +18,6 @@ static int bnx2fc_split_bd(struct bnx2fc_cmd *io_req, u64 addr, int sg_len, ...@@ -18,8 +18,6 @@ static int bnx2fc_split_bd(struct bnx2fc_cmd *io_req, u64 addr, int sg_len,
int bd_index); int bd_index);
static int bnx2fc_map_sg(struct bnx2fc_cmd *io_req); static int bnx2fc_map_sg(struct bnx2fc_cmd *io_req);
static void bnx2fc_build_bd_list_from_sg(struct bnx2fc_cmd *io_req); static void bnx2fc_build_bd_list_from_sg(struct bnx2fc_cmd *io_req);
static int bnx2fc_post_io_req(struct bnx2fc_rport *tgt,
struct bnx2fc_cmd *io_req);
static void bnx2fc_unmap_sg_list(struct bnx2fc_cmd *io_req); static void bnx2fc_unmap_sg_list(struct bnx2fc_cmd *io_req);
static void bnx2fc_free_mp_resc(struct bnx2fc_cmd *io_req); static void bnx2fc_free_mp_resc(struct bnx2fc_cmd *io_req);
static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req, static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
...@@ -218,6 +216,11 @@ static void bnx2fc_scsi_done(struct bnx2fc_cmd *io_req, int err_code) ...@@ -218,6 +216,11 @@ static void bnx2fc_scsi_done(struct bnx2fc_cmd *io_req, int err_code)
return; return;
BNX2FC_IO_DBG(io_req, "scsi_done. err_code = 0x%x\n", err_code); BNX2FC_IO_DBG(io_req, "scsi_done. err_code = 0x%x\n", err_code);
if (test_bit(BNX2FC_FLAG_CMD_LOST, &io_req->req_flags)) {
/* Do not call scsi done for this IO */
return;
}
bnx2fc_unmap_sg_list(io_req); bnx2fc_unmap_sg_list(io_req);
io_req->sc_cmd = NULL; io_req->sc_cmd = NULL;
if (!sc_cmd) { if (!sc_cmd) {
...@@ -1902,7 +1905,7 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req, ...@@ -1902,7 +1905,7 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req,
kref_put(&io_req->refcount, bnx2fc_cmd_release); kref_put(&io_req->refcount, bnx2fc_cmd_release);
} }
static int bnx2fc_post_io_req(struct bnx2fc_rport *tgt, int bnx2fc_post_io_req(struct bnx2fc_rport *tgt,
struct bnx2fc_cmd *io_req) struct bnx2fc_cmd *io_req)
{ {
struct fcoe_task_ctx_entry *task; struct fcoe_task_ctx_entry *task;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment