diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2012-09-21 20:26:18 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-10-07 06:18:29 -0400 |
commit | 04ea65756251577991189ef659dd9694b97a5f81 (patch) | |
tree | 78312989713bc8a8884ce4c565731d39dde181dd /drivers/scsi | |
parent | e353546e447feb838db2d1b23bac23cb90755993 (diff) |
[SCSI] bfa: Fabric Assigned Address implementation fix
- Made changes such that once the PWWN is acquired from the fabric through FAA,
and if the FAPWWN configuration is modified on the switch side, driver should
show relevant information to the user.
- Added logic to cache the reason code when the given port is disabled implicitl
due to FAA error condition.
- If the port is disabled, while sending SCN to upper layer, update the
reason code appropriately. With this, BFA FC port state machine will enter
into faa_err_config state. This state will be shown to the user.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bfa/bfa_defs_svc.h | 3 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.c | 88 |
2 files changed, 88 insertions, 3 deletions
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h index 4533b28a6799..76ea10d37ad7 100644 --- a/drivers/scsi/bfa/bfa_defs_svc.h +++ b/drivers/scsi/bfa/bfa_defs_svc.h | |||
@@ -721,7 +721,7 @@ enum bfa_port_states { | |||
721 | BFA_PORT_ST_FWMISMATCH = 12, | 721 | BFA_PORT_ST_FWMISMATCH = 12, |
722 | BFA_PORT_ST_PREBOOT_DISABLED = 13, | 722 | BFA_PORT_ST_PREBOOT_DISABLED = 13, |
723 | BFA_PORT_ST_TOGGLING_QWAIT = 14, | 723 | BFA_PORT_ST_TOGGLING_QWAIT = 14, |
724 | BFA_PORT_ST_ACQ_ADDR = 15, | 724 | BFA_PORT_ST_FAA_MISCONFIG = 15, |
725 | BFA_PORT_ST_DPORT = 16, | 725 | BFA_PORT_ST_DPORT = 16, |
726 | BFA_PORT_ST_MAX_STATE, | 726 | BFA_PORT_ST_MAX_STATE, |
727 | }; | 727 | }; |
@@ -792,6 +792,7 @@ enum bfa_port_linkstate_rsn { | |||
792 | BFA_PORT_LINKSTATE_RSN_LOCAL_FAULT = 9, | 792 | BFA_PORT_LINKSTATE_RSN_LOCAL_FAULT = 9, |
793 | BFA_PORT_LINKSTATE_RSN_REMOTE_FAULT = 10, | 793 | BFA_PORT_LINKSTATE_RSN_REMOTE_FAULT = 10, |
794 | BFA_PORT_LINKSTATE_RSN_TIMEOUT = 11, | 794 | BFA_PORT_LINKSTATE_RSN_TIMEOUT = 11, |
795 | BFA_PORT_LINKSTATE_RSN_FAA_MISCONFIG = 12, | ||
795 | 796 | ||
796 | 797 | ||
797 | 798 | ||
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c index 549bd45a7dbe..309ab2ad3ce9 100644 --- a/drivers/scsi/bfa/bfa_svc.c +++ b/drivers/scsi/bfa/bfa_svc.c | |||
@@ -69,6 +69,7 @@ enum bfa_fcport_sm_event { | |||
69 | BFA_FCPORT_SM_HWFAIL = 9, /* IOC h/w failure */ | 69 | BFA_FCPORT_SM_HWFAIL = 9, /* IOC h/w failure */ |
70 | BFA_FCPORT_SM_DPORTENABLE = 10, /* enable dport */ | 70 | BFA_FCPORT_SM_DPORTENABLE = 10, /* enable dport */ |
71 | BFA_FCPORT_SM_DPORTDISABLE = 11,/* disable dport */ | 71 | BFA_FCPORT_SM_DPORTDISABLE = 11,/* disable dport */ |
72 | BFA_FCPORT_SM_FAA_MISCONFIG = 12, /* FAA misconfiguratin */ | ||
72 | }; | 73 | }; |
73 | 74 | ||
74 | /* | 75 | /* |
@@ -201,6 +202,8 @@ static void bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport, | |||
201 | enum bfa_fcport_sm_event event); | 202 | enum bfa_fcport_sm_event event); |
202 | static void bfa_fcport_sm_dport(struct bfa_fcport_s *fcport, | 203 | static void bfa_fcport_sm_dport(struct bfa_fcport_s *fcport, |
203 | enum bfa_fcport_sm_event event); | 204 | enum bfa_fcport_sm_event event); |
205 | static void bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport, | ||
206 | enum bfa_fcport_sm_event event); | ||
204 | 207 | ||
205 | static void bfa_fcport_ln_sm_dn(struct bfa_fcport_ln_s *ln, | 208 | static void bfa_fcport_ln_sm_dn(struct bfa_fcport_ln_s *ln, |
206 | enum bfa_fcport_ln_sm_event event); | 209 | enum bfa_fcport_ln_sm_event event); |
@@ -231,6 +234,7 @@ static struct bfa_sm_table_s hal_port_sm_table[] = { | |||
231 | {BFA_SM(bfa_fcport_sm_iocdown), BFA_PORT_ST_IOCDOWN}, | 234 | {BFA_SM(bfa_fcport_sm_iocdown), BFA_PORT_ST_IOCDOWN}, |
232 | {BFA_SM(bfa_fcport_sm_iocfail), BFA_PORT_ST_IOCDOWN}, | 235 | {BFA_SM(bfa_fcport_sm_iocfail), BFA_PORT_ST_IOCDOWN}, |
233 | {BFA_SM(bfa_fcport_sm_dport), BFA_PORT_ST_DPORT}, | 236 | {BFA_SM(bfa_fcport_sm_dport), BFA_PORT_ST_DPORT}, |
237 | {BFA_SM(bfa_fcport_sm_faa_misconfig), BFA_PORT_ST_FAA_MISCONFIG}, | ||
234 | }; | 238 | }; |
235 | 239 | ||
236 | 240 | ||
@@ -2180,6 +2184,12 @@ bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport, | |||
2180 | bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); | 2184 | bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); |
2181 | break; | 2185 | break; |
2182 | 2186 | ||
2187 | case BFA_FCPORT_SM_FAA_MISCONFIG: | ||
2188 | bfa_fcport_reset_linkinfo(fcport); | ||
2189 | bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); | ||
2190 | bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); | ||
2191 | break; | ||
2192 | |||
2183 | default: | 2193 | default: |
2184 | bfa_sm_fault(fcport->bfa, event); | 2194 | bfa_sm_fault(fcport->bfa, event); |
2185 | } | 2195 | } |
@@ -2236,6 +2246,12 @@ bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport, | |||
2236 | bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); | 2246 | bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); |
2237 | break; | 2247 | break; |
2238 | 2248 | ||
2249 | case BFA_FCPORT_SM_FAA_MISCONFIG: | ||
2250 | bfa_fcport_reset_linkinfo(fcport); | ||
2251 | bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); | ||
2252 | bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); | ||
2253 | break; | ||
2254 | |||
2239 | default: | 2255 | default: |
2240 | bfa_sm_fault(fcport->bfa, event); | 2256 | bfa_sm_fault(fcport->bfa, event); |
2241 | } | 2257 | } |
@@ -2322,6 +2338,12 @@ bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, | |||
2322 | bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); | 2338 | bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); |
2323 | break; | 2339 | break; |
2324 | 2340 | ||
2341 | case BFA_FCPORT_SM_FAA_MISCONFIG: | ||
2342 | bfa_fcport_reset_linkinfo(fcport); | ||
2343 | bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); | ||
2344 | bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); | ||
2345 | break; | ||
2346 | |||
2325 | default: | 2347 | default: |
2326 | bfa_sm_fault(fcport->bfa, event); | 2348 | bfa_sm_fault(fcport->bfa, event); |
2327 | } | 2349 | } |
@@ -2415,6 +2437,12 @@ bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport, | |||
2415 | } | 2437 | } |
2416 | break; | 2438 | break; |
2417 | 2439 | ||
2440 | case BFA_FCPORT_SM_FAA_MISCONFIG: | ||
2441 | bfa_fcport_reset_linkinfo(fcport); | ||
2442 | bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); | ||
2443 | bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); | ||
2444 | break; | ||
2445 | |||
2418 | default: | 2446 | default: |
2419 | bfa_sm_fault(fcport->bfa, event); | 2447 | bfa_sm_fault(fcport->bfa, event); |
2420 | } | 2448 | } |
@@ -2460,6 +2488,12 @@ bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport, | |||
2460 | bfa_reqq_wcancel(&fcport->reqq_wait); | 2488 | bfa_reqq_wcancel(&fcport->reqq_wait); |
2461 | break; | 2489 | break; |
2462 | 2490 | ||
2491 | case BFA_FCPORT_SM_FAA_MISCONFIG: | ||
2492 | bfa_fcport_reset_linkinfo(fcport); | ||
2493 | bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); | ||
2494 | bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); | ||
2495 | break; | ||
2496 | |||
2463 | default: | 2497 | default: |
2464 | bfa_sm_fault(fcport->bfa, event); | 2498 | bfa_sm_fault(fcport->bfa, event); |
2465 | } | 2499 | } |
@@ -2727,6 +2761,49 @@ bfa_fcport_sm_dport(struct bfa_fcport_s *fcport, enum bfa_fcport_sm_event event) | |||
2727 | } | 2761 | } |
2728 | } | 2762 | } |
2729 | 2763 | ||
2764 | static void | ||
2765 | bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport, | ||
2766 | enum bfa_fcport_sm_event event) | ||
2767 | { | ||
2768 | bfa_trc(fcport->bfa, event); | ||
2769 | |||
2770 | switch (event) { | ||
2771 | case BFA_FCPORT_SM_DPORTENABLE: | ||
2772 | case BFA_FCPORT_SM_ENABLE: | ||
2773 | case BFA_FCPORT_SM_START: | ||
2774 | /* | ||
2775 | * Ignore event for a port as there is FAA misconfig | ||
2776 | */ | ||
2777 | break; | ||
2778 | |||
2779 | case BFA_FCPORT_SM_DISABLE: | ||
2780 | if (bfa_fcport_send_disable(fcport)) | ||
2781 | bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); | ||
2782 | else | ||
2783 | bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); | ||
2784 | |||
2785 | bfa_fcport_reset_linkinfo(fcport); | ||
2786 | bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); | ||
2787 | bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, | ||
2788 | BFA_PL_EID_PORT_DISABLE, 0, "Port Disable"); | ||
2789 | bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); | ||
2790 | break; | ||
2791 | |||
2792 | case BFA_FCPORT_SM_STOP: | ||
2793 | bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); | ||
2794 | break; | ||
2795 | |||
2796 | case BFA_FCPORT_SM_HWFAIL: | ||
2797 | bfa_fcport_reset_linkinfo(fcport); | ||
2798 | bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); | ||
2799 | bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); | ||
2800 | break; | ||
2801 | |||
2802 | default: | ||
2803 | bfa_sm_fault(fcport->bfa, event); | ||
2804 | } | ||
2805 | } | ||
2806 | |||
2730 | /* | 2807 | /* |
2731 | * Link state is down | 2808 | * Link state is down |
2732 | */ | 2809 | */ |
@@ -3554,8 +3631,15 @@ bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg) | |||
3554 | case BFI_FCPORT_I2H_EVENT: | 3631 | case BFI_FCPORT_I2H_EVENT: |
3555 | if (i2hmsg.event->link_state.linkstate == BFA_PORT_LINKUP) | 3632 | if (i2hmsg.event->link_state.linkstate == BFA_PORT_LINKUP) |
3556 | bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKUP); | 3633 | bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKUP); |
3557 | else | 3634 | else { |
3558 | bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKDOWN); | 3635 | if (i2hmsg.event->link_state.linkstate_rsn == |
3636 | BFA_PORT_LINKSTATE_RSN_FAA_MISCONFIG) | ||
3637 | bfa_sm_send_event(fcport, | ||
3638 | BFA_FCPORT_SM_FAA_MISCONFIG); | ||
3639 | else | ||
3640 | bfa_sm_send_event(fcport, | ||
3641 | BFA_FCPORT_SM_LINKDOWN); | ||
3642 | } | ||
3559 | break; | 3643 | break; |
3560 | 3644 | ||
3561 | case BFI_FCPORT_I2H_TRUNK_SCN: | 3645 | case BFI_FCPORT_I2H_TRUNK_SCN: |