From patchwork Tue Nov 21 00:00:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10067501 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 26EF260224 for ; Tue, 21 Nov 2017 00:01:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1920729194 for ; Tue, 21 Nov 2017 00:01:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D9D92923B; Tue, 21 Nov 2017 00:01:13 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 EB2C229194 for ; Tue, 21 Nov 2017 00:01:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751975AbdKUABK (ORCPT ); Mon, 20 Nov 2017 19:01:10 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:33965 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbdKUABG (ORCPT ); Mon, 20 Nov 2017 19:01:06 -0500 Received: by mail-qk0-f196.google.com with SMTP id v137so9759698qkb.1 for ; Mon, 20 Nov 2017 16:01:06 -0800 (PST) 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=tUaplYMbO7aOeURMtUCZwhAoAe2HM6/KZhpa66lKXiI=; b=ZqBdu3Y6BFppxm9TgKTslBQqhDufGySlIm9oFP18j1hipQ4I7yiaLudxjaQ3wtP8q3 MoVHuJJ5fTQX5p0SgqjhgVQX0sYjbwbJ2dG60BEZLB6be9gXMgcQKdKobysyVy083+lB 3ksOZ1UWIgWdIT8uj0CYAMxcNNoaKSMAQgtDlm3p47se0yy76Rtgt1jvs3WvaeTPUCF7 z7Pc4fCKftmkSNyrmqIty66I3KCnPWKfFr11321CW+T1jkiyWAUVPC5OqCFDygsRXkCq v978ENmFO8/mTjQ54oTxqK85c4LdrRXGEmTHxYz1gZqO9V8Mg0mtpcZ6FtYey1TOCiuc KKJQ== 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=tUaplYMbO7aOeURMtUCZwhAoAe2HM6/KZhpa66lKXiI=; b=h8N3u2RiazX8qnra9Qoqa+RUR+WKAhfG/WFFudmHtZa+BGz3fxhdK0BECdv2Zx2Fzs cH6JiRjYz1BIdqwj0Pb63BaY1Eh3HhXalMRMU5sNCt+zT8T36RYq5coiKX55Nu6nMJ9X fJcKbWWo0O94gQAMbN3GV1jAsvtsSBVR3eTD+q3Vs7LMWTTkPWw1mel34at10soTQV5l n0AKc4dZ+wCKq5Wwmh2fTYUjgX3GnOfwdRh9xeqPtAUuPr+zMcyjn7/jYRA2ZtjnXvfd d7t8PtjRPkvF99ah/oLPvJZf8gSIsuib8MiXhjpPzHBKpvHT2rc32EpubRncJ0Ix/ciU n2Uw== X-Gm-Message-State: AJaThX7obTmfJoG+apVBIYfj5deGMLYWHlcaxw3PqoTPzeMHCQjG2phU 3U9SO+eAp5L29GT7FMwCoa8br4WC X-Google-Smtp-Source: AGs4zMaXxhnVDSSIBVkQEzIM6Gs5tEjEWlAYlfpsWtt48yzSUSvlcQi3OUNjx61BDEsXe6KE/lfkeA== X-Received: by 10.55.101.9 with SMTP id z9mr24087658qkb.206.1511222465577; Mon, 20 Nov 2017 16:01:05 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id w143sm1612821qka.84.2017.11.20.16.01.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Nov 2017 16:01:05 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v3 11/17] lpfc: Linux LPFC driver does not process all RSCNs Date: Mon, 20 Nov 2017 16:00:38 -0800 Message-Id: <20171121000044.27702-12-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20171121000044.27702-1-jsmart2021@gmail.com> References: <20171121000044.27702-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 Reviewed-by: Hannes Reinecke --- v3: per review, fix weird data element that was a combination of multiple fields. The log print now has each field. --- drivers/scsi/lpfc/lpfc_ct.c | 19 +++++++++++++++++++ drivers/scsi/lpfc/lpfc_els.c | 4 +--- drivers/scsi/lpfc/lpfc_hbadisc.c | 7 +++++-- 3 files changed, 25 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 911066c9612d..71ec580f46a3 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1675,6 +1675,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, @@ -6177,9 +6178,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..31773e481264 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -5837,9 +5837,12 @@ __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) if (filter(ndlp, param)) { lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, "3185 FIND node filter %p DID " - "Data: x%p x%x x%x\n", + "ndlp %p did x%x flg x%x st x%x " + "xri x%x type x%x rpi x%x\n", filter, ndlp, ndlp->nlp_DID, - ndlp->nlp_flag); + ndlp->nlp_flag, ndlp->nlp_state, + ndlp->nlp_xri, ndlp->nlp_type, + ndlp->nlp_rpi); return ndlp; } }