scsi: qla2xxx: Fix NVMe retry
authorQuinn Tran <qutran@marvell.com>
Tue, 17 Aug 2021 05:13:12 +0000 (22:13 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 24 Aug 2021 02:36:54 +0000 (22:36 -0400)
commitf88444570072a6863f3e2bd67878560a51b187f2
tree9dcf1fc4b77fe1a0e39e88a903e3091b1eaff343
parent2cabf10dbbe380e2ef27a69ce2059bcab7c8b419
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 <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_gs.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_os.c