scsi: qla2xxx: Add switch command to simplify fabric discovery
- add "async" gpn_ft, gnn_ft, gfpn_id, gnn_id switch commands. - For 8G and newer adapters, use async commands when it comes to fabric scan to reduce bottle neck. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
1429f0446a
commit
a4239945b8
@@ -2270,11 +2270,13 @@ struct ct_sns_desc {
|
||||
|
||||
enum discovery_state {
|
||||
DSC_DELETED,
|
||||
DSC_GNN_ID,
|
||||
DSC_GID_PN,
|
||||
DSC_GNL,
|
||||
DSC_LOGIN_PEND,
|
||||
DSC_LOGIN_FAILED,
|
||||
DSC_GPDB,
|
||||
DSC_GFPN_ID,
|
||||
DSC_GPSC,
|
||||
DSC_UPD_FCPORT,
|
||||
DSC_LOGIN_COMPLETE,
|
||||
@@ -2304,8 +2306,9 @@ enum fcport_mgt_event {
|
||||
FCME_GPDB_DONE,
|
||||
FCME_GPNID_DONE,
|
||||
FCME_GFFID_DONE,
|
||||
FCME_DELETE_DONE,
|
||||
FCME_ADISC_DONE,
|
||||
FCME_GNNID_DONE,
|
||||
FCME_GFPNID_DONE,
|
||||
};
|
||||
|
||||
enum rscn_addr_format {
|
||||
@@ -2338,6 +2341,7 @@ typedef struct fc_port {
|
||||
unsigned int login_pause:1;
|
||||
unsigned int login_succ:1;
|
||||
unsigned int query:1;
|
||||
unsigned int id_changed:1;
|
||||
|
||||
struct work_struct nvme_del_work;
|
||||
struct completion nvme_del_done;
|
||||
@@ -2485,6 +2489,11 @@ static const char * const port_state_str[] = {
|
||||
#define GA_NXT_REQ_SIZE (16 + 4)
|
||||
#define GA_NXT_RSP_SIZE (16 + 620)
|
||||
|
||||
#define GPN_FT_CMD 0x172
|
||||
#define GPN_FT_REQ_SIZE (16 + 4)
|
||||
#define GNN_FT_CMD 0x173
|
||||
#define GNN_FT_REQ_SIZE (16 + 4)
|
||||
|
||||
#define GID_PT_CMD 0x1A1
|
||||
#define GID_PT_REQ_SIZE (16 + 4)
|
||||
|
||||
@@ -2739,6 +2748,13 @@ struct ct_sns_req {
|
||||
uint8_t port_id[3];
|
||||
} port_id;
|
||||
|
||||
struct {
|
||||
uint8_t reserved;
|
||||
uint8_t domain;
|
||||
uint8_t area;
|
||||
uint8_t port_type;
|
||||
} gpn_ft;
|
||||
|
||||
struct {
|
||||
uint8_t port_type;
|
||||
uint8_t domain;
|
||||
@@ -2852,6 +2868,27 @@ struct ct_sns_gid_pt_data {
|
||||
uint8_t port_id[3];
|
||||
};
|
||||
|
||||
/* It's the same for both GPN_FT and GNN_FT */
|
||||
struct ct_sns_gpnft_rsp {
|
||||
struct {
|
||||
struct ct_cmd_hdr header;
|
||||
uint16_t response;
|
||||
uint16_t residual;
|
||||
uint8_t fragment_id;
|
||||
uint8_t reason_code;
|
||||
uint8_t explanation_code;
|
||||
uint8_t vendor_unique;
|
||||
};
|
||||
/* Assume the largest number of targets for the union */
|
||||
struct ct_sns_gpn_ft_data {
|
||||
u8 control_byte;
|
||||
u8 port_id[3];
|
||||
u32 reserved;
|
||||
u8 port_name[8];
|
||||
} entries[1];
|
||||
};
|
||||
|
||||
/* CT command response */
|
||||
struct ct_sns_rsp {
|
||||
struct ct_rsp_hdr header;
|
||||
|
||||
@@ -2927,6 +2964,24 @@ struct ct_sns_pkt {
|
||||
} p;
|
||||
};
|
||||
|
||||
struct ct_sns_gpnft_pkt {
|
||||
union {
|
||||
struct ct_sns_req req;
|
||||
struct ct_sns_gpnft_rsp rsp;
|
||||
} p;
|
||||
};
|
||||
|
||||
struct fab_scan_rp {
|
||||
port_id_t id;
|
||||
u8 port_name[8];
|
||||
u8 node_name[8];
|
||||
};
|
||||
|
||||
struct fab_scan {
|
||||
struct fab_scan_rp *l;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
/*
|
||||
* SNS command structures -- for 2200 compatibility.
|
||||
*/
|
||||
@@ -3143,6 +3198,11 @@ enum qla_work_type {
|
||||
QLA_EVT_RELOGIN,
|
||||
QLA_EVT_ASYNC_PRLO,
|
||||
QLA_EVT_ASYNC_PRLO_DONE,
|
||||
QLA_EVT_GPNFT,
|
||||
QLA_EVT_GPNFT_DONE,
|
||||
QLA_EVT_GNNFT_DONE,
|
||||
QLA_EVT_GNNID,
|
||||
QLA_EVT_GFPNID,
|
||||
};
|
||||
|
||||
|
||||
@@ -3184,7 +3244,9 @@ struct qla_work_evt {
|
||||
struct {
|
||||
port_id_t id;
|
||||
u8 port_name[8];
|
||||
u8 node_name[8];
|
||||
void *pla;
|
||||
u8 fc4_type;
|
||||
} new_sess;
|
||||
struct { /*Get PDB, Get Speed, update fcport, gnl, gidpn */
|
||||
fc_port_t *fcport;
|
||||
@@ -3195,6 +3257,9 @@ struct qla_work_evt {
|
||||
u8 iocb[IOCB_SIZE];
|
||||
int type;
|
||||
} nack;
|
||||
struct {
|
||||
u8 fc4_type;
|
||||
} gpnft;
|
||||
} u;
|
||||
};
|
||||
|
||||
@@ -3729,6 +3794,8 @@ struct qla_hw_data {
|
||||
(IS_QLA81XX(ha) || IS_QLA83XX(ha) || IS_QLA27XX(ha))
|
||||
#define IS_EXLOGIN_OFFLD_CAPABLE(ha) \
|
||||
(IS_QLA25XX(ha) || IS_QLA81XX(ha) || IS_QLA83XX(ha) || IS_QLA27XX(ha))
|
||||
#define USE_ASYNC_SCAN(ha) (IS_QLA25XX(ha) || IS_QLA81XX(ha) ||\
|
||||
IS_QLA83XX(ha) || IS_QLA27XX(ha))
|
||||
|
||||
/* HBA serial number */
|
||||
uint8_t serial0;
|
||||
@@ -3811,7 +3878,7 @@ struct qla_hw_data {
|
||||
int exchoffld_size;
|
||||
int exchoffld_count;
|
||||
|
||||
void *swl;
|
||||
void *swl;
|
||||
|
||||
/* These are used by mailbox operations. */
|
||||
uint16_t mailbox_out[MAILBOX_REGISTER_COUNT];
|
||||
@@ -4271,6 +4338,7 @@ typedef struct scsi_qla_host {
|
||||
uint8_t n2n_port_name[WWN_SIZE];
|
||||
uint16_t n2n_id;
|
||||
struct list_head gpnid_list;
|
||||
struct fab_scan scan;
|
||||
} scsi_qla_host_t;
|
||||
|
||||
struct qla27xx_image_status {
|
||||
|
||||
Reference in New Issue
Block a user