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

[SCSI] libfc: adds flogi retry in case DID is zero in RJT

Sometimes switch in NPV mode rejects flogi request with DID
zero and in that case flogi is not tried again and port
remains offline, so this patch validates DID for non zero
along with only ACC response to allow flogi retry
for RJT with DID=0 also succeed FLOGI in next try.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Vasu Dev and committed by
James Bottomley
60a3c4df 75eee725

+4 -8
+4 -8
drivers/scsi/libfc/fc_lport.c
··· 1447 1447 } 1448 1448 1449 1449 did = fc_frame_did(fp); 1450 - 1451 - if (!did) { 1452 - FC_LPORT_DBG(lport, "Bad FLOGI response\n"); 1453 - goto out; 1454 - } 1455 - 1456 - if (fc_frame_payload_op(fp) == ELS_LS_ACC) { 1450 + if (fc_frame_payload_op(fp) == ELS_LS_ACC && did) { 1457 1451 flp = fc_frame_payload_get(fp, sizeof(*flp)); 1458 1452 if (flp) { 1459 1453 mfs = ntohs(flp->fl_csp.sp_bb_data) & ··· 1486 1492 fc_lport_enter_dns(lport); 1487 1493 } 1488 1494 } 1489 - } else 1495 + } else { 1496 + FC_LPORT_DBG(lport, "FLOGI RJT or bad response\n"); 1490 1497 fc_lport_error(lport, fp); 1498 + } 1491 1499 1492 1500 out: 1493 1501 fc_frame_free(fp);