Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f1806bc authored by Jing Huang's avatar Jing Huang Committed by James Bottomley
Browse files

[SCSI] bfa: use standards defined timeout for ELS/CT



Use standards defined 2 * RA_TOV as a timeout for ELS Request retries.
And standards defined 3 * RA_TOV as a timeout for FC-CT Request retries.
Also, added a check to send RPSC2 to a Brocade Fabric only.

Signed-off-by: default avatarJing Huang <huangj@brocade.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent b85d045e
Loading
Loading
Loading
Loading
+26 −0
Original line number Original line Diff line number Diff line
@@ -1027,6 +1027,32 @@ bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric)
	return fabric->num_vports;
	return fabric->num_vports;
}
}


/*
 *  Get OUI of the attached switch.
 *
 *  Note : Use of this function should be avoided as much as possible.
 *         This function should be used only if there is any requirement
 *         to check for FOS version below 6.3.
 *         To check if the attached fabric is a brocade fabric, use
 *         bfa_lps_is_brcd_fabric() which works for FOS versions 6.3
 *         or above only.
 */

u16
bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric)
{
	wwn_t fab_nwwn;
	u8 *tmp;
	u16 oui;

	fab_nwwn = bfa_lps_get_peer_nwwn(fabric->lps);

	tmp = (uint8_t *)&fab_nwwn;
	oui = (tmp[3] << 8) | tmp[4];

	return oui;
}

/**
/**
 * 		Unsolicited frame receive handling.
 * 		Unsolicited frame receive handling.
 */
 */
+1 −1
Original line number Original line Diff line number Diff line
@@ -422,7 +422,7 @@ bfa_fcs_itnim_send_prli(void *itnim_cbarg, struct bfa_fcxp_s *fcxp_alloced)
	bfa_fcxp_send(fcxp, rport->bfa_rport, port->fabric->vf_id, port->lp_tag,
	bfa_fcxp_send(fcxp, rport->bfa_rport, port->fabric->vf_id, port->lp_tag,
		      BFA_FALSE, FC_CLASS_3, len, &fchs,
		      BFA_FALSE, FC_CLASS_3, len, &fchs,
		      bfa_fcs_itnim_prli_response, (void *)itnim, FC_MAX_PDUSZ,
		      bfa_fcs_itnim_prli_response, (void *)itnim, FC_MAX_PDUSZ,
		      FC_RA_TOV);
		      FC_ELS_TOV);


	itnim->stats.prli_sent++;
	itnim->stats.prli_sent++;
	bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_FRMSENT);
	bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_FRMSENT);
+3 −0
Original line number Original line Diff line number Diff line
@@ -26,6 +26,8 @@
#include <fcs/bfa_fcs_vport.h>
#include <fcs/bfa_fcs_vport.h>
#include <fcs/bfa_fcs_lport.h>
#include <fcs/bfa_fcs_lport.h>


#define BFA_FCS_BRCD_SWITCH_OUI  0x051e

/*
/*
* fcs friend functions: only between fcs modules
* fcs friend functions: only between fcs modules
 */
 */
@@ -60,6 +62,7 @@ void bfa_fcs_auth_finished(struct bfa_fcs_fabric_s *fabric,


void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
			wwn_t fabric_name);
			wwn_t fabric_name);
u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric);
void bfa_fcs_get_sym_name(const struct bfa_fcs_s *fcs, char *node_symname);
void bfa_fcs_get_sym_name(const struct bfa_fcs_s *fcs, char *node_symname);


#endif /* __FCS_FABRIC_H__ */
#endif /* __FCS_FABRIC_H__ */
+3 −3
Original line number Original line Diff line number Diff line
@@ -532,7 +532,7 @@ bfa_fcs_port_fdmi_send_rhba(void *fdmi_cbarg, struct bfa_fcxp_s *fcxp_alloced)
	bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
	bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
		      FC_CLASS_3, (len + attr_len), &fchs,
		      FC_CLASS_3, (len + attr_len), &fchs,
		      bfa_fcs_port_fdmi_rhba_response, (void *)fdmi,
		      bfa_fcs_port_fdmi_rhba_response, (void *)fdmi,
		      FC_MAX_PDUSZ, FC_RA_TOV);
		      FC_MAX_PDUSZ, FC_FCCT_TOV);


	bfa_sm_send_event(fdmi, FDMISM_EVENT_RHBA_SENT);
	bfa_sm_send_event(fdmi, FDMISM_EVENT_RHBA_SENT);
}
}
@@ -823,7 +823,7 @@ bfa_fcs_port_fdmi_send_rprt(void *fdmi_cbarg, struct bfa_fcxp_s *fcxp_alloced)
	bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
	bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
		      FC_CLASS_3, len + attr_len, &fchs,
		      FC_CLASS_3, len + attr_len, &fchs,
		      bfa_fcs_port_fdmi_rprt_response, (void *)fdmi,
		      bfa_fcs_port_fdmi_rprt_response, (void *)fdmi,
		      FC_MAX_PDUSZ, FC_RA_TOV);
		      FC_MAX_PDUSZ, FC_FCCT_TOV);


	bfa_sm_send_event(fdmi, FDMISM_EVENT_RPRT_SENT);
	bfa_sm_send_event(fdmi, FDMISM_EVENT_RPRT_SENT);
}
}
@@ -1043,7 +1043,7 @@ bfa_fcs_port_fdmi_send_rpa(void *fdmi_cbarg, struct bfa_fcxp_s *fcxp_alloced)
	bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
	bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
		      FC_CLASS_3, len + attr_len, &fchs,
		      FC_CLASS_3, len + attr_len, &fchs,
		      bfa_fcs_port_fdmi_rpa_response, (void *)fdmi,
		      bfa_fcs_port_fdmi_rpa_response, (void *)fdmi,
		      FC_MAX_PDUSZ, FC_RA_TOV);
		      FC_MAX_PDUSZ, FC_FCCT_TOV);


	bfa_sm_send_event(fdmi, FDMISM_EVENT_RPA_SENT);
	bfa_sm_send_event(fdmi, FDMISM_EVENT_RPA_SENT);
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -1080,6 +1080,7 @@ struct fc_alpabm_s{
#define FC_REC_TOV		(FC_ED_TOV + 1)
#define FC_REC_TOV		(FC_ED_TOV + 1)
#define FC_RA_TOV		10
#define FC_RA_TOV		10
#define FC_ELS_TOV		(2 * FC_RA_TOV)
#define FC_ELS_TOV		(2 * FC_RA_TOV)
#define FC_FCCT_TOV		(3 * FC_RA_TOV)


/*
/*
 * virtual fabric related defines
 * virtual fabric related defines
Loading