From patchwork Thu Jun 10 10:35:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 1490377 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=marvell.com header.i=@marvell.com header.a=rsa-sha256 header.s=pfpt0220 header.b=Oj+EjLDL; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G10lh264Rz9sRK; Thu, 10 Jun 2021 20:37:04 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lrI3Z-0001g7-Dx; Thu, 10 Jun 2021 10:37:01 +0000 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174] helo=mx0b-0016f401.pphosted.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lrI3X-0001fq-12 for kernel-team@lists.ubuntu.com; Thu, 10 Jun 2021 10:36:59 +0000 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15AAZBpP014111 for ; Thu, 10 Jun 2021 03:36:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=8/ODLUvdVlo0Ozm2reHCN5Fuq5aXN1synG8jQyiLXKE=; b=Oj+EjLDLYq6it2wYt3ceFJvk9spvNvH/7lIBUx4sWfMKEQ9F4LPgGmA8RYtHfT79Tfmd 1osD97pfZMWSN9CCIEO+ECgcX7EdcO1+OXm3jIHF3c0uTsLdlK+/9fMq1EpAn26Zwz3t yiFZckRBAiVXKOY0bL4kYb88adfjJ7xXfbWDibmanYgVFQjf2ZN7GIjgz/Ve0+r0hyJx CLI1Qza3pNv68G0zR6+OTP7exnbjcM7Fx5ukFRpur0euj2FZNTsQB7/Mr8eQxpGlaK9Q kfHR8fpwboJPp8to8ZuZOvIWl8mN/xyRofc/1c79pPS+XGh+MRvahEYzwLPMHjQ1OJ02 Cw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 393f38rfcu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 10 Jun 2021 03:36:57 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 10 Jun 2021 03:36:56 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 10 Jun 2021 03:36:55 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id E60293F705C; Thu, 10 Jun 2021 03:36:55 -0700 (PDT) Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id 15AAatM0003618; Thu, 10 Jun 2021 03:36:55 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 15AAatVZ003616; Thu, 10 Jun 2021 03:36:55 -0700 From: Nilesh Javali To: Subject: [SRU] [Focal] [PATCH v4 3/4] scsi: qla2xxx: Fix point-to-point (N2N) device discovery issue Date: Thu, 10 Jun 2021 03:35:18 -0700 Message-ID: <20210610103519.3554-4-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210610103519.3554-1-njavali@marvell.com> References: <20210610103519.3554-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: HcnFCoeiL2E_xqh_8r-D9DzAoG0n6lC3 X-Proofpoint-GUID: HcnFCoeiL2E_xqh_8r-D9DzAoG0n6lC3 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-10_05:2021-06-10, 2021-06-10 signatures=0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: GR-QLogic-Storage-Upstream@marvell.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Arun Easi BugLink: https://bugs.launchpad.net/bugs/1860724 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 Signed-off-by: Arun Easi Signed-off-by: Martin K. Petersen (backported from commit 94eda2717826015a80ca271394c4378747de8936) Signed-off-by: Nilesh Javali --- drivers/scsi/qla2xxx/qla_def.h | 2 ++ drivers/scsi/qla2xxx/qla_mbx.c | 3 ++- drivers/scsi/qla2xxx/qla_os.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 7c22f8eea3ea..7d8f424d73fa 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -4842,6 +4842,8 @@ struct sff_8247_a0 { 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) \ diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 7e1b4822a8bc..8d35022f737c 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -3905,7 +3905,8 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, 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; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 8437dc2e71ca..4d2a908424f0 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -5054,6 +5054,8 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) 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)