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

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

[SCSI] bfa: BSG and User interface fixes.



Made changes to set the rport maxfrsize param to use a value that is
equal to or less than the Buffer-to-Buffer Receive Data_Field size
specified in the Common Service Parameters.
Increased the diag memtest timeout for the Brocade-1860 adapters.
Made changes to enable valid port speed configuration check for all adapters.
Made changes to increase the max hw segments in a request, in order to
support larger data transfers from user space.

Signed-off-by: default avatarKrishna Gudipati <kgudipat@brocade.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent ff179e0f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2169,7 +2169,10 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi)
	 * - MAX receive frame size
	 */
	rport->cisc = plogi->csp.cisc;
	if (be16_to_cpu(plogi->class3.rxsz) < be16_to_cpu(plogi->csp.rxsz))
		rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz);
	else
		rport->maxfrsize = be16_to_cpu(plogi->csp.rxsz);

	bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred));
	bfa_trc(port->fcs, port->fabric->bb_credit);
+6 −2
Original line number Diff line number Diff line
@@ -4449,7 +4449,7 @@ bfa_flash_read_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type,
 */

#define BFA_DIAG_MEMTEST_TOV	50000	/* memtest timeout in msec */
#define BFA_DIAG_FWPING_TOV	1000	/* msec */
#define CT2_BFA_DIAG_MEMTEST_TOV	(9*30*1000)  /* 4.5 min */

/* IOC event handler */
static void
@@ -4804,6 +4804,8 @@ bfa_diag_memtest(struct bfa_diag_s *diag, struct bfa_diag_memtest_s *memtest,
		u32 pattern, struct bfa_diag_memtest_result *result,
		bfa_cb_diag_t cbfn, void *cbarg)
{
	u32	memtest_tov;

	bfa_trc(diag, pattern);

	if (!bfa_ioc_adapter_is_disabled(diag->ioc))
@@ -4823,8 +4825,10 @@ bfa_diag_memtest(struct bfa_diag_s *diag, struct bfa_diag_memtest_s *memtest,
	/* download memtest code and take LPU0 out of reset */
	bfa_ioc_boot(diag->ioc, BFI_FWBOOT_TYPE_MEMTEST, BFI_FWBOOT_ENV_OS);

	memtest_tov = (bfa_ioc_asic_gen(diag->ioc) == BFI_ASIC_GEN_CT2) ?
		       CT2_BFA_DIAG_MEMTEST_TOV : BFA_DIAG_MEMTEST_TOV;
	bfa_timer_begin(diag->ioc->timer_mod, &diag->timer,
			bfa_diag_memtest_done, diag, BFA_DIAG_MEMTEST_TOV);
			bfa_diag_memtest_done, diag, memtest_tov);
	diag->timer_active = 1;
	return BFA_STATUS_OK;
}
+17 −19
Original line number Diff line number Diff line
@@ -3576,8 +3576,7 @@ bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_port_speed speed)
		return BFA_STATUS_UNSUPP_SPEED;
	}

	/* For Mezz card, port speed entered needs to be checked */
	if (bfa_mfg_is_mezz(fcport->bfa->ioc.attr->card_type)) {
	/* Port speed entered needs to be checked */
	if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) {
		/* For CT2, 1G is not supported */
		if ((speed == BFA_PORT_SPEED_1GBPS) &&
@@ -3596,7 +3595,6 @@ bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_port_speed speed)
		if (speed != BFA_PORT_SPEED_10GBPS)
			return BFA_STATUS_UNSUPP_SPEED;
	}
	}

	fcport->cfg.speed = speed;

+7 −0
Original line number Diff line number Diff line
@@ -2762,9 +2762,16 @@ bfad_im_bsg_vendor_request(struct fc_bsg_job *job)
	struct bfad_im_port_s *im_port =
			(struct bfad_im_port_s *) job->shost->hostdata[0];
	struct bfad_s *bfad = im_port->bfad;
	struct request_queue *request_q = job->req->q;
	void *payload_kbuf;
	int rc = -EINVAL;

	/*
	 * Set the BSG device request_queue size to 256 to support
	 * payloads larger than 512*1024K bytes.
	 */
	blk_queue_max_segments(request_q, 256);

	/* Allocate a temp buffer to hold the passed in user space command */
	payload_kbuf = kzalloc(job->request_payload.payload_len, GFP_KERNEL);
	if (!payload_kbuf) {