Commit 875386b9 authored by Manish Rangankar's avatar Manish Rangankar Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: Add Unsolicited LS Request and Response Support for NVMe



Introduce infrastructure in the driver to support the processing of
unsolicited LS (Link Service) requests. This will involve the utilization
of a new pass-up of unsolicited FC-NVMe request IOCB interface. Unsolicited
requests will be submitted to the NVMe transport layer through
nvme_fc_rcv_ls_req(). Any received LS responses, which are sent using
xmt_ls_rsp(), will be forwarded to the firmware through the existing
Pass-Through IOCB interface, responsible for sending FC-NVMe Link Service
requests and responses.

Signed-off-by: default avatarManish Rangankar <mrangankar@marvell.com>
Signed-off-by: default avatarNilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20230821130045.34850-2-njavali@marvell.com


Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ae25f65a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -12,9 +12,8 @@
 * ----------------------------------------------------------------------
 * | Module Init and Probe        |       0x0199       |                |
 * | Mailbox commands             |       0x1206       | 0x11a5-0x11ff	|
 * | Device Discovery             |       0x2134       | 0x210e-0x2115  |
 * |                              |                    | 0x211c-0x2128  |
 * |                              |                    | 0x212c-0x2134  |
 * | Device Discovery             |       0x2134       | 0x2112-0x2115  |
 * |                              |                    | 0x2127-0x2128  |
 * | Queue Command and IO tracing |       0x3074       | 0x300b         |
 * |                              |                    | 0x3027-0x3028  |
 * |                              |                    | 0x303d-0x3041  |
+1 −0
Original line number Diff line number Diff line
@@ -368,6 +368,7 @@ ql_log_qp(uint32_t, struct qla_qpair *, int32_t, const char *fmt, ...);
#define ql_dbg_tgt_tmr	0x00001000 /* Target mode task management */
#define ql_dbg_tgt_dif  0x00000800 /* Target mode dif */
#define ql_dbg_edif	0x00000400 /* edif and purex debug */
#define ql_dbg_unsol	0x00000100 /* Unsolicited path debug */

extern int qla27xx_dump_mpi_ram(struct qla_hw_data *, uint32_t, uint32_t *,
	uint32_t, void **);
+32 −2
Original line number Diff line number Diff line
@@ -346,6 +346,12 @@ struct name_list_extended {
	u8			sent;
};

struct qla_nvme_fc_rjt {
	struct fcnvme_ls_rjt *c;
	dma_addr_t  cdma;
	u16 size;
};

struct els_reject {
	struct fc_els_ls_rjt *c;
	dma_addr_t  cdma;
@@ -503,6 +509,20 @@ struct ct_arg {
	port_id_t	id;
};

struct qla_nvme_lsrjt_pt_arg {
	struct fc_port *fcport;
	u8 opcode;
	u8 vp_idx;
	u8 reason;
	u8 explanation;
	__le16 nport_handle;
	u16 control_flags;
	__le16 ox_id;
	__le32 xchg_address;
	u32 tx_byte_count, rx_byte_count;
	dma_addr_t tx_addr, rx_addr;
};

/*
 * SRB extensions.
 */
@@ -611,13 +631,16 @@ struct srb_iocb {
			void *desc;

			/* These are only used with ls4 requests */
			int cmd_len;
			int rsp_len;
			__le32 cmd_len;
			__le32 rsp_len;
			dma_addr_t cmd_dma;
			dma_addr_t rsp_dma;
			enum nvmefc_fcp_datadir dir;
			uint32_t dl;
			uint32_t timeout_sec;
			__le32 exchange_address;
			__le16 nport_handle;
			__le16 ox_id;
			struct	list_head   entry;
		} nvme;
		struct {
@@ -707,6 +730,10 @@ typedef struct srb {
	struct fc_port *fcport;
	struct scsi_qla_host *vha;
	unsigned int start_timer:1;
	unsigned int abort:1;
	unsigned int aborted:1;
	unsigned int completed:1;
	unsigned int unsol_rsp:1;

	uint32_t handle;
	uint16_t flags;
@@ -2542,6 +2569,7 @@ enum rscn_addr_format {
typedef struct fc_port {
	struct list_head list;
	struct scsi_qla_host *vha;
	struct list_head unsol_ctx_head;

	unsigned int conf_compl_supported:1;
	unsigned int deleted:2;
@@ -4802,6 +4830,7 @@ struct qla_hw_data {
	struct els_reject elsrej;
	u8 edif_post_stop_cnt_down;
	struct qla_vp_map *vp_map;
	struct qla_nvme_fc_rjt lsrjt;
};

#define RX_ELS_SIZE (roundup(sizeof(struct enode) + ELS_MAX_PAYLOAD, SMP_CACHE_BYTES))
@@ -4834,6 +4863,7 @@ struct active_regions {
 * is variable) starting at "iocb".
 */
struct purex_item {
	void *purls_context;
	struct list_head list;
	struct scsi_qla_host *vha;
	void (*process_item)(struct scsi_qla_host *vha,
+10 −4
Original line number Diff line number Diff line
@@ -611,7 +611,11 @@ qla2xxx_msix_rsp_q_hs(int irq, void *dev_id);
fc_port_t *qla2x00_find_fcport_by_loopid(scsi_qla_host_t *, uint16_t);
fc_port_t *qla2x00_find_fcport_by_wwpn(scsi_qla_host_t *, u8 *, u8);
fc_port_t *qla2x00_find_fcport_by_nportid(scsi_qla_host_t *, port_id_t *, u8);
void __qla_consume_iocb(struct scsi_qla_host *vha, void **pkt, struct rsp_que **rsp);
void qla24xx_queue_purex_item(scsi_qla_host_t *, struct purex_item *,
			      void (*process_item)(struct scsi_qla_host *,
			      struct purex_item *));
void __qla_consume_iocb(struct scsi_qla_host *, void **, struct rsp_que **);
void qla2xxx_process_purls_iocb(void **pkt, struct rsp_que **rsp);

/*
 * Global Function Prototypes in qla_sup.c source file.
@@ -674,9 +678,11 @@ extern int qla2xxx_get_vpd_field(scsi_qla_host_t *, char *, char *, size_t);
extern void qla2xxx_flash_npiv_conf(scsi_qla_host_t *);
extern int qla24xx_read_fcp_prio_cfg(scsi_qla_host_t *);
extern int qla2x00_mailbox_passthru(struct bsg_job *bsg_job);
int __qla_copy_purex_to_buffer(struct scsi_qla_host *vha, void **pkt,
	struct rsp_que **rsp, u8 *buf, u32 buf_len);

int qla2x00_sys_ld_info(struct bsg_job *bsg_job);
int __qla_copy_purex_to_buffer(struct scsi_qla_host *, void **,
	struct rsp_que **, u8 *, u32);
struct purex_item *qla27xx_copy_multiple_pkt(struct scsi_qla_host *vha,
	void **pkt, struct rsp_que **rsp, bool is_purls, bool byte_order);
int qla_mailbox_passthru(scsi_qla_host_t *vha, uint16_t *mbx_in,
			 uint16_t *mbx_out);

+1 −0
Original line number Diff line number Diff line
@@ -5554,6 +5554,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags)
	INIT_WORK(&fcport->reg_work, qla_register_fcport_fn);
	INIT_LIST_HEAD(&fcport->gnl_entry);
	INIT_LIST_HEAD(&fcport->list);
	INIT_LIST_HEAD(&fcport->unsol_ctx_head);

	INIT_LIST_HEAD(&fcport->sess_cmd_list);
	spin_lock_init(&fcport->sess_cmd_lock);
Loading