From patchwork Wed Jun 2 09:25:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 1486716 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=jojesKtJ; 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 4Fw9082F0hz9sW4; Wed, 2 Jun 2021 23:31: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 1loQxY-0005ag-D2; Wed, 02 Jun 2021 13:31:00 +0000 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1loN8S-0007zb-Ge for kernel-team@lists.ubuntu.com; Wed, 02 Jun 2021 09:26:00 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1529AI69006231 for ; Wed, 2 Jun 2021 02:25:59 -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=9KxJ4msS9/Dwq3zMPZcoHDOigOuXRxtmk/fjOpx0HJk=; b=jojesKtJYBY27wLcERwDxsuvfk7/3XFk1ZP3+z7sEDLYUQc0d2oH7S3v20iF/inUCeHk BSWxFulr1ciImJy8Eu+shoQEEs6lWj1YtBX7NouO19YJMTlu+/CJ7msQ/DjI+0Uymw1/ CpHv0C3XmttTJjM7GPa3+4Lmew1Xa3VIXXcZQ7evFX222qjqcvBlEfaMMRThKn5wiT0e MsjMHjur7wqdZ6LyI3XjohoyCMYTjsoABBXw28dMU0dS5978umC83SehRl+CXxKb7im6 3EpKXAPJjNiXAv4/BDH33OnJz4DdZkQrEAJCo2bFhg9eDbHm1l6gpAmCxK8bZBkxxsOt Gw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 38wufgta12-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 02 Jun 2021 02:25:59 -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; Wed, 2 Jun 2021 02:25:57 -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; Wed, 2 Jun 2021 02:25:56 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 54B0C3F703F; Wed, 2 Jun 2021 02:25:57 -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 1529Pvsm015719; Wed, 2 Jun 2021 02:25:57 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 1529PvJp015718; Wed, 2 Jun 2021 02:25:57 -0700 From: Nilesh Javali To: Subject: [SRU] [Focal] [PATCH v3 1/4] scsi: qla2xxx: Serialize fc_port alloc in N2N Date: Wed, 2 Jun 2021 02:25:05 -0700 Message-ID: <20210602092508.15672-2-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210602092508.15672-1-njavali@marvell.com> References: <20210602092508.15672-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: pwymAW7rc8yF5sbnsf5iz-wd9zREVDuk X-Proofpoint-GUID: pwymAW7rc8yF5sbnsf5iz-wd9zREVDuk X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-02_05:2021-06-02, 2021-06-02 signatures=0 X-Mailman-Approved-At: Wed, 02 Jun 2021 13:30:58 +0000 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: Quinn Tran BugLink: https://bugs.launchpad.net/bugs/1860724 For N2N, fc_port struct is created during report id acquisition. At later time, the loop resync (fabric, n2n, loop) would trigger the rest of the login using the created fc_port struct. The loop resync logic can trigger another fc_port allocation if the 1st allocation was not able to execute. This patch prevents the 2nd allocation trigger. Link: https://lore.kernel.org/r/20200226224022.24518-15-hmadhani@marvell.com Signed-off-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Martin K. Petersen (cherry picked from commit 11efe8755d73efd153d6459240866b6d52448f19) Signed-off-by: Nilesh Javali --- drivers/scsi/qla2xxx/qla_init.c | 1 + drivers/scsi/qla2xxx/qla_os.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index b300e1109582..cfee373c79f7 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5086,6 +5086,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); } + return QLA_FUNCTION_FAILED; } found_devs = 0; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 67b1e74fcd1e..2cfcc309dec8 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -5175,9 +5175,8 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) fcport->n2n_flag = 1; } fcport->fw_login_state = 0; - /* - * wait link init done before sending login - */ + + schedule_delayed_work(&vha->scan.scan_work, 5); } else { qla24xx_fcport_handle_login(vha, fcport); } From patchwork Wed Jun 2 09:25:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 1486719 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=YCuULAZa; 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 4Fw9082GByz9sW6; Wed, 2 Jun 2021 23:31: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 1loQxW-0005Zj-PA; Wed, 02 Jun 2021 13:30:58 +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 1loN8q-00080W-F9 for kernel-team@lists.ubuntu.com; Wed, 02 Jun 2021 09:26:24 +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 1529A5Bs014401 for ; Wed, 2 Jun 2021 02:26:23 -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=H3iWCDKShIECbsbFxPaayELTpcT2A9bHOUcjMUbouE4=; b=YCuULAZaGEYq9JLMg/8Mqvk7naajeRqJw+l40HGnz+nWCPTEIa4XkHAc2xpil7i1yVI3 +Rm0s/brY750ROsxN1D/0FwWKkSoNLlvwMIylFj+5KQAYB5fUUs8k2AIvIcxwqSIqEb2 hGsbqF1LAcJYeImITqzYkvsktjSzgzNh2Ru3hFgpiRJxdIN1lTLlmT24DjAbnouQJ42P gzuaGd9Er02FEpzbfVeEPH+4C4gL+WsPvIKxnrGSayjPT0pY4b9nv+ZUUHZUpYr1zOiA EFu776hsYCT6BBQJVnIcrgITB66j3YUTodhTshN6Vp4nByXiBcLSMaYUPyyc8uBrhkZM gA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 38wug72abt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 02 Jun 2021 02:26:22 -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; Wed, 2 Jun 2021 02:26:21 -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; Wed, 2 Jun 2021 02:26:21 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 715DE3F703F; Wed, 2 Jun 2021 02:26:21 -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 1529QLP6015723; Wed, 2 Jun 2021 02:26:21 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 1529QLE3015722; Wed, 2 Jun 2021 02:26:21 -0700 From: Nilesh Javali To: Subject: [SRU] [Focal] [PATCH v3 2/4] scsi: qla2xxx: Set Nport ID for N2N Date: Wed, 2 Jun 2021 02:25:06 -0700 Message-ID: <20210602092508.15672-3-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210602092508.15672-1-njavali@marvell.com> References: <20210602092508.15672-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 3len3O_8sTwjT525R4kaCipOpBbIBNTD X-Proofpoint-GUID: 3len3O_8sTwjT525R4kaCipOpBbIBNTD X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-02_05:2021-06-02, 2021-06-02 signatures=0 X-Mailman-Approved-At: Wed, 02 Jun 2021 13:30:58 +0000 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: Quinn Tran BugLink: https://bugs.launchpad.net/bugs/1860724 When transitioning from loop to N2N, stale NPort ID is not re-assigned. Stale ID can collide with remote device. This patch will re-assign NPort ID on N2N is detected. Link: https://lore.kernel.org/r/20200226224022.24518-18-hmadhani@marvell.com Signed-off-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Martin K. Petersen (cherry picked from commit ad8a260aa80d4dfa9588fd5d23b71ec922f61c8b) Signed-off-by: Nilesh Javali --- drivers/scsi/qla2xxx/qla_mbx.c | 42 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index c1631e42d35d..1ec16d9f6d4a 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -3880,11 +3880,29 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, fcport->scan_state = QLA_FCPORT_SCAN; fcport->n2n_flag = 0; } + id.b24 = 0; + if (wwn_to_u64(vha->port_name) > + wwn_to_u64(rptid_entry->u.f1.port_name)) { + vha->d_id.b24 = 0; + vha->d_id.b.al_pa = 1; + ha->flags.n2n_bigger = 1; + + id.b.al_pa = 2; + ql_dbg(ql_dbg_async, vha, 0x5075, + "Format 1: assign local id %x remote id %x\n", + vha->d_id.b24, id.b24); + } else { + ql_dbg(ql_dbg_async, vha, 0x5075, + "Format 1: Remote login - Waiting for WWPN %8phC.\n", + rptid_entry->u.f1.port_name); + ha->flags.n2n_bigger = 0; + } fcport = qla2x00_find_fcport_by_wwpn(vha, rptid_entry->u.f1.port_name, 1); spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); + if (fcport) { fcport->plogi_nack_done_deadline = jiffies + HZ; fcport->dm_login_expire = jiffies + 2*HZ; @@ -3894,6 +3912,11 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, if (vha->flags.nvme_enabled) fcport->fc4f_nvme = 1; + if (wwn_to_u64(vha->port_name) > + wwn_to_u64(fcport->port_name)) { + fcport->d_id = id; + } + switch (fcport->disc_state) { case DSC_DELETED: set_bit(RELOGIN_NEEDED, @@ -3906,25 +3929,6 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, break; } } else { - id.b24 = 0; - if (wwn_to_u64(vha->port_name) > - wwn_to_u64(rptid_entry->u.f1.port_name)) { - vha->d_id.b24 = 0; - vha->d_id.b.al_pa = 1; - ha->flags.n2n_bigger = 1; - ha->flags.n2n_ae = 0; - - id.b.al_pa = 2; - ql_dbg(ql_dbg_async, vha, 0x5075, - "Format 1: assign local id %x remote id %x\n", - vha->d_id.b24, id.b24); - } else { - ql_dbg(ql_dbg_async, vha, 0x5075, - "Format 1: Remote login - Waiting for WWPN %8phC.\n", - rptid_entry->u.f1.port_name); - ha->flags.n2n_bigger = 0; - ha->flags.n2n_ae = 1; - } qla24xx_post_newsess_work(vha, &id, rptid_entry->u.f1.port_name, rptid_entry->u.f1.node_name, From patchwork Wed Jun 2 09:25:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 1486720 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=b6ghS3+n; 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 4Fw9086nXKz9sWF; Wed, 2 Jun 2021 23:31: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 1loQxZ-0005bO-3k; Wed, 02 Jun 2021 13:31:01 +0000 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1loN9E-00080u-PE for kernel-team@lists.ubuntu.com; Wed, 02 Jun 2021 09:26:48 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1529AO1k006312 for ; Wed, 2 Jun 2021 02:26:47 -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=6WH8lI9yUWMxYWpKJsQ4yeZ/IFN6QDToHaqJGS2/GwM=; b=b6ghS3+nJ0pn3jdQfm8X5JW6FeuHTHXrrVNTAmLjDDNImcNCIHGvP6F43cObz47enMLd HmxMvMJ957smQfre08SpKOgpZRx0BxUbmYpoaszZYxcnWsWIM+ghBeiCQedOfV6Nv3TB RKeIBUu1fUTRuwSOyLWs4ZP6cEMR2SmOZw7KiTA16E6MUJSa09MKRDusHNDeAldh5Qp5 7LptAlKSSAvfkH16K8le/CAf/53cRLGOVjowAIM2TGN1qDhPORvvR+YIkUXPk4DcK9Ku PyZwwUMNRaI2EX2+XULABQkAnTkaoLkdAftf/wfgZ6YLI3Co9uTBn0bPuc3IxV5FaI67 MA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 38wufgta31-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 02 Jun 2021 02:26:47 -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; Wed, 2 Jun 2021 02:26:45 -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; Wed, 2 Jun 2021 02:26:45 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id 869AC3F7040; Wed, 2 Jun 2021 02:26:45 -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 1529QjVg015735; Wed, 2 Jun 2021 02:26:45 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 1529QjUU015726; Wed, 2 Jun 2021 02:26:45 -0700 From: Nilesh Javali To: Subject: [SRU] [Focal] [PATCH v3 3/4] scsi: qla2xxx: Fix point-to-point (N2N) device discovery issue Date: Wed, 2 Jun 2021 02:25:07 -0700 Message-ID: <20210602092508.15672-4-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210602092508.15672-1-njavali@marvell.com> References: <20210602092508.15672-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: hKP59mKE9dYlXpM_rXqlSDEh1O9ys7fd X-Proofpoint-GUID: hKP59mKE9dYlXpM_rXqlSDEh1O9ys7fd X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-02_05:2021-06-02, 2021-06-02 signatures=0 X-Mailman-Approved-At: Wed, 02 Jun 2021 13:30:58 +0000 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 | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c57b95a20688..c60b183aac29 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -4823,6 +4823,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 PRLI_PHASE(_cls) \ ((_cls == DSC_LS_PRLI_PEND) || (_cls == DSC_LS_PRLI_COMP)) diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 1ec16d9f6d4a..9a64057c7d06 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 2cfcc309dec8..2436fc2082ba 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -5066,8 +5066,11 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) memcpy(fcport->port_name, e->u.new_sess.port_name, WWN_SIZE); - if (e->u.new_sess.fc4_type & FS_FCP_IS_N2N) + if (e->u.new_sess.fc4_type & FS_FCP_IS_N2N) { + fcport->dm_login_expire = jiffies + + QLA_N2N_WAIT_TIME * HZ; fcport->n2n_flag = 1; + } } else { ql_dbg(ql_dbg_disc, vha, 0xffff, From patchwork Wed Jun 2 09:25:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nilesh Javali X-Patchwork-Id: 1486718 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=QrR5Mflu; 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 4Fw9083BRKz9sW7; Wed, 2 Jun 2021 23:31: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 1loQxW-0005Zr-UR; Wed, 02 Jun 2021 13:30:58 +0000 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1loN9c-00086G-Sd for kernel-team@lists.ubuntu.com; Wed, 02 Jun 2021 09:27:13 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1529AKwT006272 for ; Wed, 2 Jun 2021 02:27:11 -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 : content-transfer-encoding; s=pfpt0220; bh=A9YLT21jN0MvuA6Lf5wAwOeP9OJv0+p9IrmAYj1EVRE=; b=QrR5MfluuMuEYRLYkPjtOxTx40OUKHLgKFIv/OpwULpFGmHX1vNmp7rKaEakJpFto6OQ pCeYQFk1TefGUSpLgAX3wvIfX8L4NRfZmBHBA8wOIqfIUda5QU62wG/G7xC/0qvSYRlT qFAJJexUhpTImmkw8Nr6DWlVTksPmpZMidhNOsHAcfh/QuExlhaGc0u8zbDPshwxB+GO 3/XqOE1hhU49/k4wnS+BO9qOieGx9F3VXG97QGRYagxDGoXXGly3JR/z3sBlM0guN4yu /CNCFtj2pTD80QFaGtZ3rEdSyuYEx+voJMw4Gyn/rohzqQYsc+Dvs2Go4G7UOBgo0No/ Og== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 38wufgta3r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 02 Jun 2021 02:27:11 -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; Wed, 2 Jun 2021 02:27:09 -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; Wed, 2 Jun 2021 02:27:09 -0700 Received: from dut1171.mv.qlogic.com (unknown [10.112.88.18]) by maili.marvell.com (Postfix) with ESMTP id A56F63F703F; Wed, 2 Jun 2021 02:27:09 -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 1529R9jg015739; Wed, 2 Jun 2021 02:27:09 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id 1529R9aa015738; Wed, 2 Jun 2021 02:27:09 -0700 From: Nilesh Javali To: Subject: [SRU] [Focal] [PATCH v3 4/4] scsi: qla2xxx: Fix N2N and NVMe connect retry failure Date: Wed, 2 Jun 2021 02:25:08 -0700 Message-ID: <20210602092508.15672-5-njavali@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20210602092508.15672-1-njavali@marvell.com> References: <20210602092508.15672-1-njavali@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Yuyei972gs05JflurMH6nxsKYjar-EAQ X-Proofpoint-GUID: Yuyei972gs05JflurMH6nxsKYjar-EAQ X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-02_05:2021-06-02, 2021-06-02 signatures=0 X-Mailman-Approved-At: Wed, 02 Jun 2021 13:30:58 +0000 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: Quinn Trann BugLink: https://bugs.launchpad.net/bugs/1860724 FC-NVMe target discovery failed when initiator wwpn < target wwpn in an N2N (Direct Attach) config, where the driver was stuck on FCP PRLI mode and failed to retry with NVMe PRLI. Link: https://lore.kernel.org/r/20201202132312.19966-10-njavali@marvell.com Fixes: 84ed362ac40c ("scsi: qla2xxx: Dual FCP-NVMe target port support”) Fixes: 983f127603fa ("scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure”) Signed-off-by: Quinn Tran Signed-off-by: Martin K. Petersen (backported from commit 07a5f69248e3486e387c40af64793466371c7d91) Signed-off-by: Nilesh Javali --- drivers/scsi/qla2xxx/qla_init.c | 67 ++++++++++++++++++++++++++------- drivers/scsi/qla2xxx/qla_mbx.c | 2 - 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index cfee373c79f7..d9af92dcf996 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1281,9 +1281,10 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) lio->u.logio.flags |= SRB_LOGIN_NVME_PRLI; ql_dbg(ql_dbg_disc, vha, 0x211b, - "Async-prli - %8phC hdl=%x, loopid=%x portid=%06x retries=%d %s.\n", + "Async-prli - %8phC hdl=%x, loopid=%x portid=%06x retries=%d fc4type %x priority %x %s.\n", fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b24, - fcport->login_retry, fcport->fc4f_nvme ? "nvme" : "fc"); + fcport->login_retry, fcport->fc4_type, vha->hw->fc4_type_priority, + fcport->fc4f_nvme ? "nvme" : "fc"); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) { @@ -1916,18 +1917,58 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) break; } - if (ea->fcport->fc4f_nvme) { - ql_dbg(ql_dbg_disc, vha, 0x2118, - "%s %d %8phC post fc4 prli\n", - __func__, __LINE__, ea->fcport->port_name); - ea->fcport->fc4f_nvme = 0; - return; - } + ql_dbg(ql_dbg_disc, vha, 0x2118, + "%s %d %8phC priority %s, fc4type %x\n", + __func__, __LINE__, ea->fcport->port_name, + vha->hw->fc4_type_priority == FC4_PRIORITY_FCP ? + "FCP" : "NVMe", ea->fcport->fc4_type); - ea->fcport->flags &= ~FCF_ASYNC_SENT; - ea->fcport->keep_nport_handle = 0; - ea->fcport->logout_on_delete = 1; - qlt_schedule_sess_for_deletion(ea->fcport); + if (N2N_TOPO(vha->hw)) { + if (vha->hw->fc4_type_priority == FC4_PRIORITY_NVME) { + ea->fcport->fc4_type &= ~FS_FC4TYPE_NVME; + ea->fcport->fc4_type |= FS_FC4TYPE_FCP; + } else { + ea->fcport->fc4_type &= ~FS_FC4TYPE_FCP; + ea->fcport->fc4_type |= FS_FC4TYPE_NVME; + } + + if (ea->fcport->n2n_link_reset_cnt < 3) { + ea->fcport->n2n_link_reset_cnt++; + vha->relogin_jif = jiffies + 2 * HZ; + /* + * PRLI failed. Reset link to kick start + * state machine + */ + set_bit(N2N_LINK_RESET, &vha->dpc_flags); + } else { + ql_log(ql_log_warn, vha, 0x2119, + "%s %d %8phC Unable to reconnect\n", + __func__, __LINE__, + ea->fcport->port_name); + } + } else { + /* + * switch connect. login failed. Take connection down + * and allow relogin to retrigger + */ + if (NVME_FCP_TARGET(ea->fcport)) { + ql_dbg(ql_dbg_disc, vha, 0x2118, + "%s %d %8phC post %s prli\n", + __func__, __LINE__, + ea->fcport->port_name, + (ea->fcport->fc4_type & FS_FC4TYPE_NVME) + ? "NVMe" : "FCP"); + if (vha->hw->fc4_type_priority == FC4_PRIORITY_NVME) + ea->fcport->fc4_type &= ~FS_FC4TYPE_NVME; + else + ea->fcport->fc4_type &= ~FS_FC4TYPE_FCP; + } + + ea->fcport->flags &= ~FCF_ASYNC_SENT; + ea->fcport->keep_nport_handle = 0; + ea->fcport->logout_on_delete = 1; + qlt_schedule_sess_for_deletion(ea->fcport); + } break; } } diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 9a64057c7d06..12976a785e58 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -3910,8 +3910,6 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, fcport->scan_state = QLA_FCPORT_FOUND; fcport->n2n_flag = 1; fcport->keep_nport_handle = 1; - if (vha->flags.nvme_enabled) - fcport->fc4f_nvme = 1; if (wwn_to_u64(vha->port_name) > wwn_to_u64(fcport->port_name)) {