From patchwork Wed Aug 2 23:36:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 9877945 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 E687560360 for ; Wed, 2 Aug 2017 23:38:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D91F32878E for ; Wed, 2 Aug 2017 23:38:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE3F328842; Wed, 2 Aug 2017 23:38:22 +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 849312878E for ; Wed, 2 Aug 2017 23:38:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752022AbdHBXiV (ORCPT ); Wed, 2 Aug 2017 19:38:21 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:34547 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751945AbdHBXiS (ORCPT ); Wed, 2 Aug 2017 19:38:18 -0400 Received: by mail-qk0-f196.google.com with SMTP id q66so6121547qki.1 for ; Wed, 02 Aug 2017 16:38:18 -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=5bCcz3XXnAJgetHhW4HNrh4oFazFckYOpoDeNfwzpqc=; b=Em6QG+xFN+9dKNCmCUiGy9BxNNHwi+iHBSsrbOVmxHmbOJ57d97PfsSEeXfBNYgwMW GZcqP9/B0i9V6o8ZIox1sAeoqYDbu1ni5YzRbY+IHoABzPpSyH3Pml5ooFe/6LUw4gX+ cP9gYaGOOD+61zdnx1UKpraqlJALdXJCnn/vLhDuMnaAj/a4mXpF+9FvCptP70M9cECZ H4eBvsIMPCG5kfT/cxClCjqPlR3zWdMDNs2daZxwv3mLBRnoyPhTm8X7i7fIycDVribK 7y5xwhjUnEjdtEDrRTlZa9XXspcc/5WIg/UzEsKQ80l6FGnyY/F1cTIAYuvsqvrg8UBt Ziag== 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=5bCcz3XXnAJgetHhW4HNrh4oFazFckYOpoDeNfwzpqc=; b=Dv9zdTo/LK+dGylE62jdTS4nMRn9U6Y6U1TG5u7CCAAuyvoUciK+Uy5hsE2NpRTTx4 YIe2fhx89AJxEByKR3TsyxbjkMQEgYMIREo5jB3zVV2EraGBKPeFgT22RUP8vYc/8mCm N0AZFAlifaf0tRds2yyOSzCxFpSNAu5ueJgR1YXQkM9lHpdXl+SBLWB3IXD9ydmDQ6Nt oGqi03f6iTR5U12Tcom7RC9AwxFplqo7q8YWsubYbvZYfhEKS1l79Z0EX2Iyd/BqUw3q BTK0tnu+kIImjisW6yFw0mfvucO5YsImWweUaMIs2C15Fl8pVbTiu6UYBPio6Sk52WKI +NPQ== X-Gm-Message-State: AHYfb5gLKLt9LmOTOOVnuSrRikKcUtmy10W8rkcI4bVZ5H4N93oLZRNN uAGlOMJmGG5pCCMx X-Received: by 10.55.149.7 with SMTP id x7mr49199qkd.14.1501717097369; Wed, 02 Aug 2017 16:38:17 -0700 (PDT) Received: from pallmd1.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id c55sm26260318qta.8.2017.08.02.16.38.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 16:38:16 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: Dick Kennedy , James Smart Subject: [PATCH 17/21] lpfc: Fix bad sgl reposting after 2nd adapter reset Date: Wed, 2 Aug 2017 16:36:44 -0700 Message-Id: <20170802233648.4573-18-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170802233648.4573-1-jsmart2021@gmail.com> References: <20170802233648.4573-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 From: Dick Kennedy Fix bad sgl reposting after 2nd adapter reset port issue was fixed, the hbacmd reset would take more than 8 minutes to complete. There were conflicting NVME SGL posting/reposting responsibilities between lpfc_online()/lpfc_sli4_hba_setup() and lpfc_nvme_create_localport(). The lpfc_online() causes a REPOST on existing NVME SGLs which is not released during the fc port reset. However, lpfc_nvme_create_localport() wants to allocate new NVME buffers and post them. Both cancelled out each other which had a side effect of hosing the mailbox handling that was used to remove the sgl lists - causing multiple 60s mbx timeouts. Fix by preserving all SGL lists over the fc port reset. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_nvme.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index 87e0743c4ace..8e7cdbd5d7d3 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -2181,8 +2181,15 @@ lpfc_nvme_create_localport(struct lpfc_vport *vport) vport->localport = localport; lport->vport = vport; vport->nvmei_support = 1; - len = lpfc_new_nvme_buf(vport, phba->sli4_hba.nvme_xri_max); - vport->phba->total_nvme_bufs += len; + + /* Don't post more new bufs if repost already recovered + * the nvme sgls. + */ + if (phba->sli4_hba.nvme_xri_cnt == 0) { + len = lpfc_new_nvme_buf(vport, + phba->sli4_hba.nvme_xri_max); + vport->phba->total_nvme_bufs += len; + } } return ret;