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

Commit 03aaa89f authored by Darren Trapp's avatar Darren Trapp Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: Add First Burst support for FC-NVMe devices



Add Support for First Burst for FC-NVMe protocol. This feature requires
First Burst support in the firmware.

Signed-off-by: default avatarDarren Trapp <darren.trapp@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ec322937
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2367,7 +2367,9 @@ typedef struct fc_port {
#define NVME_PRLI_SP_INITIATOR  BIT_5
#define NVME_PRLI_SP_TARGET     BIT_4
#define NVME_PRLI_SP_DISCOVERY  BIT_3
#define NVME_PRLI_SP_FIRST_BURST	BIT_0
	uint8_t nvme_flag;
	uint32_t nvme_first_burst_size;
#define NVME_FLAG_REGISTERED 4
#define NVME_FLAG_DELETING 2
#define NVME_FLAG_RESETTING 1
@@ -3966,6 +3968,7 @@ struct qla_hw_data {
	uint16_t	fw_subminor_version;
	uint16_t	fw_attributes;
	uint16_t	fw_attributes_h;
#define FW_ATTR_H_NVME_FBURST 	BIT_1
#define FW_ATTR_H_NVME		BIT_10
#define FW_ATTR_H_NVME_UPDATED  BIT_14

@@ -4260,6 +4263,7 @@ typedef struct scsi_qla_host {
		uint32_t	qpairs_req_created:1;
		uint32_t	qpairs_rsp_created:1;
		uint32_t	nvme_enabled:1;
		uint32_t        nvme_first_burst:1;
	} flags;

	atomic_t	loop_state;
+6 −0
Original line number Diff line number Diff line
@@ -1831,6 +1831,12 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea)

		ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset;
		ea->fcport->logout_on_delete = 1;
		ea->fcport->nvme_prli_service_param = ea->iop[0];
		if (ea->iop[0] & NVME_PRLI_SP_FIRST_BURST)
			ea->fcport->nvme_first_burst_size =
			    (ea->iop[1] & 0xffff) * 512;
		else
			ea->fcport->nvme_first_burst_size = 0;
		qla24xx_post_gpdb_work(vha, ea->fcport, 0);
		break;
	default:
+4 −1
Original line number Diff line number Diff line
@@ -2419,8 +2419,11 @@ qla24xx_prli_iocb(srb_t *sp, struct logio_entry_24xx *logio)

	logio->entry_type = LOGINOUT_PORT_IOCB_TYPE;
	logio->control_flags = cpu_to_le16(LCF_COMMAND_PRLI);
	if (lio->u.logio.flags & SRB_LOGIN_NVME_PRLI)
	if (lio->u.logio.flags & SRB_LOGIN_NVME_PRLI) {
		logio->control_flags |= LCF_NVME_PRLI;
		if (sp->vha->flags.nvme_first_burst)
			logio->io_parameter[0] = NVME_PRLI_SP_FIRST_BURST;
	}

	logio->nport_handle = cpu_to_le16(sp->fcport->loop_id);
	logio->port_id[0] = sp->fcport->d_id.b.al_pa;
+9 −0
Original line number Diff line number Diff line
@@ -1715,6 +1715,15 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req,

		vha->hw->exch_starvation = 0;
		data[0] = MBS_COMMAND_COMPLETE;

		if (sp->type == SRB_PRLI_CMD) {
			lio->u.logio.iop[0] =
			    le32_to_cpu(logio->io_parameter[0]);
			lio->u.logio.iop[1] =
			    le32_to_cpu(logio->io_parameter[1]);
			goto logio_done;
		}

		if (sp->type != SRB_LOGIN_CMD)
			goto logio_done;

+3 −2
Original line number Diff line number Diff line
@@ -1112,6 +1112,9 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha)
		if ((ha->fw_attributes_h &
		    (FW_ATTR_H_NVME | FW_ATTR_H_NVME_UPDATED)) &&
			ql2xnvmeenable) {
			if (ha->fw_attributes_h & FW_ATTR_H_NVME_FBURST)
				vha->flags.nvme_first_burst = 1;

			vha->flags.nvme_enabled = 1;
			ql_log(ql_log_info, vha, 0xd302,
			    "%s: FC-NVMe is Enabled (0x%x)\n",
@@ -6267,8 +6270,6 @@ int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport,
	fcport->d_id.b.rsvd_1 = 0;

	if (fcport->fc4f_nvme) {
		fcport->nvme_prli_service_param =
		    pd->prli_nvme_svc_param_word_3;
		fcport->port_type = FCT_NVME;
	} else {
		/* If not target must be initiator or unknown type. */
Loading