aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_svc.c
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-06-13 18:53:04 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 16:52:21 -0400
commitbe540a991e2097c313d7304e0daaf89d68011bb9 (patch)
treea44685889c9989546ffac1ee7ad1da7dd641c20c /drivers/scsi/bfa/bfa_svc.c
parent8b070b4a022f86dd5098308e36426ce29b6b8960 (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_svc.c')
-rw-r--r--drivers/scsi/bfa/bfa_svc.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 46e8cdd31db9..5373e5ddd4ad 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -1257,6 +1257,7 @@ bfa_lps_sm_login(struct bfa_lps_s *lps, enum bfa_lps_event event)
1257 break; 1257 break;
1258 1258
1259 case BFA_LPS_SM_OFFLINE: 1259 case BFA_LPS_SM_OFFLINE:
1260 case BFA_LPS_SM_DELETE:
1260 bfa_sm_set_state(lps, bfa_lps_sm_init); 1261 bfa_sm_set_state(lps, bfa_lps_sm_init);
1261 break; 1262 break;
1262 1263
@@ -1285,6 +1286,7 @@ bfa_lps_sm_loginwait(struct bfa_lps_s *lps, enum bfa_lps_event event)
1285 break; 1286 break;
1286 1287
1287 case BFA_LPS_SM_OFFLINE: 1288 case BFA_LPS_SM_OFFLINE:
1289 case BFA_LPS_SM_DELETE:
1288 bfa_sm_set_state(lps, bfa_lps_sm_init); 1290 bfa_sm_set_state(lps, bfa_lps_sm_init);
1289 bfa_reqq_wcancel(&lps->wqe); 1291 bfa_reqq_wcancel(&lps->wqe);
1290 break; 1292 break;
@@ -1409,6 +1411,7 @@ bfa_lps_sm_logout(struct bfa_lps_s *lps, enum bfa_lps_event event)
1409 break; 1411 break;
1410 1412
1411 case BFA_LPS_SM_OFFLINE: 1413 case BFA_LPS_SM_OFFLINE:
1414 case BFA_LPS_SM_DELETE:
1412 bfa_sm_set_state(lps, bfa_lps_sm_init); 1415 bfa_sm_set_state(lps, bfa_lps_sm_init);
1413 break; 1416 break;
1414 1417
@@ -1433,6 +1436,7 @@ bfa_lps_sm_logowait(struct bfa_lps_s *lps, enum bfa_lps_event event)
1433 break; 1436 break;
1434 1437
1435 case BFA_LPS_SM_OFFLINE: 1438 case BFA_LPS_SM_OFFLINE:
1439 case BFA_LPS_SM_DELETE:
1436 bfa_sm_set_state(lps, bfa_lps_sm_init); 1440 bfa_sm_set_state(lps, bfa_lps_sm_init);
1437 bfa_reqq_wcancel(&lps->wqe); 1441 bfa_reqq_wcancel(&lps->wqe);
1438 break; 1442 break;
@@ -1551,6 +1555,7 @@ bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp)
1551 lps->lp_mac = rsp->lp_mac; 1555 lps->lp_mac = rsp->lp_mac;
1552 lps->brcd_switch = rsp->brcd_switch; 1556 lps->brcd_switch = rsp->brcd_switch;
1553 lps->fcf_mac = rsp->fcf_mac; 1557 lps->fcf_mac = rsp->fcf_mac;
1558 lps->pr_bbscn = rsp->bb_scn;
1554 1559
1555 break; 1560 break;
1556 1561
@@ -1647,6 +1652,7 @@ bfa_lps_send_login(struct bfa_lps_s *lps)
1647 m->nwwn = lps->nwwn; 1652 m->nwwn = lps->nwwn;
1648 m->fdisc = lps->fdisc; 1653 m->fdisc = lps->fdisc;
1649 m->auth_en = lps->auth_en; 1654 m->auth_en = lps->auth_en;
1655 m->bb_scn = lps->bb_scn;
1650 1656
1651 bfa_reqq_produce(lps->bfa, lps->reqq); 1657 bfa_reqq_produce(lps->bfa, lps->reqq);
1652} 1658}
@@ -1838,7 +1844,7 @@ bfa_lps_delete(struct bfa_lps_s *lps)
1838 */ 1844 */
1839void 1845void
1840bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, u16 pdusz, 1846bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, u16 pdusz,
1841 wwn_t pwwn, wwn_t nwwn, bfa_boolean_t auth_en) 1847 wwn_t pwwn, wwn_t nwwn, bfa_boolean_t auth_en, uint8_t bb_scn)
1842{ 1848{
1843 lps->uarg = uarg; 1849 lps->uarg = uarg;
1844 lps->alpa = alpa; 1850 lps->alpa = alpa;
@@ -1847,6 +1853,7 @@ bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, u16 pdusz,
1847 lps->nwwn = nwwn; 1853 lps->nwwn = nwwn;
1848 lps->fdisc = BFA_FALSE; 1854 lps->fdisc = BFA_FALSE;
1849 lps->auth_en = auth_en; 1855 lps->auth_en = auth_en;
1856 lps->bb_scn = bb_scn;
1850 bfa_sm_send_event(lps, BFA_LPS_SM_LOGIN); 1857 bfa_sm_send_event(lps, BFA_LPS_SM_LOGIN);
1851} 1858}
1852 1859
@@ -2900,6 +2907,7 @@ bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport)
2900{ 2907{
2901 fcport->speed = BFA_PORT_SPEED_UNKNOWN; 2908 fcport->speed = BFA_PORT_SPEED_UNKNOWN;
2902 fcport->topology = BFA_PORT_TOPOLOGY_NONE; 2909 fcport->topology = BFA_PORT_TOPOLOGY_NONE;
2910 fcport->bbsc_op_state = BFA_FALSE;
2903} 2911}
2904 2912
2905/* 2913/*
@@ -3010,6 +3018,7 @@ bfa_fcport_send_txcredit(void *port_cbarg)
3010 bfi_h2i_set(m->mh, BFI_MC_FCPORT, BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ, 3018 bfi_h2i_set(m->mh, BFI_MC_FCPORT, BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ,
3011 bfa_lpuid(fcport->bfa)); 3019 bfa_lpuid(fcport->bfa));
3012 m->tx_bbcredit = cpu_to_be16((u16)fcport->cfg.tx_bbcredit); 3020 m->tx_bbcredit = cpu_to_be16((u16)fcport->cfg.tx_bbcredit);
3021 m->bb_scn = fcport->cfg.bb_scn;
3013 3022
3014 /* 3023 /*
3015 * queue I/O message to firmware 3024 * queue I/O message to firmware
@@ -3626,11 +3635,14 @@ bfa_fcport_get_rx_bbcredit(struct bfa_s *bfa)
3626} 3635}
3627 3636
3628void 3637void
3629bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit) 3638bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit, u8 bb_scn)
3630{ 3639{
3631 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 3640 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3632 3641
3633 fcport->cfg.tx_bbcredit = (u8)tx_bbcredit; 3642 fcport->cfg.tx_bbcredit = (u8)tx_bbcredit;
3643 fcport->cfg.bb_scn = bb_scn;
3644 if (bb_scn)
3645 fcport->bbsc_op_state = BFA_TRUE;
3634 bfa_fcport_send_txcredit(fcport); 3646 bfa_fcport_send_txcredit(fcport);
3635} 3647}
3636 3648
@@ -3683,6 +3695,7 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
3683 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); 3695 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa);
3684 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); 3696 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa);
3685 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); 3697 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm);
3698 attr->bbsc_op_status = fcport->bbsc_op_state;
3686 3699
3687 /* PBC Disabled State */ 3700 /* PBC Disabled State */
3688 if (bfa_fcport_is_pbcdisabled(bfa)) 3701 if (bfa_fcport_is_pbcdisabled(bfa))
@@ -3805,6 +3818,14 @@ bfa_fcport_is_qos_enabled(struct bfa_s *bfa)
3805 return fcport->cfg.qos_enabled; 3818 return fcport->cfg.qos_enabled;
3806} 3819}
3807 3820
3821bfa_boolean_t
3822bfa_fcport_is_trunk_enabled(struct bfa_s *bfa)
3823{
3824 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3825
3826 return fcport->cfg.trunked;
3827}
3828
3808/* 3829/*
3809 * Rport State machine functions 3830 * Rport State machine functions
3810 */ 3831 */