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

Commit 36d345a7 authored by Jing Huang's avatar Jing Huang Committed by James Bottomley
Browse files

[SCSI] bfa: add dynamic queue selection



Add new bfa functionality to support dynamic queue selection (IO redirection).
IO redirection can only be enabled when QoS is disabled.

Signed-off-by: default avatarJing Huang <huangj@brocade.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 4b5e759d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -171,6 +171,11 @@ bfa_cb_ioim_get_cdblen(struct bfad_ioim_s *dio)
	return cmnd->cmd_len;
}


/**
 * Assign queue to be used for the I/O request. This value depends on whether
 * the driver wants to use the queues via any specific algorithm. Currently,
 * this is not supported.
 */
#define bfa_cb_ioim_get_reqq(__dio) BFA_FALSE

#endif /* __BFA_HCB_IOIM_MACROS_H__ */
+24 −0
Original line number Diff line number Diff line
@@ -167,4 +167,28 @@ bfa_fcpim_qdepth_get(struct bfa_s *bfa)
	return fcpim->q_depth;
}

void
bfa_fcpim_update_ioredirect(struct bfa_s *bfa)
{
	bfa_boolean_t ioredirect;

	/*
	 * IO redirection is turned off when QoS is enabled and vice versa
	 */
	ioredirect = bfa_fcport_is_qos_enabled(bfa) ? BFA_FALSE : BFA_TRUE;

	/*
	 * Notify the bfad module of a possible state change in
	 * IO redirection capability, due to a QoS state change. bfad will
	 * check on the support for io redirection and update the
	 * fcpim's ioredirect state accordingly.
	 */
	bfa_cb_ioredirect_state_change((void *)(bfa->bfad), ioredirect);
}

void
bfa_fcpim_set_ioredirect(struct bfa_s *bfa, bfa_boolean_t state)
{
	struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
	fcpim->ioredirect = state;
}
+4 −1
Original line number Diff line number Diff line
@@ -49,7 +49,8 @@ struct bfa_fcpim_mod_s {
	int			num_tskim_reqs;
	u32		path_tov;
	u16		q_depth;
	u16		rsvd;
	u8              reqq;           /* Request queue to be used */
	u8		rsvd;
	struct list_head 	itnim_q;        /*  queue of active itnim    */
	struct list_head 	ioim_free_q;    /*  free IO resources        */
	struct list_head 	ioim_resfree_q; /*  IOs waiting for f/w      */
@@ -58,6 +59,7 @@ struct bfa_fcpim_mod_s {
	u32	ios_active;	/*  current active IOs	      */
	u32	delay_comp;
	struct bfa_fcpim_stats_s stats;
	bfa_boolean_t           ioredirect;
};

struct bfa_ioim_s;
@@ -82,6 +84,7 @@ struct bfa_ioim_s {
	struct bfa_cb_qe_s hcb_qe;	/*  bfa callback qelem       */
	bfa_cb_cbfn_t io_cbfn;		/*  IO completion handler    */
	struct bfa_ioim_sp_s *iosp;	/*  slow-path IO handling    */
	u8 reqq;           		/* Request queue for I/O    */
};

struct bfa_ioim_sp_s {
+12 −1
Original line number Diff line number Diff line
@@ -1857,8 +1857,13 @@ bfa_fcport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off)

	bfa_trc(bfa, ioc_type);

	if (ioc_type == BFA_IOC_TYPE_FC)
	if (ioc_type == BFA_IOC_TYPE_FC) {
		fcport->cfg.qos_enabled = on_off;
		/**
		 * Notify fcpim of the change in QoS state
		 */
		bfa_fcpim_update_ioredirect(bfa);
	}
}

void
@@ -1942,4 +1947,10 @@ bfa_fcport_is_linkup(struct bfa_s *bfa)
	return bfa_sm_cmp_state(BFA_FCPORT_MOD(bfa), bfa_fcport_sm_linkup);
}

bfa_boolean_t
bfa_fcport_is_qos_enabled(struct bfa_s *bfa)
{
	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);

	return fcport->cfg.qos_enabled;
}
+6 −1
Original line number Diff line number Diff line
@@ -152,4 +152,9 @@ bfa_hwcb_isr_mode_set(struct bfa_s *bfa, bfa_boolean_t msix)
	bfa->iocfc.hwif.hw_rspq_ack = bfa_hwcb_rspq_ack_msix;
}

void
bfa_hwcb_msix_get_rme_range(struct bfa_s *bfa, u32 *start, u32 *end)
{
	*start = BFA_MSIX_RME_Q0;
	*end = BFA_MSIX_RME_Q7;
}
Loading