From patchwork Wed Jul 12 18:05:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34E7BEB64DA for ; Wed, 12 Jul 2023 17:53:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232615AbjGLRxj (ORCPT ); Wed, 12 Jul 2023 13:53:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232599AbjGLRxe (ORCPT ); Wed, 12 Jul 2023 13:53:34 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BFCC1FD2 for ; Wed, 12 Jul 2023 10:53:33 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1b8c364ad3bso12901555ad.1 for ; Wed, 12 Jul 2023 10:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184412; x=1691776412; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fliTXGR0cbyCdFc6vaaV+Kz1HnP9oZIHzRXQ7Gq9GtE=; b=nKe+Ah9LPGnIzy4usbtHHQ8/fIUVYSMrZ/AqgTDwGQnk40kZ2izaU2wl6psJfp8WW6 dBeyTNCyGi6/M+GwrYrCE7whNimr9E85XFfPjljIM0T3bHa9AVWbpEmcvVQwRQjKk+6U tfiQyDfTpFzUr0P1LK4M+jFScB+OJfRCi6ZX7RBsObR5h8VCiQnVFpw70PvleJWX4m7I DJuhAnkUlEZ5RtMQb3KHfq1ustTevSvhBEsFmYZtrIRY2iFMhkXDSJ5iscll6TRH3u9P VzHfHIvgkbk9EN0joqFONkDvNx2/ZA7mXFkZjNchl7WJAtmUI65c69OJaV7/mc4UFgf7 NPxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184412; x=1691776412; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fliTXGR0cbyCdFc6vaaV+Kz1HnP9oZIHzRXQ7Gq9GtE=; b=TAtE4x0Bo4uE97XE0egaE/GKagHzXwBUH0j28itG07G/5AhyImjbV/4JorZtSzClxU DQcDCjCxA9NWXedtKKMXwD50VU1VqgmxCiVX1k/PiLqWS45Nzr/TBLjSKDY18wpzVcWh RlvGa+dJtfoX7Buf6n3nSm1APxau79NqEYjj/a4XnqdweDcxK7795lPs63UNneM5ECcZ qnriuO/o6b0bu7ZQmZUCN1m74l6qPIRkPGIHRQhMskUMJ1E3C1zWpIKHxyMiPb7KpHCo MafA/CyZFvTjUtq0otkUyDiMC8WvXYg/qqx8Y2I2Oo1RTW+8tYy6IriGU4cMW64gOQmF 8hTw== X-Gm-Message-State: ABy/qLY1NZvrrxX1WgAon/ft1hSfTLreXjntjMiCjAIUzm2RiKMJ2pXh a1DMDFlSPwYTm31gJk0PPZV2miJgpIk= X-Google-Smtp-Source: APBJJlFsRPSk66mnVQ3d8dWtRvz65z2sEQCVjXFpmmdo7jnjx3MFRXEoPwKzinkXAbtdhp9BIIEYqA== X-Received: by 2002:a17:902:ce84:b0:1b8:811:b079 with SMTP id f4-20020a170902ce8400b001b80811b079mr151181plg.0.1689184411910; Wed, 12 Jul 2023 10:53:31 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:31 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 01/12] lpfc: Pull out fw diagnostic dump log message from driver's trace buffer Date: Wed, 12 Jul 2023 11:05:11 -0700 Message-Id: <20230712180522.112722-2-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The firmware diagnostic dump log message does not need to be a part of the driver's log trace buffer because it is an expected user triggered event. Change LOG_TRACE_EVENT verbose flag to LOG_SLI. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 3221a934066b..041d6f0f2097 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -2123,7 +2123,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) en_rn_msg = false; } else if (reg_err1 == SLIPORT_ERR1_REG_ERR_CODE_2 && reg_err2 == SLIPORT_ERR2_REG_FORCED_DUMP) - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, "3144 Port Down: Debug Dump\n"); else if (reg_err1 == SLIPORT_ERR1_REG_ERR_CODE_2 && reg_err2 == SLIPORT_ERR2_REG_FUNC_PROVISON) From patchwork Wed Jul 12 18:05:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310794 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C306AC0015E for ; Wed, 12 Jul 2023 17:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232599AbjGLRxk (ORCPT ); Wed, 12 Jul 2023 13:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232663AbjGLRxh (ORCPT ); Wed, 12 Jul 2023 13:53:37 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C1F21FE4 for ; Wed, 12 Jul 2023 10:53:35 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-682ae5d4184so1594788b3a.1 for ; Wed, 12 Jul 2023 10:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184414; x=1691776414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HrGqteqRW2igwkluV6hTlpF+FO5gBCOahMtsnlOpmyg=; b=KTOdvU2OiK9smhFLTXcALP3NyZ+2auhnVY3LbY9dpmwWsYpUThBuyFpzZyGzNMwGP+ GhONu7p3j/hoRLOZne8oSCryz1fh41zJFTwZ3uromPUDl1BmrIpKl5MgFpJbiufAxb56 AGHsDTZLFq15FFLl/6Bwa2vbxv3nRC9w6AIoIcrB5aCGxPzP0CmBgLNSUwksrR/qkIgJ ggL+sA/X/9YDAoFQ/UMxlpFNrEhODnn/o2d2nlLdamBmKme4ZVKiBGV5nYvWq7KYPhMu 4/5QBMYD2+cotJblO09H3znaJH8Hv+EOtEUhaqn6hOYIOaBq3Pk/kaa8DZKnoGnf139v ZgJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184414; x=1691776414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HrGqteqRW2igwkluV6hTlpF+FO5gBCOahMtsnlOpmyg=; b=NSBxphxLv6YKFJtu8hUYwFZUHhNg4mj6BqoJZN0oKmevoF1EMzp7pOus62qX3ua/g1 roctUpJy76Alqtiytpp36SBM4TtfdxI8iZtx6BmU4L54ymrCbGb7XIQgF/T9e71hIWAq 0lGUBb0ewr7b0IRhAkLEngxnrd3NY+IysjlTQSC5PdP/VaQPb9mUqoRvE7XgDP6pH/Av sXCLcNy1RrUVLuQ22CgWASw9Bq9bJi8bzd2cZrpSB87TzyFOKPKjBnY+T5MHBNnUksV9 NnIwWmMEeFN+LyC9zug2gnUl1z3C1TKNdvEQCjiVTYPCyssgprsKo0S8eq3GPeWuolYs WKBA== X-Gm-Message-State: ABy/qLY22yAxKMNw1+Czf7BfuYPdvLuGI4srouZtPiRoh7tZJM/IAreo 4kAbMm8XMqUKxv8GhqZMqIL70JQSmWo= X-Google-Smtp-Source: APBJJlGVdUerIufM3aJkUo5vQpIQCpuJOrf4TLOUM35IgyZikHad5vlR2WvLIQ4N4lCYzkN6YrsJTQ== X-Received: by 2002:a17:902:da89:b0:1a6:6bdb:b548 with SMTP id j9-20020a170902da8900b001a66bdbb548mr110598plx.1.1689184414429; Wed, 12 Jul 2023 10:53:34 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:34 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 02/12] lpfc: Simplify fcp_abort transport callback log message Date: Wed, 12 Jul 2023 11:05:12 -0700 Message-Id: <20230712180522.112722-3-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The driver is reaching into a nvme_fc_cmd_iu ptr that belongs to the transport during an abort. This could cause an unintentional ptr dereference into memory that the driver does not own. Since the nvme_fc_cmd_iu ptr was for logging purposes only, simplify the log message such that the nvme_fc_cmd_iu reference is no longer needed. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_nvme.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index 8db7cb99903d..3ee5cde481f3 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -1864,7 +1864,6 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, struct lpfc_nvme_fcpreq_priv *freqpriv; unsigned long flags; int ret_val; - struct nvme_fc_cmd_iu *cp; /* Validate pointers. LLDD fault handling with transport does * have timing races. @@ -1988,16 +1987,10 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, return; } - /* - * Get Command Id from cmd to plug into response. This - * code is not needed in the next NVME Transport drop. - */ - cp = (struct nvme_fc_cmd_iu *)lpfc_nbuf->nvmeCmd->cmdaddr; lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_ABTS, "6138 Transport Abort NVME Request Issued for " - "ox_id x%x nvme opcode x%x nvme cmd_id x%x\n", - nvmereq_wqe->sli4_xritag, cp->sqe.common.opcode, - cp->sqe.common.command_id); + "ox_id x%x\n", + nvmereq_wqe->sli4_xritag); return; out_unlock: From patchwork Wed Jul 12 18:05:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0EACC001DC for ; Wed, 12 Jul 2023 17:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232605AbjGLRxm (ORCPT ); Wed, 12 Jul 2023 13:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232797AbjGLRxi (ORCPT ); Wed, 12 Jul 2023 13:53:38 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3DB12109 for ; Wed, 12 Jul 2023 10:53:37 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1b89b0c73d7so8802685ad.1 for ; Wed, 12 Jul 2023 10:53:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184417; x=1689789217; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QurXhSXDDYPQxS3eICl+t2t9QVG4jXmJizxwtttvDq8=; b=VITeadwyJcnpc0W+6hnNF9yVA9HgDdQTUMJQk9cnp8orRBiWkGOM9AWYTX6ChHhG12 yYjdy3bit9GU3EmP5Q94Dsms3yEZgqOu3a9Wz9QywmmI3WO2JacTCT67N5POSwLtOAVv dmIRy7yNQML2bSmcrNYCvH544XdHQtOd12i8bKsCwuCzWGj/7XaQxENkYjCo9QtoQbyq ImG9oEy32HuG27QlbrhpH9fKi0TQV1hU1V0bbYMSNjc7FUq2Aw6yF2CqBTB+LtgV3Zzm 885Ps7b5idAaUR/G+XuxaKu5cQU52XNzKDFd4R6msUaDhNMezDouE7seIjXljw8c7sI+ LWKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184417; x=1689789217; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QurXhSXDDYPQxS3eICl+t2t9QVG4jXmJizxwtttvDq8=; b=gbC8o1S1UoCnXzqfDpbBA8XFU+ettK7G9NdfVKb5i0drU8o+wbfkaQQcpj9Gm90VxF NK9ikjTvNHcj7vl/WgHjoOQ55V4X1rkC0kMeVCQIEq95EfnMShfxqePreQfjRxisSRo5 wOYH6PEcLFbAldLgkAywIxM2ZoyDP14BveuouvH5QJFmlts68RdI2KMPbttzSi5QFRTy yUPSx0HZwz3VVknhlAWKjUgKuWM1SQP8wJ6lej9E5b9z1TuAa1j7Ltx+ZsEwbpUkvvoa 8h3FQGWMKkXStIbfaQ6I2WOYrRl1nzs3xT/yyhCiiH+W5bPC4YaNfzkAPRd2UoCRrXA9 tSlA== X-Gm-Message-State: ABy/qLacLvQE6DxL8fiFkccZ0FgjIODb4i5Ktz0n43U51dGNQcXO6dtA 9LeSAeFKH1PuR3cq/EEMNXwI4D58COI= X-Google-Smtp-Source: APBJJlFdV4daRCWvO7AW8/RfYP5xE7Nq6GsATEbLIeTke/5wGNeyVnyop6T7JFbhqWgW5ax/1+P0sg== X-Received: by 2002:a17:903:32c4:b0:1b8:a469:53d8 with SMTP id i4-20020a17090332c400b001b8a46953d8mr162568plr.0.1689184416785; Wed, 12 Jul 2023 10:53:36 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:36 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 03/12] lpfc: Remove extra ndlp kref decrement in FLOGI cmpl for loop topology Date: Wed, 12 Jul 2023 11:05:13 -0700 Message-Id: <20230712180522.112722-4-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In lpfc_cmpl_els_flogi, the return out: label decrements the ndlp kref signaling that FLOGI processing on the ndlp is complete. In loop topology path, there is an unnecessary ndlp put because it also branches to the out: label. This also signals ndlp usage completion too soon. As such, remove the extra lpfc_nlp_put when in loop topology. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_els.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 2bad9954c355..9a7b62d18455 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1041,7 +1041,7 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) lpfc_nlp_put(ndlp); - lpfc_printf_vlog(vport, KERN_WARNING, LOG_TRACE_EVENT, + lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS, "0150 FLOGI failure Status:x%x/x%x " "xri x%x TMO:x%x refcnt %d\n", ulp_status, ulp_word4, cmdiocb->sli4_xritag, @@ -1091,7 +1091,6 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, if (!lpfc_error_lost_link(vport, ulp_status, ulp_word4)) lpfc_issue_reg_vfi(vport); - lpfc_nlp_put(ndlp); goto out; } goto flogifail; From patchwork Wed Jul 12 18:05:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310796 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3D4CEB64DD for ; Wed, 12 Jul 2023 17:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232677AbjGLRxv (ORCPT ); Wed, 12 Jul 2023 13:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232671AbjGLRxk (ORCPT ); Wed, 12 Jul 2023 13:53:40 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BC921FED for ; Wed, 12 Jul 2023 10:53:39 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1b3ecb17721so11166485ad.0 for ; Wed, 12 Jul 2023 10:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184419; x=1691776419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9YyVfSu6+Kp5KIFRXj1gcMRMVFnmqTkhSHu02gqVfvo=; b=sdLcRtk5hJyH8YmFM5H+jd/378gh7DwhL4uFPGW3eDyJyZirq13Sq9Mdb2NapqN8Kn RQVvEBqhhtSh+/vp+j5QQjT+cw0xjgSfnsWIwQHuuhUCYVtkDJN2T1KgAqdY6XUxpJe/ 6MRViqFEViy0/cQFOMLpqP4KZ6lY9wVIBzoW4pKU4dsZMu1t+0p7EanCL2XIPg8nnzXm 1UVdEfnkTh7mCrTjbhv2gItfrI5eyEY18DAuDcbL222UDYqGuTD51gMTOlsGvV8vuJ4P lRRobB25mVImwDYYPRq/OSZIbm9wiKols2txFikEmQmkPJuFaZf1giW2JDb7ov3ZB/34 +3dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184419; x=1691776419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9YyVfSu6+Kp5KIFRXj1gcMRMVFnmqTkhSHu02gqVfvo=; b=ayFEsG3Bfabp/g9zAmzqqMmktyWD8qUi+we+j7izcqkwKjmfeehEIfWzx1j+KFDVcS PxYb52ViPA5zfstzLJY3rVQpQvaecaDXZRsCC4n4tk8SNF0VnhSQSKNz2MSL5ucJY1Ax g+A3u1IsD3spsApYM/X1Vl7WGUGHlKQFQduIOrX9bdut2q5V5Kwg5/EXTbfYclvo2JK7 EHTkP71ArPnZz9XtPpb2DCyeesX1aQoGtitmQRGKFTBCy0FWza7Li1hbSkLn03caPsRk PrKbn5o+9F+rbIezG4+sbskOIf8dJ4PW0yhFbshEMeKZl9SBhnSiBo04TyfOE3Ofiv0Y rS6Q== X-Gm-Message-State: ABy/qLYrxaqPnznS6CZIY2fj0wMsCWAbx1YjOuieGtbuovGPXs2cX5og fBDfZPK3F8SPPE8GIXgrg0pC7m2NwnQ= X-Google-Smtp-Source: APBJJlFgZxXS2c2udczIAlTThQAWeQDnupgNOGzLMPx9iblt08vw6kW2x19RGCAdQz46c+EioUy5vw== X-Received: by 2002:a17:902:eccc:b0:1b8:5827:8763 with SMTP id a12-20020a170902eccc00b001b858278763mr55792plh.4.1689184418834; Wed, 12 Jul 2023 10:53:38 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:38 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 04/12] lpfc: Qualify ndlp discovery state when processing RSCN Date: Wed, 12 Jul 2023 11:05:14 -0700 Message-Id: <20230712180522.112722-5-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Conditionalize when to put an ndlp into recovery mode when processing RSCNs. As long as an ndlp state is beyond a PLOGI issue and has been mapped to a transport layer before, the ndlp qualifies to be put into recovery mode. Otherwise, treat the ndlp rport normally through the discovery engine. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_hbadisc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 499849b58ee4..b4303254744a 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -5757,8 +5757,11 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) (NLP_FCP_TARGET | NLP_NVME_TARGET))) return NULL; - lpfc_disc_state_machine(vport, ndlp, NULL, - NLP_EVT_DEVICE_RECOVERY); + if (ndlp->nlp_state > NLP_STE_UNUSED_NODE && + ndlp->nlp_state < NLP_STE_NPR_NODE) { + lpfc_disc_state_machine(vport, ndlp, NULL, + NLP_EVT_DEVICE_RECOVERY); + } spin_lock_irq(&ndlp->lock); ndlp->nlp_flag |= NLP_NPR_2B_DISC; From patchwork Wed Jul 12 18:05:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310797 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14CA3EB64DA for ; Wed, 12 Jul 2023 17:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232441AbjGLRx4 (ORCPT ); Wed, 12 Jul 2023 13:53:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232555AbjGLRxp (ORCPT ); Wed, 12 Jul 2023 13:53:45 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A46A52100 for ; Wed, 12 Jul 2023 10:53:41 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1b9d9cbcc70so6559695ad.0 for ; Wed, 12 Jul 2023 10:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184421; x=1689789221; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e19eQPaQE2yvpbV9jflN87bZC5C/rFCgbTaQAV3M7c8=; b=YrAfI0BJlQWzmcOEmEv54PcHwISdKE9J1wwGV4GTRbkHSKSjZR942dSxaG9tMJaCON P0R2RPBXLTOg4+hBhvz3powvOqpwnUL1cEbnI+yP3X1eatUcsnLaNLx2G/eXNZYWVZh6 FZ1trlVIrk+EyDNZ4zPiiwztLVC641P/9lTIlWkUZ9BYsSrklECBHm3O90DRBbaMKFdX /yNek0AlM9Q2GkAG+9rBibhRh0GsuqZt7uzCe6+/luy0gab/MgiIdobRqADZAzJPKETA svDfi0YehI2g05f1q36e42gIEQLeQntSPwrMKHpmjLvOdodDNJysF+MS5iU6dNAwLu7K isvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184421; x=1689789221; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e19eQPaQE2yvpbV9jflN87bZC5C/rFCgbTaQAV3M7c8=; b=B7sUH7FQVnhJLj7I3fNjEMYHHAlYvo1qRjw2fQcDUiQGIlIRlp/jXMCYdlP0v8Kk4H 2hemMCPCSq9VGtsoPkDU7tHNCC6cLWOdv4KV+fyIUCjgnYXV+HWQS2JLamp6JomjLmMn 8hl9U8H/jj8xDkTkfqWmeuuebExFBuLyh5fAyRbELBgzUdyHkjyrH+q1O54LelLj3lqs zV7RfNq8Ponbl6KDMC3X+ImBtMHPSVdYscXTf+4kyEn+tmJvD1XoC0Lt6tD0G+CPy1K8 +9NRYOq4polC/toJIwyyZmtqZ78cu5lkrJZ1TBTVqcgJYY6VUw8RITO1gwT71ifbFY/4 KerQ== X-Gm-Message-State: ABy/qLbEaOcCLanHfV534zPVGNn3lfm28QN2XDJz9S3bKAuQd0VpzNZq 2Y6dvocdTAaDY2Bu9hO3xv7J9gq3ykw= X-Google-Smtp-Source: APBJJlGjwWGH3M4JO0W6a2Dbl1Mb4IPuFt0mImBu28DrqtUBTKt9UlZ9nCvcKvDTMfWg2bmdnG/ZIA== X-Received: by 2002:a17:903:22ca:b0:1b8:b0c4:2e3d with SMTP id y10-20020a17090322ca00b001b8b0c42e3dmr81095plg.4.1689184420441; Wed, 12 Jul 2023 10:53:40 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:40 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 05/12] lpfc: Revise ndlp kref handling for dev_loss_tmo_callbk and lpfc_drop_node Date: Wed, 12 Jul 2023 11:05:15 -0700 Message-Id: <20230712180522.112722-6-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The ndlp kref count implementation in lpfc_dev_loss_tmo_callbk removes the initial node reference when a vport is unloading. When lpfc_cleanup sends a DEVICE_RM event and is in NPR state, the driver calls lpfc_drop_node. Subsequently, lpfc_drop_node also removes an ndlp kref thinking it is the initial reference. This unintentionally introduces an extra kref decrement on the ndlp object. Fix by using the NLP_DROPPED node flag in lpfc_dev_loss_tmo_callbk and lpfc_drop_node to coordinate the removal of the initial node reference. In lpfc_dev_loss_tmo_callbk, remove the SCSI transport reference provided the node is registered in the dev_loss context because the driver cannot call the SCSI transport in dev_loss context or afterwards. And, have lpfc_drop_node not remove a reference if another thread is acting or has already acted on it. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_hbadisc.c | 70 +++++++++++++++++++++----------- drivers/scsi/lpfc/lpfc_nvme.c | 5 ++- 2 files changed, 50 insertions(+), 25 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index b4303254744a..388a481c8118 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -169,29 +169,44 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, "3181 dev_loss_callbk x%06x, rport x%px flg x%x " - "load_flag x%x refcnt %d state %d xpt x%x\n", + "load_flag x%x refcnt %u state %d xpt x%x\n", ndlp->nlp_DID, ndlp->rport, ndlp->nlp_flag, vport->load_flag, kref_read(&ndlp->kref), ndlp->nlp_state, ndlp->fc4_xpt_flags); - /* Don't schedule a worker thread event if the vport is going down. - * The teardown process cleans up the node via lpfc_drop_node. - */ + /* Don't schedule a worker thread event if the vport is going down. */ if (vport->load_flag & FC_UNLOADING) { - ((struct lpfc_rport_data *)rport->dd_data)->pnode = NULL; + spin_lock_irqsave(&ndlp->lock, iflags); ndlp->rport = NULL; - ndlp->fc4_xpt_flags &= ~SCSI_XPT_REGD; - /* clear the NLP_XPT_REGD if the node is not registered - * with nvme-fc + /* The scsi_transport is done with the rport so lpfc cannot + * call to unregister. Remove the scsi transport reference + * and clean up the SCSI transport node details. */ - if (ndlp->fc4_xpt_flags == NLP_XPT_REGD) - ndlp->fc4_xpt_flags &= ~NLP_XPT_REGD; + if (ndlp->fc4_xpt_flags & (NLP_XPT_REGD | SCSI_XPT_REGD)) { + ndlp->fc4_xpt_flags &= ~SCSI_XPT_REGD; - /* Remove the node reference from remote_port_add now. - * The driver will not call remote_port_delete. + /* NVME transport-registered rports need the + * NLP_XPT_REGD flag to complete an unregister. + */ + if (!(ndlp->fc4_xpt_flags & NVME_XPT_REGD)) + ndlp->fc4_xpt_flags &= ~NLP_XPT_REGD; + spin_unlock_irqrestore(&ndlp->lock, iflags); + lpfc_nlp_put(ndlp); + spin_lock_irqsave(&ndlp->lock, iflags); + } + + /* Only 1 thread can drop the initial node reference. If + * another thread has set NLP_DROPPED, this thread is done. */ - lpfc_nlp_put(ndlp); + if (!(ndlp->nlp_flag & NLP_DROPPED)) { + ndlp->nlp_flag |= NLP_DROPPED; + spin_unlock_irqrestore(&ndlp->lock, iflags); + lpfc_nlp_put(ndlp); + spin_lock_irqsave(&ndlp->lock, iflags); + } + + spin_unlock_irqrestore(&ndlp->lock, iflags); return; } @@ -4686,7 +4701,8 @@ lpfc_nlp_unreg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) spin_lock_irqsave(&ndlp->lock, iflags); if (!(ndlp->fc4_xpt_flags & NLP_XPT_REGD)) { spin_unlock_irqrestore(&ndlp->lock, iflags); - lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, + lpfc_printf_vlog(vport, KERN_INFO, + LOG_ELS | LOG_NODE | LOG_DISCOVERY, "0999 %s Not regd: ndlp x%px rport x%px DID " "x%x FLG x%x XPT x%x\n", __func__, ndlp, ndlp->rport, ndlp->nlp_DID, @@ -4702,9 +4718,10 @@ lpfc_nlp_unreg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) vport->phba->nport_event_cnt++; lpfc_unregister_remote_port(ndlp); } else if (!ndlp->rport) { - lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, + lpfc_printf_vlog(vport, KERN_INFO, + LOG_ELS | LOG_NODE | LOG_DISCOVERY, "1999 %s NDLP in devloss x%px DID x%x FLG x%x" - " XPT x%x refcnt %d\n", + " XPT x%x refcnt %u\n", __func__, ndlp, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->fc4_xpt_flags, kref_read(&ndlp->kref)); @@ -4954,22 +4971,29 @@ lpfc_drop_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) { /* * Use of lpfc_drop_node and UNUSED list: lpfc_drop_node should - * be used if we wish to issue the "last" lpfc_nlp_put() to remove - * the ndlp from the vport. The ndlp marked as UNUSED on the list - * until ALL other outstanding threads have completed. We check - * that the ndlp not already in the UNUSED state before we proceed. + * be used when lpfc wants to remove the "last" lpfc_nlp_put() to + * release the ndlp from the vport when conditions are correct. */ if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) return; lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); - ndlp->nlp_flag |= NLP_DROPPED; if (vport->phba->sli_rev == LPFC_SLI_REV4) { lpfc_cleanup_vports_rrqs(vport, ndlp); lpfc_unreg_rpi(vport, ndlp); } - lpfc_nlp_put(ndlp); - return; + /* NLP_DROPPED means another thread already removed the initial + * reference from lpfc_nlp_init. If set, don't drop it again and + * introduce an imbalance. + */ + spin_lock_irq(&ndlp->lock); + if (!(ndlp->nlp_flag & NLP_DROPPED)) { + ndlp->nlp_flag |= NLP_DROPPED; + spin_unlock_irq(&ndlp->lock); + lpfc_nlp_put(ndlp); + return; + } + spin_unlock_irq(&ndlp->lock); } /* diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index 3ee5cde481f3..39acbcb7ec66 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -2503,8 +2503,9 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, "6031 RemotePort Registration failed " - "err: %d, DID x%06x\n", - ret, ndlp->nlp_DID); + "err: %d, DID x%06x ref %u\n", + ret, ndlp->nlp_DID, kref_read(&ndlp->kref)); + lpfc_nlp_put(ndlp); } return ret; From patchwork Wed Jul 12 18:05:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310798 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA554EB64DA for ; Wed, 12 Jul 2023 17:54:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232994AbjGLRyD (ORCPT ); Wed, 12 Jul 2023 13:54:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232806AbjGLRxt (ORCPT ); Wed, 12 Jul 2023 13:53:49 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A65F61FD2 for ; Wed, 12 Jul 2023 10:53:42 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1b898cfa6a1so10687285ad.1 for ; Wed, 12 Jul 2023 10:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184422; x=1689789222; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HRCuaT4jsCLBUB5bQUQivklize9chHH8wdQ7qlVT8G4=; b=CYZxfMIQ5n6B71FT2CYbJVfcxEBvtdztB2QDCHCFG+k3MuFiSlPZS//ZyZzwtRRWyQ /h3n4RxL8TVSKu3gJi4l1Oq9yshpfYqzJ/4Utn2L8MWwPvvH+9yHg0J2zsQ2PReEEqLV xyOVEKJB74c5ZskrAW1d31CnH19824PbUaOK+SjSlO+DFoWmlik7lST2L34ey1LwE0vZ Pz7/9gWC98XOUk1ThR0mszglCrQumOFLEb1Q1DjdyQ0BlmjB4QU01rrEulqi0TnVeRfr 1C6cwaJybJG/ZgBr7zVZWcfk6uyiy0H4yS4VjxSF0m0JQoxEbWPpr4k9iXh5kv5yx6ph AVOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184422; x=1689789222; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HRCuaT4jsCLBUB5bQUQivklize9chHH8wdQ7qlVT8G4=; b=Eo3wawvEXRBAIsG98SPp+O2wuVaBdDjvGYEV7T3HMb4wBAwTZc4G0GqjZQ/uAP0zaO u3FuTFtFxHMAzi9ChEbtblNh3AAgsMGKAnRZD/W+mcbW0lgWTr5tnsj13CH/w3Usyfzr LHbpwdx2WrTRHz7j291QMeRa+YkCEiJUPo77e9zwTamE9wGLp0zoI0R/Eg3IB9Z4h//l Su293s41cvz9pyi7FRYjg9yHzYQYNde6YH8EmUprFrVmruA2G6DJmQQjgeilNaMbmjm2 u/eeDunk3pN2cv46js72S283W36moDPe7KkidFHO+bMw48DeJOLk9ONNxULyQuObY2fN bR1A== X-Gm-Message-State: ABy/qLaKdzzL66tI14P0G/8BUISgMFhbYRcgEc/J1gSMZy7jH9C+vk8w c6sKDPl7duSPmvEIozC33v+2nVF4y3I= X-Google-Smtp-Source: APBJJlE2gWG8YU5CDLxwbpvFCnvguQq/qPhZpMWB4oYGTUKQiAlGHLhpmqjkykGjXNu5u9Rb+YEhQA== X-Received: by 2002:a17:902:ec81:b0:1b3:d8ac:8db3 with SMTP id x1-20020a170902ec8100b001b3d8ac8db3mr67828plg.6.1689184421973; Wed, 12 Jul 2023 10:53:41 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:41 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 06/12] lpfc: Set Establish Image Pair service parameter only for Target Functions Date: Wed, 12 Jul 2023 11:05:16 -0700 Message-Id: <20230712180522.112722-7-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Previously, Establish Image Pair was set in all PRLI_ACC responses regardless if the received PRLI was from an initiator or target function. Specific target vendors that can operate in both initiator and target mode, may view the PRLI_ACC with Establish Image Pair set as an invalid service parameter when operating in initiator only mode. This causes discovery issues later when the target switches on its target mode function. Revise logic that determines an rport's role as an initiator or target and set the Establish Image Pair service parameter bit only if the Target Function bit is set. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_els.c | 16 +++++++++++- drivers/scsi/lpfc/lpfc_hw.h | 2 ++ drivers/scsi/lpfc/lpfc_nportdisc.c | 39 +++++++++++++++++++----------- 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 9a7b62d18455..aa48153c3735 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -6165,11 +6165,25 @@ lpfc_els_rsp_prli_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb, npr->TaskRetryIdReq = 1; } npr->acceptRspCode = PRLI_REQ_EXECUTED; - npr->estabImagePair = 1; + + /* Set image pair for complementary pairs only. */ + if (ndlp->nlp_type & NLP_FCP_TARGET) + npr->estabImagePair = 1; + else + npr->estabImagePair = 0; npr->readXferRdyDis = 1; npr->ConfmComplAllowed = 1; npr->prliType = PRLI_FCP_TYPE; npr->initiatorFunc = 1; + + /* Xmit PRLI ACC response tag */ + lpfc_printf_vlog(vport, KERN_INFO, + LOG_ELS | LOG_NODE | LOG_DISCOVERY, + "6014 FCP issue PRLI ACC imgpair %d " + "retry %d task %d\n", + npr->estabImagePair, + npr->Retry, npr->TaskRetryIdReq); + } else if (prli_fc4_req == PRLI_NVME_TYPE) { /* Respond with an NVME PRLI Type */ npr_nvme = (struct lpfc_nvme_prli *) pcmd; diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index aaea3e31944d..2108b4cb7815 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h @@ -764,6 +764,8 @@ typedef struct _PRLI { /* Structure is in Big Endian format */ #define PRLI_PREDEF_CONFIG 0x5 #define PRLI_PARTIAL_SUCCESS 0x6 #define PRLI_INVALID_PAGE_CNT 0x7 +#define PRLI_INV_SRV_PARM 0x8 + uint8_t word0Reserved3; /* FC Parm Word 0, bit 0:7 */ uint32_t origProcAssoc; /* FC Parm Word 1, bit 0:31 */ diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index b86ff9fcdf0c..6261560eb512 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -2148,6 +2148,7 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, struct lpfc_nvme_prli *nvpr; void *temp_ptr; u32 ulp_status; + bool acc_imode_sps = false; cmdiocb = (struct lpfc_iocbq *) arg; rspiocb = cmdiocb->rsp_iocb; @@ -2182,22 +2183,32 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, goto out_err; } - if (npr && (npr->acceptRspCode == PRLI_REQ_EXECUTED) && - (npr->prliType == PRLI_FCP_TYPE)) { - lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC, - "6028 FCP NPR PRLI Cmpl Init %d Target %d\n", - npr->initiatorFunc, - npr->targetFunc); - if (npr->initiatorFunc) - ndlp->nlp_type |= NLP_FCP_INITIATOR; - if (npr->targetFunc) { - ndlp->nlp_type |= NLP_FCP_TARGET; - if (npr->writeXferRdyDis) - ndlp->nlp_flag |= NLP_FIRSTBURST; + if (npr && npr->prliType == PRLI_FCP_TYPE) { + lpfc_printf_vlog(vport, KERN_INFO, + LOG_ELS | LOG_NODE | LOG_DISCOVERY, + "6028 FCP NPR PRLI Cmpl Init %d Target %d " + "EIP %d AccCode x%x\n", + npr->initiatorFunc, npr->targetFunc, + npr->estabImagePair, npr->acceptRspCode); + + if (npr->acceptRspCode == PRLI_INV_SRV_PARM) { + /* Strict initiators don't establish an image pair. */ + if (npr->initiatorFunc && !npr->targetFunc && + !npr->estabImagePair) + acc_imode_sps = true; } - if (npr->Retry) - ndlp->nlp_fcp_info |= NLP_FCP_2_DEVICE; + if (npr->acceptRspCode == PRLI_REQ_EXECUTED || acc_imode_sps) { + if (npr->initiatorFunc) + ndlp->nlp_type |= NLP_FCP_INITIATOR; + if (npr->targetFunc) { + ndlp->nlp_type |= NLP_FCP_TARGET; + if (npr->writeXferRdyDis) + ndlp->nlp_flag |= NLP_FIRSTBURST; + } + if (npr->Retry) + ndlp->nlp_fcp_info |= NLP_FCP_2_DEVICE; + } } else if (nvpr && (bf_get_be32(prli_acc_rsp_code, nvpr) == PRLI_REQ_EXECUTED) && From patchwork Wed Jul 12 18:05:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310799 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB08FEB64DA for ; Wed, 12 Jul 2023 17:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232830AbjGLRyL (ORCPT ); Wed, 12 Jul 2023 13:54:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232542AbjGLRxt (ORCPT ); Wed, 12 Jul 2023 13:53:49 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C2742103 for ; Wed, 12 Jul 2023 10:53:44 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-55b78bf0423so392230a12.0 for ; Wed, 12 Jul 2023 10:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184423; x=1691776423; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CUXpsLDX9EJlpe8C0YqEm3lcWH/cmQ9YrJ4oD++IMOU=; b=ARAkMrL1JMEXLku2a+3gSkSK/kypBLbAmOMKwTEhQiYsgpPLlutDlN9b4fx/+X+Ww4 LLiCC40qjzmka1Au80R7CwqZz1wG06XcMrmcNwHE1+M1P2OoDFrAQawaMdbB960W6Mpk GntZ632gN3q7nY4plrzUlHcWx0jL2DvgfYMzqwZ3pCIn/7HNza+NaWMlYBDgsYmg8d/X mIkn2599vyL9lQacDDf79tij1kuVaPtcb3Z+NigZQOeURx63NlEh0zSOtVYXq7yoC/xT 5fWf3VECgh4avG/m1k1uurBN1ZPG0bxbI3HAiTtSy93SUva/ZSkNRgbv7MLuBWQiphFp E+Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184423; x=1691776423; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CUXpsLDX9EJlpe8C0YqEm3lcWH/cmQ9YrJ4oD++IMOU=; b=PjJ5T2CIKkztuMBiGP+S1jk+DDRE7Lfib3R6kG/QlkH/Cd5OWeqcUGVX1IkgC6jsc0 FrZOaAxHBXIBrFEYsDL7+i1flroOaiMhjF9ftksqtmENhhltIcdawlKfJWiT6XVwaukO LruXxkrIAnI9IdPeChFfkXYV6wzSK8jnMf74OqgNDxLe3/pBROpoLnxzQeCQsc9V2l5X nb+Wi7cqM1PsN7sN2U/T5sKkKxUHaQmZ7Mept0Hts2UU2pO6MUeBsWtVb2vvph8114RK lOHLn/EZZWRBW4ip4lwbw60ynmajQC8aRAPsmgW6ZAvBb+a0pUD5oVUx8Glyfh6ygIIq Tj4w== X-Gm-Message-State: ABy/qLaJbPDiOAmul6Tbpjfg24OlttkiadTqmr4RopYWIzcPxE7Heuq0 ipovUIa/eFo5J1lEsF7P8b/2TZiHObQ= X-Google-Smtp-Source: APBJJlGiciC7ah+jNkY4izzmJGoifZzFtWQpL0X8YaIPc72yt2f2chlT60qDE6IEXX1HVUvpOK9snA== X-Received: by 2002:a17:903:32c9:b0:1b8:1591:9f81 with SMTP id i9-20020a17090332c900b001b815919f81mr58498plr.4.1689184423442; Wed, 12 Jul 2023 10:53:43 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:43 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 07/12] lpfc: Make fabric zone discovery more robust when handling unsolicited LOGO Date: Wed, 12 Jul 2023 11:05:17 -0700 Message-Id: <20230712180522.112722-8-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patch provides better target rport recovery when a target rport is running in initiator mode to discover the fabric. Such a target will issue a LOGO before switching back to strict target mode and changes are made to recover the login. Log messages are also updated accordingly. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_ct.c | 20 +++++++---- drivers/scsi/lpfc/lpfc_els.c | 14 ++++---- drivers/scsi/lpfc/lpfc_nportdisc.c | 53 ++++++++++++++++-------------- 3 files changed, 50 insertions(+), 37 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 474834f313a7..baae1f8279e0 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -1557,7 +1557,8 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ndlp->nlp_fc4_type |= NLP_FC4_FCP; if (fc4_data_1 & LPFC_FC4_TYPE_BITMASK) ndlp->nlp_fc4_type |= NLP_FC4_NVME; - lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, + lpfc_printf_vlog(vport, KERN_INFO, + LOG_DISCOVERY | LOG_NODE, "3064 Setting ndlp x%px, DID x%06x " "with FC4 x%08x, Data: x%08x x%08x " "%d\n", @@ -1568,14 +1569,21 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, if (ndlp->nlp_state == NLP_STE_REG_LOGIN_ISSUE && ndlp->nlp_fc4_type) { ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; - - lpfc_nlp_set_state(vport, ndlp, - NLP_STE_PRLI_ISSUE); - lpfc_issue_els_prli(vport, ndlp, 0); + /* This is a fabric topology so if discovery + * started with an unsolicited PLOGI, don't + * send a PRLI. Targets don't issue PLOGI or + * PRLI when acting as a target. Likely this is + * an initiator function. + */ + if (!(ndlp->nlp_flag & NLP_RCV_PLOGI)) { + lpfc_nlp_set_state(vport, ndlp, + NLP_STE_PRLI_ISSUE); + lpfc_issue_els_prli(vport, ndlp, 0); + } } else if (!ndlp->nlp_fc4_type) { /* If fc4 type is still unknown, then LOGO */ lpfc_printf_vlog(vport, KERN_INFO, - LOG_DISCOVERY, + LOG_DISCOVERY | LOG_NODE, "6443 Sending LOGO ndlp x%px," "DID x%06x with fc4_type: " "x%08x, state: %d\n", diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index aa48153c3735..f37757449f3c 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2376,10 +2376,10 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, /* PRLI failed */ lpfc_printf_vlog(vport, mode, loglevel, "2754 PRLI failure DID:%06X Status:x%x/x%x, " - "data: x%x x%x\n", + "data: x%x x%x x%x\n", ndlp->nlp_DID, ulp_status, ulp_word4, ndlp->nlp_state, - ndlp->fc4_prli_sent); + ndlp->fc4_prli_sent, ndlp->nlp_flag); /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ if (!lpfc_error_lost_link(vport, ulp_status, ulp_word4)) @@ -2390,14 +2390,16 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, * mismatch typically caused by an RSCN. Skip any * processing to allow recovery. */ - if (ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE && - ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE) { + if ((ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE && + ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE) || + (ndlp->nlp_state == NLP_STE_NPR_NODE && + ndlp->nlp_flag & NLP_DELAY_TMO)) { lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, - "2784 PRLI cmpl: state mismatch " + "2784 PRLI cmpl: Allow Node recovery " "DID x%06x nstate x%x nflag x%x\n", ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag); - goto out; + goto out; } /* diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 6261560eb512..8f6424487397 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -879,23 +879,34 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, spin_unlock_irq(shost->host_lock); lpfc_retry_pport_discovery(phba); } - } else if ((!(ndlp->nlp_type & NLP_FABRIC) && - ((ndlp->nlp_type & NLP_FCP_TARGET) || - (ndlp->nlp_type & NLP_NVME_TARGET) || - (vport->fc_flag & FC_PT2PT))) || - (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { - /* Only try to re-login if this is NOT a Fabric Node - * AND the remote NPORT is a FCP/NVME Target or we - * are in pt2pt mode. NLP_STE_ADISC_ISSUE is a special - * case for LOGO as a response to ADISC behavior. - */ - mod_timer(&ndlp->nlp_delayfunc, - jiffies + msecs_to_jiffies(1000 * 1)); - spin_lock_irq(&ndlp->lock); - ndlp->nlp_flag |= NLP_DELAY_TMO; - spin_unlock_irq(&ndlp->lock); - - ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; + } else { + lpfc_printf_vlog(vport, KERN_INFO, + LOG_NODE | LOG_ELS | LOG_DISCOVERY, + "3203 LOGO recover nport x%06x state x%x " + "ntype x%x fc_flag x%x\n", + ndlp->nlp_DID, ndlp->nlp_state, + ndlp->nlp_type, vport->fc_flag); + + /* Special cases for rports that recover post LOGO. */ + if ((!(ndlp->nlp_type == NLP_FABRIC) && + (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET) || + vport->fc_flag & FC_PT2PT)) || + (ndlp->nlp_state >= NLP_STE_ADISC_ISSUE || + ndlp->nlp_state <= NLP_STE_PRLI_ISSUE)) { + mod_timer(&ndlp->nlp_delayfunc, + jiffies + msecs_to_jiffies(1000 * 1)); + spin_lock_irq(&ndlp->lock); + ndlp->nlp_flag |= NLP_DELAY_TMO; + spin_unlock_irq(&ndlp->lock); + ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; + lpfc_printf_vlog(vport, KERN_INFO, + LOG_NODE | LOG_ELS | LOG_DISCOVERY, + "3204 Start nlpdelay on DID x%06x " + "nflag x%x lastels x%x ref cnt %u", + ndlp->nlp_DID, ndlp->nlp_flag, + ndlp->nlp_last_elscmd, + kref_read(&ndlp->kref)); + } } out: /* Unregister from backend, could have been skipped due to ADISC */ @@ -1854,7 +1865,6 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; LPFC_MBOXQ_t *mb; LPFC_MBOXQ_t *nextmb; - struct lpfc_nodelist *ns_ndlp; cmdiocb = (struct lpfc_iocbq *) arg; @@ -1882,13 +1892,6 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc_vport *vport, } spin_unlock_irq(&phba->hbalock); - /* software abort if any GID_FT is outstanding */ - if (vport->cfg_enable_fc4_type != LPFC_ENABLE_FCP) { - ns_ndlp = lpfc_findnode_did(vport, NameServer_DID); - if (ns_ndlp) - lpfc_els_abort(phba, ns_ndlp); - } - lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_LOGO); return ndlp->nlp_state; } From patchwork Wed Jul 12 18:05:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310800 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CA7FEB64DA for ; Wed, 12 Jul 2023 17:54:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232665AbjGLRyP (ORCPT ); Wed, 12 Jul 2023 13:54:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232887AbjGLRxu (ORCPT ); Wed, 12 Jul 2023 13:53:50 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88C84211C for ; Wed, 12 Jul 2023 10:53:45 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1b89c09521dso8778645ad.0 for ; Wed, 12 Jul 2023 10:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184425; x=1689789225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yx/Jf4e2+y9G2p/tuS6GsfFoY/gArJ7gLbH1sPvcGkc=; b=K6HGYA5tKlOemTax0gE9F7vWorE07509sLrYyEnyXBTctWj7aEJcCApywGZIoVHcKf kI4YIxRLhdbjfNaG2kiNZtcfOxsR1T2wzWwR1EiwREelRKzC4UuNlr7Z27vqoKx/FngN tKMOvG1Jkfpf3z7yelDzNoTlhKdJRGePZKbXvxM9ByywuLI9itw7lFJDchCKX1QmLf5k OB+a7f+ueUr4XzK7VvwLiI+Ay7iA0wCvHgKWnKiTPzI0lhOO+4shaTBoQG6IB277GlDv 5Jkl4GCqvhmjVZJMXGvaseiRxGk+B92IOIs6iMCQ0QOQMEhtEAGmhPIkEGbRXdMtu+oW L+RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184425; x=1689789225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yx/Jf4e2+y9G2p/tuS6GsfFoY/gArJ7gLbH1sPvcGkc=; b=bghwUwif+vLnx+6r+vxg+goqZaOJtenULTRKmJyAHnj263KJ5RxiC8am7r9/eeZkVW YibBOJZ+cFwU+dU1Zv+fg9gZK+FONDK3dAnp5ULebtoircpi6P8jFK9DFNckhE+8gX/a BiDPzRUkamZoCGZksF2YGlD8f6K0ePCDjV5FmehJRVej+ZCL2rGjUWm1408Mg3lgTQm2 56EYHv6p+I71L/CazKvG5WgSzC0rW7rf+HOlrzNAvRnwWzfeXHHk9VQ4fl1Ta7c4byC3 JG4iP6FvS1gb0jpZX1tQl50a/+YA7CoQPThCZsdZxsq5LIXuppqwIOux5kL8m0K0MfqF RaIA== X-Gm-Message-State: ABy/qLZl4Yrl/FLtLHrrf6J1U+blGAquDzrgGLJX2nbScQOV3GEy6TQf 8PmUZk1ErAwvjiVvs/WIZKm03BYYXeU= X-Google-Smtp-Source: APBJJlGjFoubBRWMYOJ21w+05FvO2Dl6ZPIbbCr8gX8mCyC5UNtmJAjfQu015mWDxa1JKGfweUP0pA== X-Received: by 2002:a17:903:32c4:b0:1b8:a469:53d8 with SMTP id i4-20020a17090332c400b001b8a46953d8mr162913plr.0.1689184424844; Wed, 12 Jul 2023 10:53:44 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:44 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 08/12] lpfc: Abort outstanding ELS cmds when mailbox timeout error is detected Date: Wed, 12 Jul 2023 11:05:18 -0700 Message-Id: <20230712180522.112722-9-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org A mailbox timeout error usually indicates something has gone wrong, and a follow up reset of the HBA is a typical recovery mechanism. Introduce a MBX_TMO_ERR flag to detect such cases and have lpfc_els_flush_cmd abort ELS commands if the MBX_TMO_ERR flag condition was set. This ensures all of the registered SGL resources meant for ELS traffic are not leaked after an HBA reset. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc.h | 1 + drivers/scsi/lpfc/lpfc_els.c | 25 ++++++++++++++++++------- drivers/scsi/lpfc/lpfc_init.c | 20 +++++++++++++++++--- drivers/scsi/lpfc/lpfc_sli.c | 8 +++++++- 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 9a8963684369..e8d7eeeb2185 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -872,6 +872,7 @@ enum lpfc_irq_chann_mode { enum lpfc_hba_bit_flags { FABRIC_COMANDS_BLOCKED, HBA_PCI_ERR, + MBX_TMO_ERR, }; struct lpfc_hba { diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index f37757449f3c..b5cd6d1c0a5a 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -9603,11 +9603,13 @@ void lpfc_els_flush_cmd(struct lpfc_vport *vport) { LIST_HEAD(abort_list); + LIST_HEAD(cancel_list); struct lpfc_hba *phba = vport->phba; struct lpfc_sli_ring *pring; struct lpfc_iocbq *tmp_iocb, *piocb; u32 ulp_command; unsigned long iflags = 0; + bool mbx_tmo_err; lpfc_fabric_abort_vport(vport); @@ -9629,15 +9631,16 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport) if (phba->sli_rev == LPFC_SLI_REV4) spin_lock(&pring->ring_lock); + mbx_tmo_err = test_bit(MBX_TMO_ERR, &phba->bit_flags); /* First we need to issue aborts to outstanding cmds on txcmpl */ list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) { - if (piocb->cmd_flag & LPFC_IO_LIBDFC) + if (piocb->cmd_flag & LPFC_IO_LIBDFC && !mbx_tmo_err) continue; if (piocb->vport != vport) continue; - if (piocb->cmd_flag & LPFC_DRIVER_ABORTED) + if (piocb->cmd_flag & LPFC_DRIVER_ABORTED && !mbx_tmo_err) continue; /* On the ELS ring we can have ELS_REQUESTs or @@ -9656,8 +9659,8 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport) */ if (phba->link_state == LPFC_LINK_DOWN) piocb->cmd_cmpl = lpfc_cmpl_els_link_down; - } - if (ulp_command == CMD_GEN_REQUEST64_CR) + } else if (ulp_command == CMD_GEN_REQUEST64_CR || + mbx_tmo_err) list_add_tail(&piocb->dlist, &abort_list); } @@ -9669,11 +9672,19 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport) list_for_each_entry_safe(piocb, tmp_iocb, &abort_list, dlist) { spin_lock_irqsave(&phba->hbalock, iflags); list_del_init(&piocb->dlist); - lpfc_sli_issue_abort_iotag(phba, pring, piocb, NULL); + if (mbx_tmo_err) + list_move_tail(&piocb->list, &cancel_list); + else + lpfc_sli_issue_abort_iotag(phba, pring, piocb, NULL); + spin_unlock_irqrestore(&phba->hbalock, iflags); } - /* Make sure HBA is alive */ - lpfc_issue_hb_tmo(phba); + if (!list_empty(&cancel_list)) + lpfc_sli_cancel_iocbs(phba, &cancel_list, IOSTAT_LOCAL_REJECT, + IOERR_SLI_ABORTED); + else + /* Make sure HBA is alive */ + lpfc_issue_hb_tmo(phba); if (!list_empty(&abort_list)) lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 041d6f0f2097..c878fb99dc4c 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -7550,6 +7550,8 @@ lpfc_disable_pci_dev(struct lpfc_hba *phba) void lpfc_reset_hba(struct lpfc_hba *phba) { + int rc = 0; + /* If resets are disabled then set error state and return. */ if (!phba->cfg_enable_hba_reset) { phba->link_state = LPFC_HBA_ERROR; @@ -7560,13 +7562,25 @@ lpfc_reset_hba(struct lpfc_hba *phba) if (phba->sli.sli_flag & LPFC_SLI_ACTIVE) { lpfc_offline_prep(phba, LPFC_MBX_WAIT); } else { + if (test_bit(MBX_TMO_ERR, &phba->bit_flags)) { + /* Perform a PCI function reset to start from clean */ + rc = lpfc_pci_function_reset(phba); + lpfc_els_flush_all_cmd(phba); + } lpfc_offline_prep(phba, LPFC_MBX_NO_WAIT); lpfc_sli_flush_io_rings(phba); } lpfc_offline(phba); - lpfc_sli_brdrestart(phba); - lpfc_online(phba); - lpfc_unblock_mgmt_io(phba); + clear_bit(MBX_TMO_ERR, &phba->bit_flags); + if (unlikely(rc)) { + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, + "8888 PCI function reset failed rc %x\n", + rc); + } else { + lpfc_sli_brdrestart(phba); + lpfc_online(phba); + lpfc_unblock_mgmt_io(phba); + } } /** diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 58d10f8f75a7..4dfadf254a72 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -3935,6 +3935,8 @@ void lpfc_poll_eratt(struct timer_list *t) uint64_t sli_intr, cnt; phba = from_timer(phba, t, eratt_poll); + if (!(phba->hba_flag & HBA_SETUP)) + return; /* Here we will also keep track of interrupts per sec of the hba */ sli_intr = phba->sli.slistat.sli_intr; @@ -7693,7 +7695,9 @@ lpfc_sli4_repost_sgl_list(struct lpfc_hba *phba, spin_unlock_irq(&phba->hbalock); } else { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, - "3161 Failure to post sgl to port.\n"); + "3161 Failure to post sgl to port,status %x " + "blkcnt %d totalcnt %d postcnt %d\n", + status, block_cnt, total_cnt, post_cnt); return -EIO; } @@ -8478,6 +8482,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) spin_unlock_irq(&phba->hbalock); } } + phba->hba_flag &= ~HBA_SETUP; lpfc_sli4_dip(phba); @@ -9282,6 +9287,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) * would get IOCB_ERROR from lpfc_sli_issue_iocb, allowing * it to fail all outstanding SCSI IO. */ + set_bit(MBX_TMO_ERR, &phba->bit_flags); spin_lock_irq(&phba->pport->work_port_lock); phba->pport->work_port_events &= ~WORKER_MBOX_TMO; spin_unlock_irq(&phba->pport->work_port_lock); From patchwork Wed Jul 12 18:05:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310802 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D51AEB64DA for ; Wed, 12 Jul 2023 17:54:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233030AbjGLRyV (ORCPT ); Wed, 12 Jul 2023 13:54:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232960AbjGLRxx (ORCPT ); Wed, 12 Jul 2023 13:53:53 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43A1B2127 for ; Wed, 12 Jul 2023 10:53:47 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-5576ad1b7e7so1162413a12.1 for ; Wed, 12 Jul 2023 10:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184426; x=1691776426; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4br7Q1jVmRYhKEYxZCPhw0Y3V9fusF+D1c/MNj+YSos=; b=RS7ozfatCT7AYua1V5pHGrf9mqEYgygDzbveZ43eg6WhpzI8kPPC379ZPFFlAgtRm0 7gAeIEpffh8j+ieeZPvrxb6vihgu5Fxk0rAUa8R3De+Bfmd1L4uWjNWHUCSnvm6pTmzO ZMqp9kui54hoJQpiFEvQNZc9aVgAClAZPh5xmlpF9Aw0Fsb6Wh4Cwfedc4Ukkkk0tDOE hVHXw0Q4Z3r9gDlNQCgq55vej1y5wToPE327S1HVbVyMTnXecFCxW36/t2cwKRM4pL6P siZUG5JOmosww3N+QRvCEu8g6gQxm7e+RTadEdlLQvZfgyd8P7VRpAcERVg84V47D9Z3 fl6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184426; x=1691776426; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4br7Q1jVmRYhKEYxZCPhw0Y3V9fusF+D1c/MNj+YSos=; b=HiBPp+u2OjjNOyGRpGTGGCHCwrbTNiGZA4Fy6QOE7kKAr6dqnjLyJHLuCi4f8UD4HQ A/j3ZQ4saBOfPsYv8pHmUBUIgY8RVrXq95T80GwALR91p1ZxEO2+I2IXtLoRDH/4jtmh 9I120XDTX8IirPQNVOC0b5Bqh6zkRNfgPuNCwzRu22mkUj2G/xU7Ee4OQ18zaeex2xvd mhC2AG7aCIKic4i1bWSbe3YcJnl28dcXDy3CGXbIEG2pDLwIz27uHLBtIdpph4dqHq5C k4Fkh+B6cLNeFMu6tR+Xp2JaBd4B3UOMBX5XGj1aoQ0CEv3qvG3iBwO9zmE+cvsAXvwB wdFA== X-Gm-Message-State: ABy/qLb/Y7LPLqcw0DRM/M0chxa88Zt0LHD2V+XZL5j24Hde/sejjy0B bo1F5uB44wl3ViZi01P/chNfmhL+TQQ= X-Google-Smtp-Source: APBJJlEBYkZDh2L0fGmSCi8u4RhcI7TO5HX360wYmkSieJSWZEPT3NAoojRCwMfAFhLHPL+NvtvkKQ== X-Received: by 2002:a17:903:22c4:b0:1b8:9215:9163 with SMTP id y4-20020a17090322c400b001b892159163mr43434plg.6.1689184426478; Wed, 12 Jul 2023 10:53:46 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:46 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 09/12] lpfc: Refactor cpu affinity assignment paths Date: Wed, 12 Jul 2023 11:05:19 -0700 Message-Id: <20230712180522.112722-10-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org During initialization, a lot of the same logic is used on MSI-X vector cpu affinity assignment. Create a lpfc_next_present_cpu helper routine, and apply its usage for refactoring purposes. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc.h | 19 +++++++++++++++++++ drivers/scsi/lpfc/lpfc_init.c | 31 +++++++------------------------ drivers/scsi/lpfc/lpfc_nvmet.c | 5 +---- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index e8d7eeeb2185..bc1c5f6df090 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1709,6 +1709,25 @@ lpfc_next_online_cpu(const struct cpumask *mask, unsigned int start) return cpu_it; } +/** + * lpfc_next_present_cpu - Finds next present CPU after n + * @n: the cpu prior to search + * + * Note: If no next present cpu, then fallback to first present cpu. + * + **/ +static inline unsigned int lpfc_next_present_cpu(int n) +{ + unsigned int cpu; + + cpu = cpumask_next(n, cpu_present_mask); + + if (cpu >= nr_cpu_ids) + cpu = cpumask_first(cpu_present_mask); + + return cpu; +} + /** * lpfc_sli4_mod_hba_eq_delay - update EQ delay * @phba: Pointer to HBA context object. diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index c878fb99dc4c..9e59c050103d 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -12512,10 +12512,7 @@ lpfc_cpu_affinity_check(struct lpfc_hba *phba, int vectors) (new_cpup->eq != LPFC_VECTOR_MAP_EMPTY) && (new_cpup->phys_id == cpup->phys_id)) goto found_same; - new_cpu = cpumask_next( - new_cpu, cpu_present_mask); - if (new_cpu >= nr_cpu_ids) - new_cpu = first_cpu; + new_cpu = lpfc_next_present_cpu(new_cpu); } /* At this point, we leave the CPU as unassigned */ continue; @@ -12527,9 +12524,7 @@ lpfc_cpu_affinity_check(struct lpfc_hba *phba, int vectors) * chance of having multiple unassigned CPU entries * selecting the same IRQ. */ - start_cpu = cpumask_next(new_cpu, cpu_present_mask); - if (start_cpu >= nr_cpu_ids) - start_cpu = first_cpu; + start_cpu = lpfc_next_present_cpu(new_cpu); lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "3337 Set Affinity: CPU %d " @@ -12562,10 +12557,7 @@ lpfc_cpu_affinity_check(struct lpfc_hba *phba, int vectors) if (!(new_cpup->flag & LPFC_CPU_MAP_UNASSIGN) && (new_cpup->eq != LPFC_VECTOR_MAP_EMPTY)) goto found_any; - new_cpu = cpumask_next( - new_cpu, cpu_present_mask); - if (new_cpu >= nr_cpu_ids) - new_cpu = first_cpu; + new_cpu = lpfc_next_present_cpu(new_cpu); } /* We should never leave an entry unassigned */ lpfc_printf_log(phba, KERN_ERR, LOG_INIT, @@ -12581,9 +12573,7 @@ lpfc_cpu_affinity_check(struct lpfc_hba *phba, int vectors) * chance of having multiple unassigned CPU entries * selecting the same IRQ. */ - start_cpu = cpumask_next(new_cpu, cpu_present_mask); - if (start_cpu >= nr_cpu_ids) - start_cpu = first_cpu; + start_cpu = lpfc_next_present_cpu(new_cpu); lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "3338 Set Affinity: CPU %d " @@ -12654,9 +12644,7 @@ lpfc_cpu_affinity_check(struct lpfc_hba *phba, int vectors) new_cpup->core_id == cpup->core_id) { goto found_hdwq; } - new_cpu = cpumask_next(new_cpu, cpu_present_mask); - if (new_cpu >= nr_cpu_ids) - new_cpu = first_cpu; + new_cpu = lpfc_next_present_cpu(new_cpu); } /* If we can't match both phys_id and core_id, @@ -12668,10 +12656,7 @@ lpfc_cpu_affinity_check(struct lpfc_hba *phba, int vectors) if (new_cpup->hdwq != LPFC_VECTOR_MAP_EMPTY && new_cpup->phys_id == cpup->phys_id) goto found_hdwq; - - new_cpu = cpumask_next(new_cpu, cpu_present_mask); - if (new_cpu >= nr_cpu_ids) - new_cpu = first_cpu; + new_cpu = lpfc_next_present_cpu(new_cpu); } /* Otherwise just round robin on cfg_hdw_queue */ @@ -12680,9 +12665,7 @@ lpfc_cpu_affinity_check(struct lpfc_hba *phba, int vectors) goto logit; found_hdwq: /* We found an available entry, copy the IRQ info */ - start_cpu = cpumask_next(new_cpu, cpu_present_mask); - if (start_cpu >= nr_cpu_ids) - start_cpu = first_cpu; + start_cpu = lpfc_next_present_cpu(new_cpu); cpup->hdwq = new_cpup->hdwq; logit: lpfc_printf_log(phba, KERN_INFO, LOG_INIT, diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c index dff4584d338b..425328d9c2d8 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.c +++ b/drivers/scsi/lpfc/lpfc_nvmet.c @@ -1620,10 +1620,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) cpu = cpumask_first(cpu_present_mask); continue; } - cpu = cpumask_next(cpu, cpu_present_mask); - if (cpu == nr_cpu_ids) - cpu = cpumask_first(cpu_present_mask); - + cpu = lpfc_next_present_cpu(cpu); } for_each_present_cpu(i) { From patchwork Wed Jul 12 18:05:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49786C0015E for ; Wed, 12 Jul 2023 17:54:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233128AbjGLRyW (ORCPT ); Wed, 12 Jul 2023 13:54:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232972AbjGLRxx (ORCPT ); Wed, 12 Jul 2023 13:53:53 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE873212D for ; Wed, 12 Jul 2023 10:53:48 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-676cc97ca74so1647762b3a.1 for ; Wed, 12 Jul 2023 10:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184428; x=1689789228; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Lkcn6jjamEII+0zvdwv69Z5HuW6ijaZMDO9tv3a3e48=; b=aRxF8cDA1xBwUHyoOfeBT2S2Hdhk0jiwG6M7zR6WqPaCecviDeB+EngoP1jxP4bbiO OXLBwlUyZnzXwH+YzKYmyFuSgjgRjjwEQYJ1RVKM3zdCbjoIT3WBcbrhielXQdjc0BaY LZdnbW9tTWtroqW0oipyzanz/CquJefqLhKRW6qRpCcFsC6T7Vd/Sge3oSozmucb+aPi XR3TniLaCF0O3sj2x8ThttXyjKHlM/man0mLs3iK8EJH/af6h8hkJ4RMYYMXaVDyO+o4 DpFiZEBnesHic4Ywi06vyB4ngUdXACDtM9CZSTG5sf+4NBoXCoC2W3X/1I3RV99HVWRL fwAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184428; x=1689789228; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lkcn6jjamEII+0zvdwv69Z5HuW6ijaZMDO9tv3a3e48=; b=ek4z5nspiVHnu9Xhn/XexN51mKWx6gcpjYaMchrj/+TliVq5SPP4al7DU1LvzQFSTS kSQS33OwR2z1jISksyiXb+YteNiP15hOEBWGVGy+b9z6pFA3n/VD0MfmQSAC5Is5Bb8U 9RtFu4XGQSdACSmh90u0NQ2n9C1tOeJpn5kpBqrPSOdZVpVn9rgrBjd3K0CIHzbs0Cbz /VnRdVYcOGXXfbEqlKW1EnsguooZepPpbGRpFn0YxzeDsK2Fz/eCLJdi64u/CK1mcOlx CcG987/FUGdsrnStB9igR9mO7wMxyLd6ONn5UrHEWEo4UlfsuhVdcKUIVaBYyaKHdiRa ZFtA== X-Gm-Message-State: ABy/qLYOePZFx+FcxHTPVvVU2hF3ZBYmhCG3x0c+n+6/1qxucLztFRIa dJLgJ6NX7fXp045aK2KPEJt5JFCd0XA= X-Google-Smtp-Source: APBJJlHHgP5fq+6VWt503CXNLrliWFSpNH/LJCphw40G1bGWB5iupqvbik2xZxX7nTm1skGqno8Vcw== X-Received: by 2002:a17:902:d483:b0:1b8:95fc:cfe with SMTP id c3-20020a170902d48300b001b895fc0cfemr54316plg.3.1689184428069; Wed, 12 Jul 2023 10:53:48 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:47 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 10/12] lpfc: Clean up SLI-4 sysfs resource reporting Date: Wed, 12 Jul 2023 11:05:20 -0700 Message-Id: <20230712180522.112722-11-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Currently, we have dated logic to work around the differences between SLI-4 and SLI-3 resource reporting through sysfs. Leave the SLI-3 path untouched, but for SLI4 path, retrieve resource values from the phba->sli4_hba->max_cfg_param structure. Max values are populated during ACQE events right after READ_CONFIG mbox cmd is sent. Instead of the dated subtraction logic, used resource calculation is directly fed into sysfs for display. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_attr.c | 136 +++++++++++++++++++++++++--------- 1 file changed, 101 insertions(+), 35 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 21c7ecd3ede5..b1c9107d3408 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -2127,11 +2127,12 @@ lpfc_get_hba_info(struct lpfc_hba *phba, uint32_t *mrpi, uint32_t *arpi, uint32_t *mvpi, uint32_t *avpi) { - struct lpfc_mbx_read_config *rd_config; LPFC_MBOXQ_t *pmboxq; MAILBOX_t *pmb; int rc = 0; - uint32_t max_vpi; + struct lpfc_sli4_hba *sli4_hba; + struct lpfc_max_cfg_param *max_cfg_param; + u16 rsrc_ext_cnt, rsrc_ext_size, max_vpi; /* * prevent udev from issuing mailbox commands until the port is @@ -2167,31 +2168,65 @@ lpfc_get_hba_info(struct lpfc_hba *phba, } if (phba->sli_rev == LPFC_SLI_REV4) { - rd_config = &pmboxq->u.mqe.un.rd_config; - if (mrpi) - *mrpi = bf_get(lpfc_mbx_rd_conf_rpi_count, rd_config); - if (arpi) - *arpi = bf_get(lpfc_mbx_rd_conf_rpi_count, rd_config) - - phba->sli4_hba.max_cfg_param.rpi_used; - if (mxri) - *mxri = bf_get(lpfc_mbx_rd_conf_xri_count, rd_config); - if (axri) - *axri = bf_get(lpfc_mbx_rd_conf_xri_count, rd_config) - - phba->sli4_hba.max_cfg_param.xri_used; + sli4_hba = &phba->sli4_hba; + max_cfg_param = &sli4_hba->max_cfg_param; + + /* Normally, extents are not used */ + if (!phba->sli4_hba.extents_in_use) { + if (mrpi) + *mrpi = max_cfg_param->max_rpi; + if (mxri) + *mxri = max_cfg_param->max_xri; + if (mvpi) { + max_vpi = max_cfg_param->max_vpi; + + /* Limit the max we support */ + if (max_vpi > LPFC_MAX_VPI) + max_vpi = LPFC_MAX_VPI; + *mvpi = max_vpi; + } + } else { /* Extents in use */ + if (mrpi) { + if (lpfc_sli4_get_avail_extnt_rsrc(phba, + LPFC_RSC_TYPE_FCOE_RPI, + &rsrc_ext_cnt, + &rsrc_ext_size)) { + rc = 0; + goto free_pmboxq; + } + + *mrpi = rsrc_ext_cnt * rsrc_ext_size; + } - /* Account for differences with SLI-3. Get vpi count from - * mailbox data and subtract one for max vpi value. - */ - max_vpi = (bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config) > 0) ? - (bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config) - 1) : 0; + if (mxri) { + if (lpfc_sli4_get_avail_extnt_rsrc(phba, + LPFC_RSC_TYPE_FCOE_XRI, + &rsrc_ext_cnt, + &rsrc_ext_size)) { + rc = 0; + goto free_pmboxq; + } - /* Limit the max we support */ - if (max_vpi > LPFC_MAX_VPI) - max_vpi = LPFC_MAX_VPI; - if (mvpi) - *mvpi = max_vpi; - if (avpi) - *avpi = max_vpi - phba->sli4_hba.max_cfg_param.vpi_used; + *mxri = rsrc_ext_cnt * rsrc_ext_size; + } + + if (mvpi) { + if (lpfc_sli4_get_avail_extnt_rsrc(phba, + LPFC_RSC_TYPE_FCOE_VPI, + &rsrc_ext_cnt, + &rsrc_ext_size)) { + rc = 0; + goto free_pmboxq; + } + + max_vpi = rsrc_ext_cnt * rsrc_ext_size; + + /* Limit the max we support */ + if (max_vpi > LPFC_MAX_VPI) + max_vpi = LPFC_MAX_VPI; + *mvpi = max_vpi; + } + } } else { if (mrpi) *mrpi = pmb->un.varRdConfig.max_rpi; @@ -2212,8 +2247,12 @@ lpfc_get_hba_info(struct lpfc_hba *phba, } } + /* Success */ + rc = 1; + +free_pmboxq: mempool_free(pmboxq, phba->mbox_mem_pool); - return 1; + return rc; } /** @@ -2265,10 +2304,19 @@ lpfc_used_rpi_show(struct device *dev, struct device_attribute *attr, struct Scsi_Host *shost = class_to_shost(dev); struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; struct lpfc_hba *phba = vport->phba; - uint32_t cnt, acnt; + struct lpfc_sli4_hba *sli4_hba; + struct lpfc_max_cfg_param *max_cfg_param; + u32 cnt = 0, acnt = 0; - if (lpfc_get_hba_info(phba, NULL, NULL, &cnt, &acnt, NULL, NULL)) - return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); + if (phba->sli_rev == LPFC_SLI_REV4) { + sli4_hba = &phba->sli4_hba; + max_cfg_param = &sli4_hba->max_cfg_param; + return scnprintf(buf, PAGE_SIZE, "%d\n", + max_cfg_param->rpi_used); + } else { + if (lpfc_get_hba_info(phba, NULL, NULL, &cnt, &acnt, NULL, NULL)) + return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); + } return scnprintf(buf, PAGE_SIZE, "Unknown\n"); } @@ -2321,10 +2369,19 @@ lpfc_used_xri_show(struct device *dev, struct device_attribute *attr, struct Scsi_Host *shost = class_to_shost(dev); struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; struct lpfc_hba *phba = vport->phba; - uint32_t cnt, acnt; + struct lpfc_sli4_hba *sli4_hba; + struct lpfc_max_cfg_param *max_cfg_param; + u32 cnt = 0, acnt = 0; - if (lpfc_get_hba_info(phba, &cnt, &acnt, NULL, NULL, NULL, NULL)) - return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); + if (phba->sli_rev == LPFC_SLI_REV4) { + sli4_hba = &phba->sli4_hba; + max_cfg_param = &sli4_hba->max_cfg_param; + return scnprintf(buf, PAGE_SIZE, "%d\n", + max_cfg_param->xri_used); + } else { + if (lpfc_get_hba_info(phba, &cnt, &acnt, NULL, NULL, NULL, NULL)) + return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); + } return scnprintf(buf, PAGE_SIZE, "Unknown\n"); } @@ -2377,10 +2434,19 @@ lpfc_used_vpi_show(struct device *dev, struct device_attribute *attr, struct Scsi_Host *shost = class_to_shost(dev); struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; struct lpfc_hba *phba = vport->phba; - uint32_t cnt, acnt; + struct lpfc_sli4_hba *sli4_hba; + struct lpfc_max_cfg_param *max_cfg_param; + u32 cnt = 0, acnt = 0; - if (lpfc_get_hba_info(phba, NULL, NULL, NULL, NULL, &cnt, &acnt)) - return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); + if (phba->sli_rev == LPFC_SLI_REV4) { + sli4_hba = &phba->sli4_hba; + max_cfg_param = &sli4_hba->max_cfg_param; + return scnprintf(buf, PAGE_SIZE, "%d\n", + max_cfg_param->vpi_used); + } else { + if (lpfc_get_hba_info(phba, NULL, NULL, NULL, NULL, &cnt, &acnt)) + return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); + } return scnprintf(buf, PAGE_SIZE, "Unknown\n"); } From patchwork Wed Jul 12 18:05:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E90B7C001DC for ; Wed, 12 Jul 2023 17:54:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232784AbjGLRyX (ORCPT ); Wed, 12 Jul 2023 13:54:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232348AbjGLRxz (ORCPT ); Wed, 12 Jul 2023 13:53:55 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A36F412F for ; Wed, 12 Jul 2023 10:53:50 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-51f64817809so636320a12.1 for ; Wed, 12 Jul 2023 10:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184430; x=1689789230; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TGW4L1yM4j5Oc0g3u6zCqTTAZJUXAUAdzTVERIwlx+s=; b=bDpMNpVTbEEugq74+oku7HjS3/XKcLX4AmOANcAsRUCkvdFGg+cjphri5d6i9RSxvU XO9C0WshzKkeU51kqnKHi4JNDXX8SYJnCA0wLaK5nTMXYneYintn5FrGxEzFXf/AOwrq /nNu5WVROhXpI78uAm7N4udVG5QeLoi48zCee5K3SjUW/r6k/C78ZGqKPj08o87qyP6G yiRidPSzldaHhq4qXRvBv7BV9wyLL7LOR3MjVp8T5o+gRRPDzJmbZwo2cYycY6k/Gw4e S9Grgxa2uozWWoIQnWaKbcBT6g90L3OkamvTDRSDwPc8YGXeRzvUXCFzt2diUioS3SpI QSKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184430; x=1689789230; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TGW4L1yM4j5Oc0g3u6zCqTTAZJUXAUAdzTVERIwlx+s=; b=LZ6iAjYP0WVIOz875sTBn/JLwKwAnLtXDKQ37wfm8ELt9AJbcbmAEIkuaXDYB6l20J mBMVmR/qDXFCdfdJovXLZfU+n5VogGOYZKZuXFSEh53aZY6XOldnnBZgDTVcmNuG9AH7 U9pU1LT/FDpitLtrGitrFxTW0aJzvfABbXprfsTSxvfPfF0J5O+e/U3JT3Viu66itK5Y 3ZAIpBX+YRZk8iNwTGLM/jmn8odEFL25esklBKH24hEwgM0L5zDlKQ/kXo/mGNRYUerb jl55xusj/uKUR3uqzyFrFZPS1ZL05earR2sKh8PUnKBYjuNXg+dNrAkh/OQ54xNG/TvR X+uw== X-Gm-Message-State: ABy/qLYyrXaRqGA7NXoIvT0Lat9iTKYRZFvmAHHJHrceo16OY45bJkt9 DtLTZrGsPx0Cum40K+Gqm+F0zTsYQ4A= X-Google-Smtp-Source: APBJJlGAt0WqUKFYpS51UZlrzN12kyhJUxjgbq/QofhjAZb91xYw2btERTahebAATj9SWp2g4pC7QQ== X-Received: by 2002:a17:903:32c4:b0:1b8:a469:53d8 with SMTP id i4-20020a17090332c400b001b8a46953d8mr163119plr.0.1689184429974; Wed, 12 Jul 2023 10:53:49 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:49 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 11/12] lpfc: Update lpfc version to 14.2.0.14 Date: Wed, 12 Jul 2023 11:05:21 -0700 Message-Id: <20230712180522.112722-12-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Update lpfc version to 14.2.0.14 Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index 6f35491aed0f..13a547277f97 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h @@ -20,7 +20,7 @@ * included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "14.2.0.13" +#define LPFC_DRIVER_VERSION "14.2.0.14" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */ From patchwork Wed Jul 12 18:05:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13310804 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43844EB64DA for ; Wed, 12 Jul 2023 17:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231221AbjGLRya (ORCPT ); Wed, 12 Jul 2023 13:54:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232757AbjGLRx7 (ORCPT ); Wed, 12 Jul 2023 13:53:59 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63F94210A for ; Wed, 12 Jul 2023 10:53:52 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1b8c364ad3bso12901935ad.1 for ; Wed, 12 Jul 2023 10:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689184431; x=1691776431; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Iz7ZF/P7DVc41TNYZJYra9/4i+Xij5lvK8vmkcD/FyQ=; b=MmHu1rnU2OMptWTAmVhyvUZdIavxh3pbv//XkjSeDR824eDqqgGhT+kJUFDVKFB5wr 539pvu/ifkKXnG4fNEqLSgA4ceI4+4J6eO0RpX3/9h6XAaArtjDmJFQ+3M79dANI6aXD HkT5SpQ4MHFyFeODFXiCaSS+y6ivffHt/2tinOViZ5o8A439+BZVxZnB6YIseT8ON/gB myol8RrLb9Je1HUcdDGti/C7BiU65bN8/V0n0ueATODDdXjpGA+icT7O/czaj2+D5qV9 wEX1c1mku6M5R9Mr3BFyFW0vmgzlsQPoedvknW71dWyDhWXQNY3d40cFn6eieBjfO3iF HLxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689184431; x=1691776431; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Iz7ZF/P7DVc41TNYZJYra9/4i+Xij5lvK8vmkcD/FyQ=; b=NaRPzTlbBW7zz4bE1QNjNqXhOg08EBbrLChpaJT730zwWg0WdQfmcTs6ogtedxlOW6 c7RszoD3HKrXt2++SOZMy/566dnz4cqFgqEInrB7Z+N/A6hQHDo61JMFUQFUttCh5Ahz u4KeDtOvG1fv4Vn7ZuwwyudYJgbBDTeskgq/G8oJtFLk4E4vybvXOEd83qEsefgkRGJp qzQ092oIG1JxXP6ki13h2V2RJ4/R5b8MMxPZ1e8WjmV7A3T87szYsFEcd+khT64qkCv2 lTX02fL9EJO8Kr4rIMWH/lNJhhZ8v+PLe49VJc5DUiVkl8OQCPDmYmgSLgt9C9H5krwA j1Pg== X-Gm-Message-State: ABy/qLZJmjdANwtDF9g9mV+ZBFl+o3MZQ7kLuIhlUhiNBmCDr5KBcxFl wCo9QTapVOAF77Q8yUmX8iqBPLBuuhk= X-Google-Smtp-Source: APBJJlGofkkYopJxgnQHm2qLHzc6UIS9p48qK+jwObjcru6105uHYKkFIgqqmzYeSt3tmkv8NnByXA== X-Received: by 2002:a17:902:f68b:b0:1b8:b4f6:1327 with SMTP id l11-20020a170902f68b00b001b8b4f61327mr50057plg.6.1689184431580; Wed, 12 Jul 2023 10:53:51 -0700 (PDT) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d11-20020a170902b70b00b001b898595be7sm4218459pls.291.2023.07.12.10.53.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jul 2023 10:53:51 -0700 (PDT) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 12/12] lpfc: Copyright updates for 14.2.0.14 patches Date: Wed, 12 Jul 2023 11:05:22 -0700 Message-Id: <20230712180522.112722-13-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20230712180522.112722-1-justintee8345@gmail.com> References: <20230712180522.112722-1-justintee8345@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Update copyrights to 2023 for files modified in the 14.2.0.14 patch set. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_nportdisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 8f6424487397..1eb7f7e60bba 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. *