diff options
Diffstat (limited to 'drivers/scsi/bfa/fcpim.c')
-rw-r--r-- | drivers/scsi/bfa/fcpim.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/scsi/bfa/fcpim.c b/drivers/scsi/bfa/fcpim.c index 8ae4a2cfa85b..6b8976ad22fa 100644 --- a/drivers/scsi/bfa/fcpim.c +++ b/drivers/scsi/bfa/fcpim.c | |||
@@ -110,6 +110,7 @@ bfa_fcs_itnim_sm_offline(struct bfa_fcs_itnim_s *itnim, | |||
110 | switch (event) { | 110 | switch (event) { |
111 | case BFA_FCS_ITNIM_SM_ONLINE: | 111 | case BFA_FCS_ITNIM_SM_ONLINE: |
112 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_prli_send); | 112 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_prli_send); |
113 | itnim->prli_retries = 0; | ||
113 | bfa_fcs_itnim_send_prli(itnim, NULL); | 114 | bfa_fcs_itnim_send_prli(itnim, NULL); |
114 | break; | 115 | break; |
115 | 116 | ||
@@ -174,8 +175,12 @@ bfa_fcs_itnim_sm_prli(struct bfa_fcs_itnim_s *itnim, | |||
174 | 175 | ||
175 | switch (event) { | 176 | switch (event) { |
176 | case BFA_FCS_ITNIM_SM_RSP_OK: | 177 | case BFA_FCS_ITNIM_SM_RSP_OK: |
177 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_hcb_online); | 178 | if (itnim->rport->scsi_function == BFA_RPORT_INITIATOR) { |
178 | bfa_itnim_online(itnim->bfa_itnim, itnim->seq_rec); | 179 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_initiator); |
180 | } else { | ||
181 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_hcb_online); | ||
182 | bfa_itnim_online(itnim->bfa_itnim, itnim->seq_rec); | ||
183 | } | ||
179 | break; | 184 | break; |
180 | 185 | ||
181 | case BFA_FCS_ITNIM_SM_RSP_ERROR: | 186 | case BFA_FCS_ITNIM_SM_RSP_ERROR: |
@@ -193,9 +198,7 @@ bfa_fcs_itnim_sm_prli(struct bfa_fcs_itnim_s *itnim, | |||
193 | 198 | ||
194 | case BFA_FCS_ITNIM_SM_INITIATOR: | 199 | case BFA_FCS_ITNIM_SM_INITIATOR: |
195 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_initiator); | 200 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_initiator); |
196 | /* | 201 | bfa_fcxp_discard(itnim->fcxp); |
197 | * dont discard fcxp. accept will reach same state | ||
198 | */ | ||
199 | break; | 202 | break; |
200 | 203 | ||
201 | case BFA_FCS_ITNIM_SM_DELETE: | 204 | case BFA_FCS_ITNIM_SM_DELETE: |
@@ -218,8 +221,16 @@ bfa_fcs_itnim_sm_prli_retry(struct bfa_fcs_itnim_s *itnim, | |||
218 | 221 | ||
219 | switch (event) { | 222 | switch (event) { |
220 | case BFA_FCS_ITNIM_SM_TIMEOUT: | 223 | case BFA_FCS_ITNIM_SM_TIMEOUT: |
221 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_prli_send); | 224 | if (itnim->prli_retries < BFA_FCS_RPORT_MAX_RETRIES) { |
222 | bfa_fcs_itnim_send_prli(itnim, NULL); | 225 | itnim->prli_retries++; |
226 | bfa_trc(itnim->fcs, itnim->prli_retries); | ||
227 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_prli_send); | ||
228 | bfa_fcs_itnim_send_prli(itnim, NULL); | ||
229 | } else { | ||
230 | /* invoke target offline */ | ||
231 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); | ||
232 | bfa_fcs_rport_logo_imp(itnim->rport); | ||
233 | } | ||
223 | break; | 234 | break; |
224 | 235 | ||
225 | case BFA_FCS_ITNIM_SM_OFFLINE: | 236 | case BFA_FCS_ITNIM_SM_OFFLINE: |
@@ -422,7 +433,7 @@ bfa_fcs_itnim_send_prli(void *itnim_cbarg, struct bfa_fcxp_s *fcxp_alloced) | |||
422 | bfa_fcxp_send(fcxp, rport->bfa_rport, port->fabric->vf_id, port->lp_tag, | 433 | bfa_fcxp_send(fcxp, rport->bfa_rport, port->fabric->vf_id, port->lp_tag, |
423 | BFA_FALSE, FC_CLASS_3, len, &fchs, | 434 | BFA_FALSE, FC_CLASS_3, len, &fchs, |
424 | bfa_fcs_itnim_prli_response, (void *)itnim, FC_MAX_PDUSZ, | 435 | bfa_fcs_itnim_prli_response, (void *)itnim, FC_MAX_PDUSZ, |
425 | FC_RA_TOV); | 436 | FC_ELS_TOV); |
426 | 437 | ||
427 | itnim->stats.prli_sent++; | 438 | itnim->stats.prli_sent++; |
428 | bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_FRMSENT); | 439 | bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_FRMSENT); |
@@ -467,7 +478,7 @@ bfa_fcs_itnim_prli_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, | |||
467 | BFA_RPORT_INITIATOR; | 478 | BFA_RPORT_INITIATOR; |
468 | itnim->stats.prli_rsp_acc++; | 479 | itnim->stats.prli_rsp_acc++; |
469 | bfa_sm_send_event(itnim, | 480 | bfa_sm_send_event(itnim, |
470 | BFA_FCS_ITNIM_SM_INITIATOR); | 481 | BFA_FCS_ITNIM_SM_RSP_OK); |
471 | return; | 482 | return; |
472 | } | 483 | } |
473 | 484 | ||
@@ -738,6 +749,7 @@ bfa_fcs_itnim_attr_get(struct bfa_fcs_port_s *port, wwn_t rpwwn, | |||
738 | attr->rec_support = itnim->rec_support; | 749 | attr->rec_support = itnim->rec_support; |
739 | attr->conf_comp = itnim->conf_comp; | 750 | attr->conf_comp = itnim->conf_comp; |
740 | attr->task_retry_id = itnim->task_retry_id; | 751 | attr->task_retry_id = itnim->task_retry_id; |
752 | bfa_os_memset(&attr->io_latency, 0, sizeof(struct bfa_itnim_latency_s)); | ||
741 | 753 | ||
742 | return BFA_STATUS_OK; | 754 | return BFA_STATUS_OK; |
743 | } | 755 | } |
@@ -793,7 +805,7 @@ bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim, struct fchs_s *fchs, | |||
793 | 805 | ||
794 | switch (els_cmd->els_code) { | 806 | switch (els_cmd->els_code) { |
795 | case FC_ELS_PRLO: | 807 | case FC_ELS_PRLO: |
796 | /* bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_PRLO); */ | 808 | bfa_fcs_rport_prlo(itnim->rport, fchs->ox_id); |
797 | break; | 809 | break; |
798 | 810 | ||
799 | default: | 811 | default: |