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

Commit d7be54cc authored by Krishna Gudipati's avatar Krishna Gudipati Committed by James Bottomley
Browse files

[SCSI] bfa: FCS bug fixes.



- Added logic to initiate a PLOGI to the target, while processing a LOGO
  from the same target in Direct attach mode.
- Added logic to generate a FCCT Reject indicating unsupported command,
  upon receiving FCCT/FCGS requests.
- Added logic to set the fcpim in offline state and avoid any PRLI retries
  if a PRLI response is a reject with a reason Command Not Supported.
- Updated the FDMI Supported/Current speeds.
- Added logic to wait for the response  from the firmware before sending
  ACC to PLOGI and transitioning to subsequent states - while processing an
  Incoming PLOGI in online state.
- Added a wait state in the fcs_vport state machine - For case where
  FDISC is in progress and we get a vport delete request we wait for
  fdisc response and will transition to the appropriate state based on
  rsp status, else its causing both driver/fw resources to be not
  freed.
- Remove the fc_credit_recovery module param.

Signed-off-by: default avatarKrishna Gudipati <kgudipat@brocade.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 4507025d
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -249,12 +249,13 @@ enum bfa_vport_state {
	BFA_FCS_VPORT_FDISC_SEND	= 2,
	BFA_FCS_VPORT_FDISC		= 3,
	BFA_FCS_VPORT_FDISC_RETRY	= 4,
	BFA_FCS_VPORT_ONLINE		= 5,
	BFA_FCS_VPORT_DELETING		= 6,
	BFA_FCS_VPORT_CLEANUP		= 6,
	BFA_FCS_VPORT_LOGO_SEND		= 7,
	BFA_FCS_VPORT_LOGO		= 8,
	BFA_FCS_VPORT_ERROR		= 9,
	BFA_FCS_VPORT_FDISC_RSP_WAIT	= 5,
	BFA_FCS_VPORT_ONLINE		= 6,
	BFA_FCS_VPORT_DELETING		= 7,
	BFA_FCS_VPORT_CLEANUP		= 8,
	BFA_FCS_VPORT_LOGO_SEND		= 9,
	BFA_FCS_VPORT_LOGO		= 10,
	BFA_FCS_VPORT_ERROR		= 11,
	BFA_FCS_VPORT_MAX_STATE,
};

+4 −6
Original line number Diff line number Diff line
@@ -748,9 +748,10 @@ struct bfa_port_cfg_s {
	u8	 tx_bbcredit;	/*  transmit buffer credits	*/
	u8	 ratelimit;	/*  ratelimit enabled or not	*/
	u8	 trl_def_speed;	/*  ratelimit default speed	*/
	u8	bb_scn;
	u8	bb_scn;		/*  BB_SCN value from FLOGI Exchg */
	u8	bb_scn_state;	/*  Config state of BB_SCN */
	u8	faa_state;	/*  FAA enabled/disabled        */
	u8	rsvd[2];
	u8	rsvd[1];
	u16 path_tov;	/*  device path timeout	*/
	u16 q_depth;	/*  SCSI Queue depth		*/
};
@@ -786,7 +787,6 @@ struct bfa_port_attr_s {
	enum bfa_port_topology	topology;	/*  current topology */
	bfa_boolean_t		beacon;		/*  current beacon status */
	bfa_boolean_t		link_e2e_beacon; /*  link beacon is on */
	bfa_boolean_t		plog_enabled;	/*  portlog is enabled */
	bfa_boolean_t	bbsc_op_status;	/* fc credit recovery oper state */

	/*
@@ -796,12 +796,10 @@ struct bfa_port_attr_s {
	enum bfa_port_type	port_type;	/*  current topology */
	u32		loopback;	/*  external loopback */
	u32		authfail;	/*  auth fail state */
	bfa_boolean_t		io_profile;	/*  get it from fcpim mod */
	u8			pad[4];		/*  for 64-bit alignement */

	/* FCoE specific  */
	u16		fcoe_vlan;
	u8			rsvd1[6];
	u8			rsvd1[2];
};

/*
+31 −0
Original line number Diff line number Diff line
@@ -155,6 +155,22 @@ fc_gs_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u32 ox_id)
	 */
}

static void
fc_gsresp_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
{
	memset(fchs, 0, sizeof(struct fchs_s));

	fchs->routing = FC_RTG_FC4_DEV_DATA;
	fchs->cat_info = FC_CAT_SOLICIT_CTRL;
	fchs->type = FC_TYPE_SERVICES;
	fchs->f_ctl =
		bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH |
			   FCTL_END_SEQ | FCTL_SI_XFER);
	fchs->d_id = d_id;
	fchs->s_id = s_id;
	fchs->ox_id = ox_id;
}

void
fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id)
{
@@ -1097,6 +1113,21 @@ fc_ct_rsp_parse(struct ct_hdr_s *cthdr)
	return FC_PARSE_OK;
}

u16
fc_gs_rjt_build(struct fchs_s *fchs,  struct ct_hdr_s *cthdr,
		u32 d_id, u32 s_id, u16 ox_id, u8 reason_code,
		u8 reason_code_expl)
{
	fc_gsresp_fchdr_build(fchs, d_id, s_id, ox_id);

	cthdr->cmd_rsp_code = cpu_to_be16(CT_RSP_REJECT);
	cthdr->rev_id = CT_GS3_REVISION;

	cthdr->reason_code = reason_code;
	cthdr->exp_code    = reason_code_expl;
	return sizeof(struct ct_hdr_s);
}

u16
fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr,
		u8 set_br_reg, u32 s_id, u16 ox_id)
+4 −0
Original line number Diff line number Diff line
@@ -183,6 +183,10 @@ u16 fc_gidpn_build(struct fchs_s *fchs, void *pyld, u32 s_id,
u16        fc_gpnid_build(struct fchs_s *fchs, void *pld, u32 s_id,
			       u16 ox_id, u32 port_id);

u16	fc_gs_rjt_build(struct fchs_s *fchs, struct ct_hdr_s *cthdr,
			u32 d_id, u32 s_id, u16 ox_id,
			u8 reason_code, u8 reason_code_expl);

u16        fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr,
			u8 set_br_reg, u32 s_id, u16 ox_id);

+15 −5
Original line number Diff line number Diff line
@@ -193,9 +193,12 @@ bfa_fcs_exit(struct bfa_fcs_s *fcs)

#define bfa_fcs_fabric_set_opertype(__fabric) do {			\
	if (bfa_fcport_get_topology((__fabric)->fcs->bfa)		\
		    == BFA_PORT_TOPOLOGY_P2P)				\
				== BFA_PORT_TOPOLOGY_P2P) {		\
		if (fabric->fab_type == BFA_FCS_FABRIC_SWITCHED)	\
			(__fabric)->oper_type = BFA_PORT_TYPE_NPORT;	\
		else							\
			(__fabric)->oper_type = BFA_PORT_TYPE_P2P;	\
	} else								\
		(__fabric)->oper_type = BFA_PORT_TYPE_NLPORT;		\
} while (0)

@@ -551,6 +554,9 @@ bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
					   bfa_fcs_fabric_oper_bbscn(fabric));
		break;

	case BFA_FCS_FABRIC_SM_RETRY_OP:
		break;

	default:
		bfa_sm_fault(fabric->fcs, event);
	}
@@ -827,6 +833,7 @@ bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status)
		 */
		fabric->bport.port_topo.pn2n.rem_port_wwn =
			fabric->lps->pr_pwwn;
		fabric->fab_type = BFA_FCS_FABRIC_N2N;
		bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC);
	}

@@ -917,8 +924,9 @@ static u8
bfa_fcs_fabric_oper_bbscn(struct bfa_fcs_fabric_s *fabric)
{
	u8	pr_bbscn = fabric->lps->pr_bbscn;
	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fabric->fcs->bfa);

	if (!(fabric->fcs->bbscn_enabled && pr_bbscn))
	if (!(fcport->cfg.bb_scn_state && pr_bbscn))
		return 0;

	/* return max of local/remote bb_scn values */
@@ -932,8 +940,10 @@ bfa_fcs_fabric_oper_bbscn(struct bfa_fcs_fabric_s *fabric)
static bfa_boolean_t
bfa_fcs_fabric_is_bbscn_enabled(struct bfa_fcs_fabric_s *fabric)
{
	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fabric->fcs->bfa);

	if (bfa_ioc_get_fcmode(&fabric->fcs->bfa->ioc) &&
			fabric->fcs->bbscn_enabled &&
			fcport->cfg.bb_scn_state &&
			!bfa_fcport_is_qos_enabled(fabric->fcs->bfa) &&
			!bfa_fcport_is_trunk_enabled(fabric->fcs->bfa))
		return BFA_TRUE;
Loading