Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: lpfc: Fix retry of PRLI when status indicates its unsupported

With port bounce/address swaps and timing between initiator GID queries vs
remote port FC4 support registrations, the driver may be in a situation
where it sends PRLIs for both FCP and NVME even though the target may not
support one of the protocols. In this case, the remote port will reject the
PRLI and usually indicate it does not support the request. However, the
driver currently ignores the status of the failure and immediately retries
the PRLI, which is pointless. In the case of this one remote port, the
reception of the PRLI retry caused it to decide to send a LOGO. The LOGO
restarted the process and the same results happened. It made the remote
port undiscoverable to either protocol.

Add logic to detect the non-support status and not attempt the retry
of the PRLI.

Link: https://lore.kernel.org/r/20200803210229.23063-6-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Dick Kennedy and committed by
Martin K. Petersen
678768da 24411fcd

+7 -3
+7 -3
drivers/scsi/lpfc/lpfc_els.c
··· 3937 3937 case LSRJT_UNABLE_TPC: 3938 3938 /* The driver has a VALID PLOGI but the rport has 3939 3939 * rejected the PRLI - can't do it now. Delay 3940 - * for 1 second and try again - don't care about 3941 - * the explanation. 3940 + * for 1 second and try again. 3941 + * 3942 + * However, if explanation is REQ_UNSUPPORTED there's 3943 + * no point to retry PRLI. 3942 3944 */ 3943 - if (cmd == ELS_CMD_PRLI || cmd == ELS_CMD_NVMEPRLI) { 3945 + if ((cmd == ELS_CMD_PRLI || cmd == ELS_CMD_NVMEPRLI) && 3946 + stat.un.b.lsRjtRsnCodeExp != 3947 + LSEXP_REQ_UNSUPPORTED) { 3944 3948 delay = 1000; 3945 3949 maxretry = lpfc_max_els_tries + 1; 3946 3950 retry = 1;