From patchwork Wed Aug 23 23:55:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 9918713 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 AEDBA600F5 for ; Wed, 23 Aug 2017 23:56:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1BCF28A99 for ; Wed, 23 Aug 2017 23:56:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96A6528A9D; Wed, 23 Aug 2017 23:56:36 +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 3B51628A99 for ; Wed, 23 Aug 2017 23:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751964AbdHWX4d (ORCPT ); Wed, 23 Aug 2017 19:56:33 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34920 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751947AbdHWX4c (ORCPT ); Wed, 23 Aug 2017 19:56:32 -0400 Received: by mail-wr0-f193.google.com with SMTP id n53so590394wrb.2 for ; Wed, 23 Aug 2017 16:56:32 -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=Iw/VkSzPgGJXHOBzsWrVYhx424cly9jHSAh/erlK/yY=; b=FENtLX0QdXVZR7dLFQiMDeWGVvcZdC3b1CJSVidf6MZTb+vzc+TqbVH6pNOTTSyGkY z2BNnyEwzgACXfQ0TnyHUdsP8FpfDgKgaop+iTvDYHHl5kzgT2fH1491TQz6GOtp3MGY E5JSQtT5E682VJZH8FPpZCo/OjEEhxlnUbvv/8wdt4nsGmz2OfFwvfazHemNe/N+iUZf 8nOBXMZrbIvAMvK6oNTqBX/RkTAmslEm0ewkWHH1pCKl9tmqI0EaYYIphXVoPlr/Kgs8 FajOe3D6T1VvTupkGYHwlsghqmoBG8rGC6MhLXd7nanIX8wnIxoe9l4/qJWD72f8oM3O 7kQQ== 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=Iw/VkSzPgGJXHOBzsWrVYhx424cly9jHSAh/erlK/yY=; b=UTHNdvS/GhZelZf4orQHZdsjuaWdTG4tgcn+ukJjgL32kiBRV3lFv3FjYBVH/u82Kw v1QnXI5xy0UBJSoxMRmR3GW1NXkm5z/k3XnyCSJQMwEFkJ/5r6jlaqSvC6y/P7zJgg2v C9dClDL8bttqJaHmDL5qyeEdrXjYuys/QCpmUhir5GzNEWOJAQbXE4gTIp8v6NeYPRrD /zmNO2hjCPGBSsYzMh/QDKig6kcDtt4RdKDnCekMNyIl9fTceoMz3ZeFMtYPFCnOz6JH WV0MRl9l/m0JxSTx97u1uICgEkRalFhlW1QOt1a9aGy942dpsLA1e6XxSKeatghCXIin XTXg== X-Gm-Message-State: AHYfb5h6+D9vP2ye8tyUgTGS2YSlhEVpTe5Hr6Guye07A9WFCDX+EkKU 3y/rwVmd9N4MGWSs X-Received: by 10.223.171.90 with SMTP id r26mr2395227wrc.88.1503532591387; Wed, 23 Aug 2017 16:56:31 -0700 (PDT) Received: from pallmd1.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id l131sm3984100wmb.5.2017.08.23.16.56.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Aug 2017 16:56:30 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: Dick Kennedy , James Smart Subject: [PATCH v3 16/20] lpfc: Fix bad sgl reposting after 2nd adapter reset Date: Wed, 23 Aug 2017 16:55:45 -0700 Message-Id: <20170823235549.2883-17-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170823235549.2883-1-jsmart2021@gmail.com> References: <20170823235549.2883-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 Reviewed-by: Johannes Thumshirn --- 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 24dc69de6023..bb9ede2521b9 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;