From patchwork Fri Nov 3 22:56:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10041319 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 991E9603D7 for ; Fri, 3 Nov 2017 22:57:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B79F299CE for ; Fri, 3 Nov 2017 22:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FF05299E1; Fri, 3 Nov 2017 22:57:16 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 14465299D9 for ; Fri, 3 Nov 2017 22:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932258AbdKCW5M (ORCPT ); Fri, 3 Nov 2017 18:57:12 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:51905 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756128AbdKCW4s (ORCPT ); Fri, 3 Nov 2017 18:56:48 -0400 Received: by mail-qk0-f196.google.com with SMTP id n66so446496qki.8 for ; Fri, 03 Nov 2017 15:56:48 -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=cClUJs+6AvHF+E/+jSkXwZDCqtY2NkA3onsK1cn+AG0=; b=VH30tbAHQUeACpsf3jKGQ0CUS9r/Vf47CKoBrdzlo1nQRNJ8EV5E6oBZzASa4fHEWO DNpqkMetfaQLN1dtt8gpcqN8hGmPD8hoY0TXWsi9uCwa8xSQUP2D3hbNtS/C7+BmABTx 9h8vX6UET144X9hc7khv84B2j+9qgbgYjsH2uxZTERQFrpW1OmrIIzbUvoOAfTNgrE6w /dJ2TWtH5A0ktZYjOeTgVKpxyieQ5OsZSOrcwj+rGAeUDi/o1IKl18oKMrHl+WtHd4yy KqXCaLFCNAt9/mlePEBjn0xgX/cDM9yiOxii6Fh9AsgtvnQIM1rHADC5QIcqJ3d47TOK w3ng== 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=cClUJs+6AvHF+E/+jSkXwZDCqtY2NkA3onsK1cn+AG0=; b=g/d+xG9Q1FUjItez6F01QF5+OuwHj/AX6Z6ThbScBwfHwwQAU3pIAiQE1QRBb+eLI3 MsyBe8jaFxEbaoNiVZ5oFUMoSTWaQBhSkDjbpakHu0O2vO2n3sdmtkNFGXAE2ADEeEyS C5LhFjIufzKySS0wEWehlfthP2s/SWq6VfBWhnU4s1wpZKaUrL27kwYeE6KPfeCuJ9mF GtgVEXyrkzUh/7wscM0KOuDnhjjU0NnBT/xpHX53zoXlTSNOzGdb1E7VGXhAviQzivQb S6s1KPNj8KqWxWZkQ/3L2l/7Fm/0lX/A+9r6YRF0Qe1qsPxdrKYid/5BSxDunuSuzVlr 5EsA== X-Gm-Message-State: AMCzsaUqt0Mdz5qJ7v1a1u6kRbeXE6jLFZWxoC2Csg44rbSnegD7Lu9/ 0N0cKnuv8nvWxMmVgB+KLm5hbEp+ X-Google-Smtp-Source: ABhQp+TAXGC+Cd+OGyLGlKGDnX8t7zexdnmsTZjKaZmcMAi2XL09lJC+zis8V8uwhpBZO713p7Ydqw== X-Received: by 10.233.244.11 with SMTP id y11mr11601795qkl.164.1509749807697; Fri, 03 Nov 2017 15:56:47 -0700 (PDT) Received: from pallmd1.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id v21sm4765626qtv.21.2017.11.03.15.56.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Nov 2017 15:56:47 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH 11/17] lpfc: Linux LPFC driver does not process all RSCNs Date: Fri, 3 Nov 2017 15:56:22 -0700 Message-Id: <20171103225628.24716-12-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20171103225628.24716-1-jsmart2021@gmail.com> References: <20171103225628.24716-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 During RSCN storms, the driver does not rediscover some targets. The driver marks some RSCN as to be handled after the ones it's working on. The driver missed processing some deferred RSCN. Move where the driver checks for deferred RSCNs and initiate deferred RSCN handling if the flag was set. Also revise nport state within the RSCN confirm routine. Add some state data to a possible debug print to aid future debugging. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_ct.c | 19 +++++++++++++++++++ drivers/scsi/lpfc/lpfc_els.c | 4 +--- drivers/scsi/lpfc/lpfc_hbadisc.c | 9 +++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 33417681f5d4..0990f81524cd 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -685,6 +685,25 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, lpfc_els_flush_rscn(vport); goto out; } + + spin_lock_irq(shost->host_lock); + if (vport->fc_flag & FC_RSCN_DEFERRED) { + vport->fc_flag &= ~FC_RSCN_DEFERRED; + spin_unlock_irq(shost->host_lock); + + /* + * Skip processing the NS response + * Re-issue the NS cmd + */ + lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, + "0151 Process Deferred RSCN Data: x%x x%x\n", + vport->fc_flag, vport->fc_rscn_id_cnt); + lpfc_els_handle_rscn(vport); + + goto out; + } + spin_unlock_irq(shost->host_lock); + if (irsp->ulpStatus) { /* Check for retry */ if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index a708d80cb609..5cfa73e8fe40 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1681,6 +1681,7 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, /* Two ndlps cannot have the same did on the nodelist */ ndlp->nlp_DID = keepDID; + lpfc_nlp_set_state(vport, ndlp, keep_nlp_state); if (phba->sli_rev == LPFC_SLI_REV4 && active_rrqs_xri_bitmap) memcpy(ndlp->active_rrqs_xri_bitmap, @@ -6183,9 +6184,6 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); /* send RECOVERY event for ALL nodes that match RSCN payload */ lpfc_rscn_recovery_check(vport); - spin_lock_irq(shost->host_lock); - vport->fc_flag &= ~FC_RSCN_DEFERRED; - spin_unlock_irq(shost->host_lock); return 0; } lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 3468257bda02..4577330313c0 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -5832,14 +5832,19 @@ static struct lpfc_nodelist * __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) { struct lpfc_nodelist *ndlp; + uint32_t data1; list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { if (filter(ndlp, param)) { + data1 = (((uint32_t) ndlp->nlp_state << 24) | + ((uint32_t) ndlp->nlp_xri << 16) | + ((uint32_t) ndlp->nlp_type << 8) | + ((uint32_t) ndlp->nlp_rpi & 0xff)); lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, "3185 FIND node filter %p DID " - "Data: x%p x%x x%x\n", + "Data: x%p x%x x%x x%x\n", filter, ndlp, ndlp->nlp_DID, - ndlp->nlp_flag); + ndlp->nlp_flag, data1); return ndlp; } }