From patchwork Mon Oct 3 19:02:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Lane X-Patchwork-Id: 1685611 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=rnWv73DX; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mh9Fx1wXZz23jP for ; Tue, 4 Oct 2022 06:03:00 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ofQiJ-0000YB-WE; Mon, 03 Oct 2022 19:02:52 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ofQiF-0000UI-L9 for kernel-team@lists.ubuntu.com; Mon, 03 Oct 2022 19:02:47 +0000 Received: from localhost.localdomain (1.general.jlane.us.vpn [10.172.64.160]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 14A193F5AA for ; Mon, 3 Oct 2022 19:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1664823767; bh=IfNzCrd7efXSFrZUVVJloKRpn9zhD6ihwMfudEjnVW4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rnWv73DXxyRxKPlb0/1aZBBsVsTW3lhzKhveq/xPHTftrS3VgOh7mV3WYYXZ87t4h /7rfn5XeHMJdDgcZM26crv7NCXTcKbDo71BptFnxcIWbipAnTGqAVT5WjcMYQwADY5 XKl9Lv7CGgms24C3xLHdg06xj3IPbPu8V0gY2p6s6VkbCVWDczEyWo5cjaYuF86GUT pWwCx2hd7ZbEfZkKpmDN6pyTy4LdlqMZFJcXNQKCzyt8kBxfBSb9QZ7rxp4PsWNCmI MN4bBfHZvp4C+IXiFLA0aDwpJ+b7JyESPXe+8HVn80/t8OnIQ8U34OFcdUOgiYZeib lwF9jRiK3BWrA== From: Jeff Lane To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/6] scsi: lpfc: Fix lost NVMe paths during LIF bounce stress test Date: Mon, 3 Oct 2022 15:02:40 -0400 Message-Id: <20221003190243.353454-4-jeffrey.lane@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221003190243.353454-1-jeffrey.lane@canonical.com> References: <20221003190243.353454-1-jeffrey.lane@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: James Smart BugLink: https://bugs.launchpad.net/bugs/1988711 During a target link bounce test, the driver sees a mismatch between the NPortId and the WWPN on the node structures (ndlps) involved. When this occurs, the driver "swaps" the ndlp and new_ndlp node parameters to restore WWPN/DID uniqueness in the fc_nodes list per vport. However, the driver neglected to swap the nlp_fc4_type in the ndlp passed to lpfc_plogi_confirm_nport causing a failure to recover the NVMe PLOGI/PRLI and ultimately the NVMe paths. Correct confirm_nport to preserve the fc4 types from the new-ndlp when the data is moved over ot the ndlp structure. Link: https://lore.kernel.org/r/20220701211425.2708-8-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen (cherry picked from commit ea92e173dc55460f1b9e71df5ceac951c506d214) Signed-off-by: Jeff Lane --- drivers/scsi/lpfc/lpfc_els.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index c904e9486b92..9371829e11b2 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1790,18 +1790,20 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, /* Move this back to NPR state */ if (memcmp(&ndlp->nlp_portname, name, sizeof(struct lpfc_name)) == 0) { - /* The new_ndlp is replacing ndlp totally, so we need - * to put ndlp on UNUSED list and try to free it. + /* The ndlp doesn't have a portname yet, but does have an + * NPort ID. The new_ndlp portname matches the Rport's + * portname. Reinstantiate the new_ndlp and reset the ndlp. */ lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, "3179 PLOGI confirm NEW: %x %x\n", new_ndlp->nlp_DID, keepDID); /* Two ndlps cannot have the same did on the nodelist. - * Note: for this case, ndlp has a NULL WWPN so setting - * the nlp_fc4_type isn't required. + * The KeepDID and keep_nlp_fc4_type need to be swapped + * because ndlp is inflight with no WWPN. */ ndlp->nlp_DID = keepDID; + ndlp->nlp_fc4_type = keep_nlp_fc4_type; lpfc_nlp_set_state(vport, ndlp, keep_nlp_state); if (phba->sli_rev == LPFC_SLI_REV4 && active_rrqs_xri_bitmap) @@ -1816,9 +1818,8 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, lpfc_unreg_rpi(vport, ndlp); - /* Two ndlps cannot have the same did and the fc4 - * type must be transferred because the ndlp is in - * flight. + /* The ndlp and new_ndlp both have WWPNs but are swapping + * NPort Ids and attributes. */ ndlp->nlp_DID = keepDID; ndlp->nlp_fc4_type = keep_nlp_fc4_type;