diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2011-06-13 18:53:04 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 16:52:21 -0400 |
commit | be540a991e2097c313d7304e0daaf89d68011bb9 (patch) | |
tree | a44685889c9989546ffac1ee7ad1da7dd641c20c /drivers/scsi/bfa/bfa_fcbuild.c | |
parent | 8b070b4a022f86dd5098308e36426ce29b6b8960 (diff) |
[SCSI] bfa: FC credit recovery and misc bug fixes.
- Introduce FC credit recovery.
- Added module parameter to enable/disable credit recovery.
Bug Fixes:
- Removed check for ignoring plogi from initiator in switched fabric mode.
- The ABTS for PLOGI is going out few millisecs earlier due to FW
timer calibration (around 300 miilisecs earlier). So there is a
window if an accept comes during this time HBA would have initiated
an ABORT.
- Added 1 to FC_ELS_TOV for compensating for FW timer.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcbuild.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcbuild.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c index b7e253451654..08fba370cf4f 100644 --- a/drivers/scsi/bfa/bfa_fcbuild.c +++ b/drivers/scsi/bfa/bfa_fcbuild.c | |||
@@ -94,7 +94,6 @@ fcbuild_init(void) | |||
94 | */ | 94 | */ |
95 | plogi_tmpl.csp.verhi = FC_PH_VER_PH_3; | 95 | plogi_tmpl.csp.verhi = FC_PH_VER_PH_3; |
96 | plogi_tmpl.csp.verlo = FC_PH_VER_4_3; | 96 | plogi_tmpl.csp.verlo = FC_PH_VER_4_3; |
97 | plogi_tmpl.csp.bbcred = cpu_to_be16(0x0004); | ||
98 | plogi_tmpl.csp.ciro = 0x1; | 97 | plogi_tmpl.csp.ciro = 0x1; |
99 | plogi_tmpl.csp.cisc = 0x0; | 98 | plogi_tmpl.csp.cisc = 0x0; |
100 | plogi_tmpl.csp.altbbcred = 0x0; | 99 | plogi_tmpl.csp.altbbcred = 0x0; |
@@ -207,7 +206,7 @@ fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id) | |||
207 | static u16 | 206 | static u16 |
208 | fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, | 207 | fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, |
209 | __be16 ox_id, wwn_t port_name, wwn_t node_name, | 208 | __be16 ox_id, wwn_t port_name, wwn_t node_name, |
210 | u16 pdu_size, u8 els_code) | 209 | u16 pdu_size, u16 bb_cr, u8 els_code) |
211 | { | 210 | { |
212 | struct fc_logi_s *plogi = (struct fc_logi_s *) (pld); | 211 | struct fc_logi_s *plogi = (struct fc_logi_s *) (pld); |
213 | 212 | ||
@@ -220,6 +219,7 @@ fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, | |||
220 | fc_els_rsp_build(fchs, d_id, s_id, ox_id); | 219 | fc_els_rsp_build(fchs, d_id, s_id, ox_id); |
221 | 220 | ||
222 | plogi->csp.rxsz = plogi->class3.rxsz = cpu_to_be16(pdu_size); | 221 | plogi->csp.rxsz = plogi->class3.rxsz = cpu_to_be16(pdu_size); |
222 | plogi->csp.bbcred = cpu_to_be16(bb_cr); | ||
223 | 223 | ||
224 | memcpy(&plogi->port_name, &port_name, sizeof(wwn_t)); | 224 | memcpy(&plogi->port_name, &port_name, sizeof(wwn_t)); |
225 | memcpy(&plogi->node_name, &node_name, sizeof(wwn_t)); | 225 | memcpy(&plogi->node_name, &node_name, sizeof(wwn_t)); |
@@ -268,15 +268,17 @@ fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, | |||
268 | u16 | 268 | u16 |
269 | fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, | 269 | fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, |
270 | __be16 ox_id, wwn_t port_name, wwn_t node_name, | 270 | __be16 ox_id, wwn_t port_name, wwn_t node_name, |
271 | u16 pdu_size, u16 local_bb_credits) | 271 | u16 pdu_size, u16 local_bb_credits, u8 bb_scn) |
272 | { | 272 | { |
273 | u32 d_id = 0; | 273 | u32 d_id = 0; |
274 | u16 bbscn_rxsz = (bb_scn << 12) | pdu_size; | ||
274 | 275 | ||
275 | memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); | 276 | memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); |
276 | fc_els_rsp_build(fchs, d_id, s_id, ox_id); | 277 | fc_els_rsp_build(fchs, d_id, s_id, ox_id); |
277 | 278 | ||
278 | flogi->els_cmd.els_code = FC_ELS_ACC; | 279 | flogi->els_cmd.els_code = FC_ELS_ACC; |
279 | flogi->csp.rxsz = flogi->class3.rxsz = cpu_to_be16(pdu_size); | 280 | flogi->class3.rxsz = cpu_to_be16(pdu_size); |
281 | flogi->csp.rxsz = cpu_to_be16(bbscn_rxsz); /* bb_scn/rxsz */ | ||
280 | flogi->port_name = port_name; | 282 | flogi->port_name = port_name; |
281 | flogi->node_name = node_name; | 283 | flogi->node_name = node_name; |
282 | 284 | ||
@@ -306,19 +308,19 @@ fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, | |||
306 | u16 | 308 | u16 |
307 | fc_plogi_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, | 309 | fc_plogi_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, |
308 | u16 ox_id, wwn_t port_name, wwn_t node_name, | 310 | u16 ox_id, wwn_t port_name, wwn_t node_name, |
309 | u16 pdu_size) | 311 | u16 pdu_size, u16 bb_cr) |
310 | { | 312 | { |
311 | return fc_plogi_x_build(fchs, pld, d_id, s_id, ox_id, port_name, | 313 | return fc_plogi_x_build(fchs, pld, d_id, s_id, ox_id, port_name, |
312 | node_name, pdu_size, FC_ELS_PLOGI); | 314 | node_name, pdu_size, bb_cr, FC_ELS_PLOGI); |
313 | } | 315 | } |
314 | 316 | ||
315 | u16 | 317 | u16 |
316 | fc_plogi_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, | 318 | fc_plogi_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, |
317 | u16 ox_id, wwn_t port_name, wwn_t node_name, | 319 | u16 ox_id, wwn_t port_name, wwn_t node_name, |
318 | u16 pdu_size) | 320 | u16 pdu_size, u16 bb_cr) |
319 | { | 321 | { |
320 | return fc_plogi_x_build(fchs, pld, d_id, s_id, ox_id, port_name, | 322 | return fc_plogi_x_build(fchs, pld, d_id, s_id, ox_id, port_name, |
321 | node_name, pdu_size, FC_ELS_ACC); | 323 | node_name, pdu_size, bb_cr, FC_ELS_ACC); |
322 | } | 324 | } |
323 | 325 | ||
324 | enum fc_parse_status | 326 | enum fc_parse_status |