From patchwork Wed Jul 7 18:43:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471634 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 910A3C07E95 for ; Wed, 7 Jul 2021 18:44:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8197B61CCC for ; Wed, 7 Jul 2021 18:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232596AbhGGSqm (ORCPT ); Wed, 7 Jul 2021 14:46:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232561AbhGGSqh (ORCPT ); Wed, 7 Jul 2021 14:46:37 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AE78C061762 for ; Wed, 7 Jul 2021 11:43:56 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id p17so1038833plf.12 for ; Wed, 07 Jul 2021 11:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D6XRAuY/qlTjtwcXcEbweRU62gteERcsO/R3U9yidbo=; b=RWa7w5lmK5ToHOWKHaEWYNqyo/9RPV9ulEnMWys+M+KvTrBoSm7GcLtPlzdnw7GqeA 5I3BveyWVZlgSqhSbHATU1D3oNh0v3RSvsiPpGIl+q47fAUrvbDh6KtChD/dXC/pf3kJ vWLN7Wjjc25PWBLApunC7F2gGxdTqEzeM+ll5jUdST+gh5ZtJnMEK3pGqBjcuDTn0zIr OUSobYTcDLsXnlQodgqF2kO2T/achUirzjo9NQyMiUaTJZFtgSCtW6J06f27J7cBC/FB aHi/StPUeXy5e4qS2sWwf90iuRvEKRtDOvFAtdylN6RaiYleYs1eLzuk9HYVnXVB7AHx z2PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D6XRAuY/qlTjtwcXcEbweRU62gteERcsO/R3U9yidbo=; b=kiHQlekxMZZdIm+o595rLopIKsvUNQ178KvFov0TYM17/4nI1SdyBu8bA4SmzeWpbd FSGmp8ue9kz1RHxn6wEoO2yq5Bb6KN9PfdMOI3bJAPgil70qmY0FJyK77NmxxlLvCUK/ tCt4t5q/uP8MZsUW+gBqbQRW4F4FCgvMtKaAR+aLnTFlj8Xx9oE1dN3rjGAjjg4zMx4u P/QbHjpz/2IoHfxEvxJmfELqwn2XOeeV8l74LhyYd0oZYzZqIgzWu8gBhPyXVs66Dgaf ZpR5pbZTUrMrnCUwxYm6gWXD/YBlHZY+V/S1T1H774O7tvtfZkTcS9ze9RbSfBOrK0Cs 9lvg== X-Gm-Message-State: AOAM532ANfQ6K7EkCz3lXfYBYmouBg/pDHseV3k1gMjhqkV1eNQ3tbe0 DBnMMal9BufHCDa5W7r+bFf7UWwZU8o= X-Google-Smtp-Source: ABdhPJxG/D5kGpe6XOI8/h1X8GUQOl1+VD8wxcbxIE/FsUB3uApUEbTfxTJVr5G649WoVm3vTSALhQ== X-Received: by 2002:a17:902:8d92:b029:113:91e7:89d6 with SMTP id v18-20020a1709028d92b029011391e789d6mr22514127plo.85.1625683436064; Wed, 07 Jul 2021 11:43:56 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:43:55 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 01/20] lpfc: Fix NVME support reporting in log message Date: Wed, 7 Jul 2021 11:43:32 -0700 Message-Id: <20210707184351.67872-2-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The NVME support indicator in log message 6422 is displaying a field that was initialized but never set to indicate NVME support. Remove obsolete nvme_support element from the lpfc_hba structure and change log message to display NVME support status as reported in SLI4 Config Parameters mailbox command. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc.h | 1 - drivers/scsi/lpfc/lpfc_init.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 17028861234b..dd3ddfa5f761 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -922,7 +922,6 @@ struct lpfc_hba { uint8_t wwpn[8]; uint32_t RandomData[7]; uint8_t fcp_embed_io; - uint8_t nvme_support; /* Firmware supports NVME */ uint8_t nvmet_support; /* driver supports NVMET */ #define LPFC_NVMET_MAX_PORTS 32 uint8_t mds_diags_support; diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index f3032e30c3e4..cf5bfd27058a 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -12241,7 +12241,6 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) bf_get(cfg_xib, mbx_sli4_parameters), phba->cfg_enable_fc4_type); fcponly: - phba->nvme_support = 0; phba->nvmet_support = 0; phba->cfg_nvmet_mrq = 0; phba->cfg_nvme_seg_cnt = 0; @@ -12299,7 +12298,7 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) "6422 XIB %d PBDE %d: FCP %d NVME %d %d %d\n", bf_get(cfg_xib, mbx_sli4_parameters), phba->cfg_enable_pbde, - phba->fcp_embed_io, phba->nvme_support, + phba->fcp_embed_io, sli4_params->nvme, phba->cfg_nvme_embed_cmd, phba->cfg_suppress_rsp); if ((bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) == From patchwork Wed Jul 7 18:43:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471636 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51B82C07E95 for ; Wed, 7 Jul 2021 18:44:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3109361CCE for ; Wed, 7 Jul 2021 18:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231875AbhGGSqk (ORCPT ); Wed, 7 Jul 2021 14:46:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232614AbhGGSqi (ORCPT ); Wed, 7 Jul 2021 14:46:38 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31EE3C061764 for ; Wed, 7 Jul 2021 11:43:57 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id y2so1564214plc.8 for ; Wed, 07 Jul 2021 11:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hhXq0i5fh5/IZG5p6s02l1Yzc2ZTBC+FLtzUS4iLLns=; b=FE/rP8yh0tHt7ymrtCDAo2TSrctvOsSmgk3M/qeKCIeDLLTItdLp8NeNhLERe02xRF IiLqQAIEhhITlYsJs7ICIsNbIR3OA5nBSFNWWHrUK8YROuZImSRwGS12R7xzy9IdWV1l 3C7mwjgMe6dWhut7ujpsSOM4+Sqg/aGZtmCpQpSAR6j5dl8OAR9lcYdxKvlflPAqk6pV VlkKEE2XXIkfjk5r6PHLC1MnVWN+C5J8rcTmmbO52r13ka+9cKHNLRjpyZ+9F4UucU1F yVtI85FbJ34TKqUCVLmUVqGCInGS8IQEcbUAqzVYqPB94nYety1rt/Tczlr9q/sGgN0E 05eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hhXq0i5fh5/IZG5p6s02l1Yzc2ZTBC+FLtzUS4iLLns=; b=jeI9gzz3Hs9UN7Fr74T+69Fakm6G+b0bV1Kp4mPQEtiIBg0w3jS9jg/JuZnHAv4eYV 3qKnJxVB4RBPf9m0fcW53bHaUZS9GCTmOdzQF+tLycQmDCXsxhcjUIrKRKXe3AusWMVl um1JZHHA03sC6aYois+ypq4vyHXAqVIbMAxsCQrRwxwM3N62yqhXij49mBb3BvhZkTmE cdUTYG7GiD1WtOoUqR+KmD3jC6+jYbx77eAYSIEVP34D54Hj4PuMHCYty95IZWUwdOd7 8gXFPmfF2QNHQbIiJwtmpACvd+B4Iu4UbCeGK/eKYqL1gpspuJmD/eZU70VfoY9/VF4T s/Cw== X-Gm-Message-State: AOAM533wDfDDqt9kkFQAf4bw6SS2N1s6AFr18XKwkpGeQ7zk43H8Xp2W b5cW3nunbfqwBd+W+1jPE71ZrOeKxP4= X-Google-Smtp-Source: ABdhPJyils2y7wDuDch9jA44TQxmEwgJBEstxEz1Fgk04jHGxfPxiKBQNskfh7Cb3aDi8rmsTuV2Uw== X-Received: by 2002:a17:90a:4884:: with SMTP id b4mr419046pjh.173.1625683436718; Wed, 07 Jul 2021 11:43:56 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:43:56 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 02/20] lpfc: Remove use of kmalloc in trace event logging Date: Wed, 7 Jul 2021 11:43:33 -0700 Message-Id: <20210707184351.67872-3-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org There are instances when trace event logs are triggered from an interrupt context. The trace event log may attempt to alloc memory causing scheduling while atomic bug call traces. Remove the need for the kmalloc'ed vport array when checking the log_verbose flag, which eliminates the need for any allocation. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index cf5bfd27058a..51f4058a75b8 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -14162,8 +14162,9 @@ void lpfc_dmp_dbg(struct lpfc_hba *phba) unsigned int temp_idx; int i; int j = 0; - unsigned long rem_nsec; - struct lpfc_vport **vports; + unsigned long rem_nsec, iflags; + bool log_verbose = false; + struct lpfc_vport *port_iterator; /* Don't dump messages if we explicitly set log_verbose for the * physical port or any vport. @@ -14171,16 +14172,24 @@ void lpfc_dmp_dbg(struct lpfc_hba *phba) if (phba->cfg_log_verbose) return; - vports = lpfc_create_vport_work_array(phba); - if (vports != NULL) { - for (i = 0; i <= phba->max_vpi && vports[i] != NULL; i++) { - if (vports[i]->cfg_log_verbose) { - lpfc_destroy_vport_work_array(phba, vports); + spin_lock_irqsave(&phba->port_list_lock, iflags); + list_for_each_entry(port_iterator, &phba->port_list, listentry) { + if (port_iterator->load_flag & FC_UNLOADING) + continue; + if (scsi_host_get(lpfc_shost_from_vport(port_iterator))) { + if (port_iterator->cfg_log_verbose) + log_verbose = true; + + scsi_host_put(lpfc_shost_from_vport(port_iterator)); + + if (log_verbose) { + spin_unlock_irqrestore(&phba->port_list_lock, + iflags); return; } } } - lpfc_destroy_vport_work_array(phba, vports); + spin_unlock_irqrestore(&phba->port_list_lock, iflags); if (atomic_cmpxchg(&phba->dbg_log_dmping, 0, 1) != 0) return; From patchwork Wed Jul 7 18:43:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96177C07E9E for ; Wed, 7 Jul 2021 18:44:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 826A061CC8 for ; Wed, 7 Jul 2021 18:44:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232360AbhGGSqk (ORCPT ); Wed, 7 Jul 2021 14:46:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232492AbhGGSqj (ORCPT ); Wed, 7 Jul 2021 14:46:39 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E87C7C061765 for ; Wed, 7 Jul 2021 11:43:57 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id cs1-20020a17090af501b0290170856e1a8aso4296004pjb.3 for ; Wed, 07 Jul 2021 11:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AoyCoWLBNuAAqv1pxCWCuErdMEQijUUmN2t9fUpp0y0=; b=ctW8T4wUnHLzp7O4C3uTGJRK+vwoWLtVM7Xkp2gsf+Nti9PYxD0OhZfHo6iwlnDmy8 Sk8nHVL27wyJcdB64M5QNTwS5MWf2daWtSUmT839IRCWYc0qrfbSF84AKw52GCCg3jBq jCox6TDLDsHWLxhhiwwLezdVN8tPj7mzkp0QDyf1Pgl44MpZXokxZsciSXuOdmsckMmh WniXEdBNc+7+zM4iNBzhXLNqxAkbyEsBlCn/9C5uQ4+GqTy2Qzh9yVrkTT2a19jpJMCl DanSB4r2mcw2Q6eBBc+tv6rG9tFOxjfsse3Nh+bvHdKOp/+StncoyNLH75xp6aOIJ0Dw /JGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AoyCoWLBNuAAqv1pxCWCuErdMEQijUUmN2t9fUpp0y0=; b=J8rQgdiqAsfoOHhetyu3o7NPxOdWEmNmaMSFfclCNgLTrY1aV6vnxnN53i6iz8EJuP ZG9/S8Tw9qSUYTYMOCh+jVMXnqkdLz2qleOzCM+MYotYImQ/vfnkDQAg/CT6fZWsy0/L rhNETGgTznE1HRkMTW6XhwsSRm2HynKWtUTA++ZUhEcBH532Oy3kfQC+2Dh4s0OY+ChF NV3OLFSKtZ/feecDNaTTqwnvlE2AmpVV/Nhj55BZMBtk5CNLPKQUzw7O4duzfT0h7Jfe ht6/vM3Rdi5U/HKeKUnjq3h9/xb5NXOnIfm6ThvkSWfQkezTXYU6IDPk4Ymn76+8Rr2P 3dzA== X-Gm-Message-State: AOAM5304TpEdOAlj/YErT+296vV+KS/ASjg0ZR+fhibWKan3WxZ+TC5z 6HsctN9lUS677fIHE+BfTEIId+moobY= X-Google-Smtp-Source: ABdhPJxgcw9O4jyRXkXmgfJ7Tmnebxth1HD7EyX0sSI9ZaMDbQam15Hs/DLk0KZ0bnBpRFnwPliinA== X-Received: by 2002:a17:902:bcc3:b029:11c:5ffb:61fb with SMTP id o3-20020a170902bcc3b029011c5ffb61fbmr22350365pls.18.1625683437376; Wed, 07 Jul 2021 11:43:57 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:43:57 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 03/20] lpfc: Improve firmware download logging Date: Wed, 7 Jul 2021 11:43:34 -0700 Message-Id: <20210707184351.67872-4-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Define additional status fields in mailbox commands to help provide additional information when downloading new firmware. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hw4.h | 9 ++ drivers/scsi/lpfc/lpfc_sli.c | 152 ++++++++++++++++++++++++---------- drivers/scsi/lpfc/lpfc_sli4.h | 2 + 3 files changed, 121 insertions(+), 42 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index eb8c735a243b..7d4d179fb534 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h @@ -959,6 +959,12 @@ union lpfc_sli4_cfg_shdr { #define lpfc_mbox_hdr_add_status_SHIFT 8 #define lpfc_mbox_hdr_add_status_MASK 0x000000FF #define lpfc_mbox_hdr_add_status_WORD word7 +#define LPFC_ADD_STATUS_INCOMPAT_OBJ 0xA2 +#define lpfc_mbox_hdr_add_status_2_SHIFT 16 +#define lpfc_mbox_hdr_add_status_2_MASK 0x000000FF +#define lpfc_mbox_hdr_add_status_2_WORD word7 +#define LPFC_ADD_STATUS_2_INCOMPAT_FLASH 0x01 +#define LPFC_ADD_STATUS_2_INCORRECT_ASIC 0x02 uint32_t response_length; uint32_t actual_response_length; } response; @@ -3603,6 +3609,9 @@ struct lpfc_controller_attribute { #define lpfc_cntl_attr_eprom_ver_hi_SHIFT 8 #define lpfc_cntl_attr_eprom_ver_hi_MASK 0x000000ff #define lpfc_cntl_attr_eprom_ver_hi_WORD word17 +#define lpfc_cntl_attr_flash_id_SHIFT 16 +#define lpfc_cntl_attr_flash_id_MASK 0x000000ff +#define lpfc_cntl_attr_flash_id_WORD word17 uint32_t mbx_da_struct_ver; uint32_t ep_fw_da_struct_ver; uint32_t ncsi_ver_str[3]; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 993f9c0dd006..b5c224aafea0 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -5674,16 +5674,20 @@ lpfc_sli4_get_ctl_attr(struct lpfc_hba *phba) bf_get(lpfc_cntl_attr_lnk_type, cntl_attr); phba->sli4_hba.lnk_info.lnk_no = bf_get(lpfc_cntl_attr_lnk_numb, cntl_attr); + phba->sli4_hba.flash_id = bf_get(lpfc_cntl_attr_flash_id, cntl_attr); + phba->sli4_hba.asic_rev = bf_get(lpfc_cntl_attr_asic_rev, cntl_attr); memset(phba->BIOSVersion, 0, sizeof(phba->BIOSVersion)); strlcat(phba->BIOSVersion, (char *)cntl_attr->bios_ver_str, sizeof(phba->BIOSVersion)); lpfc_printf_log(phba, KERN_INFO, LOG_SLI, - "3086 lnk_type:%d, lnk_numb:%d, bios_ver:%s\n", + "3086 lnk_type:%d, lnk_numb:%d, bios_ver:%s, " + "flash_id: x%02x, asic_rev: x%02x\n", phba->sli4_hba.lnk_info.lnk_tp, phba->sli4_hba.lnk_info.lnk_no, - phba->BIOSVersion); + phba->BIOSVersion, phba->sli4_hba.flash_id, + phba->sli4_hba.asic_rev); out_free_mboxq: if (bf_get(lpfc_mqe_command, &mboxq->u.mqe) == MBX_SLI4_CONFIG) lpfc_sli4_mbox_cmd_free(phba, mboxq); @@ -20020,6 +20024,91 @@ lpfc_sli_read_link_ste(struct lpfc_hba *phba) return; } +/** + * lpfc_log_fw_write_cmpl - logs firmware write completion status + * @phba: pointer to lpfc hba data structure + * @shdr_status: wr_object rsp's status field + * @shdr_add_status: wr_object rsp's add_status field + * @shdr_add_status_2: wr_object rsp's add_status_2 field + * @shdr_change_status: wr_object rsp's change_status field + * @shdr_csf: wr_object rsp's csf bit + * + * This routine is intended to be called after a firmware write completes. + * It will log next action items to be performed by the user to instantiate + * the newly downloaded firmware or reason for incompatibility. + **/ +static void +lpfc_log_fw_write_cmpl(struct lpfc_hba *phba, u32 shdr_status, + u32 shdr_add_status, u32 shdr_add_status_2, + u32 shdr_change_status, u32 shdr_csf) +{ + lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, + "4198 %s: flash_id x%02x, asic_rev x%02x, " + "status x%02x, add_status x%02x, add_status_2 x%02x, " + "change_status x%02x, csf %01x\n", __func__, + phba->sli4_hba.flash_id, phba->sli4_hba.asic_rev, + shdr_status, shdr_add_status, shdr_add_status_2, + shdr_change_status, shdr_csf); + + if (shdr_add_status == LPFC_ADD_STATUS_INCOMPAT_OBJ) { + switch (shdr_add_status_2) { + case LPFC_ADD_STATUS_2_INCOMPAT_FLASH: + lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, + "4199 Firmware write failed: " + "image incompatible with flash x%02x\n", + phba->sli4_hba.flash_id); + break; + case LPFC_ADD_STATUS_2_INCORRECT_ASIC: + lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, + "4200 Firmware write failed: " + "image incompatible with ASIC " + "architecture x%02x\n", + phba->sli4_hba.asic_rev); + break; + default: + lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, + "4210 Firmware write failed: " + "add_status_2 x%02x\n", + shdr_add_status_2); + break; + } + } else if (!shdr_status && !shdr_add_status) { + if (shdr_change_status == LPFC_CHANGE_STATUS_FW_RESET || + shdr_change_status == LPFC_CHANGE_STATUS_PORT_MIGRATION) { + if (shdr_csf) + shdr_change_status = + LPFC_CHANGE_STATUS_PCI_RESET; + } + + switch (shdr_change_status) { + case (LPFC_CHANGE_STATUS_PHYS_DEV_RESET): + lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, + "3198 Firmware write complete: System " + "reboot required to instantiate\n"); + break; + case (LPFC_CHANGE_STATUS_FW_RESET): + lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, + "3199 Firmware write complete: " + "Firmware reset required to " + "instantiate\n"); + break; + case (LPFC_CHANGE_STATUS_PORT_MIGRATION): + lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, + "3200 Firmware write complete: Port " + "Migration or PCI Reset required to " + "instantiate\n"); + break; + case (LPFC_CHANGE_STATUS_PCI_RESET): + lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, + "3201 Firmware write complete: PCI " + "Reset required to instantiate\n"); + break; + default: + break; + } + } +} + /** * lpfc_wr_object - write an object to the firmware * @phba: HBA structure that indicates port to create a queue on. @@ -20046,7 +20135,8 @@ lpfc_wr_object(struct lpfc_hba *phba, struct list_head *dmabuf_list, struct lpfc_mbx_wr_object *wr_object; LPFC_MBOXQ_t *mbox; int rc = 0, i = 0; - uint32_t shdr_status, shdr_add_status, shdr_change_status, shdr_csf; + uint32_t shdr_status, shdr_add_status, shdr_add_status_2; + uint32_t shdr_change_status = 0, shdr_csf = 0; uint32_t mbox_tmo; struct lpfc_dmabuf *dmabuf; uint32_t written = 0; @@ -20100,58 +20190,36 @@ lpfc_wr_object(struct lpfc_hba *phba, struct list_head *dmabuf_list, &wr_object->header.cfg_shdr.response); shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &wr_object->header.cfg_shdr.response); + shdr_add_status_2 = bf_get(lpfc_mbox_hdr_add_status_2, + &wr_object->header.cfg_shdr.response); if (check_change_status) { shdr_change_status = bf_get(lpfc_wr_object_change_status, &wr_object->u.response); - - if (shdr_change_status == LPFC_CHANGE_STATUS_FW_RESET || - shdr_change_status == LPFC_CHANGE_STATUS_PORT_MIGRATION) { - shdr_csf = bf_get(lpfc_wr_object_csf, - &wr_object->u.response); - if (shdr_csf) - shdr_change_status = - LPFC_CHANGE_STATUS_PCI_RESET; - } - - switch (shdr_change_status) { - case (LPFC_CHANGE_STATUS_PHYS_DEV_RESET): - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "3198 Firmware write complete: System " - "reboot required to instantiate\n"); - break; - case (LPFC_CHANGE_STATUS_FW_RESET): - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "3199 Firmware write complete: Firmware" - " reset required to instantiate\n"); - break; - case (LPFC_CHANGE_STATUS_PORT_MIGRATION): - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "3200 Firmware write complete: Port " - "Migration or PCI Reset required to " - "instantiate\n"); - break; - case (LPFC_CHANGE_STATUS_PCI_RESET): - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "3201 Firmware write complete: PCI " - "Reset required to instantiate\n"); - break; - default: - break; - } + shdr_csf = bf_get(lpfc_wr_object_csf, + &wr_object->u.response); } + if (!phba->sli4_hba.intr_enable) mempool_free(mbox, phba->mbox_mem_pool); else if (rc != MBX_TIMEOUT) mempool_free(mbox, phba->mbox_mem_pool); - if (shdr_status || shdr_add_status || rc) { + if (shdr_status || shdr_add_status || shdr_add_status_2 || rc) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "3025 Write Object mailbox failed with " - "status x%x add_status x%x, mbx status x%x\n", - shdr_status, shdr_add_status, rc); + "status x%x add_status x%x, add_status_2 x%x, " + "mbx status x%x\n", + shdr_status, shdr_add_status, shdr_add_status_2, + rc); rc = -ENXIO; *offset = shdr_add_status; - } else + } else { *offset += wr_object->u.response.actual_write_length; + } + + if (rc || check_change_status) + lpfc_log_fw_write_cmpl(phba, shdr_status, shdr_add_status, + shdr_add_status_2, shdr_change_status, + shdr_csf); return rc; } diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index 26f19c95380f..021edbfbbca5 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h @@ -978,6 +978,8 @@ struct lpfc_sli4_hba { #define lpfc_conf_trunk_port3_nd_WORD conf_trunk #define lpfc_conf_trunk_port3_nd_SHIFT 7 #define lpfc_conf_trunk_port3_nd_MASK 0x1 + uint8_t flash_id; + uint8_t asic_rev; }; enum lpfc_sge_type { From patchwork Wed Jul 7 18:43:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1058C07E9C for ; Wed, 7 Jul 2021 18:44:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C891C61CD1 for ; Wed, 7 Jul 2021 18:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232561AbhGGSqm (ORCPT ); Wed, 7 Jul 2021 14:46:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbhGGSqj (ORCPT ); Wed, 7 Jul 2021 14:46:39 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C716C061768 for ; Wed, 7 Jul 2021 11:43:58 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id 145so3082305pfv.0 for ; Wed, 07 Jul 2021 11:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5tH2/DTXmjYGTFufvhLqLupDSMJ7Y2vU3YGAlX27NgI=; b=fFIsQ6cxEZIaUYsM6A/yquypJx/VPNI1x3CqENaYgeZS8S5a01/AFlLDsCvxGPpNtr VQyaoP7f5ei/Hg79q4okZVL3v+fvVva88YQUupJ4FdPuA4MaocqLrZEKyX2CVjwh3CBu AmFzXCjKzwf0hRPu+oxwI7StIxPO5ZjOfiNH9WyF9f8ntEyFuZdGD1OALUpeLnxSvXiB dTkWzCFKD2XfxtGyCKxDhjdG5TgyJe/Vx47EDd8c63zk0rxAt7SjhhcxweW1eHkPkOYa 6J1GZVm3YooiP9FQf8ATOclW7tVSkwckBF4s5NG6WLxh8C/au/BryU8V5kaFP5u+Hb4x QnhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5tH2/DTXmjYGTFufvhLqLupDSMJ7Y2vU3YGAlX27NgI=; b=WtMSmya6AdTmlLnwQDQRzKJ6Rr/vmoW2e9691b9KaI5Ltm8gKXeSYsOpHnuphZtwUy qJn4g0TSkHnjz7ivYVBO5AXynptZ/idIIlyJXdYzZ02nAIxpUJb8UZ/O9oisIDXjD5n2 Esu9rxA3R0E/xZicoNevUdmdH5Acd9bTEFMNt2fTU7QXUkF9j/0LIW/7uM/EwlwOyaWm cvMiJVDc70XWepY3TqoZJnbCiVQOO5sGxNFgVKpm0HgamUjg3jzASkDWtM5CTe2icZr0 y9r5fsrGIFlPPo9IXcEj0uRi33tcas0lu4rVzkar8ZHSWGQuBzM9RM+IhioSHYqN+jdn aGTQ== X-Gm-Message-State: AOAM533Jfq0qqW/ioCfEMloiFynn8g7ct5CVMqlJCIdQpHdNkT1xM88Z DE80AwipIEAVMxl+8/d7rzx2czVziZA= X-Google-Smtp-Source: ABdhPJxLY3Ng0ckx+5Mmg8ij0F/PzdHUVAGoMHofc0JpRVlTaOtcAjsaT5w/Q5Cfsn+VjmXURbcXbA== X-Received: by 2002:a63:2c8a:: with SMTP id s132mr27587227pgs.65.1625683438012; Wed, 07 Jul 2021 11:43:58 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:43:57 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 04/20] lpfc: Fix function description comments for vmid routines Date: Wed, 7 Jul 2021 11:43:35 -0700 Message-Id: <20210707184351.67872-5-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Update comment headers for functions lpfc_vmid_cmd and lpfc_vmid_poll Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c | 5 ++--- drivers/scsi/lpfc/lpfc_init.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 610b6dabb3b5..1acb8820a08e 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -3884,9 +3884,8 @@ lpfc_cmpl_ct_cmd_vmid(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, /** * lpfc_vmid_cmd - Build and send a FDMI cmd to the specified NPort * @vport: pointer to a host virtual N_Port data structure. - * @ndlp: ndlp to send FDMI cmd to (if NULL use FDMI_DID) - * cmdcode: FDMI command to send - * mask: Mask of HBA or PORT Attributes to send + * @cmdcode: application server command code to send + * @vmid: pointer to vmid info structure * * Builds and sends a FDMI command using the CT subsystem. */ diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 51f4058a75b8..6867b02219b0 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -4845,7 +4845,7 @@ lpfc_sli4_fcf_redisc_wait_tmo(struct timer_list *t) /** * lpfc_vmid_poll - VMID timeout detection - * @ptr: Map to lpfc_hba data structure pointer. + * @t: Timer context used to obtain the pointer to lpfc hba data structure. * * This routine is invoked when there is no I/O on by a VM for the specified * amount of time. When this situation is detected, the VMID has to be From patchwork Wed Jul 7 18:43:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32DD3C11F66 for ; Wed, 7 Jul 2021 18:44:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B87961CCD for ; Wed, 7 Jul 2021 18:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232571AbhGGSql (ORCPT ); Wed, 7 Jul 2021 14:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbhGGSqj (ORCPT ); Wed, 7 Jul 2021 14:46:39 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32F1AC06175F for ; Wed, 7 Jul 2021 11:43:59 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id y2so1564279plc.8 for ; Wed, 07 Jul 2021 11:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1gxjOzlQ6knQQqEHTUDa6isoqPdVaG9gPW6rV1r+7Is=; b=jkydFR+ak9LSqHYSzKfxL6Vraodn9UaqGW6sKG6WTSrgFqGqXupBxLQEVjm5H1nwGd h42EKDe+e+d4A3WzS0Ctevof6V71PSdBvq2mxW/6AyVRGgn0Bt/JHH2BYrA9FOgtzJ/Q jkCRHzkSL4M56MBjquqLwZgTc/0+MmfSuxYEQoe6z0CtAcPweoa4xR8q5f4H8um9mFou c3HTrb0WOCg3RTDEUYhe2/o+iNYEZhiPJb7E7iTmDalv9Utj/ahZB/130lP0IJ3wkYNM xVvUUFT7BVU9DH/iaSw7zs+o/I3Xh0Bklg8LS2VYc4NomSCfJz/55Y/eTHx8EbvRHIaj 5ZUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1gxjOzlQ6knQQqEHTUDa6isoqPdVaG9gPW6rV1r+7Is=; b=iL3wLTFYUHn2Luk9zklkwa8nlKvtvj02Yw5UwKsWO2qMtNaHcbYwdA+aovAV4jBDi2 e3H+ri8eJlAy3bhIBFOOr5nrMBR1nKldBxN0gMuKTlwD6VKlUp03ZAAOjlREhTxHibVO aPNeLVT8CX77sCgjoKaoBv8hXheckknhene1mNMYjXpR7pZniDiFytabi+jIurcoh1RS NhgxJlNqnoWL9/8a+vQFaWCBkgpNSEkmaAfZQ1YXafniws1WGwJeUGVYdcS8masW/hGe Hhn1GGK++3L1RzKapDrYz/vVbs4CsdAApUio3cJbohJopo9zg1LDnK1R/cK+1UmZXfjU 281Q== X-Gm-Message-State: AOAM533IEYvBDLElVGdq0LnjtjhcpGIpTWFkDR3lw4HYdhyG5Cpj2/NS tq++uEd52fU0g0VyR/rGqEa2L5YMxdU= X-Google-Smtp-Source: ABdhPJzYOnoCN1XEeUBeg9HPZcdKBvNDgsgWy6ar6cxWOLlh6FuCP3xx9c/j6JrGBGssVXYgIkbfrA== X-Received: by 2002:a17:90b:384f:: with SMTP id nl15mr27841422pjb.88.1625683438661; Wed, 07 Jul 2021 11:43:58 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:43:58 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 05/20] lpfc: Discovery state machine fixes for LOGO handling Date: Wed, 7 Jul 2021 11:43:36 -0700 Message-Id: <20210707184351.67872-6-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org - If a LOGO is received for a node that is in the NPR state, post a DEVICE_RM event to allow clean up of the logged out node. - Clearing the NLP_NPR_2B_DISC flag upon receipt of a LOGO ACC may cause skipping of processing outstanding PLOGIs triggered by parallel RSCN events. If an outstanding PLOGI is being retried and receipt of a LOGO ACC occurs, then allow the discovery state machine's PLOGI completion to clean up the node. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index e481f5fe29d7..b0c443a0cf92 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -4612,6 +4612,15 @@ lpfc_cmpl_els_logo_acc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, goto out; if (ndlp->nlp_state == NLP_STE_NPR_NODE) { + + /* If PLOGI is being retried, PLOGI completion will cleanup the + * node. The NLP_NPR_2B_DISC flag needs to be retained to make + * progress on nodes discovered from last RSCN. + */ + if ((ndlp->nlp_flag & NLP_DELAY_TMO) && + (ndlp->nlp_last_elscmd == ELS_CMD_PLOGI)) + goto out; + /* NPort Recovery mode or node is just allocated */ if (!lpfc_nlp_not_used(ndlp)) { /* A LOGO is completing and the node is in NPR state. @@ -8948,6 +8957,9 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, break; } lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_LOGO); + if (newnode) + lpfc_disc_state_machine(vport, ndlp, NULL, + NLP_EVT_DEVICE_RM); break; case ELS_CMD_PRLO: lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, From patchwork Wed Jul 7 18:43:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78CA1C07E9B for ; Wed, 7 Jul 2021 18:44:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6581A61CC8 for ; Wed, 7 Jul 2021 18:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232597AbhGGSqn (ORCPT ); Wed, 7 Jul 2021 14:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232066AbhGGSqk (ORCPT ); Wed, 7 Jul 2021 14:46:40 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1805C061574 for ; Wed, 7 Jul 2021 11:43:59 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso2216729pjp.5 for ; Wed, 07 Jul 2021 11:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HpTK0Ngh8TzknRVT34FEqY8VYWrDYSmyhcMUIVCJs4k=; b=EcSXSy4e6HndTKpb3MdY4Zwsxc0Wky50OtQViKdxxx6Kps6lznl06xkKjINKtikr8t R5+JnIZwdl5XVMMehsGLmXEO1kGJCzjL3Es5iC2L7JAuKi+hejiRbDtNMXiUAvcFot4V pKdwfYsoOF6yAvd4QVtwaz+QfvxMw7FhL2Ii8irfd6aynwqdJ3UZmSz28Hxm99TOWbxP ztIMm9zpWvTkZOCBedbTwRcBJG0GSfq/hNqrVQMf7vE3toJk+4l+JflSrGphReKZ1XiE DAzDpflk3NTmU+i3PIJeKuR9x9VUOq+d5+sERbhRzoVP1LQIpQT2DttzrsVVhbEGQ1D5 1V5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HpTK0Ngh8TzknRVT34FEqY8VYWrDYSmyhcMUIVCJs4k=; b=eJ8HaVn8YUfVPzz1Cmqfy3vRQP6Sne+zqOJwYHq7Oxzh4LKwtoYkCGEmjMvENcQpB/ aRLg1geuD0ejdMQi+CHs5PjCtNZ92DgxgE7zZxYW9CV6+cnIT8sFCkS6cWS27r2tboRg eJJ0JsMLNm8+Qxbt+MjDdbwOi5PXMDzvFfUR3Bqlh8eksA7yPJ2d6JJAr5bLEFNaWVIy VBuHmGq0iSeo+6itivSOFyxOVPwscGCYtn8AB6kTC15Iad6RcK8EG8lmiLQYSxOMZQsN ujmqIPNpfTOMGYTsefRzEsaP4fhZZlMGQme9oWHjv5Vv62tN46Bna6fJWc/BbobozsSR LW3A== X-Gm-Message-State: AOAM5328bxWsdwEPOOyXvYEamlIi3COx8YBL/qrhZRKY30YV3NiSbpBP WVREwI2ljk8PF04T5SB0ovhyRgyUU+k= X-Google-Smtp-Source: ABdhPJxQMChuMIkpzAZghviaxtq8zPpzPJPgcX/uXLkdqRZ5GpX+ZP1TrKUakUVpCxN7VHJ2z+hBZA== X-Received: by 2002:a17:902:dad0:b029:129:c3fa:715 with SMTP id q16-20020a170902dad0b0290129c3fa0715mr4099845plx.45.1625683439348; Wed, 07 Jul 2021 11:43:59 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:43:59 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 06/20] lpfc: Fix target reset handler from falsely returning FAILURE Date: Wed, 7 Jul 2021 11:43:37 -0700 Message-Id: <20210707184351.67872-7-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Previous logic accidentally overrides the status variable to FAILURE when target reset status is SUCCESS. Refactor the non-SUCCESS logic of lpfc_vmid_vport_cleanup(), which resolves the false override. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_scsi.c | 68 +++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 1b248c237be1..10002a13c5c6 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -6273,6 +6273,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) struct lpfc_scsi_event_header scsi_event; int status; u32 logit = LOG_FCP; + u32 dev_loss_tmo = vport->cfg_devloss_tmo; unsigned long flags; DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq); @@ -6314,39 +6315,44 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) status = lpfc_send_taskmgmt(vport, cmnd, tgt_id, lun_id, FCP_TARGET_RESET); - if (status != SUCCESS) - logit = LOG_TRACE_EVENT; - spin_lock_irqsave(&pnode->lock, flags); - if (status != SUCCESS && - (!(pnode->upcall_flags & NLP_WAIT_FOR_LOGO)) && - !pnode->logo_waitq) { - pnode->logo_waitq = &waitq; - pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; - pnode->nlp_flag |= NLP_ISSUE_LOGO; - pnode->upcall_flags |= NLP_WAIT_FOR_LOGO; - spin_unlock_irqrestore(&pnode->lock, flags); - lpfc_unreg_rpi(vport, pnode); - wait_event_timeout(waitq, - (!(pnode->upcall_flags & NLP_WAIT_FOR_LOGO)), - msecs_to_jiffies(vport->cfg_devloss_tmo * - 1000)); - - if (pnode->upcall_flags & NLP_WAIT_FOR_LOGO) { - lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, - "0725 SCSI layer TGTRST failed & LOGO TMO " - " (%d, %llu) return x%x\n", tgt_id, - lun_id, status); - spin_lock_irqsave(&pnode->lock, flags); - pnode->upcall_flags &= ~NLP_WAIT_FOR_LOGO; + if (status != SUCCESS) { + logit = LOG_TRACE_EVENT; + + /* Issue LOGO, if no LOGO is outstanding */ + spin_lock_irqsave(&pnode->lock, flags); + if (!(pnode->upcall_flags & NLP_WAIT_FOR_LOGO) && + !pnode->logo_waitq) { + pnode->logo_waitq = &waitq; + pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; + pnode->nlp_flag |= NLP_ISSUE_LOGO; + pnode->upcall_flags |= NLP_WAIT_FOR_LOGO; + spin_unlock_irqrestore(&pnode->lock, flags); + lpfc_unreg_rpi(vport, pnode); + wait_event_timeout(waitq, + (!(pnode->upcall_flags & + NLP_WAIT_FOR_LOGO)), + msecs_to_jiffies(dev_loss_tmo * + 1000)); + + if (pnode->upcall_flags & NLP_WAIT_FOR_LOGO) { + lpfc_printf_vlog(vport, KERN_ERR, logit, + "0725 SCSI layer TGTRST " + "failed & LOGO TMO (%d, %llu) " + "return x%x\n", + tgt_id, lun_id, status); + spin_lock_irqsave(&pnode->lock, flags); + pnode->upcall_flags &= ~NLP_WAIT_FOR_LOGO; + } else { + spin_lock_irqsave(&pnode->lock, flags); + } + pnode->logo_waitq = NULL; + spin_unlock_irqrestore(&pnode->lock, flags); + status = SUCCESS; + } else { - spin_lock_irqsave(&pnode->lock, flags); + spin_unlock_irqrestore(&pnode->lock, flags); + status = FAILED; } - pnode->logo_waitq = NULL; - spin_unlock_irqrestore(&pnode->lock, flags); - status = SUCCESS; - } else { - status = FAILED; - spin_unlock_irqrestore(&pnode->lock, flags); } lpfc_printf_vlog(vport, KERN_ERR, logit, From patchwork Wed Jul 7 18:43:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471632 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DAF2C11F66 for ; Wed, 7 Jul 2021 18:44:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7904C61CC8 for ; Wed, 7 Jul 2021 18:44:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231755AbhGGSqn (ORCPT ); Wed, 7 Jul 2021 14:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232575AbhGGSqm (ORCPT ); Wed, 7 Jul 2021 14:46:42 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DDCCC061574 for ; Wed, 7 Jul 2021 11:44:00 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id v7so3256725pgl.2 for ; Wed, 07 Jul 2021 11:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ie7Q3EUThRYmD8OZDb/784xCrGi7UhZ9Y/1ovsnX6cg=; b=GHlnkcDyD1pa5qzLXywmcCyXl7KK+DgZmblSyajuh1Pou8Qrb43JvJABPRNkpfNoH/ +GPCdG/ayQMqzuEUWFhYkJR0yOIt8S3Jzw/XGdizQsA57k75GGAjKssEeb/reVv1CoWl lTz+r2ORAXxdi0ZaY7PjAw7fwL2r3aV5tIhdPsc2kWJH3x2eIX9k7MhqMc8dIhWUpLdy P1DDIX5aoyt5PoZ7GdnG27jdv7K2vrCTX2o8b+5k4b5qs2mT2ForAtBdddXu9gWHL/4W OiwSBSr91Rj5d+Gtf+344w1kySrmmQw+XcUzw10LP7S+AhTifGB/Q/N2yVldm2srVfzB /PeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ie7Q3EUThRYmD8OZDb/784xCrGi7UhZ9Y/1ovsnX6cg=; b=QpfYB1iTtXiu2EwnPv8EyulDSDHSNiJPK8girkLD0JJuoqhorl8bLylq0uHSfFdUNX MiUrkarDjRVjsLgpEZp+THKQ86i6b7hm/fvgdnXVYM1t+amGcxrH2H+A5paWq3MKQYJF cc+hwayek9XDemC09rtHEUL97VWJcQXlbf+8EtS7JF7RMrjwI4j+HaX4xjEXIXSCYsvh XKn8PjeAlHLNClM9nnxOvgHln2HTYDHkxLtRtie3utfjB1nL+hy2ouhY3yVm1f76oq5s tZaX+GFXVtI4SAGWgX3QVrg2dKYg7BHNK6xhzqrtTqXje+2GUCEoRT9sUCgLyK5k6eZy Klgg== X-Gm-Message-State: AOAM533zWIrbNnSECSYo5fgFIFr0aoauuFkS01YG2mWbs2rK5m3I6hlw HCegQeK3/FHsQNF9eojZBSQtcHtCvAw= X-Google-Smtp-Source: ABdhPJzQNzZctsuKDLQr6PljW8z4XD1yiOO4yU40XHGuW/qSyVRojEcVjKB1btcIYvlh3aDuya9mbg== X-Received: by 2002:a63:338d:: with SMTP id z135mr27619710pgz.314.1625683440133; Wed, 07 Jul 2021 11:44:00 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:43:59 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 07/20] lpfc: Keep ndlp reference until after freeing the iocb after els handling Date: Wed, 7 Jul 2021 11:43:38 -0700 Message-Id: <20210707184351.67872-8-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In the routine that generically cleans up an els after completion, the ndlp put is done prior to the freeing of the iocb. The iocb may reference the ndlp. Move the lpfc_nlp_put after freeing the iocb. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index b5c224aafea0..1abf63c85c4b 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -11623,6 +11623,7 @@ void lpfc_ignore_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, struct lpfc_iocbq *rspiocb) { + struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) cmdiocb->context1; IOCB_t *irsp = &rspiocb->iocb; /* ELS cmd tag completes */ @@ -11631,11 +11632,16 @@ lpfc_ignore_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, "x%x x%x x%x\n", irsp->ulpIoTag, irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpTimeout); - lpfc_nlp_put((struct lpfc_nodelist *)cmdiocb->context1); + /* + * Deref the ndlp after free_iocb. sli_release_iocb will access the ndlp + * if exchange is busy. + */ if (cmdiocb->iocb.ulpCommand == CMD_GEN_REQUEST64_CR) lpfc_ct_free_iocb(phba, cmdiocb); else lpfc_els_free_iocb(phba, cmdiocb); + + lpfc_nlp_put(ndlp); } /** From patchwork Wed Jul 7 18:43:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A93AAC11F67 for ; Wed, 7 Jul 2021 18:44:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93C7D61CCC for ; Wed, 7 Jul 2021 18:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232614AbhGGSqn (ORCPT ); Wed, 7 Jul 2021 14:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231755AbhGGSql (ORCPT ); Wed, 7 Jul 2021 14:46:41 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34FA2C06175F for ; Wed, 7 Jul 2021 11:44:01 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id f20so3058673pfa.1 for ; Wed, 07 Jul 2021 11:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eVVRgO9DeBF+eScGT7dgkxmiF2ifh9NrcFNE73jGyQg=; b=BwhQe63LJhUI0EhEzB8NQ/qUNNxfvDICXP1LyCe4Va+oUXhWsUunGxuqu1t3dWxsJe ur6IYCizSQViw3ikzLYzv/0x/a0eYMoNvjF48N68oj9VN4t2NZaIXlaUZFDEpTRO7Je0 RlGATrqbzvEHBLDhkWmwsEWc+ZJUUsvMZDFR9Mgkf2Odq4fznvrZOz/KjvXfBh1wXeaE 2h/HUpHIbfGwA8jE3aklc0w881QI9HffM4gkfXpV//DaHCyNy0Q5aGEqA0/8PYxo8KAY suKDi+NdoIXEJdZ1OgiOsmrM/hGeP8JZezhaYfYproJeS4gt+1ksTtwhTBfl3MqvnevB jvjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eVVRgO9DeBF+eScGT7dgkxmiF2ifh9NrcFNE73jGyQg=; b=uR7EaIxI3aGMilpSmHn+AloO5zFFTPAZke9i0pXHjac5nsbftFLsL5yDTTbpUlzXiz qMiAx1JtR2hw0MhtmJ/AAENC855xe+ofhPYqtHw9LbtrRwYFNpCDSleOo+qlOw6r2Xbo cSHGss1JSv//bioYdLKY3fttM4wrFcbJtwzk1zUkJ86LHjAWjuOpg8XbQFfQeIbrQGBj iX6wQnRpMzLaNfp2InZ1vcnCL3u4BqT7yGpnSQ6zXC0MAJoq0LbqrGA8CExopwwAXSKn lRohKLmnIGnTYtdsdeBcYPyg6QEusuqKGMF1V5DwAXEuJfLj0Kjh94YoHE7JWQbUppSj dDyA== X-Gm-Message-State: AOAM533HsguvLBwkZK2VHDEl0K95tI5xIa9Xj2g6st5WuKW2lslRmFNn c82Z2ojNyquheP+lZKnLcv7zhM8gBqw= X-Google-Smtp-Source: ABdhPJy7eEfrIVoVtRFQCp4gFsgIwiZlP2gLkZO+G42aa5YhnCGc05KZ+DquaLz8oKGdKDl5kd8fEg== X-Received: by 2002:a65:4949:: with SMTP id q9mr26835408pgs.327.1625683440750; Wed, 07 Jul 2021 11:44:00 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:00 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 08/20] lpfc: Fix null ptr dereference with NPIV ports for RDF handling Date: Wed, 7 Jul 2021 11:43:39 -0700 Message-Id: <20210707184351.67872-9-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org RDF ELS handling for NPIV ports may result in an incorrect ndlp reference count. In the event of a persistent link down, this may lead to premature release of an ndlp structure and subsequent null ptr dereference panic. Remove extraneous lpfc_nlp_put() call in NPIV port RDF processing. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index b0c443a0cf92..b1ca6f8e5970 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -3413,7 +3413,6 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint8_t retry) return 1; } - /* Keep the ndlp just in case RDF is being sent */ return 0; } @@ -3657,11 +3656,9 @@ lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry) lpfc_enqueue_node(vport, ndlp); } - /* RDF ELS is not required on an NPIV VN_Port. */ - if (vport->port_type == LPFC_NPIV_PORT) { - lpfc_nlp_put(ndlp); + /* RDF ELS is not required on an NPIV VN_Port. */ + if (vport->port_type == LPFC_NPIV_PORT) return -EACCES; - } elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, ndlp->nlp_DID, ELS_CMD_RDF); From patchwork Wed Jul 7 18:43:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 854B5C07E95 for ; Wed, 7 Jul 2021 18:44:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70BA261CCD for ; Wed, 7 Jul 2021 18:44:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232516AbhGGSqo (ORCPT ); Wed, 7 Jul 2021 14:46:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232602AbhGGSqn (ORCPT ); Wed, 7 Jul 2021 14:46:43 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD753C06175F for ; Wed, 7 Jul 2021 11:44:01 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id 145so3082433pfv.0 for ; Wed, 07 Jul 2021 11:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IBBGqilqsoY3KWB5nmZAVsYzQTTL8XNkKqSSRvVOtP8=; b=RmMI0Bvo5Vyad/FWdWJC3UBhKmuTeUkAqGXE+us+Xo/kaYN0HTpGjhQkvSdwF6GuLE 95KaOMyJjsEN+W7fbiWHk3dgutSSjPB2qDtuYngx1Se99nQLwXlg2OSZZHuXvz3zjvlU dSYdjrjnvMdOvdOy/RXiL0p+myFGEDkpWC8gleyKbpzpdzLNroKKtI2UvIX7APRN2mH0 sKb7RHsxZ5n+R2BtvPkxAaxEVs85bVvLWB85TiPIqYtutRlQ7zrcB1tTfFCvrb5t8WTS mdOh94/i7Tvms+xUhGNOpF9HnD3OEyhU1ZYRIT2JQFqd3+h99ZyQtwi3gor47u1nqzbo kxZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IBBGqilqsoY3KWB5nmZAVsYzQTTL8XNkKqSSRvVOtP8=; b=UUs8/rjzsuQ3wqpxwuN5dWgO+5dHubYxyTZZzmXB+u7RptPw6Gx6g9bVKIoJlAMoSL zWsJJgytudCVkhksE1ianRy0pByQi5S+CsPaGPh2v1SO36XggN0k0CsZEZ8GwgHuS8hi l2oU5rK8YBSrkyDln9oy6jvAIbmTM6gNMHWGHk/+k074YlCOe1NGf7XGZTaUg7VUjVcr IhJIjL6iXt7w1hnCdma3r+TtCjmymKfsUKfpNv/8fmua4tzwXvHyOLJV65nz6JdnUBIe FMFdAPDbM7PKBQzC6Co+oXRaJQ3cgofT6OjtDEXtjVArMqzuHGsHe27lRndYXnBmTIsQ c1oQ== X-Gm-Message-State: AOAM532tqZQsH/mDmfFLIm7z8hWeVxF99aMMJ4r23/AAgbgX3gre2E69 lB2bRIsYzyOhD0q0p9w2K/L0122nmuE= X-Google-Smtp-Source: ABdhPJw+nAHD9Y0wShIY4DPERs0pQbCjU0XCs33Q1PF69iMbGn5n4CIg29gSwC8f9nutjFBHVhDc1g== X-Received: by 2002:a63:505d:: with SMTP id q29mr18817313pgl.137.1625683441332; Wed, 07 Jul 2021 11:44:01 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:01 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 09/20] lpfc: Fix memory leaks in error paths while issuing ELS RDF/SCR request Date: Wed, 7 Jul 2021 11:43:40 -0700 Message-Id: <20210707184351.67872-10-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The els job request structure, that is allocated while issuing els rdf/scr requests path, is not being released in an error path causing a memory leak message on driver unload. Free the els job structure in the error paths. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index b1ca6f8e5970..3381912bf982 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -3375,6 +3375,7 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint8_t retry) if (phba->sli_rev == LPFC_SLI_REV4) { rc = lpfc_reg_fab_ctrl_node(vport, ndlp); if (rc) { + lpfc_els_free_iocb(phba, elsiocb); lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, "0937 %s: Failed to reg fc node, rc %d\n", __func__, rc); @@ -3667,6 +3668,7 @@ lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry) if (phba->sli_rev == LPFC_SLI_REV4 && !(ndlp->nlp_flag & NLP_RPI_REGISTERED)) { + lpfc_els_free_iocb(phba, elsiocb); lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, "0939 %s: FC_NODE x%x RPI x%x flag x%x " "ste x%x type x%x Not registered\n", From patchwork Wed Jul 7 18:43:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9BD5C07E9C for ; Wed, 7 Jul 2021 18:44:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A805461CD2 for ; Wed, 7 Jul 2021 18:44:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232623AbhGGSqr (ORCPT ); Wed, 7 Jul 2021 14:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232615AbhGGSqn (ORCPT ); Wed, 7 Jul 2021 14:46:43 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84E2AC061574 for ; Wed, 7 Jul 2021 11:44:02 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id t9so3243151pgn.4 for ; Wed, 07 Jul 2021 11:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lP9b1Oygjgq82OieErigQ+Dy8BCsov17Z5zbGNZ7w/k=; b=nqhcrbGYLbcGzEvqM2MQZbd5KBqpdjJ2pe6wWMDjheU2ZE4ADVIQiJC2zGFcCB54b0 9XR/zzBb0AySLPsX+IcGL5UtBpUXfR7C9CTFY0C9O6NmmgTmsUvrtWT+Ebzg7LrcX9Z5 cGm9ahMGG6ThuCbNzzko4kNJZURPmN+MdaSqRsmxdN963vpEhAJFg+xb4x4k7fEFDDsq tWE3sHroz8VqoHRIAvVvQGpkXCMVmstI/QieRmpEf54LwYz+uF1bbPFvzPeiaFI99vPN 7OQcpQu1NAk/llwprhVbIwI0HGGaUrzAnN/powz4dVu9t0womLx57R4l+CgkAtBsJQok BbZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lP9b1Oygjgq82OieErigQ+Dy8BCsov17Z5zbGNZ7w/k=; b=REjux4hd1zcB06n+A6kFeq33NjxIznSYQw0wH0cAdx6DN5UjAzL6+JXmvAA9UuheVE 9ulP1AL1sbOeAdRO9Ap1A0uqKRa9dHR4yBLcla89xBtQ0o+mvJ1Zqn9Ue5/ol3AvQalO mpOwjWLlbtN+uScMtUlZpWFgZcmWZ6uYshUjiINNMFvP9blJmoS67dXxIUSn65IJnCZr 3KTJaN96TQkRSjDbvxYJUskw9AC04zJxMyXXhC3lhVhalzUItybEoAuVwrFu15jKWZkU BNrUKzBYh4stFRqZxIdC82WSVMYQRADiXmKyiaSXOTSBr6bA8PWydXVbT8Lq/5jcmk7U Yv+g== X-Gm-Message-State: AOAM530D+6JKZp8yNUQSFUarie7l6eAPGv4cMdC978OicGZzbUAE6GU0 a9rrq65KyuPuqvV1swk+7KH6DNKsboM= X-Google-Smtp-Source: ABdhPJzGlhRxAFp/7b7k3LUb17EI4nnpUjptJ8sgzKzVgH9ZuqIEGAC/N9XC+P9h3y2KChzknGQPyw== X-Received: by 2002:a05:6a00:22c1:b029:31c:f694:6f4e with SMTP id f1-20020a056a0022c1b029031cf6946f4emr20196572pfj.65.1625683441996; Wed, 07 Jul 2021 11:44:01 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:01 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 10/20] lpfc: Remove REG_LOGIN check requirement to issue an ELS RDF Date: Wed, 7 Jul 2021 11:43:41 -0700 Message-Id: <20210707184351.67872-11-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Since the REG_LOGIN to the fabric controller happens in parallel with SCR, it may or may not be completed by the time RDF is sent. RDF and SCR are sent to the fabric in parallel, so checking for a completed REG_LOGIN in the RDF submit path is not needed. Remove the REG_LOGI check from the RDF submission path. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 3381912bf982..94dc80dc99b7 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -3666,18 +3666,6 @@ lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry) if (!elsiocb) return -ENOMEM; - if (phba->sli_rev == LPFC_SLI_REV4 && - !(ndlp->nlp_flag & NLP_RPI_REGISTERED)) { - lpfc_els_free_iocb(phba, elsiocb); - lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, - "0939 %s: FC_NODE x%x RPI x%x flag x%x " - "ste x%x type x%x Not registered\n", - __func__, ndlp->nlp_DID, ndlp->nlp_rpi, - ndlp->nlp_flag, ndlp->nlp_state, - ndlp->nlp_type); - return -ENODEV; - } - /* Configure the payload for the supported FPIN events. */ prdf = (struct lpfc_els_rdf_req *) (((struct lpfc_dmabuf *)elsiocb->context2)->virt); From patchwork Wed Jul 7 18:43:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FD81C07E95 for ; Wed, 7 Jul 2021 18:44:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D62B61CC8 for ; Wed, 7 Jul 2021 18:44:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232684AbhGGSqt (ORCPT ); Wed, 7 Jul 2021 14:46:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232606AbhGGSqo (ORCPT ); Wed, 7 Jul 2021 14:46:44 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A512C06175F for ; Wed, 7 Jul 2021 11:44:03 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id a2so3226153pgi.6 for ; Wed, 07 Jul 2021 11:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l41WL1YRoN8UoHaOEQ52H1qf3qJEJ4Rqkq6dPkmzcag=; b=rW/xBG0jjFaCQSyY8r0WQA5fRTn7LAhORPYarkXG79GzOBuTGH5Abc5WTmwL/xShIz YSRBXe/TXL97pqs/RSaDpq50tZkZSStt4lxRA1xK3QIyZkk9QO6hPVJ8ytkI5UsFc/Ht PTvaKJRQuKQQnZ2tGPZW4CVO7QAptg8jFvFJrEFPa3hJemhIA88QcTF/3iXoE6Ajo/dT SKTIwMSnUXWd7Yo5WW59IYdwR3IeTnZ4zRMKdlga7UIm65QEPKze/wJuFfG226caAt2n v83D+J4kbUkXAjpXgnWJqjrMEq4sd5IchE93y/lcimFJLd1UGNrGRn+T5/HsJWFACmuF 2Ffw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l41WL1YRoN8UoHaOEQ52H1qf3qJEJ4Rqkq6dPkmzcag=; b=MERg5LeVMytKUiQ60aH8izgtbDU5o9AdB/0HHqeORdaPoZWlW2K2LiGjCJDOpN+zOx lPGldT46o+JiPmIcgHeNga0s6jlDWnKlu9yvOqAZCi2fjYg4e/fXpHWFPkTFG847CPvD d4CWsUKfmIfcZ+xCy+UASemvPGLkKJElFFkn8G2SReuzT/3dvnMY2XAfxM7PF/AMFU5k ZkOV3MwPXmNqPWtWRAK7TaMG6nttPNA+wTaR+adBAHDdPNOYs9mXO3pinhnnQSI+dWjl tC8IvtSttuRgWg9MQtbyNB+5LSUnz4bP3KDDozHAdgaAC/DoOZqdPqrOP0xUpLDz/R4w osyg== X-Gm-Message-State: AOAM532+ihRZOJv2FOrQEp8h4+MDMks0o7Ux3X/LzmxrxniET8nn7m/i /plpXgTxN9RTCcdV4UXVemCwdZ0392c= X-Google-Smtp-Source: ABdhPJy5sWP5fKHuJ+2plojnaMeGM7eha14HZGEYX9QxA1CYs/0sni3u3SKqkQQIy8Brmag8Igfnuw== X-Received: by 2002:a65:6248:: with SMTP id q8mr28005665pgv.279.1625683442750; Wed, 07 Jul 2021 11:44:02 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:02 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 11/20] lpfc: Fix KASAN slab-out-of-bounds in lpfc_unreg_rpi routine Date: Wed, 7 Jul 2021 11:43:42 -0700 Message-Id: <20210707184351.67872-12-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In lpfc_offline_prep() an RPI is freed and nlp_rpi set to 0xFFFF before calling lpfc_unreg_rpi(). Unfortunately, lpfc_unreg_rpi() uses nlp_rpi to index the sli4_hba.rpi_ids[] array. In lpfc_offline_prep, the unreg rpi before freeing the rpi. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 6867b02219b0..2d277979a56a 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -3541,6 +3541,8 @@ lpfc_offline_prep(struct lpfc_hba *phba, int mbx_action) spin_lock_irq(&ndlp->lock); ndlp->nlp_flag &= ~NLP_NPR_ADISC; spin_unlock_irq(&ndlp->lock); + + lpfc_unreg_rpi(vports[i], ndlp); /* * Whenever an SLI4 port goes offline, free the * RPI. Get a new RPI when the adapter port @@ -3556,7 +3558,6 @@ lpfc_offline_prep(struct lpfc_hba *phba, int mbx_action) lpfc_sli4_free_rpi(phba, ndlp->nlp_rpi); ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; } - lpfc_unreg_rpi(vports[i], ndlp); if (ndlp->nlp_type & NLP_FABRIC) { lpfc_disc_state_machine(vports[i], ndlp, From patchwork Wed Jul 7 18:43:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E289AC07E9E for ; Wed, 7 Jul 2021 18:44:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D15BB61CCC for ; Wed, 7 Jul 2021 18:44:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232662AbhGGSqs (ORCPT ); Wed, 7 Jul 2021 14:46:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232575AbhGGSqo (ORCPT ); Wed, 7 Jul 2021 14:46:44 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDA24C061574 for ; Wed, 7 Jul 2021 11:44:03 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id 21so3059321pfp.3 for ; Wed, 07 Jul 2021 11:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZX+01/RsrYeGVUO4Kq8ptwF8Yi7g6UA416e5Z9MjXPY=; b=bN5LgSDawzh2Q8dZTPFTq0/0XxebkqNIK7QcMNrdZKj9IbWdyN9ZGrMLFqN2KNwVxa 4PFaldb9Dnx1o9FMf1aNRyiYk7PyVYQ7sb1k1AQ7ZU09QubUQYAhkzRkJ/X899J8Pv+c +nTp8wFtMqNBmRgBiOjI+8e7m6sL/gosgJfGVuUQeSDO1aYCNSFprNuEaBJ4D5ZD/K/B eKt3+hZ1L90w5avpFrCtwy5tAkPOMexK1wGNEtGRyXAYPxMbVk4KggvBuowKzvXj5c65 jWs7+qJ1aIqxqnUYE/cbDnwLwhVn1eqT48W8YeI9drakEH6XIU1+9gQX67IsgHIrCu9p phCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZX+01/RsrYeGVUO4Kq8ptwF8Yi7g6UA416e5Z9MjXPY=; b=ZQhJQBBb5mo4pMXBdcdIxyRjghlnOIHit5gwi7bwGYuKwFWc13N7awghh/kzroffJm N7l/+nCtfDV5HebHIvr/7kBm4VlHehxnv2ewklZdqld+T4boKX1+3QH41I+6lPm61cxg SNAB6P2KN5dcDvrYCJyf1aG/WMqMyueEn0S5sqPDUQhR8Va8Po7v2mVCGUh3QdmXkDnk b53A47e3hajxLDoQu9+8C2zmaSoL8skw1KYVAO9HaJ0ueJEgipjbB/+EntLy9fZV++MX S93f5Hivt1dUSakjCdc1YieNVig+/Y9Vq5WepWYuXAusx1seXt/x+tb8xUELC4SRIPuv rz3g== X-Gm-Message-State: AOAM533vPBHq6KRQGWMWwG5teTuqIo9uosPJann9maknCSSPJROaS4ox 9NZ9L1XZFZRcZ0In1+l5waY1t6r2asA= X-Google-Smtp-Source: ABdhPJwod9NGPRS2Tsaxm6Eu7mU7EECyuzQPHwxVjI8lnF+e0M46+x4o4LhsWcszG1gjdAPu4SOH/g== X-Received: by 2002:a63:4242:: with SMTP id p63mr8170036pga.185.1625683443360; Wed, 07 Jul 2021 11:44:03 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:03 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 12/20] lpfc: Clear outstanding active mailbox during PCI function reset Date: Wed, 7 Jul 2021 11:43:43 -0700 Message-Id: <20210707184351.67872-13-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Mailbox commands sent via ioctl/bsg from user applications may be interrupted from processing by a concurrently triggered PCI function reset. The command will not generate a completion due to the reset. This results in a user application hang waiting for the mailbox command to complete. Resolve by changing the function reset handler to detect that there was an outstanding mailbox command and simulate a mailbox completion. Add some additional debug when a mailbox command times out. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 11 ++++++++++- drivers/scsi/lpfc/lpfc_sli.c | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 2d277979a56a..bd3742035e76 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -1852,6 +1852,7 @@ lpfc_sli4_port_sta_fn_reset(struct lpfc_hba *phba, int mbx_action, { int rc; uint32_t intr_mode; + LPFC_MBOXQ_t *mboxq; if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) >= LPFC_SLI_INTF_IF_TYPE_2) { @@ -1871,11 +1872,19 @@ lpfc_sli4_port_sta_fn_reset(struct lpfc_hba *phba, int mbx_action, "Recovery...\n"); /* If we are no wait, the HBA has been reset and is not - * functional, thus we should clear LPFC_SLI_ACTIVE flag. + * functional, thus we should clear + * (LPFC_SLI_ACTIVE | LPFC_SLI_MBOX_ACTIVE) flags. */ if (mbx_action == LPFC_MBX_NO_WAIT) { spin_lock_irq(&phba->hbalock); phba->sli.sli_flag &= ~LPFC_SLI_ACTIVE; + if (phba->sli.mbox_active) { + mboxq = phba->sli.mbox_active; + mboxq->u.mb.mbxStatus = MBX_NOT_FINISHED; + __lpfc_mbox_cmpl_put(phba, mboxq); + phba->sli.sli_flag &= ~LPFC_SLI_MBOX_ACTIVE; + phba->sli.mbox_active = NULL; + } spin_unlock_irq(&phba->hbalock); } diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 1abf63c85c4b..06ed8d0e6035 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -8794,8 +8794,11 @@ static int lpfc_sli4_async_mbox_block(struct lpfc_hba *phba) { struct lpfc_sli *psli = &phba->sli; + LPFC_MBOXQ_t *mboxq; int rc = 0; unsigned long timeout = 0; + u32 sli_flag; + u8 cmd, subsys, opcode; /* Mark the asynchronous mailbox command posting as blocked */ spin_lock_irq(&phba->hbalock); @@ -8813,12 +8816,37 @@ lpfc_sli4_async_mbox_block(struct lpfc_hba *phba) if (timeout) lpfc_sli4_process_missed_mbox_completions(phba); - /* Wait for the outstnading mailbox command to complete */ + /* Wait for the outstanding mailbox command to complete */ while (phba->sli.mbox_active) { /* Check active mailbox complete status every 2ms */ msleep(2); if (time_after(jiffies, timeout)) { - /* Timeout, marked the outstanding cmd not complete */ + /* Timeout, mark the outstanding cmd not complete */ + + /* Sanity check sli.mbox_active has not completed or + * cancelled from another context during last 2ms sleep, + * so take hbalock to be sure before logging. + */ + spin_lock_irq(&phba->hbalock); + if (phba->sli.mbox_active) { + mboxq = phba->sli.mbox_active; + cmd = mboxq->u.mb.mbxCommand; + subsys = lpfc_sli_config_mbox_subsys_get(phba, + mboxq); + opcode = lpfc_sli_config_mbox_opcode_get(phba, + mboxq); + sli_flag = psli->sli_flag; + spin_unlock_irq(&phba->hbalock); + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2352 Mailbox command x%x " + "(x%x/x%x) sli_flag x%x could " + "not complete\n", + cmd, subsys, opcode, + sli_flag); + } else { + spin_unlock_irq(&phba->hbalock); + } + rc = 1; break; } From patchwork Wed Jul 7 18:43:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471060 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FD69C07E95 for ; Wed, 7 Jul 2021 18:44:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AD2E61CD2 for ; Wed, 7 Jul 2021 18:44:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232686AbhGGSqt (ORCPT ); Wed, 7 Jul 2021 14:46:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232619AbhGGSqo (ORCPT ); Wed, 7 Jul 2021 14:46:44 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79BD3C061760 for ; Wed, 7 Jul 2021 11:44:04 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id b12so3039245pfv.6 for ; Wed, 07 Jul 2021 11:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5383wP3xm3p3hPyRePRbf0QNR7YyzZs+d9KNbeJOtIU=; b=OaDGylTvyTjs0ZEPz0Yq4YH6lLNvHE61Th7cwUg3ejhvCH91juQwymU//E4GI+pV0E gi9Pe36HHAWNcbEpW4RHn4hrJjsP2XnL4zSJocUcNMEUKWVEOfYx4Ij4WKAOplPP2XCJ TqmkmCW57X0swtaym9vcvo7BKX4jU4wI7OwZhhpDVudWhjyAihYRubPiYBJ6ElS6o594 PQqcg3LHfs4L3j8Pg4WpDa87bEubmjlWHcXANJmwCLcGIwNW1oreFZN+yiUoOi7aHM+C +Ms+FiunQeGkFPemh37cBVj/pO5BWaozmuv9oGKJq50f7JHjY4ih781N+gT+Ut4r6B7c glpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5383wP3xm3p3hPyRePRbf0QNR7YyzZs+d9KNbeJOtIU=; b=KE9OWyvFw9RXOCJoxDL6X1s6jseBIxjw0EhjlfFdqsfYFPkaKsxqUSKUuCTOK7Elx9 v7TW8CH3J6y75Bmt6HLlqhpObBcAFiwiSS8Z+fTSB1gQETwHFiynVyNChTG72MEVf9Br ZHw9VLgijwlxt23lOCH/4aF0G0PmMmB6WeNOCy+Y7yNoFNQ7YEhPEX949rab76nW2SN1 R5dr2DHuykPsAfuyby+2NZiLUnXYPCOTda5GXjeJFwmBaYT+PIIJ5GAYS/iC8KEWMgjU Kqgel31LNOtQPo8I9WpykGQ3e91t6L6ce1wzwYfGz9nuaN/ESlLw3CBpR3nCziyS8I9W /SUw== X-Gm-Message-State: AOAM530AIGj/7/9euidnL7J8tmMAF9bl5m1blf1s/eZrGDEqTC621LIf 7f2lYyrBOZSJO0wc8z3/uhqSBFY/XvM= X-Google-Smtp-Source: ABdhPJw47N/bnoDQYyAgDNmE8cgRFrRAxXmD/CwsfMg9wdoMoPyKQGw5KmTxv7Jm2c6i0oi0cL2R2g== X-Received: by 2002:a05:6a00:1903:b029:31d:f720:133f with SMTP id y3-20020a056a001903b029031df720133fmr18867178pfi.46.1625683443970; Wed, 07 Jul 2021 11:44:03 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:03 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 13/20] lpfc: Use PBDE feature enabled bit to determine PBDE support Date: Wed, 7 Jul 2021 11:43:44 -0700 Message-Id: <20210707184351.67872-14-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The SLI4 interface changed in the manner to indicate PBDE support. Rework the driver to check for PBDE support via the PBDE feature bit in COMMON_GET_SLI4_PARAMETERS. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hw4.h | 11 +++++++---- drivers/scsi/lpfc/lpfc_init.c | 7 ++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 7d4d179fb534..4d9233de9ead 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h @@ -3334,17 +3334,20 @@ struct lpfc_sli4_parameters { #define cfg_nosr_SHIFT 9 #define cfg_nosr_MASK 0x00000001 #define cfg_nosr_WORD word19 - #define cfg_bv1s_SHIFT 10 #define cfg_bv1s_MASK 0x00000001 #define cfg_bv1s_WORD word19 -#define cfg_pvl_SHIFT 13 -#define cfg_pvl_MASK 0x00000001 -#define cfg_pvl_WORD word19 #define cfg_nsler_SHIFT 12 #define cfg_nsler_MASK 0x00000001 #define cfg_nsler_WORD word19 +#define cfg_pvl_SHIFT 13 +#define cfg_pvl_MASK 0x00000001 +#define cfg_pvl_WORD word19 + +#define cfg_pbde_SHIFT 20 +#define cfg_pbde_MASK 0x00000001 +#define cfg_pbde_WORD word19 uint32_t word20; #define cfg_max_tow_xri_SHIFT 0 diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index bd3742035e76..b06b2f847df2 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -12268,9 +12268,10 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) phba->cfg_sg_seg_cnt = LPFC_MAX_NVME_SEG_CNT; - /* Only embed PBDE for if_type 6, PBDE support requires xib be set */ - if ((bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != - LPFC_SLI_INTF_IF_TYPE_6) || (!bf_get(cfg_xib, mbx_sli4_parameters))) + /* Enable embedded Payload BDE if support is indicated */ + if (bf_get(cfg_pbde, mbx_sli4_parameters)) + phba->cfg_enable_pbde = 1; + else phba->cfg_enable_pbde = 0; /* From patchwork Wed Jul 7 18:43:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B3C8C07E9B for ; Wed, 7 Jul 2021 18:44:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4473061CD2 for ; Wed, 7 Jul 2021 18:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232701AbhGGSqw (ORCPT ); Wed, 7 Jul 2021 14:46:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232638AbhGGSqr (ORCPT ); Wed, 7 Jul 2021 14:46:47 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B9ADC061762 for ; Wed, 7 Jul 2021 11:44:05 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id y2so3021377pff.11 for ; Wed, 07 Jul 2021 11:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yy/iYGV/KYaKOPynXND+If3cD1nTCvpSDTASDS9fR08=; b=Kw3M8QpXwGW5sOrDM70pLQ90n1B2eoC55DjzVVgZj0nRnZti9ZefEhaB+rr9RASCZO wmwKEkQTQQrQZ/T8HhPiCRSQprrIWUJ5KPXOD8Dcjics+R+IcMgOXo1XBgbGJvkFxkoZ 71b25wcPGtSUbB1SCTjrXeVfJW9dta8BnwCqXi2alT8PCsjsrqGFgCUYtpIO5TUsJ9Bk PU/bG1aBUKx9ig6kChWfE+pi3+st676KBDxUdHXvYqMBIi1BBKWCpzSbgriykws3gAZV I1ypULnDN8qngyYfmzWTf8Myi+YU2VfHqVk82SdujZrfnS74b6Q+NFdJ8PrAH2vzTUMh 2Z5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yy/iYGV/KYaKOPynXND+If3cD1nTCvpSDTASDS9fR08=; b=P6WqTwkKMuIIDF/M4ncmSbVEGPchiyqr8dKGAaLPsgL8M4jPDv4Cntq2d/+SMgB7TG Elr5tw3SSdUCbzsyioEepRR9vtBVr7xihJWm3XxIdCdnjTvSnjwVafyAEGzRYPR9+vaS B11k1Mk36r4GEf7mt1SCZE8+fdwtxnjIt9yMKr1cJ9+RRaHmE/tmwTjt0VbA6cn5wsLQ IRE1lMgm+ga6Z4IA9VAuMrjjJe0SrflKP9boHNDJDDl8TyhEZqXO4se7ltU/gD0rHGVw iqY8aMch9gxl2Va0GxnZYf8Dsn+3/aCAiA16W+SUtvxQ16qIds3pBEYf19WjWnXFOElY H5Pw== X-Gm-Message-State: AOAM5323jbxI4CWKTQuYD5VrZrLdZqfzXAslaXVuYY2c95L6FNGV8AKA RglfPZXC5BcoGZ9gfkiuwHhe2GccwBE= X-Google-Smtp-Source: ABdhPJwGuNUDLNPMQgSwFKZD6BVWG1Wcn9/5XfA6anSd1vcHKzVekCJ9ehmTo7P6aH1g+HJbWdmRIQ== X-Received: by 2002:a63:e316:: with SMTP id f22mr27357487pgh.100.1625683444621; Wed, 07 Jul 2021 11:44:04 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:04 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 14/20] lpfc: Enable adisc discovery after RSCN by default Date: Wed, 7 Jul 2021 11:43:45 -0700 Message-Id: <20210707184351.67872-15-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Assign a default value of 1 to driver module parameter lpfc_use_adisc Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index eb88aaaf36eb..457989cfc0b7 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -5412,9 +5412,9 @@ LPFC_VPORT_ATTR_R(fcp_class, 3, 2, 3, /* # lpfc_use_adisc: Use ADISC for FCP rediscovery instead of PLOGI. Value range -# is [0,1]. Default value is 0. +# is [0,1]. Default value is 1. */ -LPFC_VPORT_ATTR_RW(use_adisc, 0, 0, 1, +LPFC_VPORT_ATTR_RW(use_adisc, 1, 0, 1, "Use ADISC on rediscovery to authenticate FCP devices"); /* From patchwork Wed Jul 7 18:43:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F405C07E9E for ; Wed, 7 Jul 2021 18:44:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC96F61CC8 for ; Wed, 7 Jul 2021 18:44:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232513AbhGGSq4 (ORCPT ); Wed, 7 Jul 2021 14:46:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232672AbhGGSqs (ORCPT ); Wed, 7 Jul 2021 14:46:48 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6CC0C061764 for ; Wed, 7 Jul 2021 11:44:05 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id a127so3025313pfa.10 for ; Wed, 07 Jul 2021 11:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uG0E5fAFj9ifYbLD84JpUzgMntoUJD0F8u7sjk/SUVc=; b=kI+g030hjvyiuNJf4mytphMB5ImPuq6/tPRB48/5xOvn7Yl5tN5sRQWns8jDszdQgm yQ3DTfA+jBgcKG3OYPDFUt2mlHkIfSRGezIqqxFHMFM8nEYv9kmJWCqMx1QYxWRFkyEV 3KpjwnT4MuL/W+wJV75a8rqxs4Zx6oEYjUsZh1kbRlc8WK04SCbRvbcqGNrvfFuqDVQA KJ6Z9VUE9XQiUBZY8hCD906Ey810GNYsaH40zKDFFsxZrs+aEKsEW+CPutscpt0dqhtv MrMvRPFrmaNkmJVojmL9C0+ea4ZN6bZyVehkmJjyZ3bQHPaou0z3FbLXnK+3eQCm5Hru qn1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uG0E5fAFj9ifYbLD84JpUzgMntoUJD0F8u7sjk/SUVc=; b=BxJRCdMnm5rvDSyO3LkSSVg4GtIoULaE/N8tA88aczgdT90zl3lQD4cIzWXLkOv1ff rXFd+5OeE5XuILsBHIxWpK3BwSYrNPIG4NLpe1wkEDzKBIXWeqLwULW23xf7ZENHwW+e /g2zyRYvbTBlpQspjySN9l8tSWNxVMNzmWSEIomevPBEPWiP9wSvmkB2XaLPZ7cXlJFB 97mldpa5k4O63Wc4P58g0NiSJG7dVUskab5cX5/IvqJoxNt0nUdpYyFAZYPdgb1kQ2RF I6bO9+5U6yAdVLB00xQX95XrA61Rr9EYPV8YMhxkE2bZfKTEpoonJTGOiEEfNU1+7ani cWMQ== X-Gm-Message-State: AOAM530eS6zckFU1hkNy7h+Mdsi4qOEFUE9JmWNiVvoE0wIVc33wFwhW M8830M7W4ski3sijj0uTu8rd/OL62wU= X-Google-Smtp-Source: ABdhPJwO6NtZqIOQIHSHR9madda3Xyzl9D3wNIf0EJGUjmYg8Ejy8nkXxObuuaEQXCuM5bHRjITUEw== X-Received: by 2002:a62:154d:0:b029:323:a515:2e43 with SMTP id 74-20020a62154d0000b0290323a5152e43mr9081009pfv.75.1625683445308; Wed, 07 Jul 2021 11:44:05 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:05 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 15/20] lpfc: Delay unregistering from transport until GIDFT or ADISC completes Date: Wed, 7 Jul 2021 11:43:46 -0700 Message-Id: <20210707184351.67872-16-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org On an RSCN event, the nodes specified in RSCN payload and in MAPPED state are moved to NPR state in order to revalidate the login. This triggers an immediate unregister from SCSI/NVME backend. The assumption is that the node may be missing. The re-registration with the backend happens after either relogin (PLOGI/PRLI; if ADISC is disabled or login truly lost) or when ADISC completes successfully (rediscover with ADISC enabled). However, the NVME-FC standard provides for an RSCN to be triggered when the remote port supports a discovery controller and there was a change of discovery log content. As the remote port typically also supports storage subsystems, this unregister causes all storage controller connections to fail and require reconnect. Correct by reworking the code to ensure that the unregistration only occurs when a login state is truly terminated, thereby leaving the nvme storage controllers in place. The changes made in the patch are: - Retain node state in ADISC_ISSUE when scheduling ADISC els retry. - Do not clear wwpn/wwnn values upon ADISC failure. - Move MAPPED nodes to NPR during RSCN processing, but do not unregister with transport. On GIDFT completion, identify missing nodes (not marked NLP_NPR_2B_DISC) and unregister them. - Perform unregistration for nodes that will go through ADISC processing if ADISC completion fails. - Successful ADISC completion will move node back to MAPPED state. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_crtn.h | 2 + drivers/scsi/lpfc/lpfc_disc.h | 9 +- drivers/scsi/lpfc/lpfc_els.c | 66 ++++++---- drivers/scsi/lpfc/lpfc_hbadisc.c | 197 ++++++++++++++++++++++------- drivers/scsi/lpfc/lpfc_nportdisc.c | 9 +- drivers/scsi/lpfc/lpfc_nvme.c | 10 +- drivers/scsi/lpfc/lpfc_nvme.h | 4 +- 7 files changed, 207 insertions(+), 90 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index 737483c3f01d..41e0d8ef015a 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h @@ -87,6 +87,8 @@ void lpfc_unregister_vfi_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *); void lpfc_enqueue_node(struct lpfc_vport *, struct lpfc_nodelist *); void lpfc_dequeue_node(struct lpfc_vport *, struct lpfc_nodelist *); void lpfc_nlp_set_state(struct lpfc_vport *, struct lpfc_nodelist *, int); +void lpfc_nlp_reg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp); +void lpfc_nlp_unreg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp); void lpfc_drop_node(struct lpfc_vport *, struct lpfc_nodelist *); void lpfc_set_disctmo(struct lpfc_vport *); int lpfc_can_disctmo(struct lpfc_vport *); diff --git a/drivers/scsi/lpfc/lpfc_disc.h b/drivers/scsi/lpfc/lpfc_disc.h index 131374a61d7e..871b665bd72e 100644 --- a/drivers/scsi/lpfc/lpfc_disc.h +++ b/drivers/scsi/lpfc/lpfc_disc.h @@ -78,10 +78,11 @@ struct lpfc_node_rrqs { }; enum lpfc_fc4_xpt_flags { - NLP_WAIT_FOR_UNREG = 0x1, - SCSI_XPT_REGD = 0x2, - NVME_XPT_REGD = 0x4, - NLP_XPT_HAS_HH = 0x8, + NLP_XPT_REGD = 0x1, + SCSI_XPT_REGD = 0x2, + NVME_XPT_REGD = 0x4, + NVME_XPT_UNREG_WAIT = 0x8, + NLP_XPT_HAS_HH = 0x10 }; struct lpfc_nodelist { diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 94dc80dc99b7..32f5f00f0a85 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1664,6 +1664,12 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, if (!new_ndlp || (new_ndlp == ndlp)) return ndlp; + /* + * Unregister from backend if not done yet. Could have been skipped + * due to ADISC + */ + lpfc_nlp_unreg_node(vport, new_ndlp); + if (phba->sli_rev == LPFC_SLI_REV4) { active_rrqs_xri_bitmap = mempool_alloc(phba->active_rrq_pool, GFP_KERNEL); @@ -4365,7 +4371,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, (cmd == ELS_CMD_NVMEPRLI)) lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); - else + else if (cmd != ELS_CMD_ADISC) lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); ndlp->nlp_last_elscmd = cmd; @@ -5653,25 +5659,40 @@ lpfc_els_disc_adisc(struct lpfc_vport *vport) /* go thru NPR nodes and issue any remaining ELS ADISCs */ list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { - if (ndlp->nlp_state == NLP_STE_NPR_NODE && - (ndlp->nlp_flag & NLP_NPR_2B_DISC) != 0 && - (ndlp->nlp_flag & NLP_NPR_ADISC) != 0) { - spin_lock_irq(&ndlp->lock); - ndlp->nlp_flag &= ~NLP_NPR_ADISC; - spin_unlock_irq(&ndlp->lock); - ndlp->nlp_prev_state = ndlp->nlp_state; - lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); - lpfc_issue_els_adisc(vport, ndlp, 0); - sentadisc++; - vport->num_disc_nodes++; - if (vport->num_disc_nodes >= - vport->cfg_discovery_threads) { - spin_lock_irq(shost->host_lock); - vport->fc_flag |= FC_NLP_MORE; - spin_unlock_irq(shost->host_lock); - break; - } + + if (ndlp->nlp_state != NLP_STE_NPR_NODE || + !(ndlp->nlp_flag & NLP_NPR_ADISC)) + continue; + + spin_lock_irq(&ndlp->lock); + ndlp->nlp_flag &= ~NLP_NPR_ADISC; + spin_unlock_irq(&ndlp->lock); + + if (!(ndlp->nlp_flag & NLP_NPR_2B_DISC)) { + /* This node was marked for ADISC but was not picked + * for discovery. This is possible if the node was + * missing in gidft response. + * + * At time of marking node for ADISC, we skipped unreg + * from backend + */ + lpfc_nlp_unreg_node(vport, ndlp); + continue; } + + ndlp->nlp_prev_state = ndlp->nlp_state; + lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); + lpfc_issue_els_adisc(vport, ndlp, 0); + sentadisc++; + vport->num_disc_nodes++; + if (vport->num_disc_nodes >= + vport->cfg_discovery_threads) { + spin_lock_irq(shost->host_lock); + vport->fc_flag |= FC_NLP_MORE; + spin_unlock_irq(shost->host_lock); + break; + } + } if (sentadisc == 0) { spin_lock_irq(shost->host_lock); @@ -6882,13 +6903,6 @@ lpfc_rscn_recovery_check(struct lpfc_vport *vport) continue; } - /* Check to see if we need to NVME rescan this target - * remoteport. - */ - if (ndlp->nlp_fc4_type & NLP_FC4_NVME && - ndlp->nlp_type & (NLP_NVME_TARGET | NLP_NVME_DISCOVERY)) - lpfc_nvme_rescan_port(vport, ndlp); - lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RECOVERY); lpfc_cancel_retry_delay_tmo(vport, ndlp); diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 7cc5920979f8..32fb3be42b26 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -4501,10 +4501,152 @@ lpfc_nlp_counters(struct lpfc_vport *vport, int state, int count) spin_unlock_irqrestore(shost->host_lock, iflags); } +/* Register a node with backend if not already done */ +void +lpfc_nlp_reg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) +{ + + unsigned long iflags; + + spin_lock_irqsave(&ndlp->lock, iflags); + if (ndlp->fc4_xpt_flags & NLP_XPT_REGD) { + /* Already registered with backend, trigger rescan */ + spin_unlock_irqrestore(&ndlp->lock, iflags); + + if (ndlp->fc4_xpt_flags & NVME_XPT_REGD && + ndlp->nlp_type & (NLP_NVME_TARGET | NLP_NVME_DISCOVERY)) { + lpfc_nvme_rescan_port(vport, ndlp); + } + return; + } + + ndlp->fc4_xpt_flags |= NLP_XPT_REGD; + spin_unlock_irqrestore(&ndlp->lock, iflags); + + if (lpfc_valid_xpt_node(ndlp)) { + vport->phba->nport_event_cnt++; + /* + * Tell the fc transport about the port, if we haven't + * already. If we have, and it's a scsi entity, be + */ + lpfc_register_remote_port(vport, ndlp); + } + + /* We are done if we do not have any NVME remote node */ + if (!(ndlp->nlp_fc4_type & NLP_FC4_NVME)) + return; + + /* Notify the NVME transport of this new rport. */ + if (vport->phba->sli_rev >= LPFC_SLI_REV4 && + ndlp->nlp_fc4_type & NLP_FC4_NVME) { + if (vport->phba->nvmet_support == 0) { + /* Register this rport with the transport. + * Only NVME Target Rports are registered with + * the transport. + */ + if (ndlp->nlp_type & NLP_NVME_TARGET) { + vport->phba->nport_event_cnt++; + lpfc_nvme_register_port(vport, ndlp); + } + } else { + /* Just take an NDLP ref count since the + * target does not register rports. + */ + lpfc_nlp_get(ndlp); + } + } +} + +/* Unregister a node with backend if not already done */ +void +lpfc_nlp_unreg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) +{ + unsigned long iflags; + + spin_lock_irqsave(&ndlp->lock, iflags); + if (!(ndlp->fc4_xpt_flags & NLP_XPT_REGD)) { + spin_unlock_irqrestore(&ndlp->lock, iflags); + return; + } + + ndlp->fc4_xpt_flags &= ~NLP_XPT_REGD; + spin_unlock_irqrestore(&ndlp->lock, iflags); + + if (ndlp->rport && + ndlp->fc4_xpt_flags & SCSI_XPT_REGD) { + vport->phba->nport_event_cnt++; + lpfc_unregister_remote_port(ndlp); + } + + if (ndlp->fc4_xpt_flags & NVME_XPT_REGD) { + vport->phba->nport_event_cnt++; + if (vport->phba->nvmet_support == 0) { + /* Start devloss if target. */ + if (ndlp->nlp_type & NLP_NVME_TARGET) + lpfc_nvme_unregister_port(vport, ndlp); + } else { + /* NVMET has no upcall. */ + lpfc_nlp_put(ndlp); + } + } + +} + +/* + * Adisc state change handling + */ +static void +lpfc_handle_adisc_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, + int new_state) +{ + switch (new_state) { + /* + * Any state to ADISC_ISSUE + * Do nothing, adisc cmpl handling will trigger state changes + */ + case NLP_STE_ADISC_ISSUE: + break; + + /* + * ADISC_ISSUE to mapped states + * Trigger a registration with backend, it will be nop if + * already registered + */ + case NLP_STE_UNMAPPED_NODE: + ndlp->nlp_type |= NLP_FC_NODE; + fallthrough; + case NLP_STE_MAPPED_NODE: + ndlp->nlp_flag &= ~NLP_NODEV_REMOVE; + lpfc_nlp_reg_node(vport, ndlp); + break; + + /* + * ADISC_ISSUE to non-mapped states + * We are moving from ADISC_ISSUE to a non-mapped state because + * ADISC failed, we would have skipped unregistering with + * backend, attempt it now + */ + case NLP_STE_NPR_NODE: + ndlp->nlp_flag &= ~NLP_RCV_PLOGI; + fallthrough; + default: + lpfc_nlp_unreg_node(vport, ndlp); + break; + } + +} + static void lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int old_state, int new_state) { + /* Trap ADISC changes here */ + if (new_state == NLP_STE_ADISC_ISSUE || + old_state == NLP_STE_ADISC_ISSUE) { + lpfc_handle_adisc_state(vport, ndlp, new_state); + return; + } + if (new_state == NLP_STE_UNMAPPED_NODE) { ndlp->nlp_flag &= ~NLP_NODEV_REMOVE; ndlp->nlp_type |= NLP_FC_NODE; @@ -4514,60 +4656,17 @@ lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, if (new_state == NLP_STE_NPR_NODE) ndlp->nlp_flag &= ~NLP_RCV_PLOGI; - /* FCP and NVME Transport interface */ + /* Reg/Unreg for FCP and NVME Transport interface */ if ((old_state == NLP_STE_MAPPED_NODE || old_state == NLP_STE_UNMAPPED_NODE)) { - if (ndlp->rport && - lpfc_valid_xpt_node(ndlp)) { - vport->phba->nport_event_cnt++; - lpfc_unregister_remote_port(ndlp); - } - - if (ndlp->nlp_fc4_type & NLP_FC4_NVME) { - vport->phba->nport_event_cnt++; - if (vport->phba->nvmet_support == 0) { - /* Start devloss if target. */ - if (ndlp->nlp_type & NLP_NVME_TARGET) - lpfc_nvme_unregister_port(vport, ndlp); - } else { - /* NVMET has no upcall. */ - lpfc_nlp_put(ndlp); - } - } + /* For nodes marked for ADISC, Handle unreg in ADISC cmpl */ + if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) + lpfc_nlp_unreg_node(vport, ndlp); } - /* FCP and NVME Transport interfaces */ - if (new_state == NLP_STE_MAPPED_NODE || - new_state == NLP_STE_UNMAPPED_NODE) { - if (lpfc_valid_xpt_node(ndlp)) { - vport->phba->nport_event_cnt++; - /* - * Tell the fc transport about the port, if we haven't - * already. If we have, and it's a scsi entity, be - */ - lpfc_register_remote_port(vport, ndlp); - } - /* Notify the NVME transport of this new rport. */ - if (vport->phba->sli_rev >= LPFC_SLI_REV4 && - ndlp->nlp_fc4_type & NLP_FC4_NVME) { - if (vport->phba->nvmet_support == 0) { - /* Register this rport with the transport. - * Only NVME Target Rports are registered with - * the transport. - */ - if (ndlp->nlp_type & NLP_NVME_TARGET) { - vport->phba->nport_event_cnt++; - lpfc_nvme_register_port(vport, ndlp); - } - } else { - /* Just take an NDLP ref count since the - * target does not register rports. - */ - lpfc_nlp_get(ndlp); - } - } - } + new_state == NLP_STE_UNMAPPED_NODE) + lpfc_nlp_reg_node(vport, ndlp); if ((new_state == NLP_STE_MAPPED_NODE) && (vport->stat_data_enabled)) { diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index e12f83fb795c..46c1905f6f39 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -863,6 +863,9 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; } out: + /* Unregister from backend, could have been skipped due to ADISC */ + lpfc_nlp_unreg_node(vport, ndlp); + ndlp->nlp_prev_state = ndlp->nlp_state; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); @@ -1677,9 +1680,6 @@ lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport, spin_unlock_irq(&ndlp->lock); ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; - memset(&ndlp->nlp_nodename, 0, sizeof(struct lpfc_name)); - memset(&ndlp->nlp_portname, 0, sizeof(struct lpfc_name)); - ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); lpfc_unreg_rpi(vport, ndlp); @@ -2597,13 +2597,14 @@ lpfc_device_recov_mapped_node(struct lpfc_vport *vport, void *arg, uint32_t evt) { + lpfc_disc_set_adisc(vport, ndlp); + ndlp->nlp_prev_state = NLP_STE_MAPPED_NODE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); spin_lock_irq(&ndlp->lock); ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME); spin_unlock_irq(&ndlp->lock); - lpfc_disc_set_adisc(vport, ndlp); return ndlp->nlp_state; } diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index bcc804cefd30..f36294e9b5dd 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -216,8 +216,8 @@ lpfc_nvme_remoteport_delete(struct nvme_fc_remote_port *remoteport) /* The register rebind might have occurred before the delete * downcall. Guard against this race. */ - if (ndlp->fc4_xpt_flags & NLP_WAIT_FOR_UNREG) - ndlp->fc4_xpt_flags &= ~(NLP_WAIT_FOR_UNREG | NVME_XPT_REGD); + if (ndlp->fc4_xpt_flags & NVME_XPT_UNREG_WAIT) + ndlp->fc4_xpt_flags &= ~(NVME_XPT_UNREG_WAIT | NVME_XPT_REGD); spin_unlock_irq(&ndlp->lock); @@ -2324,7 +2324,7 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) * race that leaves the WAIT flag set. */ spin_lock_irq(&ndlp->lock); - ndlp->fc4_xpt_flags &= ~NLP_WAIT_FOR_UNREG; + ndlp->fc4_xpt_flags &= ~NVME_XPT_UNREG_WAIT; ndlp->fc4_xpt_flags |= NVME_XPT_REGD; spin_unlock_irq(&ndlp->lock); rport = remote_port->private; @@ -2336,7 +2336,7 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) */ spin_lock_irq(&ndlp->lock); ndlp->nrport = NULL; - ndlp->fc4_xpt_flags &= ~NLP_WAIT_FOR_UNREG; + ndlp->fc4_xpt_flags &= ~NVME_XPT_UNREG_WAIT; spin_unlock_irq(&ndlp->lock); rport->ndlp = NULL; rport->remoteport = NULL; @@ -2488,7 +2488,7 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) * The transport will update it. */ spin_lock_irq(&vport->phba->hbalock); - ndlp->fc4_xpt_flags |= NLP_WAIT_FOR_UNREG; + ndlp->fc4_xpt_flags |= NVME_XPT_UNREG_WAIT; spin_unlock_irq(&vport->phba->hbalock); /* Don't let the host nvme transport keep sending keep-alives diff --git a/drivers/scsi/lpfc/lpfc_nvme.h b/drivers/scsi/lpfc/lpfc_nvme.h index 69a5a844c69c..060a7c111bad 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.h +++ b/drivers/scsi/lpfc/lpfc_nvme.h @@ -37,8 +37,8 @@ #define LPFC_MAX_NVME_INFO_TMP_LEN 100 #define LPFC_NVME_INFO_MORE_STR "\nCould be more info...\n" -#define lpfc_ndlp_get_nrport(ndlp) \ - ((!ndlp->nrport || (ndlp->fc4_xpt_flags & NLP_WAIT_FOR_UNREG)) \ +#define lpfc_ndlp_get_nrport(ndlp) \ + ((!ndlp->nrport || (ndlp->fc4_xpt_flags & NVME_XPT_UNREG_WAIT))\ ? NULL : ndlp->nrport) struct lpfc_nvme_qhandle { From patchwork Wed Jul 7 18:43:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A115FC07E95 for ; Wed, 7 Jul 2021 18:44:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A90161CD2 for ; Wed, 7 Jul 2021 18:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232661AbhGGSqy (ORCPT ); Wed, 7 Jul 2021 14:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231948AbhGGSqr (ORCPT ); Wed, 7 Jul 2021 14:46:47 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADCCFC061765 for ; Wed, 7 Jul 2021 11:44:06 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id v7so3257010pgl.2 for ; Wed, 07 Jul 2021 11:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n8/aFQB7mqMNfN205fqFBT5VKFuSC7RRpVl/FyjQWqA=; b=h6BFYwgNxXve2bXHtltGqps2vxJMM5YXPunnHu7QkImBarZ3sIntEYNyeXNuWe3plR oQ4fRX5NVfiaGEtXFL8+TXfw/PLYrPspOicQss/WmGBo9L3sl2HVVWdKOeNAUtL/FlAu y9PQOtOnf4mEgYpHyFpWuJq8Y/gV4/2pjKBhNh/qOM8BhY1mDZuX5FiiT1FEK8n9ct43 5HYnHIDxdK3Zf2iR6IxuURBHo8rQNHM7sdUBDLVHvNkGvDaJJyPW6mPoXKPih/kOwsRV x8mFR0AcoyjuC1n7nZZrYJY9l1EEDcVLw+GdcQVcJez2ruNsuxOgC0+e6BBoAQpv53cN HW3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n8/aFQB7mqMNfN205fqFBT5VKFuSC7RRpVl/FyjQWqA=; b=SiS5yXgk75t6Ah1T6bX+Jg5eJ1oThhWDlbJC6EMPhdnCXg10KfaX6gMEmmEZAq5jXY HMbMEzxesfKzs62QUQO3aUqRDT5uYu2EiQNplM34FmHtoM6ZcFG0AkvwsQHXsfdbZDLe Z6bec/jU+TG4IdUjgM2u9OU/AHKgoZcDXSfbsO83m8YvDTSEkREBEt3CslzKglAtd0hW AEZXxUWuOhQYGsbMqAg3Nh69t3Qoy6NbL310UA0hTpmZo3rEFkYXnjXW+OPZNGoj7e5L 53V9puhu8MiuantJiQpVE/ppci++exxuoZf8ZidTGmEO62AB2d4aGSIKr446h/Vm2Cis IcWg== X-Gm-Message-State: AOAM530GfPku2XFjU+p1ddneoJdonpa5UXBAdVbdENok0VNLTX3nOmQ7 q9zfAbNgQrLOTHLC9lcEgj9JruZkZWo= X-Google-Smtp-Source: ABdhPJzoleVXqJJ8JS5D17/Ds/o0Ca9GTV0JixkF4GI7q1iQFmyauxjInjwli3aIoKPb/zkeod/urw== X-Received: by 2002:a65:50ca:: with SMTP id s10mr28064030pgp.68.1625683446180; Wed, 07 Jul 2021 11:44:06 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:05 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 16/20] lpfc: Call discovery state machine when handling PLOGI/ADISC completions Date: Wed, 7 Jul 2021 11:43:47 -0700 Message-Id: <20210707184351.67872-17-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In the PLOGI and ADISC completion handling, the device removal event could be skipped during some link errors. This could leave a stale node in UNUSED state. Driver unload would hang for a long time waiting for this node to be freed. Resolve by taking the following steps: - Always post ADISC completion events to discovery state machine upon ADISC completion. - In case of a completion error for PLOGI/ADISC, ensure that init refcount is dropped if not registered with transport. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 32f5f00f0a85..11e56534b8f0 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2031,9 +2031,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, irsp->un.ulpWord[4]); /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ - if (lpfc_error_lost_link(irsp)) - goto check_plogi; - else + if (!lpfc_error_lost_link(irsp)) lpfc_disc_state_machine(vport, ndlp, cmdiocb, NLP_EVT_CMPL_PLOGI); @@ -2086,7 +2084,6 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, NLP_EVT_CMPL_PLOGI); } - check_plogi: if (disc && vport->num_disc_nodes) { /* Check to see if there are more PLOGIs to be sent */ lpfc_more_plogi(vport); @@ -2755,12 +2752,9 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, "2755 ADISC failure DID:%06X Status:x%x/x%x\n", ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4]); - /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ - if (lpfc_error_lost_link(irsp)) - goto check_adisc; - else - lpfc_disc_state_machine(vport, ndlp, cmdiocb, - NLP_EVT_CMPL_ADISC); + + lpfc_disc_state_machine(vport, ndlp, cmdiocb, + NLP_EVT_CMPL_ADISC); /* As long as this node is not registered with the SCSI or NVMe * transport, it is no longer an active node. Otherwise @@ -2778,7 +2772,6 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, lpfc_disc_state_machine(vport, ndlp, cmdiocb, NLP_EVT_CMPL_ADISC); - check_adisc: /* Check to see if there are more ADISCs to be sent */ if (disc && vport->num_disc_nodes) lpfc_more_adisc(vport); From patchwork Wed Jul 7 18:43:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 664C6C07E9C for ; Wed, 7 Jul 2021 18:44:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DC7461CCE for ; Wed, 7 Jul 2021 18:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232724AbhGGSqx (ORCPT ); Wed, 7 Jul 2021 14:46:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232640AbhGGSqr (ORCPT ); Wed, 7 Jul 2021 14:46:47 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 474A4C061574 for ; Wed, 7 Jul 2021 11:44:07 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id p9so2068217pjl.3 for ; Wed, 07 Jul 2021 11:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1XRHycLuBv2mlw/4Sks8C19TtCruVWziBnfzmR/aUIE=; b=THVKqtrgmuAxvn8ENg9qPNpX1BDiejMP5Q4oA8oiPMLIR3FN9udjUk1J60YCEYbCrS 2A8ullvmXJTby4oRCeKfxEnGbmhpXcSduszchxIAjQAVRVaImVm8f1egQUG2Gv1LxGtE LqDRrUpumBYXUpQl4KRJuxQvk2Mr7gkODaltpEuDdw+uioUrPl+e8EIg8foa5MV+4Yot 3lc3bpz5SR+N2k09UqTDJz4xoHjPYKfE78zLr9WOKkorWd2jgSuFqX0VfQ8t1DuvSgh0 IJ4VVNA4tTg0UBQu3dJEl3u49pI8CzGlhj6XP5FpN1Sqa7LO1J+7jCPCEse3Yk3hPx6i KKfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1XRHycLuBv2mlw/4Sks8C19TtCruVWziBnfzmR/aUIE=; b=j9XT+Ys1OPCev3wjKeZv6V838UatrjVSslyI65YZkC1BIhWfyupG/01XJopBrp8sqJ diRejxGsb9zEZN+Mg5/5RS7q82t97wkPOtUPU/f7i5wkW6cx8z9GCX2t17ZTywfuAF77 y0ZSm7ZRYGtRmqPrWRtYJMa24caX+OeOdSePg1+fmMfrMg1yEimDdXJ4cBJwIyLUoLy8 A48NV4Sf+S1kcFA0mcObni2J0Wpxv9qY2QMcDO0+7xybusQBqreKuretXwhAczh5Ue85 RdNbIyayClFIE9+lcCDgZWHeC+fSXqQ0DICki5CglBwrpYaN8DOESKIvDPdVOZJtRsrP 7RMA== X-Gm-Message-State: AOAM530IE97NvBUprglEFVd7QjyKgVlZT15MxjrNxQsK1J74bjB6THfW PVw3XVI1MEDQHTrInqYAMIJYNMlHw8I= X-Google-Smtp-Source: ABdhPJxLsiKuZLlICd5dO8FS6mC/5I9JQaYj5s4+xz80BXwvQ/TICZhQPhJwsW4u6Kmff3oAiH9vCA== X-Received: by 2002:a17:90b:124f:: with SMTP id gx15mr476005pjb.8.1625683446797; Wed, 07 Jul 2021 11:44:06 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:06 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 17/20] lpfc: Skip reg_vpi when link is down for SLI3 in ADISC cmpl path Date: Wed, 7 Jul 2021 11:43:48 -0700 Message-Id: <20210707184351.67872-18-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org During RSCN storms, some instances of LIP on SLI-3 adapters lead to a situation where FLOGIs keep failing with firmware indicating an illegal command error code. This situation was preceded by an ADISC completion that was processed while the link was down. This path on SLI-3 performs a CLEAR_LA and attempts to activate a VPI with REG_VPI. Later, as the FLOGI completes, it's no longer in sync with the VPI state. In SLI-3 it is illegal to have an active VPI during FLOGI. Resolve by circumventing the SLI-3 path that performs the CLEAR_LA and REG_VPI. The path will be taken after the FLOGI after the next Link Up. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 11e56534b8f0..342c7e28ee95 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2610,6 +2610,14 @@ lpfc_adisc_done(struct lpfc_vport *vport) if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) && !(vport->fc_flag & FC_RSCN_MODE) && (phba->sli_rev < LPFC_SLI_REV4)) { + + /* + * If link is down, clear_la and reg_vpi will be done after + * flogi following a link up event + */ + if (!lpfc_is_link_up(phba)) + return; + /* The ADISCs are complete. Doesn't matter if they * succeeded or failed because the ADISC completion * routine guarantees to call the state machine and From patchwork Wed Jul 7 18:43:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6410CC07E9B for ; Wed, 7 Jul 2021 18:44:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 530BF61CCE for ; Wed, 7 Jul 2021 18:44:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232328AbhGGSqy (ORCPT ); Wed, 7 Jul 2021 14:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232673AbhGGSqs (ORCPT ); Wed, 7 Jul 2021 14:46:48 -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 EDE2EC061760 for ; Wed, 7 Jul 2021 11:44:07 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id 17so3060808pfz.4 for ; Wed, 07 Jul 2021 11:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q2+jTCdmK1CyvXp8vVBUgDilW7nXpcJW8iITvEhfUhU=; b=VgpWYxcz5OrHwQhU7bxnJMqT1SPPL4JonlRCYEh7zG1dAUE7vw7H5TNrNTLnN8kDIC x9cNk0X4JB0fsyXpas3W0OqHxZmzmJSQIZXASLO1ipZHwQ7vd8csOtb1kf5mFTj3RYJ7 3n+iZHsZXzu4aayt72AmD/ThgrAOsFlxSQh7CcnCknL2B9snZHuP7kfV1yEzWMi6Ad/Y GfClNogEmLJe0cW7BLGU8J9BwFHFd+VG0hAtVKK3LD2Ci7ey/Z7tGjmtVWG8yIRhx3bp yBLseslVP/fWxaOeB2LYsv3MvoA86Z3vQ1hd9aTp/a2VCQ8jlsPnjxbngenUw3YwxDUf FWEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q2+jTCdmK1CyvXp8vVBUgDilW7nXpcJW8iITvEhfUhU=; b=ZfJEgb+qvZrDEdzTgUz3vD+/jQ6pCZCLcXxBo3DVOWiNIOZDLuBlEPN6AxMzELJ6gP YKAm+d2u1OxqXuOu53HPE9uN+dvM4AluLR2ELc+qmJsx3rFaDw7PKetL2LaLmIMU63Sb W1Yq33ewkeNGKc3f0qv8WKoTfS7xhSG+Uhgu7Nu8bmo+vF2aqxHDPemPvMbT1dxCpApG avcatg6xZXhzyTot8Zg36rQLbt5Yj6zJceO/sOi7Yjaf60BiLbeTgfUpq9YSeeefQ7zo Y+uFeZjVS5kEo58prqXPHaIqZ2EmApTHnhPrfsPV+ftkw+3J+TU0DYxRjA/ZN1OA5ZEW 3Fbw== X-Gm-Message-State: AOAM531Dz1MxOMi11goyU2J2JHHBEgBOAscS7ww25B6KCm6tNmRlTrYE 7Uyz1W8/9zqxe9VkUp+vpL9ZSXgSLCg= X-Google-Smtp-Source: ABdhPJxhfVRPsXeFKx5X6CEn76BmksDrK32gztCF8i+NXvYHL2olMwZO1TT34guBKpA9NC4uOnhpmw== X-Received: by 2002:aa7:921a:0:b029:2cf:b55b:9d52 with SMTP id 26-20020aa7921a0000b02902cfb55b9d52mr26441635pfo.35.1625683447419; Wed, 07 Jul 2021 11:44:07 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:07 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 18/20] lpfc: Skip issuing ADISC when node is in NPR state Date: Wed, 7 Jul 2021 11:43:49 -0700 Message-Id: <20210707184351.67872-19-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org When a node moves to NPR state due to a device recovery event, the nlp_fc4_types in the node are cleared. An ADISC received for a node in the NPR state triggers an ADISC. Without fc4 types being known, the calls to register with the transport are no-op'd, thus no additional references are placed on the node by transport re-registrations. A subsequent RSCN could trigger another unregister request, which will decrement the reference counts, leading to the ref count hitting zero and the node being freed while futher discovery on the node is being attempted by the RSCN event handling. Fix by skipping the trigger of an ADISC when in NPR state. The normal ADISC process will kick off in the regular discovery path after receiving a response from name server. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nportdisc.c | 34 +++++++++++++++++------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 46c1905f6f39..27263f02ab9f 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -736,9 +736,13 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, * is already in MAPPED or UNMAPPED state. Catch this * condition and don't set the nlp_state again because * it causes an unnecessary transport unregister/register. + * + * Nodes marked for ADISC will move MAPPED or UNMAPPED state + * after issuing ADISC */ if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET)) { - if (ndlp->nlp_state != NLP_STE_MAPPED_NODE) + if ((ndlp->nlp_state != NLP_STE_MAPPED_NODE) && + !(ndlp->nlp_flag & NLP_NPR_ADISC)) lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE); } @@ -2646,14 +2650,13 @@ lpfc_rcv_prli_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); if (!(ndlp->nlp_flag & NLP_DELAY_TMO)) { - if (ndlp->nlp_flag & NLP_NPR_ADISC) { - spin_lock_irq(&ndlp->lock); - ndlp->nlp_flag &= ~NLP_NPR_ADISC; - ndlp->nlp_prev_state = NLP_STE_NPR_NODE; - spin_unlock_irq(&ndlp->lock); - lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); - lpfc_issue_els_adisc(vport, ndlp, 0); - } else { + /* + * ADISC nodes will be handled in regular discovery path after + * receiving response from NS. + * + * For other nodes, Send PLOGI to trigger an implicit LOGO. + */ + if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) { ndlp->nlp_prev_state = NLP_STE_NPR_NODE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); @@ -2686,12 +2689,13 @@ lpfc_rcv_padisc_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, */ if (!(ndlp->nlp_flag & NLP_DELAY_TMO) && !(ndlp->nlp_flag & NLP_NPR_2B_DISC)) { - if (ndlp->nlp_flag & NLP_NPR_ADISC) { - ndlp->nlp_flag &= ~NLP_NPR_ADISC; - ndlp->nlp_prev_state = NLP_STE_NPR_NODE; - lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); - lpfc_issue_els_adisc(vport, ndlp, 0); - } else { + /* + * ADISC nodes will be handled in regular discovery path after + * receiving response from NS. + * + * For other nodes, Send PLOGI to trigger an implicit LOGO. + */ + if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) { ndlp->nlp_prev_state = NLP_STE_NPR_NODE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); From patchwork Wed Jul 7 18:43:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBA11C07E95 for ; Wed, 7 Jul 2021 18:44:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0C6A61CCD for ; Wed, 7 Jul 2021 18:44:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232677AbhGGSrB (ORCPT ); Wed, 7 Jul 2021 14:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232680AbhGGSqt (ORCPT ); Wed, 7 Jul 2021 14:46:49 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9391CC061762 for ; Wed, 7 Jul 2021 11:44:08 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso2216935pjp.5 for ; Wed, 07 Jul 2021 11:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y1Fd06JvSHl4wSEfCiUbzcae9DXL7XG3BQE57xZeIKs=; b=KiCDh4yD8L10BF8PIviMc4hIGqVELRQy1rSeIZUcDMm6sF3ZaORHazvbhnAxmviO8F HCR6I0iZPrnE/+Zv64ZNfa7Llovar6pRFB0UYjL5gFMZJ08GlPgSWO2sTLjFnxz7WpDb hh81xw8OVj7lFSLIXCeePKLTs8qhEGKDDRLgc1nOUWlx1tPAYYIyS4PcLtKI3A1dV2bB 2muJc0DaJhRsnTketORsNHI/XCOs5awX+NjUE02v4ffUsSxA947/3s47CW8Zkuw6nA2q VBPbRt6VA+li8EN0BZkg/jzkWpmChmXgICZZyvxuVDOyzj4XBfCM66TegML2fV7xTITz VePA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y1Fd06JvSHl4wSEfCiUbzcae9DXL7XG3BQE57xZeIKs=; b=HheBUmbLLbpyIgp5HCw3w96OK+SeAyuAkrkmHUPeUBqgF5CBeVkjHXK42QfCm5Wgvc ULRwoW6UMu/Vma5epiUINaRmuHRHj2UXehOGF28qbGYpS0reZVShwA++DjhQV9CiaJDh u1QQTnTTM6oWP+glPoL9SHCjWkT25GzNxEVEONUa+Ex+zGl9wOshHVAhgrbw0WAr7li3 eSjkw+vvpS3mNDxqYYD3YqN6Wi2lSKTWWKCH6T2ywi+SsXHU0wDctUQDqNamVF4rayWj yKBf5YgHkb587B7/x7lGOwPJJCAP8PQiZm2ykkI2XNIp6maeu/uL4wxfk5OczHJzg7iS 4qTA== X-Gm-Message-State: AOAM5316VTAzmDkYCrhu8DqFbnFb4wFC03GNpCCpqnelxPlYFF5OMJDO VqOMTcP9Qvx+439+qSi1eDCGUMA1ips= X-Google-Smtp-Source: ABdhPJwNh2zllbHSxGa7+D9JTN63V+D11SN6U0usirTxXiK0BhxdWghEuwBh+3rD41ApFmyPki1SMA== X-Received: by 2002:a17:903:2445:b029:129:586e:7d16 with SMTP id l5-20020a1709032445b0290129586e7d16mr22437816pls.54.1625683448092; Wed, 07 Jul 2021 11:44:08 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:07 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 19/20] lpfc: Update lpfc version to 12.8.0.11 Date: Wed, 7 Jul 2021 11:43:50 -0700 Message-Id: <20210707184351.67872-20-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Update lpfc version to 12.8.0.11 Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- 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 2d62fd2a9824..63b2690ab49f 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 "12.8.0.10" +#define LPFC_DRIVER_VERSION "12.8.0.11" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */ From patchwork Wed Jul 7 18:43:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 471626 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC521C07E9B for ; Wed, 7 Jul 2021 18:44:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98FAB61CD1 for ; Wed, 7 Jul 2021 18:44:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232680AbhGGSrB (ORCPT ); Wed, 7 Jul 2021 14:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232688AbhGGSqt (ORCPT ); Wed, 7 Jul 2021 14:46:49 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E15C061767 for ; Wed, 7 Jul 2021 11:44:09 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id a127so3025479pfa.10 for ; Wed, 07 Jul 2021 11:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=veF7IArj5RvOtdG254L8uPv6LZo+bKNp6QXwGfagVqY=; b=txYFtMP5W89y/uLqfRRLV+Jm2YpqGwy1z33JnshNfkw4SIABfsAPJv/Kv8Ip7+NePb 5TtKWemNoil39pJGeawGjDYHc68PRoUTTg8p4qR1KVTDSw8R3NoBjw/NZ1n3vABE7r4F ZKc6FHq9m48PloEdCMNdlcKszy70G9swosb7gaOjoCr6k5ZTQD5bHgZ8wJXwCLRIYMIr 4SrtJwdUv7F61pEuWL+9A1YkkuGI4PeP8Tdk2tY8AlbzmisH2Yi0EwW1t+54dFdA0ktI Rvn8fz4IOEqAcFd6CzmTIsSsssZqKygYUGO/KsWGPIy8ZRHniBTmC+bDl6G2xQAq6VAz kV1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=veF7IArj5RvOtdG254L8uPv6LZo+bKNp6QXwGfagVqY=; b=gB4VJM5OmqyvmhaDzKXKobom/mphiuEC2sS1JaFdUcAzWDrEBqjIrRQvF6TubC64X/ KBxEQbO+8uK7bQC/8B1gZ9LwRnRtonc5qEkQBTt5g5vB3ZBXI+1WsK7T0701M3Kw86bh mFLgkVU292MZo4x4DFlmJexPUokHOXnyfJELzjuNiRfTSrgYEgW4qndrc6D7TYsl6fRp DDuvOmGtERepCZ/w3ORBTISZcj6TWRseaTo127zxJ882DY8vQrY3mR69Iss5gJ/CisiY u3pSnd+Jtrx6TNYHnomt1H/JBSYg/cmvFgz9BwIjDO9X2IifnhlA+qOEn+NpR/1uvNJP so8w== X-Gm-Message-State: AOAM533aKgJdMI0Ku4O67O40krniFnnIGRzkQU6UdlJQF2AbSyz9YXSC QWSp7ZW0NGiHv5/LuoncxUqMFLi6QV0= X-Google-Smtp-Source: ABdhPJx6IJASv8MHeQe7YIaWqsg/YHIKf3jSupvZ6VENlF+fYVwWKF0p+cIxOadZXZISuPextzu0WQ== X-Received: by 2002:a63:3584:: with SMTP id c126mr27440508pga.33.1625683448768; Wed, 07 Jul 2021 11:44:08 -0700 (PDT) Received: from localhost.localdomain (ip174-67-196-173.oc.oc.cox.net. [174.67.196.173]) by smtp.gmail.com with ESMTPSA id z3sm23578631pgl.77.2021.07.07.11.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:44:08 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 20/20] lpfc: Copyright updates for 12.8.0.11 patches Date: Wed, 7 Jul 2021 11:43:51 -0700 Message-Id: <20210707184351.67872-21-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210707184351.67872-1-jsmart2021@gmail.com> References: <20210707184351.67872-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Update copyrights for files modified by the 12.8.0.11 patch set. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nvme.h | 2 +- drivers/scsi/lpfc/lpfc_sli4.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvme.h b/drivers/scsi/lpfc/lpfc_nvme.h index 060a7c111bad..f61223fbe644 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.h +++ b/drivers/scsi/lpfc/lpfc_nvme.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2020 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2021 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. * diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index 021edbfbbca5..f250b666ac57 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2019 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2021 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2009-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. *