From f88444570072a6863f3e2bd67878560a51b187f2 Mon Sep 17 00:00:00 2001 From: Quinn Tran Date: Mon, 16 Aug 2021 22:13:12 -0700 Subject: scsi: qla2xxx: Fix NVMe retry 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. Link: https://lore.kernel.org/r/20210817051315.2477-10-njavali@marvell.com Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen --- drivers/scsi/qla2xxx/qla_mbx.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/scsi/qla2xxx/qla_mbx.c') diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index fcc219172aa9..438af0d55135 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -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)) { -- cgit v1.2.3