qla2xxx driver bug fixes
Subsystems (2)
Nilesh Javali
maintainercover qla2xxx driver bug fixes
Martin,
Please apply the qla2xxx driver bug fixes to the scsi tree at your earliest convenience.
Thanks,
Nilesh
Arun Easi (2):
qla2xxx: Fix hang during NVME session tear down
qla2xxx: Fix hang on NVME command timeouts
Nilesh Javali (1):
qla2xxx: Update version to 10.02.06.200-k
Quinn Tran (8):
qla2xxx: edif: Fix stale session
qla2xxx: edif: reject AUTH ELS on session down
qla2xxx: edif: fix edif enable flag
qla2xxx: edif: add N2N support for EDIF
qla2xxx: edif: do secure plogi when auth app is present
qla2xxx: fix NVME | FCP personality change
qla2xxx: fix NVME retry
qla2xxx: fix NVME session down detection
kernel test robot (1):
qla2xxx: edif: fix returnvar.cocci warnings
drivers/scsi/qla2xxx/qla_attr.c | 12 ++- drivers/scsi/qla2xxx/qla_def.h | 19 +++- drivers/scsi/qla2xxx/qla_edif.c | 110 +++++++++++++++------ drivers/scsi/qla2xxx/qla_edif.h | 8 ++ drivers/scsi/qla2xxx/qla_fw.h | 1 + drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_gs.c | 9 ++ drivers/scsi/qla2xxx/qla_init.c | 152 +++++++++++++++++------------ drivers/scsi/qla2xxx/qla_inline.h | 16 +++ drivers/scsi/qla2xxx/qla_iocb.c | 19 +++- drivers/scsi/qla2xxx/qla_isr.c | 10 ++ drivers/scsi/qla2xxx/qla_mbx.c | 32 +++++- drivers/scsi/qla2xxx/qla_nvme.c | 28 ++++-- drivers/scsi/qla2xxx/qla_os.c | 12 ++- drivers/scsi/qla2xxx/qla_target.c | 55 ++++++++++- drivers/scsi/qla2xxx/qla_version.h | 4 +- 16 files changed, 363 insertions(+), 125 deletions(-)
base-commit: 92cc94adfce4683d0b421cbf59013703368aaeb9
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 1/12 qla2xxx: edif: Fix stale session
From: Quinn Tran <[email protected]>
FW indicates session has been torn down via UPDATE SA IOCB or ELS Passthrough IOCB, driver need to also tear down the session.
--- drivers/scsi/qla2xxx/qla_edif.c | 8 ++++++++ drivers/scsi/qla2xxx/qla_edif.h | 2 ++ drivers/scsi/qla2xxx/qla_isr.c | 1 + 3 files changed, 11 insertions(+)
drivers/scsi/qla2xxx/qla_edif.c +8 -0
@@ -2674,6 +2674,14 @@ qla28xx_sa_update_iocb_entry(scsi_qla_host_t *v, struct req_que *req, __func__, pkt->sa_index, nport_handle);qla_edif_sadb_delete_sa_index (sp->fcport, nport_handle,le16_to_cpu (pkt->sa_index)); +switch (le16_to_cpu (pkt->u.comp_sts)) { +case CS_PORT_EDIF_UNAVAIL : +case CS_PORT_EDIF_LOGOUT : +qlt_schedule_sess_for_deletion (sp->fcport); +break ; +default : +break ; + } } sp->done (sp,0 );
drivers/scsi/qla2xxx/qla_edif.h +2 -0
@@ -63,6 +63,8 @@ struct sa_update_28xx {union {__le16 nport_handle;/* in: N_PORT handle. */ __le16 comp_sts;/* out: completion status */ +#define CS_PORT_EDIF_UNAVAIL 0x28 +#define CS_PORT_EDIF_LOGOUT 0x29#define CS_PORT_EDIF_SUPP_NOT_RDY 0x64#define CS_PORT_EDIF_INV_REQ 0x66 } u;
drivers/scsi/qla2xxx/qla_isr.c +1 -0
@@ -2235,6 +2235,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *v, struct req_que *req, }else if (comp_status ==CS_PORT_LOGGED_OUT ) { els->u.els_plogi.len =0 ; res =DID_IMM_RETRY <<16 ; +qlt_schedule_sess_for_deletion (sp->fcport); }else { els->u.els_plogi.len =0 ; res =DID_ERROR <<16 ;
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 2/12 qla2xxx: edif: reject AUTH ELS on session down
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
Reject inflight AUTH ELS if driver is going through session recovery.
--- drivers/scsi/qla2xxx/qla_edif.c | 2 +- drivers/scsi/qla2xxx/qla_edif.h | 6 ++++++ drivers/scsi/qla2xxx/qla_os.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_edif.c +1 -1
@@ -2376,7 +2376,7 @@ void qla24xx_auth_els(scsi_qla_host_t *vha, void **pkt, struct rsp_que **rsp) fcport =qla2x00_find_fcport_by_pid (host, &purex->pur_info.pur_sid);if (host->e_dbell.db_flags !=EDB_ACTIVE || - (fcport && fcport->loop_id ==FC_NO_LOOP_ID )) { + (fcport &&EDIF_SESSION_DOWN (fcport))) {ql_dbg (ql_dbg_edif, host,0x0910c ,"%s e_dbell.db_flags =%x %06x\n" , __func__, host->e_dbell.db_flags, fcport ? fcport->d_id.b24 :0 );
drivers/scsi/qla2xxx/qla_edif.h +6 -0
@@ -127,4 +127,10 @@ struct enode { struct purexevent purexinfo; } u; }; + +#define EDIF_SESSION_DOWN (_s) \ + (_s->disc_state == DSC_DELETE_PEND || \ + _s->disc_state == DSC_DELETED || \ + !_s->edif.app_sess_online) +#endif /* __QLA_EDIF_H */
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -4345,7 +4345,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, goto fail_elsrej; } ha->elsrej.c->er_cmd =ELS_LS_RJT ; - ha->elsrej.c->er_reason =ELS_RJT_BUSY ; + ha->elsrej.c->er_reason =ELS_RJT_LOGIC ; ha->elsrej.c->er_explan =ELS_EXPL_UNAB_DATA ;return 0 ;
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 3/12 qla2xxx: edif: fix edif enable flag
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
edif_enabled is prematurely turned on if HW supports it. FW too needs to support EDIF before enabling the bit.
--- drivers/scsi/qla2xxx/qla_def.h | 2 ++ drivers/scsi/qla2xxx/qla_mbx.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +2 -0
@@ -4021,6 +4021,7 @@ struct qla_hw_data { uint32_t scm_supported_f:1;/* Enabled in Driver */ uint32_t scm_enabled:1; + uint32_t edif_hw:1; uint32_t edif_enabled:1; uint32_t plogi_template_valid:1; uint32_t port_isolated:1;
@@ -4433,6 +4434,7 @@ struct qla_hw_data {/* Cisco fabric attached */ #define FW_ATTR_EXT0_SCM_CISCO 0x00002000#define FW_ATTR_EXT0_NVME2 BIT_13 +#define FW_ATTR_EXT0_EDIF BIT_5uint16_t fw_attributes_ext[2 ];uint32_t fw_memory_size;uint32_t fw_transfer_size;
drivers/scsi/qla2xxx/qla_mbx.c +11 -3
@@ -663,6 +663,7 @@ qla2x00_load_ram(scsi_qla_host_t *vha, dma_addr_t req_dma, uint32_t risc_addr, }#define NVME_ENABLE_FLAG BIT_3 +#define EDIF_HW_SUPPORT BIT_10/* * qla2x00_execute_fw
@@ -795,10 +796,10 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr) } } -if (IS_QLA28XX (ha) && (mcp->mb[5 ] &BIT_10 ) && ql2xsecenable) { - ha->flags.edif_enabled =1 ; +if (IS_QLA28XX (ha) && (mcp->mb[5 ] &EDIF_HW_SUPPORT )) { + ha->flags.edif_hw =1 ;ql_log (ql_log_info, vha,0xffff , -"%s: edif is enabled\n" , __func__); +"%s: edif HW\n" , __func__); } done:
@@ -1136,6 +1137,13 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha) ha->fw_attributes_ext[0]); vha->flags.nvme2_enabled =1 ; } + +if (IS_QLA28XX (ha) && ha->flags.edif_hw && ql2xsecenable && + (ha->fw_attributes_ext[0 ] &FW_ATTR_EXT0_EDIF )) { + ha->flags.edif_enabled =1 ; +ql_log (ql_log_info + ql_dbg_edif, vha,0xffff , +"%s: edif is enabled\n" , __func__); + } }if (IS_QLA27XX (ha) ||IS_QLA28XX (ha)) {
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 4/12 qla2xxx: Fix hang during NVME session tear down
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
The following hung task call trace was seen:
[ 1230.183294] INFO: task qla2xxx_wq:523 blocked for more than 120 seconds.
[ 1230.197749] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1230.205585] qla2xxx_wq D 0 523 2 0x80004000
[ 1230.205636] Workqueue: qla2xxx_wq qlt_free_session_done [qla2xxx]
[ 1230.205639] Call Trace:
[ 1230.208100] __schedule+0x2c4/0x700
[ 1230.211607] schedule+0x38/0xa0
[ 1230.214769] schedule_timeout+0x246/0x2f0
[ 1230.222651] wait_for_completion+0x97/0x100
[ 1230.226921] qlt_free_session_done+0x6a0/0x6f0 [qla2xxx]
[ 1230.232254] process_one_work+0x1a7/0x360..when device side port resets were done.
Abort threads were getting out without processing due to the "deleted" flag check. The delete thread, meanwhile, could not proceed with a logout (that would have cleared out pending requests) as the logout iocb work was not progressing. It appears like the hung qlt_free_session_done() thread is causing the ha->wq works on hold. The qlt_free_session_done() was hung waiting for nvme_fc_unregister_remoteport() + localport_delete cb to be complete, which would only happen when all IOs are released.
Fix this by allowing abort to progress until device delete is completely done. This should make the qlt_free_session_done proceed without hang and thus clear up the deadlock.
--- drivers/scsi/qla2xxx/qla_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_nvme.c +1 -1
@@ -233,7 +233,7 @@ static void qla_nvme_abort_work(struct work_struct *work)"%s called for sp=%p, hndl=%x on fcport=%p deleted=%d\n" , __func__, sp, sp->handle, fcport, fcport->deleted); -if (!ha->flags.fw_started || fcport->deleted) +if (!ha->flags.fw_started || fcport->deleted ==QLA_SESS_DELETED ) goto out;if (ha->flags.host_shutting_down) {
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 5/12 qla2xxx: edif: add N2N support for EDIF
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
Please bring up your FW to latest (9.8.+) for EDIF + N2N to work. Driver will pause after PLOGI to allow app to authenticate. Once authentication completes, app will tell driver to do PRLI.
--- drivers/scsi/qla2xxx/qla_def.h | 3 + drivers/scsi/qla2xxx/qla_edif.c | 95 ++++++++++++++++++++------- drivers/scsi/qla2xxx/qla_edif.h | 4 +- drivers/scsi/qla2xxx/qla_fw.h | 1 + drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 105 ++++++++++++++++++++---------- drivers/scsi/qla2xxx/qla_inline.h | 16 +++++ drivers/scsi/qla2xxx/qla_iocb.c | 14 +++- drivers/scsi/qla2xxx/qla_mbx.c | 3 +- drivers/scsi/qla2xxx/qla_os.c | 5 +- drivers/scsi/qla2xxx/qla_target.c | 53 ++++++++++++++- 11 files changed, 234 insertions(+), 66 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +3 -0
@@ -2633,6 +2633,7 @@ typedef struct fc_port {uint64_t rx_bytes;uint8_t non_secured_login;uint8_t auth_state; + uint16_t authok:1;uint16_t rekey_cnt;struct list_head edif_indx_list;spinlock_t indx_list_lock;
@@ -4023,6 +4024,7 @@ struct qla_hw_data { uint32_t scm_enabled:1; uint32_t edif_hw:1; uint32_t edif_enabled:1; + uint32_t n2n_fw_acc_sec:1; uint32_t plogi_template_valid:1; uint32_t port_isolated:1; } flags;
@@ -4720,6 +4722,7 @@ struct qla_hw_data {struct list_head sadb_rx_index_list;spinlock_t sadb_lock;/* protects list */ struct els_reject elsrej; +u8 edif_post_stop_cnt_down; };#define RX_ELS_SIZE (roundup(sizeof(struct enode) + ELS_MAX_PAYLOAD, SMP_CACHE_BYTES))
drivers/scsi/qla2xxx/qla_edif.c +70 -25
121 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_edif.h +2 -2
@@ -129,8 +129,8 @@ struct enode { };#define EDIF_SESSION_DOWN (_s) \ - (_s->disc_state == DSC_DELETE_PEND || \ + (qla_ini_mode_enabled(_s->vha) && (_s->disc_state == DSC_DELETE_PEND || \ _s->disc_state == DSC_DELETED || \ - !_s->edif.app_sess_online) + !_s->edif.app_sess_online))#endif /* __QLA_EDIF_H */
drivers/scsi/qla2xxx/qla_fw.h +1 -0
@@ -810,6 +810,7 @@ struct els_entry_24xx {#define EPD_RX_XCHG (3 << 13)#define ECF_CLR_PASSTHRU_PEND BIT_12#define ECF_INCL_FRAME_HDR BIT_11 +#define ECF_SEC_LOGIN BIT_3 union { struct {
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
@@ -990,6 +990,7 @@ void qla_enode_init(scsi_qla_host_t *vha);void qla_enode_stop (scsi_qla_host_t *vha);void qla_edif_flush_sa_ctl_lists (fc_port_t *fcport);void qla_edb_init (scsi_qla_host_t *vha); +void qla_edif_timer (scsi_qla_host_t *vha);int qla28xx_start_scsi_edif (srb_t *sp);void qla24xx_sa_update_iocb (srb_t *sp,struct sa_update_28xx *sa_update_iocb);void qla24xx_sa_replace_iocb (srb_t *sp,struct sa_update_28xx *sa_update_iocb);
drivers/scsi/qla2xxx/qla_init.c +71 -34
244 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_inline.h +16 -0
@@ -478,3 +478,19 @@ bool qla_pci_disconnected(struct scsi_qla_host *vha, }return ret; } + +static inline bool +fcport_is_smaller (fc_port_t *fcport) +{ +if (wwn_to_u64 (fcport->port_name) < +wwn_to_u64 (fcport->vha->port_name)) +return true; +else +return false; +} + +static inline bool +fcport_is_bigger (fc_port_t *fcport) +{ +return !fcport_is_smaller (fcport); +}
drivers/scsi/qla2xxx/qla_iocb.c +12 -2
@@ -2745,7 +2745,10 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) els_iocb->s_id[0 ] = vha->d_id.b.domain;if (elsio->u.els_logo.els_cmd ==ELS_DCMD_PLOGI ) { - els_iocb->control_flags =0 ; +if (vha->hw->flags.edif_enabled) + els_iocb->control_flags =cpu_to_le16 (ECF_SEC_LOGIN ); +else + els_iocb->control_flags =0 ; els_iocb->tx_byte_count = els_iocb->tx_len =cpu_to_le32 (sizeof (struct els_plogi_payload )); put_unaligned_le64(elsio->u.els_plogi.els_plogi_pyld_dma,
@@ -2985,7 +2988,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,qla2x00_set_fcport_disc_state (fcport,DSC_LOGIN_PEND ); elsio = &sp->u.iocb_cmd;ql_dbg (ql_dbg_io, vha,0x3073 , -"Enter: PLOGI portid=%06x\n" , fcport->d_id.b24); +"%s Enter: PLOGI portid=%06x\n" , __func__, fcport->d_id.b24); sp->type =SRB_ELS_DCMD ; sp->name ="ELS_DCMD" ;
@@ -3028,6 +3031,13 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, elsio->u.els_plogi.els_cmd = els_opcode; elsio->u.els_plogi.els_plogi_pyld->opcode = els_opcode; +if (els_opcode ==ELS_DCMD_PLOGI && vha->hw->flags.edif_enabled && + vha->e_dbell.db_flags &EDB_ACTIVE ) { +struct fc_els_flogi *p = ptr; + + p->fl_csp.sp_features |=cpu_to_be16 (FC_SP_FT_SEC ); + } +ql_dbg (ql_dbg_disc + ql_dbg_buffer, vha,0x3073 ,"PLOGI buffer:\n" ); ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0x0109, (uint8_t *)elsio->u.els_plogi.els_plogi_pyld,
drivers/scsi/qla2xxx/qla_mbx.c +2 -1
@@ -1141,7 +1141,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha)if (IS_QLA28XX (ha) && ha->flags.edif_hw && ql2xsecenable && (ha->fw_attributes_ext[0 ] &FW_ATTR_EXT0_EDIF )) { ha->flags.edif_enabled =1 ; -ql_log (ql_log_info + ql_dbg_edif, vha,0xffff , +ql_log (ql_log_info, vha,0xffff ,"%s: edif is enabled\n" , __func__); } }
@@ -4049,6 +4049,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, fcport->scan_state =QLA_FCPORT_FOUND ; fcport->n2n_flag =1 ; fcport->keep_nport_handle =1 ; + fcport->login_retry = vha->hw->login_retry_count;if (wwn_to_u64 (vha->port_name) >wwn_to_u64 (fcport->port_name)) {
drivers/scsi/qla2xxx/qla_os.c +4 -1
@@ -3964,7 +3964,6 @@ void qla2x00_mark_device_lost(scsi_qla_host_t *vha, fc_port_t *fcport,qla2x00_schedule_rport_del (vha, fcport); } -qla_edif_sess_down (vha, fcport);/* * We may need to retry the login, so don't change the state of the * port but do the retries.
@@ -7343,6 +7342,10 @@ qla2x00_timer(struct timer_list *t) } } +/* check if edif running */ +if (vha->hw->flags.edif_enabled) +qla_edif_timer (vha); +/* Process any deferred work. */ if (!list_empty (&vha->work_list)) {unsigned long flags;
drivers/scsi/qla2xxx/qla_target.c +52 -1
113 lines not on this page · raw message
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 6/12 qla2xxx: edif: do secure plogi when auth app is present
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
For initiator mode, always do secure login when authentication app started. Also remove redundant flags to indicate secure connection.
--- drivers/scsi/qla2xxx/qla_def.h | 2 -- drivers/scsi/qla2xxx/qla_edif.c | 6 +++--- drivers/scsi/qla2xxx/qla_init.c | 7 ++----- drivers/scsi/qla2xxx/qla_iocb.c | 5 ++++- drivers/scsi/qla2xxx/qla_target.c | 4 +--- 5 files changed, 10 insertions(+), 14 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +0 -2
@@ -2620,7 +2620,6 @@ typedef struct fc_port { uint32_t enable:1; /* device is edif enabled/req'd */ uint32_t app_stop:2; uint32_t app_started:1; - uint32_t secured_login:1; uint32_t aes_gmac:1; uint32_t app_sess_online:1; uint32_t tx_sa_set:1;
@@ -2631,7 +2630,6 @@ typedef struct fc_port {uint32_t rx_rekey_cnt;uint64_t tx_bytes;uint64_t rx_bytes; -uint8_t non_secured_login;uint8_t auth_state; uint16_t authok:1;uint16_t rekey_cnt;
drivers/scsi/qla2xxx/qla_edif.c +3 -3
@@ -568,7 +568,7 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)if (atomic_read (&vha->loop_state) ==LOOP_DOWN )break ; -if (!fcport->edif.secured_login) +if (!(fcport->flags &FCF_FCSP_DEVICE ))continue ; fcport->edif.app_started =1 ;
@@ -647,7 +647,7 @@ qla_edif_app_stop(scsi_qla_host_t *vha, struct bsg_job *bsg_job)qla_edb_stop (vha);/* stop db */ list_for_each_entry_safe (fcport, tf, &vha->vp_fcports, list) { -if (fcport->edif.non_secured_login) +if (!(fcport->flags &FCF_FCSP_DEVICE ))continue ;if (fcport->flags &FCF_FCSP_DEVICE ) {
@@ -948,7 +948,7 @@ qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)ql_dbg (ql_dbg_edif, vha,0x2058 ,"Found FC_SP fcport - nn %8phN pn %8phN pcnt %d portid=%06x secure %d.\n" , fcport->node_name, fcport->port_name, pcnt, - fcport->d_id.b24, fcport->edif.secured_login); + fcport->d_id.b24, fcport->flags &FCF_FCSP_DEVICE );switch (fcport->edif.auth_state) {case VND_CMD_AUTH_STATE_ELS_RCVD :
drivers/scsi/qla2xxx/qla_init.c +2 -5
@@ -1435,18 +1435,15 @@ static int qla_chk_secure_login(scsi_qla_host_t *vha, fc_port_t *fcport,ql_dbg (ql_dbg_disc, vha,0x104d ,"Secure Login established on %8phC\n" , fcport->port_name); - fcport->edif.secured_login =1 ; - fcport->edif.non_secured_login =0 ; fcport->flags |=FCF_FCSP_DEVICE ; }else {ql_dbg (ql_dbg_disc, vha,0x104d ,"non-Secure Login %8phC" , fcport->port_name); - fcport->edif.secured_login =0 ; - fcport->edif.non_secured_login =1 ; + fcport->flags &= ~FCF_FCSP_DEVICE ; }if (vha->hw->flags.edif_enabled) { -if (fcport->edif.secured_login) { +if (fcport->flags &FCF_FCSP_DEVICE ) {qla2x00_set_fcport_disc_state (fcport,DSC_LOGIN_AUTH_PEND );/* Start edif prli timer & ring doorbell for app */ fcport->edif.rx_sa_set =0 ;
drivers/scsi/qla2xxx/qla_iocb.c +4 -1
@@ -1552,6 +1552,9 @@ qla24xx_start_scsi(srb_t *sp)struct scsi_qla_host *vha = sp->vha;struct qla_hw_data *ha = vha->hw; +if (sp->fcport->edif.enable && (sp->fcport->flags &FCF_FCSP_DEVICE )) +return qla28xx_start_scsi_edif (sp); +/* Setup device pointers. */ req = vha->req; rsp = req->rsp;
@@ -1910,7 +1913,7 @@ qla2xxx_start_scsi_mq(srb_t *sp)struct qla_hw_data *ha = vha->hw;struct qla_qpair *qpair = sp->qpair; -if (sp->fcport->edif.enable) +if (sp->fcport->edif.enable && (sp->fcport->flags &FCF_FCSP_DEVICE ))return qla28xx_start_scsi_edif (sp);/* Acquire qpair specific lock */
drivers/scsi/qla2xxx/qla_target.c +1 -3
@@ -636,10 +636,8 @@ int qla24xx_async_notify_ack(scsi_qla_host_t *vha, fc_port_t *fcport, fcport->fw_login_state =DSC_LS_PLOGI_PEND ; c ="PLOGI" ;if (vha->hw->flags.edif_enabled && - (le16_to_cpu (ntfy->u.isp24.flags) &NOTIFY24XX_FLAGS_FCSP )) { + (le16_to_cpu (ntfy->u.isp24.flags) &NOTIFY24XX_FLAGS_FCSP )) fcport->flags |=FCF_FCSP_DEVICE ; - fcport->edif.secured_login =1 ; - }break ;case SRB_NACK_PRLI : fcport->fw_login_state =DSC_LS_PRLI_PEND ;
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 7/12 qla2xxx: fix NVME | FCP personality change
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
Currently driver saves the personality type (FCP|NVME) at the start of first discovery of the remote device. If the remote device personality do change over time, then qla driver needs to present that to user to decide.
--- drivers/scsi/qla2xxx/qla_gs.c | 1 + drivers/scsi/qla2xxx/qla_init.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_gs.c +1 -0
@@ -3502,6 +3502,7 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)continue ; fcport->scan_state =QLA_FCPORT_FOUND ; fcport->last_rscn_gen = fcport->rscn_gen; + fcport->fc4_type = rp->fc4type; found = true;/* * If device was not a fabric device before.
drivers/scsi/qla2xxx/qla_init.c +3 -2
@@ -1610,11 +1610,12 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)u16 sec;ql_dbg (ql_dbg_disc, vha,0x20d8 , -"%s %8phC DS %d LS %d P %d fl %x confl %p rscn %d|%d login %d lid %d scan %d\n" , +"%s %8phC DS %d LS %d P %d fl %x confl %p rscn %d|%d login %d lid %d scan %d fc4type %x\n" , __func__, fcport->port_name, fcport->disc_state, fcport->fw_login_state, fcport->login_pause, fcport->flags, fcport->conflict, fcport->last_rscn_gen, fcport->rscn_gen, - fcport->login_gen, fcport->loop_id, fcport->scan_state); + fcport->login_gen, fcport->loop_id, fcport->scan_state, + fcport->fc4_type);if (fcport->scan_state !=QLA_FCPORT_FOUND )return 0 ;
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 8/12 qla2xxx: Fix hang on NVME command timeouts
In reply to Nilesh JavaliFrom: Arun Easi <[email protected]>
The abort callback gets called only when it gets posted to firmware. The refcounting is done properly in the callback. On internal errors, the callback is not invoked leading to a hung IO. Fix this by having separate error code when command gets returned from firmware.
--- drivers/scsi/qla2xxx/qla_def.h | 3 +++ drivers/scsi/qla2xxx/qla_init.c | 6 +++--- drivers/scsi/qla2xxx/qla_mbx.c | 4 ++-- drivers/scsi/qla2xxx/qla_nvme.c | 26 +++++++++++++++++--------- 4 files changed, 25 insertions(+), 14 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +3 -0
@@ -5166,6 +5166,9 @@ struct secure_flash_update_block_pk {#define QLA_BUSY 0x107#define QLA_ALREADY_REGISTERED 0x109#define QLA_OS_TIMER_EXPIRED 0x10a +#define QLA_ERR_NO_QPAIR 0x10b +#define QLA_ERR_NOT_FOUND 0x10c +#define QLA_ERR_FROM_FW 0x10d#define NVRAM_DELAY () udelay(10)
drivers/scsi/qla2xxx/qla_init.c +3 -3
@@ -157,7 +157,7 @@ int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) sp =qla2xxx_get_qpair_sp (cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport,GFP_ATOMIC );if (!sp) -return rval; +return QLA_MEMORY_ALLOC_FAILED ; abt_iocb = &sp->u.iocb_cmd; sp->type =SRB_ABT_CMD ;
@@ -190,7 +190,7 @@ int qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait)if (wait) {wait_for_completion (&abt_iocb->u.abt.comp); rval = abt_iocb->u.abt.comp_status ==CS_COMPLETE ? -QLA_SUCCESS :QLA_FUNCTION_FAILED ; +QLA_SUCCESS :QLA_ERR_FROM_FW ; sp->free (sp); }
@@ -1988,7 +1988,7 @@ qla24xx_async_abort_command(srb_t *sp)if (handle == req->num_outstanding_cmds) {/* Command not found. */ -return QLA_FUNCTION_FAILED ; +return QLA_ERR_NOT_FOUND ; }if (sp->type ==SRB_FXIOCB_DCMD ) return qlafx00_fx_disc(vha, &vha->hw->mr.fcport,
drivers/scsi/qla2xxx/qla_mbx.c +2 -2
@@ -3245,7 +3245,7 @@ qla24xx_abort_command(srb_t *sp)if (sp->qpair) req = sp->qpair->req;else -return QLA_FUNCTION_FAILED ; +return QLA_ERR_NO_QPAIR ;if (ql2xasynctmfenable)return qla24xx_async_abort_command (sp);
@@ -3258,7 +3258,7 @@ qla24xx_abort_command(srb_t *sp)spin_unlock_irqrestore (qpair->qp_lock_ptr, flags);if (handle == req->num_outstanding_cmds) {/* Command not found. */ -return QLA_FUNCTION_FAILED ; +return QLA_ERR_NOT_FOUND ; } abt =dma_pool_zalloc (ha->s_dma_pool,GFP_KERNEL , &abt_dma);
drivers/scsi/qla2xxx/qla_nvme.c +17 -9
@@ -227,11 +227,11 @@ static void qla_nvme_abort_work(struct work_struct *work)srb_t *sp = priv->sp;fc_port_t *fcport = sp->fcport;struct qla_hw_data *ha = fcport->vha->hw; -int rval; +int rval, abts_done_called =1 ;ql_dbg (ql_dbg_io, fcport->vha,0xffff , -"%s called for sp=%p, hndl=%x on fcport=%p deleted=%d\n" , - __func__, sp, sp->handle, fcport, fcport->deleted); +"%s called for sp=%p, hndl=%x on fcport=%p desc=%p deleted=%d\n" , + __func__, sp, sp->handle, fcport, sp->u.iocb_cmd.u.nvme.desc, fcport->deleted);if (!ha->flags.fw_started || fcport->deleted ==QLA_SESS_DELETED ) goto out;
@@ -251,12 +251,20 @@ static void qla_nvme_abort_work(struct work_struct *work) __func__, (rval !=QLA_SUCCESS ) ?"Failed to abort" :"Aborted" , sp, sp->handle, fcport, rval); +/* +* If async tmf is enabled, the abort callback is called only on +* return codes QLA_SUCCESS and QLA_ERR_FROM_FW. +*/ +if (ql2xasynctmfenable && + rval !=QLA_SUCCESS && rval !=QLA_ERR_FROM_FW ) + abts_done_called =0 ; +/* * Returned before decreasing kref so that I/O requests * are waited until ABTS complete. This kref is decreased * at qla24xx_abort_sp_done function. */ -if (ql2xabts_wait_nvme &&QLA_ABTS_WAIT_ENABLED (sp)) +if (abts_done_called && ql2xabts_wait_nvme &&QLA_ABTS_WAIT_ENABLED (sp))return ; out:/* kref_get was done before work was schedule. */
@@ -804,14 +812,14 @@ void qla_nvme_abort_process_comp_status(struct abort_entry_24xx *abt, srb_t *oricase CS_PORT_LOGGED_OUT :/* BA_RJT was received for the ABTS */ case CS_PORT_CONFIG_CHG : -ql_dbg (ql_dbg_async + ql_dbg_mbx, vha,0xf09d , +ql_dbg (ql_dbg_async, vha,0xf09d ,"Abort I/O IOCB completed with error, comp_status=%x\n" , comp_status);break ;/* BA_RJT was received for the ABTS */ case CS_REJECT_RECEIVED : -ql_dbg (ql_dbg_async + ql_dbg_mbx, vha,0xf09e , +ql_dbg (ql_dbg_async, vha,0xf09e ,"BA_RJT was received for the ABTS rjt_vendorUnique = %u" , abt->fw.ba_rjt_vendorUnique); ql_dbg(ql_dbg_async + ql_dbg_mbx, vha, 0xf09e,
@@ -820,18 +828,18 @@ void qla_nvme_abort_process_comp_status(struct abort_entry_24xx *abt, srb_t *oribreak ;case CS_COMPLETE : -ql_dbg (ql_dbg_async + ql_dbg_mbx, vha,0xf09f , +ql_dbg (ql_dbg_async + ql_dbg_verbose, vha,0xf09f ,"IOCB request is completed successfully comp_status=%x\n" , comp_status);break ;case CS_IOCB_ERROR : -ql_dbg (ql_dbg_async + ql_dbg_mbx, vha,0xf0a0 , +ql_dbg (ql_dbg_async, vha,0xf0a0 ,"IOCB request is failed, comp_status=%x\n" , comp_status);break ;default : -ql_dbg (ql_dbg_async + ql_dbg_mbx, vha,0xf0a1 , +ql_dbg (ql_dbg_async, vha,0xf0a1 ,"Invalid Abort IO IOCB Completion Status %x\n" , comp_status);break ;
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 9/12 qla2xxx: fix NVME retry
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
For target port that register itself as both FCP + NVME, initiator driver will try to login one mode at a time. If the last mode did not succeed, then driver will try the other mode.
When error is encountered, current code only flip to other mode one time (NVME->FCP) and remain on the last mode. Driver wrongly assumed target port does not support PRLI NVME, instead it was not ready to receive PRLI.
This patch will alternate back and forth on every PRLI failure until login retry count has depleted or it is succeeded.
--- drivers/scsi/qla2xxx/qla_def.h | 9 ++++++-- drivers/scsi/qla2xxx/qla_gs.c | 8 +++++++ drivers/scsi/qla2xxx/qla_init.c | 41 ++++++++++++++------------------- drivers/scsi/qla2xxx/qla_mbx.c | 3 +++ drivers/scsi/qla2xxx/qla_os.c | 5 ++++ 5 files changed, 40 insertions(+), 26 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +7 -2
@@ -2517,6 +2517,8 @@ typedef struct fc_port { unsigned int n2n_flag:1; unsigned int explicit_logout:1; unsigned int prli_pend_timer:1; + unsigned int do_prli_nvme:1; +uint8_t nvme_flag;uint8_t node_name[WWN_SIZE ];
@@ -5351,9 +5353,12 @@ struct sff_8247_a0 {#define NVME_FCP_TARGET (fcport) \ (FCP_TYPE(fcport) && NVME_TYPE(fcport)) \ +#define NVME_PRIORITY (ha, fcport) \ + (NVME_FCP_TARGET(fcport) && \ + (ha->fc4_type_priority == FC4_PRIORITY_NVME)) +#define NVME_TARGET (ha, fcport) \ - ((NVME_FCP_TARGET(fcport) && \ - (ha->fc4_type_priority == FC4_PRIORITY_NVME)) || \ + (fcport->do_prli_nvme || \ NVME_ONLY_TARGET(fcport)) \#define PRLI_PHASE (_cls) \
drivers/scsi/qla2xxx/qla_gs.c +8 -0
@@ -3504,6 +3504,14 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) fcport->last_rscn_gen = fcport->rscn_gen; fcport->fc4_type = rp->fc4type; found = true; + +if (fcport->scan_needed) { +if (NVME_PRIORITY (vha->hw, fcport)) + fcport->do_prli_nvme =1 ; +else + fcport->do_prli_nvme =0 ; + } +/* * If device was not a fabric device before. */
drivers/scsi/qla2xxx/qla_init.c +17 -24
64 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_mbx.c +3 -0
@@ -4050,6 +4050,9 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, fcport->n2n_flag =1 ; fcport->keep_nport_handle =1 ; fcport->login_retry = vha->hw->login_retry_count; + fcport->fc4_type =FS_FC4TYPE_FCP ; +if (vha->flags.nvme_enabled) + fcport->fc4_type |=FS_FC4TYPE_NVME ;if (wwn_to_u64 (vha->port_name) >wwn_to_u64 (fcport->port_name)) {
drivers/scsi/qla2xxx/qla_os.c +5 -0
@@ -5184,6 +5184,11 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) WWN_SIZE); fcport->fc4_type = e->u.new_sess.fc4_type; +if (NVME_PRIORITY (vha->hw, fcport)) + fcport->do_prli_nvme =1 ; +else + fcport->do_prli_nvme =0 ; +if (e->u.new_sess.fc4_type &FS_FCP_IS_N2N ) { fcport->dm_login_expire = jiffies +QLA_N2N_WAIT_TIME *HZ ;
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 10/12 qla2xxx: fix NVME session down detection
In reply to Nilesh JavaliFrom: Quinn Tran <[email protected]>
When Target port transition its personality from one to another (NVME <--> FCP), there could be some overlap of the two where one layer is going down while the other layer is coming up. This overlap can cause temporary IO error. This patch detects those error/transition and recover from it. This patch triggers session tear down and allow relogin to re-drive the connection under the following conditions:
- NVME command error
- On prlo + N2N (rida format 2)
--- drivers/scsi/qla2xxx/qla_attr.c | 12 +++++++----- drivers/scsi/qla2xxx/qla_isr.c | 9 +++++++++ drivers/scsi/qla2xxx/qla_mbx.c | 10 ++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +7 -5
@@ -2733,12 +2733,14 @@ qla2x00_terminate_rport_io(struct fc_rport *rport)* final cleanup of firmware resources (PCBs and XCBs). */ if (fcport->loop_id !=FC_NO_LOOP_ID ) { -if (IS_FWI2_CAPABLE (fcport->vha->hw)) - fcport->vha->hw->isp_ops->fabric_logout (fcport->vha, - fcport->loop_id, fcport->d_id.b.domain, - fcport->d_id.b.area, fcport->d_id.b.al_pa); -else +if (IS_FWI2_CAPABLE (fcport->vha->hw)) { +if (fcport->loop_id !=FC_NO_LOOP_ID ) + fcport->logout_on_delete =1 ; + +qlt_schedule_sess_for_deletion (fcport); + }else {qla2x00_port_logout (fcport->vha, fcport); + } } }
drivers/scsi/qla2xxx/qla_isr.c +9 -0
@@ -2652,6 +2652,15 @@ static void qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,case CS_PORT_UNAVAILABLE :case CS_PORT_LOGGED_OUT : fcport->nvme_flag |=NVME_FLAG_RESETTING ; +if (atomic_read (&fcport->state) ==FCS_ONLINE ) { +ql_dbg (ql_dbg_disc, fcport->vha,0x3021 , +"Port to be marked lost on fcport=%06x, current " +"port state= %s comp_status %x.\n" , + fcport->d_id.b24, port_state_str[FCS_ONLINE ], + comp_status); + +qlt_schedule_sess_for_deletion (fcport); + } fallthrough;case CS_ABORTED :case CS_PORT_BUSY :
drivers/scsi/qla2xxx/qla_mbx.c +10 -0
@@ -4190,6 +4190,16 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, rptid_entry->u.f2.remote_nport_id[1 ]; fcport->d_id.b.al_pa = rptid_entry->u.f2.remote_nport_id[0 ]; + +/* +* For the case where remote port sending PRLO, FW +* sends up RIDA Format 2 as an indication of session +* loss. In other word, FW state change from PRLI +* complete back to PLOGI complete. Delete the +* session and let relogin drive the reconnect. +*/ +if (atomic_read (&fcport->state) ==FCS_ONLINE ) +qlt_schedule_sess_for_deletion (fcport); } } }
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 11/12 qla2xxx: edif: fix returnvar.cocci warnings
In reply to Nilesh JavaliFrom: kernel test robot <[email protected]>
drivers/scsi/qla2xxx/qla_edif.c:213:25-29: Unneeded variable: "rval". Return "0" on line 264
Remove unneeded variable used to store return value.
Generated by: scripts/coccinelle/misc/returnvar.cocci
--- drivers/scsi/qla2xxx/qla_edif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_edif.c +1 -2
@@ -628,7 +628,6 @@ qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)static int qla_edif_app_stop (scsi_qla_host_t *vha,struct bsg_job *bsg_job) { -int32_t rval =0 ;struct app_stop appstop;struct fc_bsg_reply *bsg_reply = bsg_job->reply;struct fc_port *fcport, *tf;
@@ -679,7 +678,7 @@ qla_edif_app_stop(scsi_qla_host_t *vha, struct bsg_job *bsg_job)/* no return interface to app - it assumes we cleaned up ok */ -return rval; +return 0 ; } static int
Signature · 1 line
2.23.1
Nilesh Javali
maintainerPATCH 12/12 qla2xxx: Update version to 10.02.06.200-k
In reply to Nilesh Javali--- drivers/scsi/qla2xxx/qla_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_version.h +2 -2
@@ -6,9 +6,9 @@/* * Driver version */ -#define QLA2XXX_VERSION "10.02.06.100-k" +#define QLA2XXX_VERSION "10.02.06.200-k"#define QLA_DRIVER_MAJOR_VER 10#define QLA_DRIVER_MINOR_VER 2#define QLA_DRIVER_PATCH_VER 6 -#define QLA_DRIVER_BETA_VER 100 +#define QLA_DRIVER_BETA_VER 200
Signature · 1 line
2.23.1
Martin K. Petersen
AppliedNilesh,
Quoted 2 lines
Please apply the qla2xxx driver bug fixes to the scsi tree at your earliest convenience.
Applied to 5.15/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 9 lines · Nilesh Javali
Martin,
Please apply the qla2xxx driver bug fixes to the scsi tree at your earliest convenience.
Thanks,
Nilesh[...]
Applied to 5.15/scsi-queue, thanks!
[01/12] qla2xxx: edif: Fix stale session
https://git.kernel.org/mkp/scsi/c/b15ce2f34cf4 [02/12] qla2xxx: edif: reject AUTH ELS on session down https://git.kernel.org/mkp/scsi/c/225479296c4f [03/12] qla2xxx: edif: fix edif enable flag https://git.kernel.org/mkp/scsi/c/d07b75ba9649 [04/12] qla2xxx: Fix hang during NVME session tear down https://git.kernel.org/mkp/scsi/c/310e69edfbd5 [05/12] qla2xxx: edif: add N2N support for EDIF https://git.kernel.org/mkp/scsi/c/4de067e5df12 [06/12] qla2xxx: edif: do secure plogi when auth app is present https://git.kernel.org/mkp/scsi/c/1dc64a360bda [07/12] qla2xxx: fix NVME | FCP personality change https://git.kernel.org/mkp/scsi/c/f6e327fc09e4 [08/12] qla2xxx: Fix hang on NVME command timeouts https://git.kernel.org/mkp/scsi/c/2cabf10dbbe3 [09/12] qla2xxx: fix NVME retry https://git.kernel.org/mkp/scsi/c/f88444570072 [10/12] qla2xxx: fix NVME session down detection https://git.kernel.org/mkp/scsi/c/7a8ff7d9854a [11/12] qla2xxx: edif: fix returnvar.cocci warnings https://git.kernel.org/mkp/scsi/c/17f3df8fd718 [12/12] qla2xxx: Update version to 10.02.06.200-k https://git.kernel.org/mkp/scsi/c/34f69ec70355
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering