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

Commit e84067d7 authored by Duane Grigsby's avatar Duane Grigsby Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration



This code provides the interfaces to register remote and local ports of
FC4 type 0x28 with the FC-NVMe transport and transports the requests
(FC-NVMe FC link services and FC-NVMe commands IUs) to the fabric. It
also provides the support for allocating h/w queues and aborting FC-NVMe
FC requests.

Signed-off-by: default avatarDarren Trapp <darren.trapp@cavium.com>
Signed-off-by: default avatarDuane Grigsby <duane.grigsby@cavium.com>
Signed-off-by: default avatarAnil Gurumurthy <anil.gurumurhty@cavium.com>
Signed-off-by: default avatarGiridhar Malavali <giridhar.malavali@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 7401bc18
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \
		qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o qla_bsg.o \
		qla_nx.o qla_mr.o qla_nx2.o qla_target.o qla_tmpl.o
		qla_nx.o qla_mr.o qla_nx2.o qla_target.o qla_tmpl.o qla_nvme.o

obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx.o
obj-$(CONFIG_TCM_QLA2XXX) += tcm_qla2xxx.o
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
 * |                              |                    | 0x015b-0x0160	|
 * |                              |                    | 0x016e		|
 * | Mailbox commands             |       0x1199       | 0x1193		|
 * | Device Discovery             |       0x2131       | 0x210e-0x2116  |
 * | Device Discovery             |       0x2134       | 0x210e-0x2116  |
 * |				  | 		       | 0x211a         |
 * |                              |                    | 0x211c-0x2128  |
 * |                              |                    | 0x212a-0x2130  |
+6 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include "qla_bsg.h"
#include "qla_nx.h"
#include "qla_nx2.h"
#include "qla_nvme.h"
#define QLA2XXX_DRIVER_NAME	"qla2xxx"
#define QLA2XXX_APIDEV		"ql2xapidev"
#define QLA2XXX_MANUFACTURER	"QLogic Corporation"
@@ -423,6 +424,7 @@ struct srb_iocb {
			int rsp_len;
			dma_addr_t cmd_dma;
			dma_addr_t rsp_dma;
			enum nvmefc_fcp_datadir dir;
			uint32_t dl;
			uint32_t timeout_sec;
		} nvme;
@@ -452,6 +454,7 @@ struct srb_iocb {
#define SRB_NACK_PRLI	17
#define SRB_NACK_LOGO	18
#define SRB_NVME_CMD	19
#define SRB_NVME_LS	20
#define SRB_PRLI_CMD	21

enum {
@@ -467,6 +470,7 @@ typedef struct srb {
	uint8_t cmd_type;
	uint8_t pad[3];
	atomic_t ref_count;
	wait_queue_head_t nvme_ls_waitQ;
	struct fc_port *fcport;
	struct scsi_qla_host *vha;
	uint32_t handle;
@@ -2298,6 +2302,7 @@ typedef struct fc_port {

	struct work_struct nvme_del_work;
	atomic_t nvme_ref_count;
	wait_queue_head_t nvme_waitQ;
	uint32_t nvme_prli_service_param;
#define NVME_PRLI_SP_CONF       BIT_7
#define NVME_PRLI_SP_INITIATOR  BIT_5
@@ -4124,6 +4129,7 @@ typedef struct scsi_qla_host {

	struct		nvme_fc_local_port *nvme_local_port;
	atomic_t	nvme_ref_count;
	wait_queue_head_t nvme_waitQ;
	struct list_head nvme_rport_list;
	atomic_t 	nvme_active_aen_cnt;
	uint16_t	nvme_last_rptd_aen;
+11 −0
Original line number Diff line number Diff line
@@ -9,6 +9,16 @@

#include <linux/interrupt.h>

/*
 * Global functions prototype in qla_nvme.c source file.
 */
extern void qla_nvme_register_hba(scsi_qla_host_t *);
extern int  qla_nvme_register_remote(scsi_qla_host_t *, fc_port_t *);
extern void qla_nvme_delete(scsi_qla_host_t *);
extern void qla_nvme_abort(struct qla_hw_data *, srb_t *sp);
extern void qla24xx_nvme_ls4_iocb(scsi_qla_host_t *, struct pt_ls4_request *,
    struct req_que *);

/*
 * Global Function Prototypes in qla_init.c source file.
 */
@@ -141,6 +151,7 @@ extern int ql2xiniexchg;
extern int ql2xfwholdabts;
extern int ql2xmvasynctoatio;
extern int ql2xuctrlirq;
extern int ql2xnvmeenable;

extern int qla2x00_loop_reset(scsi_qla_host_t *);
extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
+8 −0
Original line number Diff line number Diff line
@@ -4520,6 +4520,11 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
	fcport->deleted = 0;
	fcport->logout_on_delete = 1;

	if (fcport->fc4f_nvme) {
		qla_nvme_register_remote(vha, fcport);
		return;
	}

	qla2x00_set_fcport_state(fcport, FCS_ONLINE);
	qla2x00_iidma_fcport(vha, fcport);
	qla24xx_update_fcport_fcp_prio(vha, fcport);
@@ -4669,6 +4674,9 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
			break;
	} while (0);

	if (!vha->nvme_local_port && vha->flags.nvme_enabled)
		qla_nvme_register_hba(vha);

	if (rval)
		ql_dbg(ql_dbg_disc, vha, 0x2068,
		    "Configure fabric error exit rval=%d.\n", rval);
Loading