From patchwork Mon Apr 9 21:24:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10332055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 646E46053B for ; Mon, 9 Apr 2018 21:25:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56D3328BEC for ; Mon, 9 Apr 2018 21:25:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B9D228C05; Mon, 9 Apr 2018 21:25:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEEC128BEC for ; Mon, 9 Apr 2018 21:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753330AbeDIVZG (ORCPT ); Mon, 9 Apr 2018 17:25:06 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33130 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753291AbeDIVYz (ORCPT ); Mon, 9 Apr 2018 17:24:55 -0400 Received: by mail-pf0-f193.google.com with SMTP id f15so6477393pfn.0 for ; Mon, 09 Apr 2018 14:24:55 -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; bh=/evZWgtMJUCtLsA424gAShi9ZLrr4NvIssgLJiXHgjQ=; b=h6WAGm3AzLLwc4yIuphjbAp8hd7n0SGIiJ9vTY9y4GAawBlE1+RfjZjcL4whdSYuZZ 4zW+ElaN4rSUQMyV1nxZz94sSguPooGVmWPBarjwRnzERKXiCpcRVXumjJhrDuywgB30 6s+eWXiPl3DIAs9om4JyNXnLMg+kQFMHZf+GBag4INn6htR7TDdKHK9lz7V21F0+lP2E aF7NgKpHdZu8ypqNYRH4KTbxTNBChw97d/MtPPTexWn3l6r6MOBKTz0Zn2EfTCT7j7oy 9nBgZ9cN69AwyL8o4q97dA0RlxahTUu4V6tPk0Io7yTirYGpGR+ZIF/jRGdVBAXr6pJ/ GhZw== 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; bh=/evZWgtMJUCtLsA424gAShi9ZLrr4NvIssgLJiXHgjQ=; b=h22I4+FI+JaKB0MRTnWuNMdn+MdA41EZO7wkj5H/LWYjKnST01HDQXnOnbcjokhL+J n63eZ2YlsO2z0ExTj8x1jcqaNKQFjaZXdpVkKcKJc6z5N5PBJMGcuqp6qRzYm88Awe3r n0241Ata3jDrt5PbzzF9N8WmJ4ueQyS6xdh2+hb5LqSD1rG4U2KvSzBsUKW3bdE4uoN8 dpsjCsuhtjKqo7F+SygbDMz1Q+mvtFfRD/TAOrqrN+17UcfeRbD788yAH7rBhVIVF18G 05n3DN9rD3QivUSCKaA3xV9y4Y67ki31/M72ppckpTifYJQMkHlDMvPNLXq2NgAtViIP 75oA== X-Gm-Message-State: AElRT7FsXVokMEaiC5zNQ7dpQ0YsVe2XOxIvhG6JrdD2tiuUdlCHaeUh 5Zx84eiJjCaXDKabAyt7RDvmtw== X-Google-Smtp-Source: AIpwx49yRBMXJln8b9kqBJ9WKTkgzpK8cN38VyKB4VwLW7mA3DXv1prktAr0vgWGf2CKmCAsGLUlMQ== X-Received: by 10.101.92.129 with SMTP id a1mr21790673pgt.69.1523309094990; Mon, 09 Apr 2018 14:24:54 -0700 (PDT) Received: from pallmd1.broadcom.com ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id w88sm2153103pfa.150.2018.04.09.14.24.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 14:24:54 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v2 12/13] lpfc: Correct missing remoteport registration during link bounces Date: Mon, 9 Apr 2018 14:24:32 -0700 Message-Id: <20180409212433.31076-13-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180409212433.31076-1-jsmart2021@gmail.com> References: <20180409212433.31076-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remote port disappearance/reappearances would cause a series of RSCN events to be delivered to the driver. During the resulting GID_FT handling, the driver clears the fc4 settings on the remote port, which makes it skip registration. As such, the nvme associations eventually fail and return io errors to the applications. Correct by not clearng the nlp_fc4_types for all nodes in lpfc_issue_gidft. Instead, when the GID_FT response is handled, clear the nlp_fc4_types of FCP and NVME prior to evaluating the fc4_type returned by the GID_FT response. This approach leaves "skipped" nodes with their nlp_fc4_types intacted. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_ct.c | 5 +++++ drivers/scsi/lpfc/lpfc_hbadisc.c | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 1e7889e45160..d4a200ae5a6f 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -471,6 +471,11 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type) "Parse GID_FTrsp: did:x%x flg:x%x x%x", Did, ndlp->nlp_flag, vport->fc_flag); + /* Don't assume the rport is always the previous + * FC4 type. + */ + ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME); + /* By default, the driver expects to support FCP FC4 */ if (fc4_type == FC_TYPE_FCP) ndlp->nlp_fc4_type |= NLP_FC4_FCP; diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 3e7712cd6c9a..cf2cbaa241b9 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -3876,10 +3876,6 @@ int lpfc_issue_gidft(struct lpfc_vport *vport) { struct lpfc_hba *phba = vport->phba; - struct lpfc_nodelist *ndlp; - - list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) - ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME); /* Good status, issue CT Request to NameServer */ if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||