Driver was using a shorter timeout waiting for PLOGI from the peer in
point-to-point configurations. Some devices takes some time (~4 seconds) to
initiate the PLOGI. This peer initiating PLOGI is when the peer has a
higher P-WWN.
Increase the wait time based on N2N R_A_TOV.
Link: https://lore.kernel.org/r/20200929102152.32278-7-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
         ha->current_topology == ISP_CFG_N || \
         !ha->current_topology)
 
+#define QLA_N2N_WAIT_TIME      5 /* 2 * ra_tov(n2n) + 1 */
+
 #define NVME_TYPE(fcport) \
        (fcport->fc4_type & FS_FC4TYPE_NVME) \
 
 
 
                        if (fcport) {
                                fcport->plogi_nack_done_deadline = jiffies + HZ;
-                               fcport->dm_login_expire = jiffies + 2*HZ;
+                               fcport->dm_login_expire = jiffies +
+                                       QLA_N2N_WAIT_TIME * HZ;
                                fcport->scan_state = QLA_FCPORT_FOUND;
                                fcport->n2n_flag = 1;
                                fcport->keep_nport_handle = 1;
 
 
                        fcport->fc4_type = e->u.new_sess.fc4_type;
                        if (e->u.new_sess.fc4_type & FS_FCP_IS_N2N) {
+                               fcport->dm_login_expire = jiffies +
+                                       QLA_N2N_WAIT_TIME * HZ;
                                fcport->fc4_type = FS_FC4TYPE_FCP;
                                fcport->n2n_flag = 1;
                                if (vha->flags.nvme_enabled)