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

Configure Feed

Select the types of activity you want to include in your feed.

scsi: qla2xxx: edif: Reduce N2N thrashing at app_start time

For N2N + remote WWPN is bigger than local adapter, remote adapter will
login to local adapter while authentication application is not running.
When authentication application starts, the current session in FW needs to
to be invalidated.

Make sure the old session is torn down before triggering a relogin.

Link: https://lore.kernel.org/r/20220608115849.16693-9-njavali@marvell.com
Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.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>

authored by

Quinn Tran and committed by
Martin K. Petersen
37be3f9d ec538eb8

+34 -13
+34 -13
drivers/scsi/qla2xxx/qla_edif.c
··· 517 517 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) 518 518 fcport->n2n_link_reset_cnt = 0; 519 519 520 - if (vha->hw->flags.n2n_fw_acc_sec) 521 - set_bit(N2N_LINK_RESET, &vha->dpc_flags); 522 - else 520 + if (vha->hw->flags.n2n_fw_acc_sec) { 521 + list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) 522 + qla_edif_sa_ctl_init(vha, fcport); 523 + 524 + /* 525 + * While authentication app was not running, remote device 526 + * could still try to login with this local port. Let's 527 + * clear the state and try again. 528 + */ 529 + qla2x00_wait_for_sess_deletion(vha); 530 + 531 + /* bounce the link to get the other guy to relogin */ 532 + if (!vha->hw->flags.n2n_bigger) { 533 + set_bit(N2N_LINK_RESET, &vha->dpc_flags); 534 + qla2xxx_wake_dpc(vha); 535 + } 536 + } else { 537 + qla2x00_wait_for_hba_online(vha); 523 538 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); 524 - qla2xxx_wake_dpc(vha); 539 + qla2xxx_wake_dpc(vha); 540 + qla2x00_wait_for_hba_online(vha); 541 + } 525 542 } else { 526 543 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { 527 544 ql_dbg(ql_dbg_edif, vha, 0x2058, ··· 937 920 if (tdid.b24 != 0 && tdid.b24 != fcport->d_id.b24) 938 921 continue; 939 922 940 - if (fcport->scan_state != QLA_FCPORT_FOUND) 941 - continue; 923 + if (!N2N_TOPO(vha->hw)) { 924 + if (fcport->scan_state != QLA_FCPORT_FOUND) 925 + continue; 942 926 943 - if (fcport->port_type == FCT_UNKNOWN && !fcport->fc4_features) 944 - rval = qla24xx_async_gffid(vha, fcport, true); 927 + if (fcport->port_type == FCT_UNKNOWN && 928 + !fcport->fc4_features) 929 + rval = qla24xx_async_gffid(vha, fcport, 930 + true); 945 931 946 - if (!rval && 947 - !(fcport->fc4_features & FC4_FF_TARGET || 948 - fcport->port_type & 949 - (FCT_TARGET | FCT_NVME_TARGET))) 950 - continue; 932 + if (!rval && 933 + !(fcport->fc4_features & FC4_FF_TARGET || 934 + fcport->port_type & 935 + (FCT_TARGET | FCT_NVME_TARGET))) 936 + continue; 937 + } 951 938 952 939 rval = 0; 953 940